fastlane-plugin-sq_ci 0.5.0 → 0.5.1

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: f3101395af566ce6e6aa25d9c0f23ffb2589357f5bdcd008b24aca7c80de2241
4
- data.tar.gz: '0958c135c717e5e45b88a516452be46ed9c23ad9c166ecbbf83b364f5e6db161'
3
+ metadata.gz: d78148f8b4b871b6fb375d6131e4db8719cd32e4f055a8a0ae27d3ce1392e0b7
4
+ data.tar.gz: 40a69c0951782de0b44c9757e210ba90a2c74442e8c60394a61555fa98fe58a3
5
5
  SHA512:
6
- metadata.gz: 6a7187492320f11d4f9b8a37d0e778b0132307b778a5422c82b143924f0a4d3622b4d1ceb0ff479ddf79a86e9fecf758cbaa701d7f72942baaab5138b5d4ac18
7
- data.tar.gz: 5750312d5128393d4247870342dd5dafbc931ccdfa5b92d430558e4cd433fa4b33ace486d381fdd96fdea54125a20f4680dfc10384e0229dce18175618d0876f
6
+ metadata.gz: 370eeeb1362e7d52d095ccbf7b88abc293531fab7bd93a68cdc2f8d480ee907b6897305d566e60bf61942343266bbd7946b851f257d3e5729c4e80c122ccac70
7
+ data.tar.gz: 2b33b80d066c9206d7e3ab785e80cd1f5465b7fff77868d86c9808050a97212bc49d50da1775c0924f8d89b1c1f3b439f3a5633e01e2527e5e5d76d70c9738f7
@@ -135,20 +135,58 @@ module Fastlane
135
135
 
136
136
  def self.get_xcodeproj_build_config(xcodeproj_path, main_target, target_scheme)
137
137
  project = Xcodeproj::Project.open(xcodeproj_path)
138
- target = project.native_targets.find { |native_target| native_target.name == main_target }
139
- target.build_configurations.find { |configuration| configuration.name == target_scheme }
138
+ xcscheme = self.xcscheme(xcodeproj_path, target_scheme)
139
+ target_uuids = xcscheme.build_action.entries.first.buildable_references.map(&:target_uuid)
140
+
141
+ targets = project.targets.find_all { |t| target_uuids.include?(t.uuid) }
142
+ if main_target.nil?
143
+ build_configuration = xcbuildconfiguration(targets.first, target_scheme)
144
+ else
145
+ target = targets.find { |t| t.name == main_target }
146
+
147
+ UI.user_error!("Target '#{main_target}' does not exist in the given scheme") if target.nil?
148
+
149
+ build_configuration = xcbuildconfiguration(target, target_scheme)
150
+ end
151
+
152
+ build_configuration
140
153
  end
141
154
 
142
155
  def self.get_xcodeproj_targets(xcodeproj_path, target_scheme)
143
156
  project = Xcodeproj::Project.open(xcodeproj_path)
157
+
144
158
  targets = {}
145
- project.native_targets.each do |native_target|
146
- build_configuration = native_target.build_configurations.find { |configuration| configuration.name == target_scheme }
147
- targets[native_target.name] = build_configuration.build_settings['PRODUCT_BUNDLE_IDENTIFIER']
159
+ project.targets.each do |target|
160
+ build_configuration = xcbuildconfiguration(target, target_scheme)
161
+ targets[target.name] = build_configuration.build_settings['PRODUCT_BUNDLE_IDENTIFIER']
148
162
  end
149
163
 
150
164
  targets
151
165
  end
166
+
167
+ def self.xcscheme(xcodeproj_path, target_scheme)
168
+ scheme_paths = Dir.glob("#{xcodeproj_path}/xcshareddata/xcschemes/#{target_scheme}.xcscheme")
169
+ if scheme_paths.empty?
170
+ scheme_paths = Dir.glob("#{xcodeproj_path}/xcuserdata/xcschemes/#{target_scheme}.xcscheme")
171
+ end
172
+ UI.user_error!("Scheme '#{target_scheme}' does not exist in the given project") if scheme_paths.empty?
173
+
174
+ scheme_path = scheme_paths.first
175
+ Xcodeproj::XCScheme.new(scheme_path)
176
+ end
177
+
178
+ def self.xcbuildconfiguration(target, build_configuration_name)
179
+ if build_configuration_name.nil?
180
+ configuration = target.build_configurations.first
181
+
182
+ UI.message("No configuration specified, taking first: '#{configuration.name}'")
183
+ else
184
+ configuration = target.build_configurations.find { |c| c.name == build_configuration_name }
185
+
186
+ UI.user_error!("Build configuration '#{build_configuration_name}' does not exist in target '#{target.name}'") if configuration.nil?
187
+ end
188
+ configuration
189
+ end
152
190
  end
153
191
  end
154
192
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module SqCi
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-sq_ci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Semen Kologrivov