fastlane-plugin-create_xcframework 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 756ad1bbb3b157ae68ea52d79c6f87ec7cf19b7bdc18c58bf77e9ac1a6323137
4
- data.tar.gz: 66f51fa14b1a29986d875a4e2b46ae73430bc394e611101f2a234bd2e932d051
3
+ metadata.gz: da76ed30e5052b1d6bf5bf741f3aa63aeb94b6ceb87d857431d61433f8b3a641
4
+ data.tar.gz: 960a159418dea2038953df31995e6c1d0f87ae71f4b1fadf1bc2d9b5e5b851f5
5
5
  SHA512:
6
- metadata.gz: f89281e8e0e292914480db2c0f1b910477a156bb534816e7864d5326767b24baa6d6eabeb559a2885c796f39cabc4b8ead8b8e2bdd6c9f98db1ec9a8a327839f
7
- data.tar.gz: 9df35e6ccf5cbd0d0424ccec7b93a9422e5ffed4ae66b1b935a07291a4347357c183c996f9a3a0a1b53847ee61d9000d5e8853cc5e963568933446523d99fd12
6
+ metadata.gz: bac7202c5d3ff57a1a91a9f95b45a959355fe8bbfe2e073ab54306b3d564f85aa25a37ab796d70ee9c9a3dda946770755b497ddc895873e14ef95a9d42879d0f
7
+ data.tar.gz: 36f6de9e8acd0ce848ba15677e7a1408e8062e653bd6bd78b06d155d2fafb155753f14f54ed56373ed20774afc3e95b556ef1bbcc180d16e458bde8c654c9f4a
@@ -21,7 +21,7 @@ module Fastlane
21
21
 
22
22
  params[:destinations].each_with_index do |destination, framework_index|
23
23
  params[:destination] = destination
24
- params[:archive_path] = @xchelper.xcarchive_path(framework_index)
24
+ params[:archive_path] = @xchelper.xcarchive_path_for_destination(framework_index)
25
25
  XcarchiveAction.run(params)
26
26
  end
27
27
 
@@ -31,7 +31,7 @@ module Fastlane
31
31
 
32
32
  copy_BCSymbolMaps(params)
33
33
 
34
- clean
34
+ clean(params)
35
35
 
36
36
  provide_shared_values
37
37
  else
@@ -40,23 +40,23 @@ module Fastlane
40
40
  end
41
41
 
42
42
  def self.provide_shared_values
43
- Actions.lane_context[SharedValues::XCFRAMEWORK_OUTPUT_PATH] = File.expand_path(@xchelper.xcframework_path)
44
- ENV[SharedValues::XCFRAMEWORK_OUTPUT_PATH.to_s] = File.expand_path(@xchelper.xcframework_path)
45
- Actions.lane_context[SharedValues::XCFRAMEWORK_DSYM_OUTPUT_PATH] = File.expand_path(@xchelper.xcframework_dSYMs_path)
46
- ENV[SharedValues::XCFRAMEWORK_DSYM_OUTPUT_PATH.to_s] = File.expand_path(@xchelper.xcframework_dSYMs_path)
47
- Actions.lane_context[SharedValues::XCFRAMEWORK_BCSYMBOLMAPS_OUTPUT_PATH] = File.expand_path(@xchelper.xcframework_BCSymbolMaps_path)
48
- ENV[SharedValues::XCFRAMEWORK_BCSYMBOLMAPS_OUTPUT_PATH.to_s] = File.expand_path(@xchelper.xcframework_BCSymbolMaps_path)
43
+ Actions.lane_context[SharedValues::XCFRAMEWORK_OUTPUT_PATH] = File.expand_path(@xchelper.xcframework_path)
44
+ ENV[SharedValues::XCFRAMEWORK_OUTPUT_PATH.to_s] = File.expand_path(@xchelper.xcframework_path)
45
+ Actions.lane_context[SharedValues::XCFRAMEWORK_DSYM_OUTPUT_PATH] = File.expand_path(@xchelper.xcframework_dSYMs_path)
46
+ ENV[SharedValues::XCFRAMEWORK_DSYM_OUTPUT_PATH.to_s] = File.expand_path(@xchelper.xcframework_dSYMs_path)
47
+ Actions.lane_context[SharedValues::XCFRAMEWORK_BCSYMBOLMAPS_OUTPUT_PATH] = File.expand_path(@xchelper.xcframework_BCSymbolMaps_path)
48
+ ENV[SharedValues::XCFRAMEWORK_BCSYMBOLMAPS_OUTPUT_PATH.to_s] = File.expand_path(@xchelper.xcframework_BCSymbolMaps_path)
49
49
  end
50
50
 
51
- def self.clean
52
- @xchelper.xcarchive_frameworks_path.each { |framework| FileUtils.rm_rf(framework.split('/').first) }
51
+ def self.clean(params)
52
+ FileUtils.rm_rf(@xchelper.xcarchive_path) if params[:remove_xcarchives]
53
53
  end
54
54
 
55
55
  def self.create_xcframework(params)
56
56
  xcframework = @xchelper.xcframework_path
57
57
  begin
58
58
  FileUtils.rm_rf(xcframework) if File.exist?(xcframework)
59
- framework_links = params[:destinations].each_with_index.map do |_, index|
59
+ framework_links = params[:destinations].each_with_index.map do |_, index|
60
60
  "-framework #{@xchelper.xcarchive_framework_path(index)} #{debug_symbols(index: index, params: params)}"
61
61
  end
62
62
 
@@ -67,7 +67,7 @@ module Fastlane
67
67
  end
68
68
 
69
69
  def self.debug_symbols(index:, params:)
70
- return "" unless Helper.xcode_at_least?('12.0.0')
70
+ return "" unless Helper.xcode_at_least?('12.0.0') && params[:include_debug_symbols] == true
71
71
 
72
72
  debug_symbols = []
73
73
 
@@ -77,10 +77,11 @@ module Fastlane
77
77
  end
78
78
 
79
79
  # Include BCSymbols in xcframework
80
- if params[:include_BCSymbolMaps] != false && params[:include_bitcode] != false
80
+ if params[:include_BCSymbolMaps] != false && params[:enable_bitcode] != false
81
81
  bc_symbols_dir = @xchelper.xcarchive_BCSymbolMaps_path(index)
82
- if Dir.exist?(bc_symbols_dir)
83
- debug_symbols << Dir.children(bc_symbols_dir).map { |path| "-debug-symbols #{File.expand_path("#{bc_symbols_dir}/#{path}")}" }.join(' ')
82
+ if Dir.exist?(bc_symbols_dir)
83
+ arguments = Dir.children(bc_symbols_dir).map { |path| "-debug-symbols #{File.expand_path("#{bc_symbols_dir}/#{path}")}" }
84
+ debug_symbols << arguments.join(' ')
84
85
  end
85
86
  end
86
87
 
@@ -88,6 +89,8 @@ module Fastlane
88
89
  end
89
90
 
90
91
  def self.copy_dSYMs(params)
92
+ return if params[:include_dSYMs] == false
93
+
91
94
  dSYMs_output_dir = @xchelper.xcframework_dSYMs_path
92
95
  FileUtils.mkdir_p(dSYMs_output_dir)
93
96
 
@@ -103,7 +106,7 @@ module Fastlane
103
106
  end
104
107
 
105
108
  def self.copy_BCSymbolMaps(params)
106
- return if params[:include_bitcode] == false
109
+ return if params[:enable_bitcode] == false || params[:include_BCSymbolMaps] == false
107
110
 
108
111
  symbols_output_dir = @xchelper.xcframework_BCSymbolMaps_path
109
112
  FileUtils.mkdir_p(symbols_output_dir)
@@ -133,7 +136,7 @@ module Fastlane
133
136
  end
134
137
  xcargs = ['SKIP_INSTALL=NO', 'BUILD_LIBRARY_FOR_DISTRIBUTION=YES']
135
138
 
136
- if params[:include_bitcode] != false
139
+ if params[:enable_bitcode] != false
137
140
  params[:xcargs].gsub!(/ENABLE_BITCODE(=|\s+)(YES|NO)/, '') if params[:xcargs]
138
141
  xcargs << ['OTHER_CFLAGS="-fembed-bitcode"', 'BITCODE_GENERATION_MODE="bitcode"', 'ENABLE_BITCODE=YES']
139
142
  end
@@ -196,7 +199,8 @@ module Fastlane
196
199
  end
197
200
 
198
201
  def self.details
199
- "Create xcframework plugin generates xcframework for specified destinations. The output of this action consists of the xcframework itself, which contains dSYM and BCSymbolMaps, if bitcode is enabled."
202
+ 'Create xcframework plugin generates xcframework for specified destinations. ' \
203
+ 'The output of this action consists of the xcframework itself, which contains dSYM and BCSymbolMaps, if bitcode is enabled.'
200
204
  end
201
205
 
202
206
  def self.available_options
@@ -207,7 +211,7 @@ module Fastlane
207
211
  optional: false
208
212
  ),
209
213
  FastlaneCore::ConfigItem.new(
210
- key: :include_bitcode,
214
+ key: :enable_bitcode,
211
215
  description: "Should the project be built with bitcode enabled?",
212
216
  optional: true,
213
217
  is_string: false,
@@ -237,10 +241,24 @@ module Fastlane
237
241
  optional: true,
238
242
  default_value: true
239
243
  ),
244
+ FastlaneCore::ConfigItem.new(
245
+ key: :include_debug_symbols,
246
+ description: 'This feature was added in Xcode 12.0.' \
247
+ 'If this is set to false, the dSYMs and BCSymbolMaps wont be added to XCFramework itself',
248
+ optional: true,
249
+ default_value: true
250
+ ),
240
251
  FastlaneCore::ConfigItem.new(
241
252
  key: :product_name,
242
253
  description: "The name of your module. Optional if equals to :scheme. Equivalent to CFBundleName",
243
254
  optional: true
255
+ ),
256
+ FastlaneCore::ConfigItem.new(
257
+ key: :remove_xcarchives,
258
+ description: 'This option will auto-remove the xcarchive files once the plugin finishes.' \
259
+ 'Set this to false to preserve the xcarchives',
260
+ optional: true,
261
+ default_value: true
244
262
  )
245
263
  ]
246
264
  end
@@ -6,7 +6,7 @@ module Fastlane
6
6
  end
7
7
 
8
8
  def product_name
9
- @params[:product_name] ||= @params[:scheme]
9
+ @params[:product_name] ||= @params[:scheme]
10
10
  end
11
11
 
12
12
  def xcframework
@@ -17,12 +17,16 @@ module Fastlane
17
17
  "#{product_name}.framework"
18
18
  end
19
19
 
20
- def xcarchive_path(framework_index)
21
- "#{framework_index}_#{product_name}.xcarchive"
20
+ def xcarchive_path
21
+ "#{output_directory}/archives"
22
+ end
23
+
24
+ def xcarchive_path_for_destination(framework_index)
25
+ "#{xcarchive_path}/#{framework_index}_#{product_name}.xcarchive"
22
26
  end
23
27
 
24
28
  def xcarchive_framework_path(framework_index)
25
- framework_path = "#{xcarchive_path(framework_index)}/Products/Library/Frameworks/#{framework}"
29
+ framework_path = "#{xcarchive_path_for_destination(framework_index)}/Products/Library/Frameworks/#{framework}"
26
30
  return framework_path if File.exist?(framework_path)
27
31
 
28
32
  FastlaneCore::UI.user_error!("▸ PRODUCT_NAME was misdefined: `#{product_name}`. Please, provide :product_name option")
@@ -33,7 +37,7 @@ module Fastlane
33
37
  end
34
38
 
35
39
  def xcarchive_dSYMs_path(framework_index)
36
- File.expand_path("#{xcarchive_path(framework_index)}/dSYMS")
40
+ File.expand_path("#{xcarchive_path_for_destination(framework_index)}/dSYMS")
37
41
  end
38
42
 
39
43
  def xcframework_dSYMs_path
@@ -41,7 +45,7 @@ module Fastlane
41
45
  end
42
46
 
43
47
  def xcarchive_BCSymbolMaps_path(framework_index)
44
- File.expand_path("#{xcarchive_path(framework_index)}/BCSymbolMaps")
48
+ File.expand_path("#{xcarchive_path_for_destination(framework_index)}/BCSymbolMaps")
45
49
  end
46
50
 
47
51
  def xcframework_BCSymbolMaps_path
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module CreateXcframework
3
- VERSION = "1.1.0"
3
+ VERSION = "1.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-create_xcframework
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris Bielik
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-09-21 00:00:00.000000000 Z
12
+ date: 2020-11-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pry
@@ -81,6 +81,20 @@ dependencies:
81
81
  - - ">="
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: fasterer
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - '='
89
+ - !ruby/object:Gem::Version
90
+ version: 0.8.3
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - '='
96
+ - !ruby/object:Gem::Version
97
+ version: 0.8.3
84
98
  - !ruby/object:Gem::Dependency
85
99
  name: rubocop
86
100
  requirement: !ruby/object:Gem::Requirement
@@ -170,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
184
  - !ruby/object:Gem::Version
171
185
  version: '0'
172
186
  requirements: []
173
- rubygems_version: 3.1.4
187
+ rubygems_version: 3.0.3
174
188
  signing_key:
175
189
  specification_version: 4
176
190
  summary: Fastlane plugin that creates xcframework for given list of destinations.