highway 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee3f2e7b9ef6c3f0c2dbb7147fa76254006735bd77fd5e894a761df266251cd8
4
- data.tar.gz: 72487db47f7809ca5b0a2fbdad65fd2a8547fb1aba17f2d5ca535f6c5b167829
3
+ metadata.gz: 73c3b2d6c45a2813f981ce86191943dba7c3774da04ad24ada4aae9caef2ed76
4
+ data.tar.gz: 24e6239b66417a222f2ffc21c97060a407442e94c1670b12fb6acfe94b58b46b
5
5
  SHA512:
6
- metadata.gz: 7df350fea15eed329f597e18d5366a224755317f59a485f32a62e98b041daa1dcc6b26296adc1b5fad8a215c43383aa857a92481b6c54ff70da12a0917707ba5
7
- data.tar.gz: 07552066b344a3c52dd7cace48deb46c1d7fa94a1c432a513cb74fca409d941919b0b53a1e0d8725b0148c0e969d6981eac8f8cd53cbbef1617b960143fe8649
6
+ metadata.gz: c90c5b3b82ae4bf4a65d1c895da8dc3b0c293650351154621478b9fdcecc40ce58d9c98aed012535a66423d58d664334a340cbdeb4df7bdfeeabfa1236db98d9
7
+ data.tar.gz: 92ed02e66e35dfe8b0f2837f48302d72549770800175066480c2e435388d5813189ce3491c9fc0709ac3c374abfa9dfadac4047b8dc361f505d257d413f7e7de
@@ -200,9 +200,9 @@ module Highway
200
200
  # @param bundle_exec [Boolean] Whether to use `bundle exec` if possible.
201
201
  # @param silent [Boolean] Whether to run the command silently.
202
202
  # @param on_error [Proc] Called if command exits with a non-zero code.
203
- def run_sh(command, bundle_exec: false, silent: false, rescue_error: nil)
203
+ def run_sh(command, bundle_exec: false, silent: false, on_error: nil)
204
204
  command = ["bundle exec", command].flatten if bundle_exec && should_use_bundle_exec?
205
- Fastlane::Actions.sh(command, log: !silent, error_callback: rescue_error)
205
+ Fastlane::Actions.sh(command, log: !silent, error_callback: on_error)
206
206
  end
207
207
 
208
208
  private
@@ -68,7 +68,12 @@ module Highway
68
68
  name: "code_coverage",
69
69
  type: Types::Bool.new(),
70
70
  required: false,
71
- )
71
+ ),
72
+ Parameters::Single.new(
73
+ name: "fastlane_params",
74
+ type: Types::Hash.new(Types::Any.new()),
75
+ required: false
76
+ ),
72
77
  ]
73
78
  end
74
79
 
@@ -83,6 +88,7 @@ module Highway
83
88
  scheme = parameters["scheme"]
84
89
  skip_build = parameters["skip_build"]
85
90
  code_coverage = parameters["code_coverage"]
91
+ fastlane_params = parameters["fastlane_params"]
86
92
 
87
93
  flags = parameters["flags"].join(" ")
88
94
  settings = parameters["settings"].map { |setting, value| "#{setting}=\"#{value.shellescape}\"" }.join(" ")
@@ -120,29 +126,31 @@ module Highway
120
126
  rescued_error = nil
121
127
 
122
128
  # Run the build and test.
129
+ options = {
123
130
 
124
- begin
125
-
126
- context.run_action("run_tests", options: {
131
+ project_key => project_value,
127
132
 
128
- project_key => project_value,
133
+ clean: clean,
134
+ configuration: configuration,
135
+ device: device,
136
+ scheme: scheme,
137
+ code_coverage: code_coverage,
138
+ skip_build: skip_build,
129
139
 
130
- clean: clean,
131
- configuration: configuration,
132
- device: device,
133
- scheme: scheme,
134
- code_coverage: code_coverage,
135
- skip_build: skip_build,
140
+ xcargs: xcargs,
136
141
 
137
- xcargs: xcargs,
142
+ buildlog_path: output_raw_temp_dir,
143
+ output_directory: output_dir,
144
+ output_types: output_types,
145
+ output_files: output_files,
146
+ xcodebuild_formatter: xcodebuild_formatter,
138
147
 
139
- buildlog_path: output_raw_temp_dir,
140
- output_directory: output_dir,
141
- output_types: output_types,
142
- output_files: output_files,
143
- xcodebuild_formatter: xcodebuild_formatter,
148
+ }
144
149
 
145
- })
150
+ begin
151
+ fastlane_params = fastlane_params.nil? ? {} : fastlane_params
152
+ combined_options = fastlane_params.merge(options)
153
+ context.run_action("run_tests", options: combined_options)
146
154
 
147
155
  rescue FastlaneCore::Interface::FastlaneBuildFailure => error
148
156
 
@@ -184,11 +192,15 @@ module Highway
184
192
  # That will output a machine-readable information about everything
185
193
  # that happened in the build.
186
194
 
187
- xcpretty_json_formatter_path = context.run_sh("xcpretty-json-formatter", bundle_exec: true, silent: true)
195
+ error_callback = ->(error) {
196
+ rescued_error = error
197
+ }
198
+
199
+ xcpretty_json_formatter_path = context.run_sh("xcpretty-json-formatter", bundle_exec: true, silent: true, on_error: error_callback)
188
200
  temp_json_report_path = File.join(Dir.mktmpdir(), "report.json")
189
201
 
190
202
  context.with_modified_env({"XCPRETTY_JSON_FILE_OUTPUT" => temp_json_report_path}) do
191
- context.run_sh(["cat", output_raw_path, "| xcpretty --formatter", xcpretty_json_formatter_path], bundle_exec: true, silent: true)
203
+ context.run_sh(["cat", output_raw_path, "| xcpretty --formatter", xcpretty_json_formatter_path], bundle_exec: true, silent: true, on_error: error_callback)
192
204
  end
193
205
 
194
206
  # Export JSON file report to environment variable
@@ -6,6 +6,6 @@
6
6
  module Highway
7
7
 
8
8
  # Version of Highway gem.
9
- VERSION = "1.0.7".freeze
9
+ VERSION = "1.0.8".freeze
10
10
 
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: highway
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Netguru
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-13 00:00:00.000000000 Z
11
+ date: 2023-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane