fastlane-plugin-create_xcframework 1.0.0 → 1.1.0

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: b199e1658ad27bf2635c6d0be824149ac918fb1af0882fe0961a0526a62dcf17
4
- data.tar.gz: '0288aba2a3501574f4c90b0b4f242f69fb53eb89fb72d97752150ea1351fe266'
3
+ metadata.gz: 756ad1bbb3b157ae68ea52d79c6f87ec7cf19b7bdc18c58bf77e9ac1a6323137
4
+ data.tar.gz: 66f51fa14b1a29986d875a4e2b46ae73430bc394e611101f2a234bd2e932d051
5
5
  SHA512:
6
- metadata.gz: 9e1b1d76e028c043922a50b4151f8c2ef797a919e8646c7a3593db50e83048abd7188b16023ab3133e41296f3133b06d2f797ef132ad2b5df4ea3b0773ef7610
7
- data.tar.gz: e4de2decf10795804c63b35966de57f4faa8725a7861ed473b4a145713616e3e33355344a958ba275b8e99cf8098c37306e6706df0215b34bc1cd824f9007dae
6
+ metadata.gz: f89281e8e0e292914480db2c0f1b910477a156bb534816e7864d5326767b24baa6d6eabeb559a2885c796f39cabc4b8ead8b8e2bdd6c9f98db1ec9a8a327839f
7
+ data.tar.gz: 9df35e6ccf5cbd0d0424ccec7b93a9422e5ffed4ae66b1b935a07291a4347357c183c996f9a3a0a1b53847ee61d9000d5e8853cc5e963568933446523d99fd12
data/README.md CHANGED
@@ -9,10 +9,11 @@ Fastlane plugin that creates xcframework for given list of destinations 🚀
9
9
  ## Requirements
10
10
 
11
11
  * Xcode 11.x or greater. Download it at the [Apple Developer - Downloads](https://developer.apple.com/downloads) or the [Mac App Store](https://apps.apple.com/us/app/xcode/id497799835?mt=12).
12
+ * fastlane
12
13
 
13
14
  ## Getting Started
14
15
 
15
- To get started with `create_xcframework`, add it to your project by running:
16
+ To get started with `create_xcframework` plugin, add it to your project by running:
16
17
 
17
18
  ```bash
18
19
  $ fastlane add_plugin create_xcframework
@@ -22,11 +23,43 @@ $ fastlane add_plugin create_xcframework
22
23
 
23
24
  ```ruby
24
25
  create_xcframework(
25
- product_name: 'Sample',
26
- scheme: 'Sample',
27
- workspace: 'Sample.xcworkspace',
28
- include_bitcode: true,
26
+ workspace: 'path/to/your.xcworkspace',
27
+ scheme: 'framework scheme',
28
+ product_name: 'Sample', # optional if scheme doesnt match the name of your framework
29
29
  destinations: ['iOS', 'maccatalyst'],
30
- xcframework_output_directory: 'Products/xcframeworks'
30
+ xcframework_output_directory: 'path/to/your/output dir'
31
31
  )
32
32
  ```
33
+
34
+ Run
35
+ ```bash
36
+ $ fastlane actions create_xcframework
37
+ ```
38
+ to learn more about the plugin.
39
+
40
+ ### Supported destinations
41
+
42
+ * iOS
43
+ * iPadOS
44
+ * maccatalyst
45
+ * tvOS
46
+ * watchOS
47
+ * carPlayOS
48
+ * macOS
49
+
50
+ ## Output
51
+
52
+ #### Files:
53
+ * xcframework
54
+ * dSYMs dir
55
+ * BCSymbolMaps dir (if bitcode is enabled)
56
+
57
+ #### Env vars:
58
+ * XCFRAMEWORK_OUTPUT_PATH
59
+ * XCFRAMEWORK_DSYM_OUTPUT_PATH
60
+ * XCFRAMEWORK_BCSYMBOLMAPS_OUTPUT_PATH
61
+
62
+
63
+ ## Contribution
64
+
65
+ - If you **want to contribute**, read the [Contributing Guide](https://github.com/bielikb/fastlane-plugin-create_xcframework/blob/master/CONTRIBUTING.md)
@@ -25,7 +25,7 @@ module Fastlane
25
25
  XcarchiveAction.run(params)
26
26
  end
27
27
 
28
- create_xcframework
28
+ create_xcframework(params)
29
29
 
30
30
  copy_dSYMs(params)
31
31
 
@@ -52,17 +52,41 @@ module Fastlane
52
52
  @xchelper.xcarchive_frameworks_path.each { |framework| FileUtils.rm_rf(framework.split('/').first) }
53
53
  end
54
54
 
55
- def self.create_xcframework
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 = @xchelper.xcarchive_frameworks_path.map { |path| "-framework #{path}" }.join(' ')
60
- Actions.sh("set -o pipefail && xcodebuild -create-xcframework #{framework_links} -output #{xcframework}")
59
+ framework_links = params[:destinations].each_with_index.map do |_, index|
60
+ "-framework #{@xchelper.xcarchive_framework_path(index)} #{debug_symbols(index: index, params: params)}"
61
+ end
62
+
63
+ Actions.sh("set -o pipefail && xcodebuild -create-xcframework #{framework_links.join(' ')} -output #{xcframework}")
61
64
  rescue => err
62
65
  UI.user_error!(err)
63
66
  end
64
67
  end
65
68
 
69
+ def self.debug_symbols(index:, params:)
70
+ return "" unless Helper.xcode_at_least?('12.0.0')
71
+
72
+ debug_symbols = []
73
+
74
+ # Include dSYMs in xcframework
75
+ if params[:include_dSYMs] != false
76
+ debug_symbols << "-debug-symbols #{@xchelper.xcarchive_dSYMs_path(index)}/#{@xchelper.framework}.dSYM"
77
+ end
78
+
79
+ # Include BCSymbols in xcframework
80
+ if params[:include_BCSymbolMaps] != false && params[:include_bitcode] != false
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(' ')
84
+ end
85
+ end
86
+
87
+ debug_symbols.join(' ')
88
+ end
89
+
66
90
  def self.copy_dSYMs(params)
67
91
  dSYMs_output_dir = @xchelper.xcframework_dSYMs_path
68
92
  FileUtils.mkdir_p(dSYMs_output_dir)
@@ -79,7 +103,7 @@ module Fastlane
79
103
  end
80
104
 
81
105
  def self.copy_BCSymbolMaps(params)
82
- return unless params[:include_bitcode]
106
+ return if params[:include_bitcode] == false
83
107
 
84
108
  symbols_output_dir = @xchelper.xcframework_BCSymbolMaps_path
85
109
  FileUtils.mkdir_p(symbols_output_dir)
@@ -109,7 +133,7 @@ module Fastlane
109
133
  end
110
134
  xcargs = ['SKIP_INSTALL=NO', 'BUILD_LIBRARY_FOR_DISTRIBUTION=YES']
111
135
 
112
- if params[:include_bitcode]
136
+ if params[:include_bitcode] != false
113
137
  params[:xcargs].gsub!(/ENABLE_BITCODE(=|\s+)(YES|NO)/, '') if params[:xcargs]
114
138
  xcargs << ['OTHER_CFLAGS="-fembed-bitcode"', 'BITCODE_GENERATION_MODE="bitcode"', 'ENABLE_BITCODE=YES']
115
139
  end
@@ -153,7 +177,6 @@ module Fastlane
153
177
  create_xcframework(
154
178
  workspace: 'path/to/your.xcworkspace',
155
179
  scheme: 'framework scheme',
156
- include_bitcode: true,
157
180
  destinations: ['iOS'],
158
181
  xcframework_output_directory: 'output_directory'
159
182
  )
@@ -173,7 +196,7 @@ module Fastlane
173
196
  end
174
197
 
175
198
  def self.details
176
- "Create xcframework plugin generates xcframework for specified destinations. The output of this action consists of the xcframework itself, dSYM and BCSymbolMaps, if bitcode is enabled."
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."
177
200
  end
178
201
 
179
202
  def self.available_options
@@ -185,10 +208,10 @@ module Fastlane
185
208
  ),
186
209
  FastlaneCore::ConfigItem.new(
187
210
  key: :include_bitcode,
188
- description: "Should the xcframework include bitcode?",
211
+ description: "Should the project be built with bitcode enabled?",
189
212
  optional: true,
190
213
  is_string: false,
191
- default_value: false
214
+ default_value: true
192
215
  ),
193
216
  FastlaneCore::ConfigItem.new(
194
217
  key: :destinations,
@@ -202,6 +225,18 @@ module Fastlane
202
225
  description: "The directory in which the xcframework should be stored in",
203
226
  optional: true
204
227
  ),
228
+ FastlaneCore::ConfigItem.new(
229
+ key: :include_dSYMs,
230
+ description: "Includes dSYM files in the xcframework",
231
+ optional: true,
232
+ default_value: true
233
+ ),
234
+ FastlaneCore::ConfigItem.new(
235
+ key: :include_BCSymbolMaps,
236
+ description: "Includes BCSymbolMap files in the xcframework",
237
+ optional: true,
238
+ default_value: true
239
+ ),
205
240
  FastlaneCore::ConfigItem.new(
206
241
  key: :product_name,
207
242
  description: "The name of your module. Optional if equals to :scheme. Equivalent to CFBundleName",
@@ -33,23 +33,23 @@ module Fastlane
33
33
  end
34
34
 
35
35
  def xcarchive_dSYMs_path(framework_index)
36
- "#{xcarchive_path(framework_index)}/dSYMS"
36
+ File.expand_path("#{xcarchive_path(framework_index)}/dSYMS")
37
37
  end
38
38
 
39
39
  def xcframework_dSYMs_path
40
- "#{output_directory}/#{product_name}.dSYMs"
40
+ File.expand_path("#{output_directory}/#{product_name}.dSYMs")
41
41
  end
42
42
 
43
43
  def xcarchive_BCSymbolMaps_path(framework_index)
44
- "#{xcarchive_path(framework_index)}/BCSymbolMaps"
44
+ File.expand_path("#{xcarchive_path(framework_index)}/BCSymbolMaps")
45
45
  end
46
46
 
47
47
  def xcframework_BCSymbolMaps_path
48
- "#{output_directory}/#{product_name}.BCSymbolMaps"
48
+ File.expand_path("#{output_directory}/#{product_name}.BCSymbolMaps")
49
49
  end
50
50
 
51
51
  def xcframework_path
52
- "#{output_directory}/#{xcframework}"
52
+ File.expand_path("#{output_directory}/#{xcframework}")
53
53
  end
54
54
 
55
55
  def output_directory
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module CreateXcframework
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
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.0.0
4
+ version: 1.1.0
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-06-27 00:00:00.000000000 Z
12
+ date: 2020-09-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pry
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  - !ruby/object:Gem::Version
171
171
  version: '0'
172
172
  requirements: []
173
- rubygems_version: 3.0.3
173
+ rubygems_version: 3.1.4
174
174
  signing_key:
175
175
  specification_version: 4
176
176
  summary: Fastlane plugin that creates xcframework for given list of destinations.