pod-builder 2.0.0.beta.27 → 2.0.0.beta.32
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 +4 -4
- data/README.md +7 -13
- data/exe/pod_builder +8 -2
- data/lib/pod_builder/command/build.rb +3 -73
- data/lib/pod_builder/command/clean.rb +1 -14
- data/lib/pod_builder/configuration.rb +1 -9
- data/lib/pod_builder/install.rb +11 -42
- data/lib/pod_builder/podfile.rb +17 -13
- data/lib/pod_builder/podfile_item.rb +9 -15
- data/lib/pod_builder/podspec.rb +4 -8
- data/lib/pod_builder/rome/post_install.rb +4 -3
- data/lib/pod_builder/version.rb +1 -1
- data/pod-builder.gemspec +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d2d2da339c3c50f17484abe18c4f4dd8080d4344bc526b393c95c3d166c9851
|
4
|
+
data.tar.gz: 483067dfc8cd9b914dfa9768afc33cf067f7807a9b09ce3f1b3c86c67b4c08a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e87ca666254ff92c0c729412acf61d02e822b55933524d07ed2ec13ea38b33a29f13fac2ec6eef221f373626b50f690ec45235f7874910374123806d0a0d6122
|
7
|
+
data.tar.gz: 945398f22ccc35ac924a16e6fe3a95be6343fd0ee335f8f9f94082004193113566884a49043cefac8bf6efb705db79d774dab304e56ec15fe468acdcf6e687e4
|
data/README.md
CHANGED
@@ -12,6 +12,10 @@ Unless you're using a Ruby version manager you should generally install using `s
|
|
12
12
|
|
13
13
|
$ sudo gem install pod-builder
|
14
14
|
|
15
|
+
## Requirements
|
16
|
+
|
17
|
+
Ruby 2.6.3 or newer. Cocoapods 1.9.0 or newer
|
18
|
+
|
15
19
|
# Quick start
|
16
20
|
|
17
21
|
You can the initialize your project to use the tool using the `init` command
|
@@ -253,6 +257,8 @@ Xcode build settings to use. You can override the default values which are:
|
|
253
257
|
}
|
254
258
|
```
|
255
259
|
|
260
|
+
If your project uses bitcode change "ENABLE_BITCODE" to "YES".
|
261
|
+
|
256
262
|
#### `build_settings_overrides`
|
257
263
|
|
258
264
|
Like `build_settings` but per pod. Pod name can also refer to subspec.
|
@@ -272,7 +278,7 @@ Like `build_settings` but per pod. Pod name can also refer to subspec.
|
|
272
278
|
|
273
279
|
#### `build_system`
|
274
280
|
|
275
|
-
Specify which build system to use to compile frameworks. Either `Legacy` (standard build system) or `Latest` (new build system). Default value: `
|
281
|
+
Specify which build system to use to compile frameworks. Either `Legacy` (standard build system) or `Latest` (new build system). Default value: `Latest`.
|
276
282
|
|
277
283
|
#### `library_evolution_support`
|
278
284
|
|
@@ -300,18 +306,6 @@ PodBuilder writes a plist and markdown license files of pods specified in the Po
|
|
300
306
|
}
|
301
307
|
```
|
302
308
|
|
303
|
-
#### `subspecs_to_split`
|
304
|
-
|
305
|
-
Normally when multiple subspecs are specified in a target a single framework is produced. There are rare cases where you specify different subspecs in different targets: a typical case is subspec specifically designed for app extensions, where you want to use a subspec in the main app and another one in the app extension.
|
306
|
-
|
307
|
-
**Warning**: This will work properly only for static frameworks (_static_framework = true_ specified in the podspec). See [issue](https://github.com/CocoaPods/CocoaPods/issues/5708) and [issue](https://github.com/CocoaPods/CocoaPods/issues/5643)
|
308
|
-
|
309
|
-
```json
|
310
|
-
{
|
311
|
-
"subspecs_to_split": ["Podname1/Subspec1", "Podname1/Subspec2", "Podname2/Subspec1", "Podname2/Subspec1"]
|
312
|
-
}
|
313
|
-
```
|
314
|
-
|
315
309
|
#### `use_bundler`
|
316
310
|
|
317
311
|
If you use bundler to pin the version of CocoaPods in your project set this to true. Default false.
|
data/exe/pod_builder
CHANGED
@@ -8,7 +8,7 @@ if show_version
|
|
8
8
|
exit(0)
|
9
9
|
end
|
10
10
|
|
11
|
-
if ENV[
|
11
|
+
if ENV["DEBUGGING"]
|
12
12
|
puts "Running in debug, injecting $LOAD_PATH"
|
13
13
|
libdir = File.expand_path("#{File.dirname(__FILE__)}/../lib")
|
14
14
|
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
|
@@ -79,6 +79,9 @@ Options:
|
|
79
79
|
# opts.on("-a", "--auto-resolve-deps", "Resolve pod dependencies automatically") do |o|
|
80
80
|
# OPTIONS[:auto_resolve_dependencies] = o
|
81
81
|
# end
|
82
|
+
opts.on("-s", "--no-stdin", "Never request interaction with sdtin (e.g. in CI environment)") do |o|
|
83
|
+
OPTIONS[:no_stdin_available] = o
|
84
|
+
end
|
82
85
|
opts.on("-d", "--debug", "Don't clean build folder") do |o|
|
83
86
|
OPTIONS[:debug] = o
|
84
87
|
end
|
@@ -108,6 +111,9 @@ Options:
|
|
108
111
|
opts.on("-w", "--allow-warnings", "Allow warnings") do |o|
|
109
112
|
OPTIONS[:allow_warnings] = o
|
110
113
|
end
|
114
|
+
opts.on("-s", "--no-stdin", "Never request interaction with sdtin (e.g. in CI environment)") do |o|
|
115
|
+
OPTIONS[:no_stdin_available] = o
|
116
|
+
end
|
111
117
|
opts.on("-d", "--debug", "Don't clean build folder") do |o|
|
112
118
|
OPTIONS[:debug] = o
|
113
119
|
end
|
@@ -367,7 +373,7 @@ end
|
|
367
373
|
|
368
374
|
command_ret = -1
|
369
375
|
begin
|
370
|
-
unless ENV[
|
376
|
+
unless ENV["USER"] != "root"
|
371
377
|
raise "\n\nFor safety do not run this as root\n".red
|
372
378
|
end
|
373
379
|
|
@@ -49,34 +49,27 @@ module PodBuilder
|
|
49
49
|
|
50
50
|
restore_file_error = Podfile.restore_file_sanity_check
|
51
51
|
|
52
|
-
check_splitted_subspecs_are_buildable(all_buildable_items, installer)
|
53
52
|
check_pods_exists(argument_pods, all_buildable_items)
|
54
53
|
|
55
54
|
pods_to_build = resolve_pods_to_build(argument_pods, buildable_items)
|
56
55
|
buildable_items -= pods_to_build
|
57
56
|
|
58
57
|
# We need to split pods to build in 3 groups
|
59
|
-
# 1.
|
60
|
-
# 2. pods to build in
|
61
|
-
# 3. pods to build in debug
|
58
|
+
# 1. pods to build in release
|
59
|
+
# 2. pods to build in debug
|
62
60
|
|
63
61
|
check_not_building_development_pods(pods_to_build)
|
64
62
|
|
65
|
-
pods_to_build_subspecs = splitted_pods_to_build(pods_to_build, installer)
|
66
|
-
|
67
63
|
# Remove dependencies from pods to build
|
68
64
|
all_dependencies_name = pods_to_build.map(&:dependency_names).flatten.uniq
|
69
65
|
pods_to_build.select! { |x| !all_dependencies_name.include?(x.name) }
|
70
66
|
|
71
|
-
pods_to_build -= pods_to_build_subspecs.flatten
|
72
67
|
pods_to_build_debug = pods_to_build.select { |x| x.build_configuration == "debug" }
|
73
68
|
pods_to_build_release = pods_to_build - pods_to_build_debug
|
74
69
|
|
75
70
|
check_dependencies_build_configurations(all_buildable_items)
|
76
71
|
|
77
|
-
podfiles_items =
|
78
|
-
podfiles_items.push(pods_to_build_debug)
|
79
|
-
podfiles_items.push(pods_to_build_release)
|
72
|
+
podfiles_items = [pods_to_build_debug] + [pods_to_build_release]
|
80
73
|
|
81
74
|
install_using_frameworks = Podfile::install_using_frameworks(analyzer)
|
82
75
|
|
@@ -125,20 +118,6 @@ module PodBuilder
|
|
125
118
|
|
126
119
|
private
|
127
120
|
|
128
|
-
def self.splitted_pods_to_build(pods_to_build, installer)
|
129
|
-
specs_by_target = installer.analysis_result.specs_by_target
|
130
|
-
|
131
|
-
pods_to_build_subspecs = pods_to_build.select { |x| x.is_subspec && Configuration.subspecs_to_split.include?(x.name) }
|
132
|
-
|
133
|
-
pods = []
|
134
|
-
specs_by_target.each do |target, specs|
|
135
|
-
grouped = pods_to_build_subspecs.group_by { |t| specs.map(&:name).include?(t.name) }
|
136
|
-
pods.push(grouped[true])
|
137
|
-
end
|
138
|
-
|
139
|
-
return pods.compact
|
140
|
-
end
|
141
|
-
|
142
121
|
def self.check_not_building_subspecs(pods_to_build)
|
143
122
|
pods_to_build.each do |pod_to_build|
|
144
123
|
if pod_to_build.include?("/")
|
@@ -156,55 +135,6 @@ module PodBuilder
|
|
156
135
|
end
|
157
136
|
end
|
158
137
|
|
159
|
-
def self.check_splitted_subspecs_are_buildable(all_buildable_items, installer)
|
160
|
-
check_splitted_subspecs_are_static(all_buildable_items)
|
161
|
-
check_splitted_subspecs_have_valid_dependencies(all_buildable_items)
|
162
|
-
check_splitted_subspecs_not_in_multiple_targets(all_buildable_items, installer)
|
163
|
-
end
|
164
|
-
|
165
|
-
def self.check_splitted_subspecs_have_valid_dependencies(all_buildable_items)
|
166
|
-
splitted_items = all_buildable_items.select { |t| Configuration.subspecs_to_split.include?(t.name) }
|
167
|
-
splitted_items.each do |splitted_item|
|
168
|
-
common_deps = splitted_item.dependency_names.select { |t| t.start_with?(splitted_item.root_name) }
|
169
|
-
|
170
|
-
if common_deps.count > 0
|
171
|
-
raise "\n\nSubspecs included in 'subspecs_to_split' cannot have dependencies to other subspecs within the spec.\n\n#{splitted_item.name} has dependencies to: '#{common_deps.join(', ')}'\n\n".red
|
172
|
-
end
|
173
|
-
end
|
174
|
-
end
|
175
|
-
|
176
|
-
def self.check_splitted_subspecs_not_in_multiple_targets(all_buildable_items, installer)
|
177
|
-
specs_by_target = installer.analysis_result.specs_by_target
|
178
|
-
|
179
|
-
flat_item_names = specs_by_target.values.flatten.map(&:name)
|
180
|
-
|
181
|
-
splitted_items = all_buildable_items.select { |t| Configuration.subspecs_to_split.include?(t.name) }
|
182
|
-
|
183
|
-
splitted_items.each do |splitted_item|
|
184
|
-
if flat_item_names.count(splitted_item.name) > 1
|
185
|
-
raise "\n\n'#{splitted_item.name}' is included in 'subspecs_to_split' but it is used in multiple targets. This is unsupported.\nIf possible duplicate the subspec '#{splitted_item.name}' in the podspec using different names for each target.\n".red
|
186
|
-
end
|
187
|
-
end
|
188
|
-
end
|
189
|
-
|
190
|
-
def self.check_splitted_subspecs_are_static(all_buildable_items)
|
191
|
-
non_static_subspecs = all_buildable_items.select { |x| x.is_subspec && x.is_static == false }
|
192
|
-
non_static_subspecs_names = non_static_subspecs.map(&:name)
|
193
|
-
|
194
|
-
invalid_subspecs = Configuration.subspecs_to_split & non_static_subspecs_names # intersect
|
195
|
-
|
196
|
-
unless invalid_subspecs.count > 0
|
197
|
-
return
|
198
|
-
end
|
199
|
-
|
200
|
-
warn_message = "The following pods `#{invalid_subspecs.join(" ")}` are non static binaries which are being splitted over different targets. Beware that this is an unsafe setup as per https://github.com/CocoaPods/CocoaPods/issues/5708 and https://github.com/CocoaPods/CocoaPods/issues/5643\n\nYou can ignore this error by passing the `--allow-warnings` flag to the build command\n"
|
201
|
-
if OPTIONS[:allow_warnings]
|
202
|
-
puts "\n\n#{warn_message}".yellow
|
203
|
-
else
|
204
|
-
raise "\n\n#{warn_message}".red
|
205
|
-
end
|
206
|
-
end
|
207
|
-
|
208
138
|
def self.check_dependencies_build_configurations(pods)
|
209
139
|
pods.each do |pod|
|
210
140
|
pod_dependency_names = pod.dependency_names.select { |x| !pod.has_common_spec(x) }
|
@@ -31,19 +31,6 @@ module PodBuilder
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
splitted_specs = buildable_items.select { |t| Configuration.subspecs_to_split.include?(t.name) }
|
35
|
-
splitted_specs.each do |splitted_spec|
|
36
|
-
root_name = splitted_spec.root_name
|
37
|
-
|
38
|
-
Dir.glob(PodBuilder::prebuiltpath("#{root_name}/Subspecs/*")).each do |path|
|
39
|
-
basename = File.basename(path)
|
40
|
-
unless splitted_specs.map(&:podspec_name).include?(basename)
|
41
|
-
puts "Cleanining up `#{root_name}/#{basename}`, no longer found among dependencies".blue
|
42
|
-
PodBuilder::safe_rm_rf(path)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
34
|
puts "Cleaning dSYM folder".yellow
|
48
35
|
module_names = buildable_items.map(&:module_name).uniq
|
49
36
|
Dir.glob(File.join(PodBuilder::dsympath, "**/*.dSYM")).each do |path|
|
@@ -78,7 +65,7 @@ module PodBuilder
|
|
78
65
|
|
79
66
|
paths_to_delete.flatten.each do |path|
|
80
67
|
confirm = ask("#{path} unused.\nDelete it? [Y/N] ") { |yn| yn.limit = 1, yn.validate = /[yn]/i }
|
81
|
-
if confirm.downcase == 'y'
|
68
|
+
if confirm.downcase == 'y' || OPTIONS.has_key?(:no_stdin_available)
|
82
69
|
PodBuilder::safe_rm_rf(path)
|
83
70
|
end
|
84
71
|
end
|
@@ -39,7 +39,7 @@ module PodBuilder
|
|
39
39
|
}.freeze
|
40
40
|
DEFAULT_SKIP_PODS = ["GoogleMaps"]
|
41
41
|
DEFAULT_FORCE_PREBUILD_PODS = ["GoogleTagManager"]
|
42
|
-
DEFAULT_BUILD_SYSTEM = "
|
42
|
+
DEFAULT_BUILD_SYSTEM = "Latest".freeze # either Latest (New build system) or Legacy (Standard build system)
|
43
43
|
DEFAULT_LIBRARY_EVOLUTION_SUPPORT = false
|
44
44
|
DEFAULT_PLATFORMS = ["iphoneos", "iphonesimulator", "appletvos", "appletvsimulator"].freeze
|
45
45
|
DEFAULT_BUILD_FOR_APPLE_SILICON = false
|
@@ -61,7 +61,6 @@ module PodBuilder
|
|
61
61
|
attr_accessor :skip_pods
|
62
62
|
attr_accessor :force_prebuild_pods
|
63
63
|
attr_accessor :license_filename
|
64
|
-
attr_accessor :subspecs_to_split
|
65
64
|
attr_accessor :development_pods_paths
|
66
65
|
attr_accessor :build_base_path
|
67
66
|
attr_accessor :build_path
|
@@ -92,7 +91,6 @@ module PodBuilder
|
|
92
91
|
@skip_pods = DEFAULT_SKIP_PODS
|
93
92
|
@force_prebuild_pods = DEFAULT_FORCE_PREBUILD_PODS
|
94
93
|
@license_filename = "Pods-acknowledgements"
|
95
|
-
@subspecs_to_split = []
|
96
94
|
@development_pods_paths = []
|
97
95
|
@build_base_path = "/tmp/pod_builder".freeze
|
98
96
|
@build_path = build_base_path
|
@@ -180,11 +178,6 @@ module PodBuilder
|
|
180
178
|
Configuration.license_filename = value
|
181
179
|
end
|
182
180
|
end
|
183
|
-
if value = json["subspecs_to_split"]
|
184
|
-
if value.is_a?(Array) && value.count > 0
|
185
|
-
Configuration.subspecs_to_split = value
|
186
|
-
end
|
187
|
-
end
|
188
181
|
if value = json["project_name"]
|
189
182
|
if value.is_a?(String) && value.length > 0
|
190
183
|
Configuration.project_name = value
|
@@ -263,7 +256,6 @@ module PodBuilder
|
|
263
256
|
config["build_system"] = Configuration.build_system
|
264
257
|
config["library_evolution_support"] = Configuration.library_evolution_support
|
265
258
|
config["license_filename"] = Configuration.license_filename
|
266
|
-
config["subspecs_to_split"] = Configuration.subspecs_to_split
|
267
259
|
config["restore_enabled"] = Configuration.restore_enabled
|
268
260
|
config["allow_building_development_pods"] = Configuration.allow_building_development_pods
|
269
261
|
config["use_bundler"] = Configuration.use_bundler
|
data/lib/pod_builder/install.rb
CHANGED
@@ -177,9 +177,9 @@ module PodBuilder
|
|
177
177
|
return InstallResult.new(licenses, prebuilt_info)
|
178
178
|
rescue Exception => e
|
179
179
|
if File.directory?("#{Configuration.build_path}/Pods/Pods.xcodeproj")
|
180
|
-
if ENV[
|
180
|
+
if ENV["DEBUGGING"]
|
181
181
|
system("xed #{Configuration.build_path}/Pods")
|
182
|
-
|
182
|
+
elsif !OPTIONS.has_key?(:no_stdin_available)
|
183
183
|
confirm = ask("\n\nOh no! Something went wrong during prebuild phase! Do you want to open the prebuild project to debug the error, you will need to add and run the Pods-Dummy scheme? [Y/N] ".red) { |yn| yn.limit = 1, yn.validate = /[yn]/i }
|
184
184
|
if confirm.downcase == 'y'
|
185
185
|
system("xed #{Configuration.build_path}/Pods")
|
@@ -217,9 +217,6 @@ module PodBuilder
|
|
217
217
|
|
218
218
|
podbuilder_file = File.join(path, Configuration.prebuilt_info_filename)
|
219
219
|
entry = podfile_item.entry(true, false)
|
220
|
-
if Configuration.subspecs_to_split.include?(podfile_item.name)
|
221
|
-
entry.gsub!("'#{podfile_item.name}'", "'#{podfile_item.root_name}'")
|
222
|
-
end
|
223
220
|
|
224
221
|
data = {}
|
225
222
|
data["entry"] = entry
|
@@ -233,7 +230,7 @@ module PodBuilder
|
|
233
230
|
subspec_self_deps = subspecs_deps.select { |x| x.start_with?("#{prebuilt_name}/") }
|
234
231
|
data["specs"] = (specs.map(&:name) + subspec_self_deps).uniq
|
235
232
|
data["is_static"] = podfile_item.is_static
|
236
|
-
data["original_compile_path"] = Configuration.build_path.
|
233
|
+
data["original_compile_path"] = Pathname.new(Configuration.build_path).realpath.to_s
|
237
234
|
if hash = build_folder_hash(podfile_item, gitignored_files)
|
238
235
|
data["build_folder_hash"] = hash
|
239
236
|
end
|
@@ -313,11 +310,8 @@ module PodBuilder
|
|
313
310
|
podspec_path = item.prebuilt_podspec_path
|
314
311
|
if last_build_folder_hash = build_folder_hash_in_prebuilt_info_file(item)
|
315
312
|
if last_build_folder_hash == build_folder_hash(item, gitignored_files)
|
316
|
-
|
317
|
-
|
318
|
-
else
|
319
|
-
puts "No changes detected to '#{item.root_name}', will skip rebuild".blue
|
320
|
-
end
|
313
|
+
puts "No changes detected to '#{item.root_name}', will skip rebuild".blue
|
314
|
+
|
321
315
|
replaced_items.push(item)
|
322
316
|
|
323
317
|
podfile_items.select { |t| t.root_name == item.root_name }.each do |replace_item|
|
@@ -385,33 +379,21 @@ module PodBuilder
|
|
385
379
|
|
386
380
|
non_prebuilt_items = podfile_items.reject(&:is_prebuilt)
|
387
381
|
|
388
|
-
|
389
|
-
splitted_pods_root_name = splitted_pods.map { |t| t.root_name }.uniq
|
390
|
-
|
391
|
-
pod_names = non_prebuilt_items.reject { |t| splitted_pods_root_name.include?(t.root_name) }.map(&:root_name).uniq + splitted_pods.map(&:name)
|
382
|
+
pod_names = non_prebuilt_items.map(&:root_name).uniq
|
392
383
|
|
393
384
|
pod_names.reject! { |t|
|
394
385
|
folder_path = PodBuilder::buildpath_prebuiltpath(t)
|
395
386
|
File.directory?(folder_path) && Dir.empty?(folder_path) # When using prebuilt items we end up with empty folders
|
396
387
|
}
|
397
388
|
|
398
|
-
# Selectively delete destination folder.
|
399
|
-
# If it's a splitted spec we just need to wipe the Subspecs/#{pod_name}
|
400
|
-
# If it's not we need to wipe everything except the Subspecs folder
|
401
389
|
pod_names.each do |pod_name|
|
402
390
|
root_name = pod_name.split("/").first
|
403
|
-
if pod_name.include?("/") # Splitted pod
|
404
|
-
PodBuilder::safe_rm_rf(PodBuilder::prebuiltpath("#{root_name}/Subspecs/#{pod_name.gsub("/", "_") }"))
|
405
|
-
else
|
406
|
-
items_to_delete = Dir.glob("#{PodBuilder::prebuiltpath(root_name)}/**/*")
|
407
|
-
items_to_delete.reject! { |t| t.include?(PodBuilder::prebuiltpath("#{root_name}/Subspecs")) }
|
408
391
|
|
409
|
-
|
410
|
-
|
392
|
+
items_to_delete = Dir.glob("#{PodBuilder::prebuiltpath(root_name)}/**/*")
|
393
|
+
items_to_delete.each { |t| PodBuilder::safe_rm_rf(t) }
|
411
394
|
end
|
412
395
|
|
413
396
|
# Now copy
|
414
|
-
splitted_items_copied = false
|
415
397
|
pod_names.each do |pod_name|
|
416
398
|
root_name = pod_name.split("/").first
|
417
399
|
source_path = PodBuilder::buildpath_prebuiltpath(root_name)
|
@@ -421,18 +403,9 @@ module PodBuilder
|
|
421
403
|
next
|
422
404
|
end
|
423
405
|
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
unless splitted_items_copied
|
428
|
-
FileUtils.cp_r("#{source_path}/.", destination_folder)
|
429
|
-
splitted_items_copied = true
|
430
|
-
end
|
431
|
-
else
|
432
|
-
destination_folder = PodBuilder::prebuiltpath(root_name)
|
433
|
-
FileUtils.mkdir_p(destination_folder)
|
434
|
-
FileUtils.cp_r("#{source_path}/.", destination_folder)
|
435
|
-
end
|
406
|
+
destination_folder = PodBuilder::prebuiltpath(root_name)
|
407
|
+
FileUtils.mkdir_p(destination_folder)
|
408
|
+
FileUtils.cp_r("#{source_path}/.", destination_folder)
|
436
409
|
end
|
437
410
|
|
438
411
|
# Folder won't exist if no dSYM were generated (all static libs)
|
@@ -522,9 +495,5 @@ module PodBuilder
|
|
522
495
|
return replace_path
|
523
496
|
end
|
524
497
|
end
|
525
|
-
|
526
|
-
def self.splitted_pod(podfile_item, podfile_items)
|
527
|
-
return podfile_items.select { |t| t.root_name == podfile_item.root_name && Configuration.subspecs_to_split.include?(t.name) }
|
528
|
-
end
|
529
498
|
end
|
530
499
|
end
|
data/lib/pod_builder/podfile.rb
CHANGED
@@ -37,29 +37,33 @@ module PodBuilder
|
|
37
37
|
item_build_settings = Configuration.build_settings_overrides[item.name] || {}
|
38
38
|
|
39
39
|
# These settings need to be set as is to properly build frameworks
|
40
|
-
build_settings[
|
41
|
-
build_settings[
|
42
|
-
build_settings[
|
40
|
+
build_settings["SWIFT_COMPILATION_MODE"] = "wholemodule"
|
41
|
+
build_settings["ONLY_ACTIVE_ARCH"] = "NO"
|
42
|
+
build_settings["DEBUG_INFORMATION_FORMAT"] = "dwarf-with-dsym"
|
43
43
|
|
44
|
-
build_settings[
|
44
|
+
build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = platform.deployment_target.version # Fix compilation warnings on Xcode 12
|
45
45
|
|
46
46
|
# Don't store .pcm info in binary, see https://forums.swift.org/t/swift-behavior-of-gmodules-and-dsyms/23211/3
|
47
|
-
build_settings[
|
48
|
-
build_settings[
|
47
|
+
build_settings["CLANG_ENABLE_MODULE_DEBUGGING"] = "NO"
|
48
|
+
build_settings["OTHER_SWIFT_FLAGS"] = "$(inherited) -Xfrontend -no-clang-module-breadcrumbs"
|
49
49
|
|
50
50
|
# Improve compile speed
|
51
|
-
build_settings[
|
52
|
-
build_settings[
|
53
|
-
build_settings[
|
51
|
+
build_settings["COMPILER_INDEX_STORE_ENABLE"] = "NO"
|
52
|
+
build_settings["SWIFT_INDEX_STORE_ENABLE"] = "NO"
|
53
|
+
build_settings["MTL_ENABLE_INDEX_STORE"] = "NO"
|
54
54
|
|
55
55
|
if Configuration.build_system == "Legacy"
|
56
|
-
build_settings[
|
56
|
+
build_settings["BUILD_LIBRARY_FOR_DISTRIBUTION"] = "NO"
|
57
57
|
raise "\n\nCan't enable library evolution support with legacy build system!".red if Configuration.library_evolution_support
|
58
58
|
elsif Configuration.library_evolution_support
|
59
|
-
build_settings[
|
59
|
+
build_settings["BUILD_LIBRARY_FOR_DISTRIBUTION"] = "YES"
|
60
60
|
end
|
61
61
|
|
62
|
-
build_settings[
|
62
|
+
build_settings["SWIFT_VERSION"] = item_build_settings["SWIFT_VERSION"] || item.swift_version || project_swift_version(analyzer)
|
63
|
+
|
64
|
+
if build_settings["ENABLE_BITCODE"] == "YES"
|
65
|
+
build_settings["BITCODE_GENERATION_MODE"] = "bitcode"
|
66
|
+
end
|
63
67
|
|
64
68
|
item_build_settings.each do |k, v|
|
65
69
|
build_settings[k] = v
|
@@ -387,7 +391,7 @@ module PodBuilder
|
|
387
391
|
def self.install_using_frameworks(analyzer)
|
388
392
|
target_settings = analyzer.podfile.target_definition_list.map(&:uses_frameworks?).uniq
|
389
393
|
if target_settings.count == 1
|
390
|
-
if target_settings.first == false && ENV[
|
394
|
+
if target_settings.first == false && ENV["DEBUGGING"].nil?
|
391
395
|
raise "\n\nOnly framework packaging currently supported. Please add 'use_frameworks!' at Podfile root level (not nested in targets)".red
|
392
396
|
end
|
393
397
|
return target_settings.first
|
@@ -295,16 +295,14 @@ module PodBuilder
|
|
295
295
|
|
296
296
|
root_names = deps.map(&:root_name).uniq
|
297
297
|
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
deps += available_pods.select { |t| root_names.include?(t.root_name) && t.root_name != t.name && !Configuration.subspecs_to_split.include?(t.name) }
|
307
|
-
end
|
298
|
+
# We need to build all other common subspecs to properly build the item
|
299
|
+
# Ex.
|
300
|
+
# PodA depends on DepA/subspec1
|
301
|
+
# PodB depends on DepA/subspec2
|
302
|
+
#
|
303
|
+
# When building PodA we need to build both DepA subspecs because they might
|
304
|
+
# contain different code
|
305
|
+
deps += available_pods.select { |t| root_names.include?(t.root_name) && t.root_name != t.name }
|
308
306
|
|
309
307
|
deps.uniq!
|
310
308
|
|
@@ -406,11 +404,7 @@ module PodBuilder
|
|
406
404
|
end
|
407
405
|
|
408
406
|
def prebuilt_rel_path
|
409
|
-
|
410
|
-
return "Subspecs/#{podspec_name}/#{module_name}.framework"
|
411
|
-
else
|
412
|
-
return "#{module_name}.framework"
|
413
|
-
end
|
407
|
+
return "#{module_name}.framework"
|
414
408
|
end
|
415
409
|
|
416
410
|
def prebuilt_podspec_path(absolute_path = true)
|
data/lib/pod_builder/podspec.rb
CHANGED
@@ -24,16 +24,12 @@ module PodBuilder
|
|
24
24
|
indentation = " " * slash_count
|
25
25
|
spec_var = "p#{slash_count}"
|
26
26
|
|
27
|
-
subspec_prefix = Configuration.subspecs_to_split.include?(item.name) ? "Subspecs/#{item.podspec_name}/" : ""
|
28
|
-
|
29
27
|
if spec_var == "p1" && item.default_subspecs.count > 0
|
30
28
|
podspec += "#{indentation}#{spec_var}.default_subspecs = '#{item.default_subspecs.join("', '")}'\n"
|
31
29
|
end
|
32
30
|
|
33
|
-
if
|
34
|
-
|
35
|
-
elsif item.name == name
|
36
|
-
if_exists = lambda { |t| File.exist?(PodBuilder::prebuiltpath("#{item.root_name}/#{subspec_prefix}#{t}") || "") }
|
31
|
+
if item.name == name
|
32
|
+
if_exists = lambda { |t| File.exist?(PodBuilder::prebuiltpath("#{item.root_name}/#{t}") || "") }
|
37
33
|
|
38
34
|
vendored_frameworks = item.vendored_frameworks
|
39
35
|
if item.default_subspecs.count == 0 && install_using_frameworks
|
@@ -76,7 +72,7 @@ module PodBuilder
|
|
76
72
|
|
77
73
|
entries = lambda { |spec_key, spec_value|
|
78
74
|
key = "#{indentation}#{spec_var}.#{spec_key}"
|
79
|
-
joined_values = spec_value.map { |t| "#{
|
75
|
+
joined_values = spec_value.map { |t| "#{t}" }.uniq.sort.join("', '")
|
80
76
|
"#{key} = '#{joined_values}'\n"
|
81
77
|
}
|
82
78
|
|
@@ -180,7 +176,7 @@ module PodBuilder
|
|
180
176
|
end
|
181
177
|
end
|
182
178
|
|
183
|
-
return podspec,
|
179
|
+
return podspec, valid
|
184
180
|
end
|
185
181
|
|
186
182
|
def self.generate_podspec_from(all_buildable_items, platform, install_using_frameworks)
|
@@ -17,7 +17,8 @@ module PodBuilder
|
|
17
17
|
target_label = target.cocoapods_target_label
|
18
18
|
|
19
19
|
xcodebuild(sandbox, target_label, device, deployment_target, configuration, deterministic_build, [], {})
|
20
|
-
excluded_archs =
|
20
|
+
excluded_archs = ["i386"] # Fixes https://github.com/Subito-it/PodBuilder/issues/17
|
21
|
+
excluded_archs += build_for_apple_silicon ? [] : ["arm64"]
|
21
22
|
xcodebuild(sandbox, target_label, simulator, deployment_target, configuration, deterministic_build, excluded_archs, {})
|
22
23
|
|
23
24
|
spec_names = target.specs.map { |spec| [spec.root.name, spec.root.module_name] }.uniq
|
@@ -258,8 +259,8 @@ module PodBuilder
|
|
258
259
|
project = Xcodeproj::Project.open(project_path)
|
259
260
|
project.targets.each do |target|
|
260
261
|
config = target.build_configurations.find { |config| config.name.eql? configuration }
|
261
|
-
config.build_settings[
|
262
|
-
config.build_settings[
|
262
|
+
config.build_settings["DEBUG_INFORMATION_FORMAT"] = "dwarf-with-dsym"
|
263
|
+
config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
|
263
264
|
end
|
264
265
|
project.save
|
265
266
|
end
|
data/lib/pod_builder/version.rb
CHANGED
data/pod-builder.gemspec
CHANGED
@@ -21,6 +21,8 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
|
+
spec.required_ruby_version = '>= 2.6'
|
25
|
+
|
24
26
|
spec.add_development_dependency "bundler", "~> 2.0"
|
25
27
|
spec.add_development_dependency "rake", ">= 12.3.3"
|
26
28
|
spec.add_development_dependency "ruby-debug-ide", '0.6.1'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pod-builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.beta.
|
4
|
+
version: 2.0.0.beta.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Camin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -226,7 +226,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
226
226
|
requirements:
|
227
227
|
- - ">="
|
228
228
|
- !ruby/object:Gem::Version
|
229
|
-
version: '
|
229
|
+
version: '2.6'
|
230
230
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
231
231
|
requirements:
|
232
232
|
- - ">"
|