pod-builder 2.0.0.beta.34 → 2.0.0.beta.39
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 +1 -1
- data/exe/pod_builder +11 -5
- data/lib/pod_builder/command/build.rb +10 -4
- data/lib/pod_builder/command/init.rb +27 -0
- data/lib/pod_builder/command/switch.rb +22 -1
- data/lib/pod_builder/command/update.rb +1 -1
- data/lib/pod_builder/configuration.rb +2 -1
- data/lib/pod_builder/install.rb +4 -6
- data/lib/pod_builder/podfile.rb +0 -3
- data/lib/pod_builder/podfile_item.rb +7 -1
- data/lib/pod_builder/podspec.rb +1 -0
- data/lib/pod_builder/rome/post_install.rb +107 -92
- data/lib/pod_builder/version.rb +1 -1
- data/pod-builder.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1a4e26182b712538e25c3d25a6b672485626bf5fba20db3fd7f6857aa65feeb
|
4
|
+
data.tar.gz: 13d479f9b5707424937418b03a0f4f0d54bac9b4f546b648192fe5fed95ed499
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4aa3f53f9778cb53901f560c7ce9af36eed3637e8340e8ef3fd4ee96a4c4447627c5fa966dc1a6d7d485bf084307821a79203bae191384f50e245fcad5b66e2
|
7
|
+
data.tar.gz: 6848089c51216aef7d107be05b4c95a4ccc9ea8d090fd2ab793664cb52c5c5d0d3613ecc93fca67b1bc3798b8430e6d22635c20c8cf84638739b52269f8fc9f5
|
data/README.md
CHANGED
@@ -130,7 +130,7 @@ This command will generate a custom lldinit file which will be stored in the _Po
|
|
130
130
|
|
131
131
|
The most convenient place to update the lldbinit file is in your Podfile pre_install or post_install actions. It is suggested to add the following lines
|
132
132
|
|
133
|
-
|
133
|
+
```
|
134
134
|
pid = spawn("pod_builder generate_lldbinit")
|
135
135
|
Process.detach(pid)
|
136
136
|
```
|
data/exe/pod_builder
CHANGED
@@ -76,8 +76,8 @@ Options:
|
|
76
76
|
opts.on("-w", "--allow-warnings", "Allow warnings") do |o|
|
77
77
|
OPTIONS[:allow_warnings] = o
|
78
78
|
end
|
79
|
-
opts.on("-
|
80
|
-
OPTIONS[:
|
79
|
+
opts.on("-r", "--parent-deps", "Include all pods that depend on the specified <PODNAME...>") do |o|
|
80
|
+
OPTIONS[:resolve_parent_dependencies] = true
|
81
81
|
end
|
82
82
|
opts.on("-s", "--no-stdin", "Never request interaction with sdtin (e.g. in CI environment)") do |o|
|
83
83
|
OPTIONS[:no_stdin_available] = o
|
@@ -282,7 +282,7 @@ Usage:
|
|
282
282
|
opts.banner = "
|
283
283
|
Usage:
|
284
284
|
|
285
|
-
$ pod_builder switch [OPTIONS] PODNAME
|
285
|
+
$ pod_builder switch [OPTIONS] <PODNAME...>
|
286
286
|
|
287
287
|
Switch integration between prebuilt/development/default pod version. Multiple space separated pods can be passed
|
288
288
|
|
@@ -297,8 +297,14 @@ Options:
|
|
297
297
|
opts.on("-s", "--default", "Default version specified in PodBuilder-Podfile") do |o|
|
298
298
|
OPTIONS[:switch_mode] = "default"
|
299
299
|
end
|
300
|
-
opts.on("-
|
301
|
-
OPTIONS[:
|
300
|
+
opts.on("-c", "--child-deps", "Include dependencies of the specified <PODNAME...>") do |o|
|
301
|
+
OPTIONS[:resolve_child_dependencies] = true
|
302
|
+
end
|
303
|
+
opts.on("-r", "--parent-deps", "Include all pods that depend on the specified <PODNAME...>") do |o|
|
304
|
+
OPTIONS[:resolve_parent_dependencies] = true
|
305
|
+
end
|
306
|
+
opts.on("-u", "--skip-repo-update", "Skip CocoaPods repo update (only when passing --parent-deps") do |o|
|
307
|
+
OPTIONS[:update_repos] = false
|
302
308
|
end
|
303
309
|
end,
|
304
310
|
:call => [
|
@@ -72,9 +72,15 @@ module PodBuilder
|
|
72
72
|
podfiles_items = [pods_to_build_debug] + [pods_to_build_release]
|
73
73
|
|
74
74
|
install_using_frameworks = Podfile::install_using_frameworks(analyzer)
|
75
|
-
|
76
|
-
|
75
|
+
if Configuration.react_native_project
|
76
|
+
if install_using_frameworks
|
77
|
+
raise "\n\nOnly static library packaging currently supported for react native projects. Please remove 'use_frameworks!' in #{PodBuilder::basepath("Podfile")}".red
|
78
|
+
end
|
77
79
|
prepare_defines_modules_override(all_buildable_items)
|
80
|
+
else
|
81
|
+
unless install_using_frameworks
|
82
|
+
raise "\n\nOnly framework packaging currently supported. Please add 'use_frameworks!' at root level (not nested in targets) in #{PodBuilder::basepath("Podfile")}".red
|
83
|
+
end
|
78
84
|
end
|
79
85
|
|
80
86
|
install_result = InstallResult.new
|
@@ -162,7 +168,7 @@ module PodBuilder
|
|
162
168
|
end
|
163
169
|
|
164
170
|
def self.check_not_building_development_pods(pods)
|
165
|
-
if (development_pods = pods.select { |x| x.is_development_pod }) && development_pods.count > 0 && (OPTIONS[:allow_warnings].nil? && Configuration.allow_building_development_pods == false)
|
171
|
+
if (development_pods = pods.select { |x| x.is_development_pod }) && development_pods.count > 0 && (OPTIONS[:allow_warnings].nil? && Configuration.allow_building_development_pods == false && Configuration.react_native_project == false)
|
166
172
|
pod_names = development_pods.map(&:name).join(", ")
|
167
173
|
raise "\n\nThe following pods are in development mode: `#{pod_names}`, won't proceed building.\n\nYou can ignore this error by passing the `--allow-warnings` flag to the build command\n".red
|
168
174
|
end
|
@@ -199,7 +205,7 @@ module PodBuilder
|
|
199
205
|
pods_to_build = buildable_items.select { |x| argument_pods.include?(x.root_name) }
|
200
206
|
pods_to_build += other_subspecs(pods_to_build, buildable_items)
|
201
207
|
|
202
|
-
if OPTIONS[:
|
208
|
+
if OPTIONS[:resolve_parent_dependencies]
|
203
209
|
dependencies = []
|
204
210
|
buildable_items.each do |pod|
|
205
211
|
if !(pod.dependencies(buildable_items) & pods_to_build).empty?
|
@@ -38,6 +38,7 @@ module PodBuilder
|
|
38
38
|
|
39
39
|
if podfile_content.include?("/node_modules/react-native/")
|
40
40
|
podfile_content = Podfile.prepare_for_react_native(podfile_content)
|
41
|
+
update_react_native_podspecs()
|
41
42
|
end
|
42
43
|
|
43
44
|
File.write(prebuilt_podfile_path, podfile_content)
|
@@ -116,6 +117,32 @@ module PodBuilder
|
|
116
117
|
def self.trim_gemfile_line(line)
|
117
118
|
return line.gsub("\"", "'").gsub(" ", "")
|
118
119
|
end
|
120
|
+
|
121
|
+
def self.update_react_native_podspecs
|
122
|
+
# React-Core.podspec
|
123
|
+
file = "React-Core.podspec"
|
124
|
+
paths = Dir.glob("#{PodBuilder::git_rootpath}/node_modules/**/#{file}")
|
125
|
+
raise "Unexpected number of #{file} found" if paths.count != 1
|
126
|
+
|
127
|
+
content = File.read(paths[0])
|
128
|
+
expected_header_search_path_prefix = "s.pod_target_xcconfig = { \"HEADER_SEARCH_PATHS\" => \""
|
129
|
+
raise "Expected header search path entry not found" unless content.include?(expected_header_search_path_prefix)
|
130
|
+
|
131
|
+
content.sub!(expected_header_search_path_prefix, "#{expected_header_search_path_prefix}\\\"$(PODS_ROOT)/Headers/Public/Flipper-Folly\\\" ")
|
132
|
+
File.write(paths[0], content)
|
133
|
+
|
134
|
+
# React-CoreModules.podspec
|
135
|
+
file = "React-CoreModules.podspec"
|
136
|
+
paths = Dir.glob("#{PodBuilder::git_rootpath}/node_modules/**/#{file}")
|
137
|
+
raise "Unexpected number of #{file} found" if paths.count != 1
|
138
|
+
|
139
|
+
content = File.read(paths[0])
|
140
|
+
expected_header_search_path_prefix = "\"HEADER_SEARCH_PATHS\" => \""
|
141
|
+
raise "Expected header search path entry not found" unless content.include?(expected_header_search_path_prefix)
|
142
|
+
|
143
|
+
content.sub!(expected_header_search_path_prefix, "#{expected_header_search_path_prefix}\\\"$(PODS_ROOT)/Headers/Public/Flipper-Folly\\\" ")
|
144
|
+
File.write(paths[0], content)
|
145
|
+
end
|
119
146
|
end
|
120
147
|
end
|
121
148
|
end
|
@@ -24,8 +24,29 @@ module PodBuilder
|
|
24
24
|
pod_names_to_switch.push(pod_name_to_switch)
|
25
25
|
end
|
26
26
|
|
27
|
+
if OPTIONS[:resolve_parent_dependencies] == true
|
28
|
+
install_update_repo = OPTIONS.fetch(:update_repos, true)
|
29
|
+
installer, analyzer = Analyze.installer_at(PodBuilder::basepath, install_update_repo)
|
30
|
+
|
31
|
+
all_buildable_items = Analyze.podfile_items(installer, analyzer)
|
32
|
+
|
33
|
+
pod_names_to_switch.each do |pod_name|
|
34
|
+
if pod = (all_buildable_items.detect { |t| t.name == pod_name } || all_buildable_items.detect { |t| t.root_name == pod_name })
|
35
|
+
dependencies = []
|
36
|
+
all_buildable_items.each do |pod|
|
37
|
+
if !(pod.dependency_names & pod_names_to_switch).empty?
|
38
|
+
dependencies.push(pod.root_name)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
pod_names_to_switch += dependencies
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
pod_names_to_switch.uniq!
|
46
|
+
end
|
47
|
+
|
27
48
|
dep_pod_names_to_switch = []
|
28
|
-
if OPTIONS[:
|
49
|
+
if OPTIONS[:resolve_child_dependencies] == true
|
29
50
|
pod_names_to_switch.each do |pod|
|
30
51
|
podspec_path = PodBuilder::prebuiltpath("#{pod}/#{pod}.podspec")
|
31
52
|
unless File.exist?(podspec_path)
|
@@ -39,7 +39,8 @@ module PodBuilder
|
|
39
39
|
"ENABLE_BITCODE": "NO"
|
40
40
|
}
|
41
41
|
}.freeze
|
42
|
-
DEFAULT_SKIP_PODS = ["GoogleMaps"]
|
42
|
+
DEFAULT_SKIP_PODS = ["GoogleMaps", "React-RCTFabric", "React-Core", "React-CoreModules"] # Not including React-RCTNetwork might loose some debug warnings
|
43
|
+
|
43
44
|
DEFAULT_FORCE_PREBUILD_PODS = []
|
44
45
|
DEFAULT_BUILD_SYSTEM = "Latest".freeze # either Latest (New build system) or Legacy (Standard build system)
|
45
46
|
DEFAULT_LIBRARY_EVOLUTION_SUPPORT = false
|
data/lib/pod_builder/install.rb
CHANGED
@@ -256,11 +256,7 @@ module PodBuilder
|
|
256
256
|
return data["PreferenceSpecifiers"] || []
|
257
257
|
end
|
258
258
|
|
259
|
-
def self.copy_development_pods_source_code(podfile_content, podfile_items)
|
260
|
-
if Configuration.build_using_repo_paths
|
261
|
-
return podfile_content
|
262
|
-
end
|
263
|
-
|
259
|
+
def self.copy_development_pods_source_code(podfile_content, podfile_items)
|
264
260
|
# Development pods are normally built/integrated without moving files from their original paths.
|
265
261
|
# It is important that CocoaPods compiles the files under Configuration.build_path in order that
|
266
262
|
# DWARF debug info reference to this constant path. Doing otherwise breaks the assumptions that
|
@@ -276,7 +272,9 @@ module PodBuilder
|
|
276
272
|
FileUtils.cp_r("#{PodBuilder::basepath(podfile_item.path)}/.", destination_path)
|
277
273
|
end
|
278
274
|
|
279
|
-
|
275
|
+
unless Configuration.build_using_repo_paths
|
276
|
+
podfile_content.gsub!("'#{podfile_item.path}'", "'#{destination_path}'")
|
277
|
+
end
|
280
278
|
end
|
281
279
|
|
282
280
|
return podfile_content
|
data/lib/pod_builder/podfile.rb
CHANGED
@@ -394,9 +394,6 @@ module PodBuilder
|
|
394
394
|
def self.install_using_frameworks(analyzer)
|
395
395
|
target_settings = analyzer.podfile.target_definition_list.map(&:uses_frameworks?).uniq
|
396
396
|
if target_settings.count == 1
|
397
|
-
if target_settings.first == false && ENV["DEBUGGING"].nil?
|
398
|
-
raise "\n\nOnly framework packaging currently supported. Please add 'use_frameworks!' at Podfile root level (not nested in targets)".red
|
399
|
-
end
|
400
397
|
return target_settings.first
|
401
398
|
elsif target_settings.count > 1
|
402
399
|
raise "\n\n'use_frameworks!' should be declared only once at Podfile root level (not nested in targets)".red
|
@@ -154,7 +154,7 @@ module PodBuilder
|
|
154
154
|
@tag = checkout_options[opts_key][:tag]
|
155
155
|
@commit = checkout_options[opts_key][:commit]
|
156
156
|
@path = checkout_options[opts_key][:path]
|
157
|
-
@podspec_path = checkout_options[opts_key][:podspec]
|
157
|
+
@podspec_path = checkout_options[opts_key][:podspec]
|
158
158
|
@branch = checkout_options[opts_key][:branch]
|
159
159
|
@is_external = true
|
160
160
|
else
|
@@ -213,6 +213,12 @@ module PodBuilder
|
|
213
213
|
@is_static = spec.root.attributes_hash["static_framework"] || false
|
214
214
|
@xcconfig = spec.root.attributes_hash["xcconfig"] || {}
|
215
215
|
|
216
|
+
if spec.attributes_hash.has_key?("script_phases")
|
217
|
+
Configuration.skip_pods += [name, root_name]
|
218
|
+
Configuration.skip_pods.uniq!
|
219
|
+
puts "Will skip '#{root_name}' which defines script_phase in podspec".blue
|
220
|
+
end
|
221
|
+
|
216
222
|
default_subspecs_specs ||= begin
|
217
223
|
subspecs = all_specs.select { |t| t.name.split("/").first == @root_name }
|
218
224
|
subspecs.select { |t| @default_subspecs.include?(t.name.split("/").last) }
|
data/lib/pod_builder/podspec.rb
CHANGED
@@ -99,6 +99,7 @@ module PodBuilder
|
|
99
99
|
end
|
100
100
|
if !item.header_dir.nil? && !install_using_frameworks
|
101
101
|
podspec += "#{indentation}#{spec_var}.header_dir = '#{item.header_dir}'\n"
|
102
|
+
podspec += "#{indentation}#{spec_var}.header_mappings_dir = '#{item.root_name}/Headers/#{item.header_dir}'\n"
|
102
103
|
end
|
103
104
|
|
104
105
|
if item.xcconfig.keys.count > 0
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'fourflusher'
|
4
4
|
require 'colored'
|
5
5
|
require 'pathname'
|
6
|
+
require 'ruby-progressbar'
|
6
7
|
|
7
8
|
module PodBuilder
|
8
9
|
def self.build_for_iosish_platform_framework(sandbox, build_dir, target, device, simulator, configuration, deterministic_build, build_for_apple_silicon)
|
@@ -20,7 +21,7 @@ module PodBuilder
|
|
20
21
|
excluded_archs = ["i386"] # Fixes https://github.com/Subito-it/PodBuilder/issues/17
|
21
22
|
excluded_archs += build_for_apple_silicon ? [] : ["arm64"]
|
22
23
|
xcodebuild(sandbox, target_label, simulator, deployment_target, configuration, deterministic_build, excluded_archs, {})
|
23
|
-
|
24
|
+
|
24
25
|
spec_names = target.specs.map { |spec| [spec.root.name, spec.root.module_name] }.uniq
|
25
26
|
spec_names.each do |root_name, module_name|
|
26
27
|
device_base = "#{build_dir}/#{configuration}-#{device}/#{root_name}"
|
@@ -66,30 +67,30 @@ module PodBuilder
|
|
66
67
|
FileUtils.rm_rf(simulator_framework_lib)
|
67
68
|
end
|
68
69
|
end
|
69
|
-
|
70
|
+
|
70
71
|
def self.build_for_iosish_platform_lib(sandbox, build_dir, target, device, simulator, configuration, deterministic_build, build_for_apple_silicon, prebuilt_root_paths)
|
71
72
|
raise "\n\nApple silicon hardware still unsupported since it requires to migrate to xcframeworks".red if build_for_apple_silicon
|
72
|
-
|
73
|
+
|
73
74
|
deployment_target = target.platform_deployment_target
|
74
75
|
target_label = target.cocoapods_target_label
|
75
|
-
|
76
|
+
|
76
77
|
spec_names = target.specs.map { |spec| [spec.root.name, spec.root.module_name] }.uniq
|
77
|
-
|
78
|
+
|
78
79
|
xcodebuild(sandbox, target_label, device, deployment_target, configuration, deterministic_build, [], prebuilt_root_paths)
|
79
80
|
excluded_archs = build_for_apple_silicon ? [] : ["arm64"]
|
80
81
|
xcodebuild(sandbox, target_label, simulator, deployment_target, configuration, deterministic_build, excluded_archs, prebuilt_root_paths)
|
81
|
-
|
82
|
+
|
82
83
|
spec_names.each do |root_name, module_name|
|
83
84
|
simulator_base = "#{build_dir}/#{configuration}-#{simulator}/#{root_name}"
|
84
85
|
simulator_lib = "#{simulator_base}/lib#{root_name}.a"
|
85
|
-
|
86
|
+
|
86
87
|
device_base = "#{build_dir}/#{configuration}-#{device}/#{root_name}"
|
87
88
|
device_lib = "#{device_base}/lib#{root_name}.a"
|
88
|
-
|
89
|
+
|
89
90
|
unless File.file?(device_lib) && File.file?(simulator_lib)
|
90
91
|
next
|
91
92
|
end
|
92
|
-
|
93
|
+
|
93
94
|
# Starting with Xcode 12b3 the simulator binary contains an arm64 slice as well which conflict with the one in the device_lib
|
94
95
|
# when creating the fat library. A naive workaround is to remove the arm64 from the simulator_lib however this is wrong because
|
95
96
|
# we might actually need to have 2 separated arm64 slices, one for simulator and one for device each built with different
|
@@ -101,12 +102,12 @@ module PodBuilder
|
|
101
102
|
end
|
102
103
|
|
103
104
|
raise "Lipo failed on #{device_lib}" unless system("xcrun lipo -create -output #{device_lib} #{device_lib} #{simulator_lib}")
|
104
|
-
|
105
|
+
|
105
106
|
device_headers = Dir.glob("#{device_base}/**/*.h")
|
106
107
|
simulator_headers = Dir.glob("#{simulator_base}/**/*.h")
|
107
108
|
device_headers.each do |device_path|
|
108
109
|
simulator_path = device_path.gsub(device_base, simulator_base)
|
109
|
-
|
110
|
+
|
110
111
|
merge_header_into(device_path, simulator_path)
|
111
112
|
end
|
112
113
|
simulator_only_headers = simulator_headers - device_headers.map { |t| t.gsub(device_base, simulator_base) }
|
@@ -117,12 +118,12 @@ module PodBuilder
|
|
117
118
|
FileUtils.mkdir_p(destination_folder)
|
118
119
|
FileUtils.cp(path, destination_folder)
|
119
120
|
end
|
120
|
-
|
121
|
+
|
121
122
|
swiftmodule_path = "#{simulator_base}/#{root_name}.swiftmodule"
|
122
123
|
if File.directory?(swiftmodule_path)
|
123
124
|
FileUtils.cp_r("#{swiftmodule_path}/.", "#{device_base}/#{root_name}.swiftmodule")
|
124
125
|
end
|
125
|
-
|
126
|
+
|
126
127
|
if File.exist?("#{device_base}/#{root_name}.swiftmodule")
|
127
128
|
# This is a swift pod with a swiftmodule in the root of the prebuilt folder
|
128
129
|
else
|
@@ -141,11 +142,11 @@ module PodBuilder
|
|
141
142
|
FileUtils.cp(path, destination_folder)
|
142
143
|
end
|
143
144
|
end
|
144
|
-
|
145
|
+
|
145
146
|
destination_path = "#{build_dir}/#{root_name}"
|
146
147
|
if Dir.glob("#{device_base}/**/*.{a,framework,h}").count > 0
|
147
148
|
FileUtils.mv(device_base, destination_path)
|
148
|
-
|
149
|
+
|
149
150
|
module_maps = Dir.glob("#{destination_path}/**/*.modulemap")
|
150
151
|
module_map_device_base = device_base.gsub(/^\/private/, "") + "/"
|
151
152
|
module_maps.each do |module_map|
|
@@ -156,7 +157,7 @@ module PodBuilder
|
|
156
157
|
end
|
157
158
|
end
|
158
159
|
end
|
159
|
-
|
160
|
+
|
160
161
|
def self.merge_header_into(device_file, simulator_file)
|
161
162
|
unless File.exist?(device_file) || File.exist?(simulator_file)
|
162
163
|
return
|
@@ -165,33 +166,33 @@ module PodBuilder
|
|
165
166
|
device_content = File.file?(device_file) ? File.read(device_file) : ""
|
166
167
|
simulator_content = File.file?(simulator_file) ? File.read(simulator_file) : ""
|
167
168
|
merged_content = %{
|
168
|
-
#if TARGET_OS_SIMULATOR
|
169
|
-
// ->
|
170
|
-
|
171
|
-
#{simulator_content}
|
172
|
-
|
173
|
-
// ->
|
174
|
-
#else
|
175
|
-
// ->
|
176
|
-
|
177
|
-
#{device_content}
|
178
|
-
|
179
|
-
// ->
|
180
|
-
#endif
|
169
|
+
#if TARGET_OS_SIMULATOR
|
170
|
+
// ->
|
171
|
+
|
172
|
+
#{simulator_content}
|
173
|
+
|
174
|
+
// ->
|
175
|
+
#else
|
176
|
+
// ->
|
177
|
+
|
178
|
+
#{device_content}
|
179
|
+
|
180
|
+
// ->
|
181
|
+
#endif
|
181
182
|
}
|
182
183
|
File.write(device_file, merged_content)
|
183
184
|
end
|
184
|
-
|
185
|
+
|
185
186
|
def self.add_simulator_conditional(path)
|
186
187
|
file_content = File.read(path)
|
187
188
|
content = %{
|
188
|
-
#if TARGET_OS_SIMULATOR
|
189
|
-
#{file_content}
|
190
|
-
#endif
|
189
|
+
#if TARGET_OS_SIMULATOR
|
190
|
+
#{file_content}
|
191
|
+
#endif
|
191
192
|
}
|
192
193
|
File.write(path, content)
|
193
194
|
end
|
194
|
-
|
195
|
+
|
195
196
|
def self.xcodebuild(sandbox, target, sdk='macosx', deployment_target=nil, configuration, deterministic_build, exclude_archs, prebuilt_root_paths)
|
196
197
|
args = %W(-project #{sandbox.project_path.realdirpath} -scheme #{target} -configuration #{configuration} -sdk #{sdk})
|
197
198
|
supported_platforms = { 'iphonesimulator' => 'iOS', 'appletvsimulator' => 'tvOS', 'watchsimulator' => 'watchOS' }
|
@@ -269,15 +270,27 @@ module PodBuilder
|
|
269
270
|
end
|
270
271
|
|
271
272
|
Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_context, user_options|
|
272
|
-
|
273
|
+
build_items_count = installer_context.umbrella_targets.map(&:specs).flatten.count
|
274
|
+
progressbar = ProgressBar.create(:length => 80,
|
275
|
+
:total => build_items_count,
|
276
|
+
:title => "Building",
|
277
|
+
:format => "%t |%b>%i| %c/%C done".yellow)
|
273
278
|
|
279
|
+
progressbar_thread = Thread.new {
|
280
|
+
loop do
|
281
|
+
built_pods = Dir.glob("#{PodBuilder::Configuration.build_path}/build/Release*/*").count
|
282
|
+
progressbar.progress = [[0, built_pods - 1].max, progressbar.total].min
|
283
|
+
sleep(5)
|
284
|
+
end
|
285
|
+
}
|
286
|
+
|
274
287
|
enable_dsym = user_options.fetch('dsym', true)
|
275
288
|
configuration = user_options.fetch('configuration', 'Debug')
|
276
289
|
uses_frameworks = user_options.fetch('uses_frameworks', true)
|
277
290
|
if user_options["pre_compile"]
|
278
291
|
user_options["pre_compile"].call(installer_context)
|
279
292
|
end
|
280
|
-
|
293
|
+
|
281
294
|
prebuilt_root_paths = JSON.parse(user_options["prebuilt_root_paths"].gsub('=>', ':'))
|
282
295
|
|
283
296
|
sandbox_root = Pathname(installer_context.sandbox_root)
|
@@ -301,72 +314,74 @@ Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_conte
|
|
301
314
|
when [:tvos, false] then PodBuilder::build_for_iosish_platform_lib(sandbox, build_dir, target, 'appletvos', 'appletvsimulator', configuration, PodBuilder::Configuration.deterministic_build, PodBuilder::Configuration.build_for_apple_silicon, prebuilt_root_paths)
|
302
315
|
when [:watchos, false] then PodBuilder::build_for_iosish_platform_lib(sandbox, build_dir, target, 'watchos', 'watchsimulator', configuration, PodBuilder::Configuration.deterministic_build, PodBuilder::Configuration.build_for_apple_silicon, prebuilt_root_paths)
|
303
316
|
else raise "\n\nUnknown platform '#{target.platform_name}'".red end
|
304
|
-
|
317
|
+
end
|
305
318
|
|
306
|
-
|
319
|
+
progressbar.finish
|
320
|
+
progressbar_thread.exit
|
307
321
|
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
umbrella.specs.each do |spec|
|
316
|
-
root_name = spec.name.split("/").first
|
317
|
-
|
318
|
-
if uses_frameworks
|
319
|
-
destination = File.join(base_destination, root_name)
|
320
|
-
else
|
321
|
-
destination = File.join(base_destination, root_name, root_name)
|
322
|
-
end
|
323
|
-
# Make sure the device target overwrites anything in the simulator build, otherwise iTunesConnect
|
324
|
-
# can get upset about Info.plist containing references to the simulator SDK
|
325
|
-
files = Pathname.glob("build/#{root_name}/*").reject { |f| f.to_s =~ /Pods[^.]+\.framework/ }
|
326
|
-
|
327
|
-
consumer = spec.consumer(umbrella.platform_name)
|
328
|
-
file_accessor = Pod::Sandbox::FileAccessor.new(sandbox.pod_dir(spec.root.name), consumer)
|
329
|
-
files += file_accessor.vendored_libraries
|
330
|
-
files += file_accessor.vendored_frameworks
|
331
|
-
files += file_accessor.resources
|
332
|
-
|
333
|
-
FileUtils.mkdir_p(destination)
|
334
|
-
files.each do |file|
|
335
|
-
FileUtils.cp_r(file, destination)
|
336
|
-
end
|
337
|
-
end
|
338
|
-
end
|
322
|
+
raise Pod::Informative, 'The build directory was not found in the expected location.' unless build_dir.directory?
|
323
|
+
|
324
|
+
specs = installer_context.umbrella_targets.map { |t| t.specs.map(&:name) }.flatten.map { |t| t.split("/").first }.uniq
|
325
|
+
built_count = Dir["#{build_dir}/*"].select { |t| specs.include?(File.basename(t)) }.count
|
326
|
+
Pod::UI.puts "Built #{built_count} #{'items'.pluralize(built_count)}, copying..."
|
327
|
+
|
328
|
+
base_destination.rmtree if base_destination.directory?
|
339
329
|
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
330
|
+
installer_context.umbrella_targets.each do |umbrella|
|
331
|
+
umbrella.specs.each do |spec|
|
332
|
+
root_name = spec.name.split("/").first
|
333
|
+
|
334
|
+
if uses_frameworks
|
335
|
+
destination = File.join(base_destination, root_name)
|
336
|
+
else
|
337
|
+
destination = File.join(base_destination, root_name, root_name)
|
344
338
|
end
|
339
|
+
# Make sure the device target overwrites anything in the simulator build, otherwise iTunesConnect
|
340
|
+
# can get upset about Info.plist containing references to the simulator SDK
|
341
|
+
files = Pathname.glob("build/#{root_name}/*").reject { |f| f.to_s =~ /Pods[^.]+\.framework/ }
|
345
342
|
|
346
|
-
|
347
|
-
|
343
|
+
consumer = spec.consumer(umbrella.platform_name)
|
344
|
+
file_accessor = Pod::Sandbox::FileAccessor.new(sandbox.pod_dir(spec.root.name), consumer)
|
345
|
+
files += file_accessor.vendored_libraries
|
346
|
+
files += file_accessor.vendored_frameworks
|
347
|
+
files += file_accessor.resources
|
348
348
|
|
349
|
+
FileUtils.mkdir_p(destination)
|
349
350
|
files.each do |file|
|
350
|
-
|
351
|
-
|
352
|
-
FileUtils.rm_rf(file)
|
353
|
-
end
|
354
|
-
end
|
351
|
+
FileUtils.cp_r(file, destination)
|
352
|
+
end
|
355
353
|
end
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
else
|
363
|
-
raise "Not implemented"
|
354
|
+
end
|
355
|
+
|
356
|
+
# Depending on the resource it may happen that it is present twice, both in the .framework and in the parent folder
|
357
|
+
Dir.glob("#{base_destination}/*") do |path|
|
358
|
+
unless File.directory?(path)
|
359
|
+
return
|
364
360
|
end
|
365
361
|
|
366
|
-
|
362
|
+
files = Dir.glob("#{path}/*")
|
363
|
+
framework_files = Dir.glob("#{path}/*.framework/**/*").map { |t| File.basename(t) }
|
367
364
|
|
368
|
-
|
369
|
-
|
365
|
+
files.each do |file|
|
366
|
+
filename = File.basename(file.gsub(/\.xib$/, ".nib"))
|
367
|
+
if framework_files.include?(filename)
|
368
|
+
FileUtils.rm_rf(file)
|
369
|
+
end
|
370
|
+
end
|
371
|
+
end
|
372
|
+
|
373
|
+
if enable_dsym
|
374
|
+
dsym_source = "#{build_dir}/dSYM"
|
375
|
+
if File.directory?(dsym_source)
|
376
|
+
FileUtils.mv(dsym_source, sandbox_root.parent)
|
370
377
|
end
|
378
|
+
else
|
379
|
+
raise "Not implemented"
|
380
|
+
end
|
381
|
+
|
382
|
+
build_dir.rmtree if build_dir.directory?
|
383
|
+
|
384
|
+
if user_options["post_compile"]
|
385
|
+
user_options["post_compile"].call(installer_context)
|
371
386
|
end
|
372
|
-
|
387
|
+
end
|
data/lib/pod_builder/version.rb
CHANGED
data/pod-builder.gemspec
CHANGED
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.39
|
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-10-
|
11
|
+
date: 2020-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -164,6 +164,20 @@ dependencies:
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: ruby-progressbar
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '1.10'
|
174
|
+
type: :runtime
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '1.10'
|
167
181
|
description: Prebuild CocoaPods pods to make compiling your Xcode projects faster
|
168
182
|
email:
|
169
183
|
- tomas.camin@adevinta.com
|