fastlane-plugin-mobile_tools 0.1.0
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 +7 -0
- data/LICENSE +21 -0
- data/README.md +52 -0
- data/lib/fastlane/plugin/mobile_tools/actions/create_xcframework_action.rb +298 -0
- data/lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb +82 -0
- data/lib/fastlane/plugin/mobile_tools/version.rb +5 -0
- data/lib/fastlane/plugin/mobile_tools.rb +16 -0
- metadata +230 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 26fdd7808252e393694a368045c09ebe1a09ec33bb520a6d0d91178a6150bfc8
|
4
|
+
data.tar.gz: 7ee6768f01189eabd2cd7fef32ebf6022e32c088eb5438cd3b0abbc78078c29e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e707b3d692c424b21636fb67c2f78ebbb1e67a2f62a40627744dc63320cd3d229f91c3ed7b523d6e06945d3e81081eecaf5f762293e805c650da0f0815ca191c
|
7
|
+
data.tar.gz: def0229a1e8caca4a092fb46bb285d7fb6eba8b54582a749d0323591d72b150c29e056f228aea52a17d62b2c41d81e67e7a6920d3b275c9896d62f9effedd296
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2024 Yogesh Khandelwal <yogesh_khandelwal@intuit.com>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# mobile_tools plugin
|
2
|
+
|
3
|
+
[](https://rubygems.org/gems/fastlane-plugin-mobile_tools)
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-mobile_tools`, add it to your project by running:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
fastlane add_plugin mobile_tools
|
11
|
+
```
|
12
|
+
|
13
|
+
## About mobile_tools
|
14
|
+
|
15
|
+
fastlane plugin for mobile devops tooling
|
16
|
+
|
17
|
+
**Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
|
18
|
+
|
19
|
+
## Example
|
20
|
+
|
21
|
+
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
|
22
|
+
|
23
|
+
**Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
|
24
|
+
|
25
|
+
## Run tests for this plugin
|
26
|
+
|
27
|
+
To run both the tests, and code style validation, run
|
28
|
+
|
29
|
+
```
|
30
|
+
rake
|
31
|
+
```
|
32
|
+
|
33
|
+
To automatically fix many of the styling issues, use
|
34
|
+
```
|
35
|
+
rubocop -a
|
36
|
+
```
|
37
|
+
|
38
|
+
## Issues and Feedback
|
39
|
+
|
40
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
41
|
+
|
42
|
+
## Troubleshooting
|
43
|
+
|
44
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
45
|
+
|
46
|
+
## Using _fastlane_ Plugins
|
47
|
+
|
48
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
49
|
+
|
50
|
+
## About _fastlane_
|
51
|
+
|
52
|
+
_fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
@@ -0,0 +1,298 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
XCFRAMEWORK_OUTPUT_PATH ||= :XCFRAMEWORK_OUTPUT_PATH
|
5
|
+
XCFRAMEWORK_DSYM_OUTPUT_PATH ||= :XCFRAMEWORK_DSYM_OUTPUT_PATH
|
6
|
+
XCFRAMEWORK_BCSYMBOLMAPS_OUTPUT_PATH ||= :XCFRAMEWORK_BCSYMBOLMAPS_OUTPUT_PATH
|
7
|
+
end
|
8
|
+
|
9
|
+
require 'fastlane_core/ui/ui'
|
10
|
+
require 'fastlane/actions/xcodebuild'
|
11
|
+
require_relative '../helper/create_xcframework_helper'
|
12
|
+
|
13
|
+
class CreateXcframeworkAction < Action
|
14
|
+
def self.run(params)
|
15
|
+
if Helper.xcode_at_least?('11.0.0')
|
16
|
+
verify_delicate_params(params)
|
17
|
+
params[:destinations] = update_destinations(params)
|
18
|
+
params[:xcargs] = update_xcargs(params)
|
19
|
+
|
20
|
+
@xchelper = Helper::CreateXcframeworkHelper.new(params)
|
21
|
+
|
22
|
+
params[:destinations].each_with_index do |destination, framework_index|
|
23
|
+
params[:destination] = destination
|
24
|
+
params[:archive_path] = @xchelper.xcarchive_path_for_destination(framework_index)
|
25
|
+
XcarchiveAction.run(params)
|
26
|
+
end
|
27
|
+
|
28
|
+
create_xcframework(params)
|
29
|
+
|
30
|
+
copy_dSYMs(params)
|
31
|
+
|
32
|
+
copy_BCSymbolMaps(params)
|
33
|
+
|
34
|
+
clean(params)
|
35
|
+
|
36
|
+
provide_shared_values
|
37
|
+
else
|
38
|
+
UI.important('xcframework can be produced only using Xcode 11 and above')
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
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)
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.clean(params)
|
52
|
+
FileUtils.rm_rf(@xchelper.xcarchive_path) if params[:remove_xcarchives]
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.create_xcframework(params)
|
56
|
+
xcframework = @xchelper.xcframework_path
|
57
|
+
begin
|
58
|
+
FileUtils.rm_rf(xcframework) if File.exist?(xcframework)
|
59
|
+
|
60
|
+
arguments = ['-create-xcframework']
|
61
|
+
arguments << '-allow-internal-distribution' if params[:allow_internal_distribution]
|
62
|
+
params[:destinations].each_with_index do |_, index|
|
63
|
+
arguments << "-framework #{@xchelper.xcarchive_framework_path(index)}"
|
64
|
+
arguments << debug_symbols(index: index, params: params)
|
65
|
+
end
|
66
|
+
arguments << "-output #{xcframework}"
|
67
|
+
|
68
|
+
Actions.sh("set -o pipefail && xcodebuild #{arguments.reject(&:empty?).join(' ')}")
|
69
|
+
rescue StandardError => e
|
70
|
+
UI.user_error!(e)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def self.debug_symbols(index:, params:)
|
75
|
+
return '' if !Helper.xcode_at_least?('12.0.0') || params[:include_debug_symbols] == false
|
76
|
+
|
77
|
+
debug_symbols = []
|
78
|
+
|
79
|
+
# Include dSYMs in xcframework
|
80
|
+
if params[:include_dSYMs] != false
|
81
|
+
debug_symbols << "-debug-symbols #{@xchelper.xcarchive_dSYMs_path(index)}/#{@xchelper.framework}.dSYM"
|
82
|
+
end
|
83
|
+
|
84
|
+
# Include BCSymbols in xcframework
|
85
|
+
if params[:include_BCSymbolMaps] != false && params[:enable_bitcode] != false
|
86
|
+
bc_symbols_dir = @xchelper.xcarchive_BCSymbolMaps_path(index)
|
87
|
+
if Dir.exist?(bc_symbols_dir)
|
88
|
+
arguments = Dir.children(bc_symbols_dir).map { |path| "-debug-symbols #{File.expand_path("#{bc_symbols_dir}/#{path}")}" }
|
89
|
+
debug_symbols << arguments.join(' ')
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
debug_symbols.join(' ')
|
94
|
+
end
|
95
|
+
|
96
|
+
def self.copy_dSYMs(params)
|
97
|
+
return if params[:include_dSYMs] == false
|
98
|
+
|
99
|
+
dSYMs_output_dir = @xchelper.xcframework_dSYMs_path
|
100
|
+
FileUtils.mkdir_p(dSYMs_output_dir)
|
101
|
+
|
102
|
+
params[:destinations].each_with_index do |_, framework_index|
|
103
|
+
dSYM_source = "#{@xchelper.xcarchive_dSYMs_path(framework_index)}/#{@xchelper.framework}.dSYM"
|
104
|
+
identifier = @xchelper.library_identifier(framework_index)
|
105
|
+
dSYM = "#{@xchelper.framework}.#{identifier}.dSYM"
|
106
|
+
dSYM_destination = "#{dSYMs_output_dir}/#{dSYM}"
|
107
|
+
|
108
|
+
UI.important("▸ Copying #{dSYM} to #{dSYMs_output_dir}")
|
109
|
+
FileUtils.cp_r(dSYM_source, dSYM_destination)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
def self.copy_BCSymbolMaps(params)
|
114
|
+
return if params[:enable_bitcode] == false || params[:include_BCSymbolMaps] == false
|
115
|
+
|
116
|
+
symbols_output_dir = @xchelper.xcframework_BCSymbolMaps_path
|
117
|
+
FileUtils.mkdir_p(symbols_output_dir)
|
118
|
+
|
119
|
+
params[:destinations].each_with_index do |_, framework_index|
|
120
|
+
symbols_xcarchive_dir = @xchelper.xcarchive_BCSymbolMaps_path(framework_index)
|
121
|
+
next unless Dir.exist?(symbols_xcarchive_dir)
|
122
|
+
|
123
|
+
FileUtils.cp_r("#{symbols_xcarchive_dir}/.", symbols_output_dir)
|
124
|
+
UI.important("▸ Copying #{Dir.children(symbols_xcarchive_dir)} to #{symbols_output_dir}")
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
def self.verify_delicate_params(params)
|
129
|
+
UI.user_error!('Error: :scheme is required option') if params[:scheme].nil?
|
130
|
+
if !params[:destinations].nil? && !params[:destinations].kind_of?(Array)
|
131
|
+
UI.user_error!('Error: :destinations option should be presented as Array')
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
def self.update_xcargs(params)
|
136
|
+
xcargs = []
|
137
|
+
if params[:override_xcargs]
|
138
|
+
UI.important('Overwriting SKIP_INSTALL and BUILD_LIBRARY_FOR_DISTRIBUTION options')
|
139
|
+
if params[:xcargs]
|
140
|
+
params[:xcargs].gsub!(/SKIP_INSTALL(=|\s+)(YES|NO)/, '')
|
141
|
+
params[:xcargs].gsub!(/BUILD_LIBRARY_FOR_DISTRIBUTION(=|\s+)(YES|NO)/, '')
|
142
|
+
end
|
143
|
+
xcargs.concat(['SKIP_INSTALL=NO', 'BUILD_LIBRARY_FOR_DISTRIBUTION=YES'])
|
144
|
+
end
|
145
|
+
|
146
|
+
if params[:enable_bitcode] != false
|
147
|
+
params[:xcargs].gsub!(/ENABLE_BITCODE(=|\s+)(YES|NO)/, '') if params[:xcargs]
|
148
|
+
xcargs << ['OTHER_CFLAGS="-fembed-bitcode"', 'BITCODE_GENERATION_MODE="bitcode"', 'ENABLE_BITCODE=YES']
|
149
|
+
end
|
150
|
+
|
151
|
+
"#{params[:xcargs].to_s.strip} #{xcargs.join(' ')}"
|
152
|
+
end
|
153
|
+
|
154
|
+
def self.update_destinations(params)
|
155
|
+
return available_destinations.values[0] if params[:destinations].nil?
|
156
|
+
|
157
|
+
requested_destinations = params[:destinations].map do |requested_de|
|
158
|
+
available_destinations.select { |available_de, _| available_de == requested_de }.values
|
159
|
+
end
|
160
|
+
UI.user_error!("Error: available destinations: #{available_destinations.keys}") if requested_destinations.any?(&:empty?)
|
161
|
+
|
162
|
+
requested_destinations.flatten
|
163
|
+
end
|
164
|
+
|
165
|
+
def self.available_destinations
|
166
|
+
{
|
167
|
+
'iOS' => ['generic/platform=iOS', 'generic/platform=iOS Simulator'],
|
168
|
+
'iPadOS' => ['generic/platform=iPadOS', 'generic/platform=iPadOS Simulator'],
|
169
|
+
'tvOS' => ['generic/platform=tvOS', 'generic/platform=tvOS Simulator'],
|
170
|
+
'watchOS' => ['generic/platform=watchOS', 'generic/platform=watchOS Simulator'],
|
171
|
+
'carPlayOS' => ['generic/platform=carPlayOS', 'generic/platform=carPlayOS Simulator'],
|
172
|
+
'macOS' => ['generic/platform=macOS'],
|
173
|
+
'maccatalyst' => ['generic/platform=macOS,variant=Mac Catalyst'],
|
174
|
+
'visionOS' => ['generic/platform=visionOS', 'generic/platform=visionOS Simulator']
|
175
|
+
}
|
176
|
+
end
|
177
|
+
|
178
|
+
#####################################################
|
179
|
+
# Documentation #
|
180
|
+
#####################################################
|
181
|
+
|
182
|
+
def self.description
|
183
|
+
'Fastlane plugin that creates xcframework for given list of destinations.'
|
184
|
+
end
|
185
|
+
|
186
|
+
def self.example_code
|
187
|
+
[
|
188
|
+
create_xcframework(
|
189
|
+
workspace: 'path/to/your.xcworkspace',
|
190
|
+
scheme: 'framework scheme',
|
191
|
+
destinations: ['iOS'],
|
192
|
+
xcframework_output_directory: 'output_directory'
|
193
|
+
)
|
194
|
+
]
|
195
|
+
end
|
196
|
+
|
197
|
+
def self.output
|
198
|
+
[
|
199
|
+
['XCFRAMEWORK_OUTPUT_PATH', 'The path to the newly generated xcframework'],
|
200
|
+
['XCFRAMEWORK_DSYM_OUTPUT_PATH', 'The path to the folder with dSYMs'],
|
201
|
+
['XCFRAMEWORK_BCSYMBOLMAPS_OUTPUT_PATH', 'The path to the folder with BCSymbolMaps']
|
202
|
+
]
|
203
|
+
end
|
204
|
+
|
205
|
+
def self.authors
|
206
|
+
['Boris Bielik', 'Alexey Alter-Pesotskiy']
|
207
|
+
end
|
208
|
+
|
209
|
+
def self.details
|
210
|
+
'Create xcframework plugin generates xcframework for specified destinations. ' \
|
211
|
+
'The output of this action consists of the xcframework itself, which contains dSYM and BCSymbolMaps, if bitcode is enabled.'
|
212
|
+
end
|
213
|
+
|
214
|
+
def self.available_options
|
215
|
+
XcarchiveAction.available_options + [
|
216
|
+
FastlaneCore::ConfigItem.new(
|
217
|
+
key: :scheme,
|
218
|
+
description: "The project's scheme. Make sure it's marked as Shared",
|
219
|
+
optional: false
|
220
|
+
),
|
221
|
+
FastlaneCore::ConfigItem.new(
|
222
|
+
key: :enable_bitcode,
|
223
|
+
description: 'Should the project be built with bitcode enabled?',
|
224
|
+
optional: true,
|
225
|
+
is_string: false,
|
226
|
+
default_value: true
|
227
|
+
),
|
228
|
+
FastlaneCore::ConfigItem.new(
|
229
|
+
key: :destinations,
|
230
|
+
description: 'Use custom destinations for building the xcframework',
|
231
|
+
optional: true,
|
232
|
+
is_string: false,
|
233
|
+
default_value: ['iOS']
|
234
|
+
),
|
235
|
+
FastlaneCore::ConfigItem.new(
|
236
|
+
key: :xcframework_output_directory,
|
237
|
+
description: 'The directory in which the xcframework should be stored in',
|
238
|
+
optional: true
|
239
|
+
),
|
240
|
+
FastlaneCore::ConfigItem.new(
|
241
|
+
key: :include_dSYMs,
|
242
|
+
description: 'Includes dSYM files in the xcframework',
|
243
|
+
optional: true,
|
244
|
+
default_value: true
|
245
|
+
),
|
246
|
+
FastlaneCore::ConfigItem.new(
|
247
|
+
key: :include_BCSymbolMaps,
|
248
|
+
description: 'Includes BCSymbolMap files in the xcframework',
|
249
|
+
optional: true,
|
250
|
+
default_value: true
|
251
|
+
),
|
252
|
+
FastlaneCore::ConfigItem.new(
|
253
|
+
key: :include_debug_symbols,
|
254
|
+
description: 'This feature was added in Xcode 12.0.' \
|
255
|
+
'If this is set to false, the dSYMs and BCSymbolMaps wont be added to XCFramework itself',
|
256
|
+
optional: true,
|
257
|
+
default_value: true
|
258
|
+
),
|
259
|
+
FastlaneCore::ConfigItem.new(
|
260
|
+
key: :product_name,
|
261
|
+
description: 'The name of your module. Optional if equals to :scheme. Equivalent to CFBundleName',
|
262
|
+
optional: true
|
263
|
+
),
|
264
|
+
FastlaneCore::ConfigItem.new(
|
265
|
+
key: :remove_xcarchives,
|
266
|
+
description: 'This option will auto-remove the xcarchive files once the plugin finishes.' \
|
267
|
+
'Set this to false to preserve the xcarchives',
|
268
|
+
optional: true,
|
269
|
+
default_value: true
|
270
|
+
),
|
271
|
+
FastlaneCore::ConfigItem.new(
|
272
|
+
key: :allow_internal_distribution,
|
273
|
+
description: 'This option will create an xcframework with the allow-internal-distribution flag.' \
|
274
|
+
'Allows the usage of @testable when importing the created xcframework in tests',
|
275
|
+
optional: true,
|
276
|
+
default_value: false
|
277
|
+
),
|
278
|
+
FastlaneCore::ConfigItem.new(
|
279
|
+
key: :override_xcargs,
|
280
|
+
description: 'This option will override xcargs SKIP_INSTALL and BUILD_LIBRARY_FOR_DISTRIBUTION.' \
|
281
|
+
'If set to true, SKIP_INSTALL will be set to NO and BUILD_LIBRARY_FOR_DISTRIBUTION will be set to YES' \
|
282
|
+
'Set this to false to preserve the passed xcargs',
|
283
|
+
optional: true,
|
284
|
+
default_value: true
|
285
|
+
)
|
286
|
+
]
|
287
|
+
end
|
288
|
+
|
289
|
+
def self.category
|
290
|
+
:building
|
291
|
+
end
|
292
|
+
|
293
|
+
def self.is_supported?(platform)
|
294
|
+
[:ios, :mac].include?(platform)
|
295
|
+
end
|
296
|
+
end
|
297
|
+
end
|
298
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Helper
|
3
|
+
class CreateXcframeworkHelper
|
4
|
+
def initialize(params)
|
5
|
+
@params = params
|
6
|
+
end
|
7
|
+
|
8
|
+
def product_name
|
9
|
+
@params[:product_name] ||= @params[:scheme]
|
10
|
+
end
|
11
|
+
|
12
|
+
def xcframework
|
13
|
+
"#{product_name}.xcframework"
|
14
|
+
end
|
15
|
+
|
16
|
+
def framework
|
17
|
+
"#{product_name}.framework"
|
18
|
+
end
|
19
|
+
|
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"
|
26
|
+
end
|
27
|
+
|
28
|
+
def xcarchive_framework_path(framework_index)
|
29
|
+
framework_path = "#{xcarchive_path_for_destination(framework_index)}/Products/Library/Frameworks/#{framework}"
|
30
|
+
return framework_path if File.exist?(framework_path)
|
31
|
+
|
32
|
+
UI.user_error!("▸ PRODUCT_NAME was misdefined: `#{product_name}`. Please, provide :product_name option")
|
33
|
+
end
|
34
|
+
|
35
|
+
def xcarchive_frameworks_path
|
36
|
+
@params[:destinations].each_with_index.map { |_, i| xcarchive_framework_path(i) }
|
37
|
+
end
|
38
|
+
|
39
|
+
def xcarchive_dSYMs_path(framework_index)
|
40
|
+
File.expand_path("#{xcarchive_path_for_destination(framework_index)}/dSYMS")
|
41
|
+
end
|
42
|
+
|
43
|
+
def xcframework_dSYMs_path
|
44
|
+
File.expand_path("#{output_directory}/#{product_name}.dSYMs")
|
45
|
+
end
|
46
|
+
|
47
|
+
def xcarchive_BCSymbolMaps_path(framework_index)
|
48
|
+
File.expand_path("#{xcarchive_path_for_destination(framework_index)}/BCSymbolMaps")
|
49
|
+
end
|
50
|
+
|
51
|
+
def xcframework_BCSymbolMaps_path
|
52
|
+
File.expand_path("#{output_directory}/#{product_name}.BCSymbolMaps")
|
53
|
+
end
|
54
|
+
|
55
|
+
def xcframework_path
|
56
|
+
File.expand_path("#{output_directory}/#{xcframework}")
|
57
|
+
end
|
58
|
+
|
59
|
+
def output_directory
|
60
|
+
@params[:xcframework_output_directory] || ''
|
61
|
+
end
|
62
|
+
|
63
|
+
def library_identifier(framework_index)
|
64
|
+
framework_path = xcarchive_framework_path(framework_index)
|
65
|
+
framework_basename = framework_path.split('/').last
|
66
|
+
framework_root = framework_basename.split('.').first
|
67
|
+
library_identifiers = Dir.chdir(xcframework_path) do
|
68
|
+
Dir.glob('*').select { |f| File.directory?(f) }
|
69
|
+
end
|
70
|
+
library_identifier = library_identifiers.detect do |id|
|
71
|
+
FileUtils.compare_file(
|
72
|
+
"#{framework_path}/#{framework_root}",
|
73
|
+
"#{xcframework_path}/#{id}/#{framework_basename}/#{framework_root}"
|
74
|
+
)
|
75
|
+
end
|
76
|
+
UI.user_error!("Error: #{xcframework_path} doesn't contain #{framework_path}") if library_identifier.nil?
|
77
|
+
|
78
|
+
library_identifier
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/mobile_tools/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module MobileTools
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::MobileTools.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,230 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-mobile_tools
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Yogesh Khandelwal
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-08-16 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: fasterer
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.9.0
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.9.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: fastlane
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.182.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.182.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec_junit_formatter
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - '='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 1.12.1
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - '='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.12.1
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop-performance
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rubocop-rake
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - '='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 0.6.0
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - '='
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 0.6.0
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rubocop-require_tools
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: rubocop-rspec
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - '='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 2.6.0
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - '='
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: 2.6.0
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: simplecov
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
description:
|
196
|
+
email: yogesh_khandelwal@intuit.com
|
197
|
+
executables: []
|
198
|
+
extensions: []
|
199
|
+
extra_rdoc_files: []
|
200
|
+
files:
|
201
|
+
- LICENSE
|
202
|
+
- README.md
|
203
|
+
- lib/fastlane/plugin/mobile_tools.rb
|
204
|
+
- lib/fastlane/plugin/mobile_tools/actions/create_xcframework_action.rb
|
205
|
+
- lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb
|
206
|
+
- lib/fastlane/plugin/mobile_tools/version.rb
|
207
|
+
homepage: https://github.com/ykhandelwal913/fastlane-plugin-mobile_tools
|
208
|
+
licenses:
|
209
|
+
- MIT
|
210
|
+
metadata: {}
|
211
|
+
post_install_message:
|
212
|
+
rdoc_options: []
|
213
|
+
require_paths:
|
214
|
+
- lib
|
215
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
216
|
+
requirements:
|
217
|
+
- - ">="
|
218
|
+
- !ruby/object:Gem::Version
|
219
|
+
version: '2.6'
|
220
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
221
|
+
requirements:
|
222
|
+
- - ">="
|
223
|
+
- !ruby/object:Gem::Version
|
224
|
+
version: '0'
|
225
|
+
requirements: []
|
226
|
+
rubygems_version: 3.5.3
|
227
|
+
signing_key:
|
228
|
+
specification_version: 4
|
229
|
+
summary: fastlane plugin for mobile devops tooling
|
230
|
+
test_files: []
|