pod-builder 4.1.0 → 4.4.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 +4 -4
- data/exe/pod_builder +9 -2
- data/lib/pod_builder/command/clean.rb +15 -4
- data/lib/pod_builder/command/install_sources.rb +5 -3
- data/lib/pod_builder/command/switch.rb +6 -21
- data/lib/pod_builder/configuration.rb +1 -1
- data/lib/pod_builder/install.rb +18 -16
- data/lib/pod_builder/podfile.rb +58 -5
- data/lib/pod_builder/podspec.rb +1 -1
- data/lib/pod_builder/rome/post_install.rb +43 -33
- data/lib/pod_builder/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9251bdb4914c0a4974426de85c7e66fbdd8f614db41ae376834b1fed4bdb6565
|
4
|
+
data.tar.gz: 04126b48df0bcfcc10269bd33ff0ea1731cbeb1b12fcdef306dad4fd59efcd49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f985c18756f4c1bf0fe71b1f1d039a7f0ecfe2032648f3d2f2437d5139e9b9001dfd07d63dbf9cfdb56005267c49547bcd8faf28fdc6b1f5a2e15819ec368699
|
7
|
+
data.tar.gz: 3bffc37c735676923ec3649580503413423f4acb0f9bcc0c460cb7484efde64756531a6d2cc7d6361466fee78586c2a87465fc5db68fb569a088e3b2c52b065f
|
data/exe/pod_builder
CHANGED
@@ -242,11 +242,18 @@ Options:
|
|
242
242
|
opts.banner = "
|
243
243
|
Usage:
|
244
244
|
|
245
|
-
$ pod_builder install_sources
|
245
|
+
$ pod_builder install_sources [OPTIONS] <PODNAME...>
|
246
246
|
|
247
247
|
Install source of prebuilt pods to be able to step into and debug prebuilt's code.
|
248
248
|
|
249
|
-
|
249
|
+
Options:
|
250
|
+
"
|
251
|
+
opts.on("-a", "--all", "Install all available sources") do |o|
|
252
|
+
OPTIONS[:all] = o
|
253
|
+
end
|
254
|
+
opts.on("-s", "--no-stdin", "Never request interaction with sdtin (e.g. in CI environment)") do |o|
|
255
|
+
OPTIONS[:no_stdin_available] = o
|
256
|
+
end
|
250
257
|
end,
|
251
258
|
:call => [
|
252
259
|
PodBuilder::Command::InstallSources
|
@@ -26,7 +26,15 @@ module PodBuilder
|
|
26
26
|
Dir.glob(PodBuilder::prebuiltpath("*")).each do |path|
|
27
27
|
basename = File.basename(path)
|
28
28
|
unless root_names.include?(basename)
|
29
|
-
puts "
|
29
|
+
puts "Cleaning up `#{basename}`, no longer found among dependencies".blue
|
30
|
+
PodBuilder::safe_rm_rf(path)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
Dir.glob(PodBuilder::prebuiltpath("*")).each do |path|
|
35
|
+
basename = File.basename(path)
|
36
|
+
if (Dir.glob("#{path}/**/*.framework").count + Dir.glob("#{path}/**/*.a").count) == 0
|
37
|
+
puts "Cleaning up `#{basename}`, no prebuilt items found".blue
|
30
38
|
PodBuilder::safe_rm_rf(path)
|
31
39
|
end
|
32
40
|
end
|
@@ -37,11 +45,10 @@ module PodBuilder
|
|
37
45
|
dsym_basename = File.basename(path, ".*")
|
38
46
|
dsym_basename.gsub!(/\.framework$/, "")
|
39
47
|
unless module_names.include?(dsym_basename)
|
40
|
-
puts "
|
48
|
+
puts "Cleaning up `#{dsym_basename}`, no longer found among dependencies".blue
|
41
49
|
PodBuilder::safe_rm_rf(path)
|
42
50
|
end
|
43
51
|
end
|
44
|
-
|
45
52
|
end
|
46
53
|
|
47
54
|
def self.install_sources(buildable_items)
|
@@ -64,8 +71,12 @@ module PodBuilder
|
|
64
71
|
end
|
65
72
|
|
66
73
|
paths_to_delete.flatten.each do |path|
|
74
|
+
if OPTIONS.has_key?(:no_stdin_available)
|
75
|
+
PodBuilder::safe_rm_rf(path)
|
76
|
+
next
|
77
|
+
end
|
67
78
|
confirm = ask("#{path} unused.\nDelete it? [Y/N] ") { |yn| yn.limit = 1, yn.validate = /[yn]/i }
|
68
|
-
if confirm.downcase == 'y'
|
79
|
+
if confirm.downcase == 'y'
|
69
80
|
PodBuilder::safe_rm_rf(path)
|
70
81
|
end
|
71
82
|
end
|
@@ -11,6 +11,8 @@ module PodBuilder
|
|
11
11
|
|
12
12
|
PodBuilder::prepare_basepath
|
13
13
|
|
14
|
+
argument_pods = ARGV.dup
|
15
|
+
|
14
16
|
install_update_repo = OPTIONS.fetch(:update_repos, true)
|
15
17
|
installer, analyzer = Analyze.installer_at(PodBuilder::basepath, install_update_repo)
|
16
18
|
podfile_items = Analyze.podfile_items(installer, analyzer).select { |x| !x.is_prebuilt }
|
@@ -20,9 +22,9 @@ module PodBuilder
|
|
20
22
|
framework_files = Dir.glob("#{base_path}/**/*.framework")
|
21
23
|
|
22
24
|
framework_files.each do |path|
|
23
|
-
|
25
|
+
next if !OPTIONS.has_key?(:all) && !argument_pods.include?(File.basename(path, ".*"))
|
24
26
|
|
25
|
-
if podfile_spec = podfile_items.detect { |x|
|
27
|
+
if podfile_spec = podfile_items.detect { |x| x.root_name == File.basename(path, ".*") }
|
26
28
|
update_repo(podfile_spec)
|
27
29
|
end
|
28
30
|
end
|
@@ -45,8 +47,8 @@ module PodBuilder
|
|
45
47
|
dest_path = PodBuilder::basepath("Sources")
|
46
48
|
FileUtils.mkdir_p(dest_path)
|
47
49
|
|
50
|
+
repo_dir = File.join(dest_path, spec.podspec_name)
|
48
51
|
Dir.chdir(dest_path) do
|
49
|
-
repo_dir = File.join(dest_path, spec.podspec_name)
|
50
52
|
if !File.directory?(repo_dir)
|
51
53
|
raise "\n\nFailed cloning #{spec.name}".red if !system("git clone #{spec.repo} #{spec.podspec_name}")
|
52
54
|
end
|
@@ -93,7 +93,7 @@ module PodBuilder
|
|
93
93
|
|
94
94
|
pod_names_to_switch.each do |pod_name_to_switch|
|
95
95
|
development_path = ""
|
96
|
-
|
96
|
+
default_entry = nil
|
97
97
|
|
98
98
|
case OPTIONS[:switch_mode]
|
99
99
|
when "development"
|
@@ -108,22 +108,15 @@ module PodBuilder
|
|
108
108
|
podfile_path = PodBuilder::basepath("Podfile")
|
109
109
|
content = File.read(podfile_path)
|
110
110
|
|
111
|
-
|
112
|
-
content.each_line do |line|
|
113
|
-
stripped_line = line.strip
|
114
|
-
if stripped_line.start_with?("def ") || stripped_line.start_with?("target ")
|
115
|
-
current_section = line.split(" ")[1]
|
116
|
-
next
|
117
|
-
end
|
118
|
-
|
111
|
+
content.each_line do |line|
|
119
112
|
if (matches = line.match(/^\s*pod ['|"](.*?)['|"](.*)/)) && matches.size == 3
|
120
113
|
if matches[1].split("/").first == pod_name_to_switch
|
121
|
-
|
114
|
+
default_entry = line
|
122
115
|
end
|
123
116
|
end
|
124
117
|
end
|
125
118
|
|
126
|
-
raise "\n\n'#{pod_name_to_switch}' not found in PodBuilder's Podfile.\n\nYou might need to explictly add:\n\n pod '#{pod_name_to_switch}'\n\nto #{podfile_path}\n".red if
|
119
|
+
raise "\n\n'#{pod_name_to_switch}' not found in PodBuilder's Podfile.\n\nYou might need to explictly add:\n\n pod '#{pod_name_to_switch}'\n\nto #{podfile_path}\n".red if default_entry.nil?
|
127
120
|
end
|
128
121
|
|
129
122
|
if development_path.nil?
|
@@ -138,13 +131,7 @@ module PodBuilder
|
|
138
131
|
content = File.read(podfile_path)
|
139
132
|
|
140
133
|
lines = []
|
141
|
-
current_section = ""
|
142
134
|
content.each_line do |line|
|
143
|
-
stripped_line = line.strip
|
144
|
-
if stripped_line.start_with?("def ") || stripped_line.start_with?("target ")
|
145
|
-
current_section = line.split(" ")[1]
|
146
|
-
end
|
147
|
-
|
148
135
|
if (matches = line.match(/^\s*pod ['|"](.*?)['|"](.*)/)) && matches.size == 3
|
149
136
|
if matches[1].split("/").first == pod_name_to_switch
|
150
137
|
case OPTIONS[:switch_mode]
|
@@ -172,10 +159,8 @@ module PodBuilder
|
|
172
159
|
lines.append(development_line)
|
173
160
|
next
|
174
161
|
when "default"
|
175
|
-
if default_line =
|
176
|
-
|
177
|
-
default_line = default_line.chomp("\n") + ", :inhibit_warnings => true\n"
|
178
|
-
end
|
162
|
+
if default_line = default_entry
|
163
|
+
# default_line is already extracted from PodBuilder's Podfile and already includes :inhibit_warnings
|
179
164
|
if line.include?("# pb<") && marker = line.split("# pb<").last
|
180
165
|
default_line = default_line.chomp("\n") + " # pb<#{marker}"
|
181
166
|
end
|
@@ -88,7 +88,7 @@ module PodBuilder
|
|
88
88
|
@library_evolution_support = false
|
89
89
|
@base_path = "PodBuilder" # Not nice. This value is used only for initial initization. Once config is loaded it will be an absolute path. FIXME
|
90
90
|
@skip_licenses = []
|
91
|
-
@skip_pods = ["GoogleMaps", "React-RCTFabric", "React-Core", "React-CoreModules"] # Not including React-RCTNetwork might loose some debug warnings
|
91
|
+
@skip_pods = ["GoogleMaps", "React-RCTFabric", "React-Core", "React-CoreModules", "FBReactNativeSpec", "fmt", "RCT-Folly", "React-jsi"] # Not including React-RCTNetwork might loose some debug warnings
|
92
92
|
@force_prebuild_pods = []
|
93
93
|
@license_filename = "Pods-acknowledgements"
|
94
94
|
@development_pods_paths = []
|
data/lib/pod_builder/install.rb
CHANGED
@@ -147,6 +147,10 @@ module PodBuilder
|
|
147
147
|
podfile_content = Podfile.update_path_entries(podfile_content, Install.method(:podfile_path_transform))
|
148
148
|
podfile_content = Podfile.update_project_entries(podfile_content, Install.method(:podfile_path_transform))
|
149
149
|
podfile_content = Podfile.update_require_entries(podfile_content, Install.method(:podfile_path_transform))
|
150
|
+
|
151
|
+
if Configuration.react_native_project
|
152
|
+
podfile_content = Podfile.prepare_react_native_compilation_workarounds(podfile_content)
|
153
|
+
end
|
150
154
|
|
151
155
|
podfile_path = File.join(Configuration.build_path, "Podfile")
|
152
156
|
File.write(podfile_path, podfile_content)
|
@@ -222,7 +226,7 @@ module PodBuilder
|
|
222
226
|
data["swift_version"] = swift_version
|
223
227
|
end
|
224
228
|
|
225
|
-
specs = podfile_items.select { |x| x.
|
229
|
+
specs = podfile_items.select { |x| x.root_name == podfile_item.root_name }
|
226
230
|
subspecs_deps = specs.map(&:dependency_names).flatten
|
227
231
|
subspec_self_deps = subspecs_deps.select { |x| x.start_with?("#{prebuilt_name}/") }
|
228
232
|
data["specs"] = (specs.map(&:name) + subspec_self_deps).uniq
|
@@ -237,6 +241,7 @@ module PodBuilder
|
|
237
241
|
|
238
242
|
return ret
|
239
243
|
end
|
244
|
+
|
240
245
|
private
|
241
246
|
|
242
247
|
def self.license_specifiers
|
@@ -386,32 +391,29 @@ module PodBuilder
|
|
386
391
|
|
387
392
|
non_prebuilt_items = podfile_items.reject(&:is_prebuilt)
|
388
393
|
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
+
non_prebuilt_items.reject! { |item|
|
395
|
+
[item.module_name, item.root_name]
|
396
|
+
.map { |t| PodBuilder::buildpath_prebuiltpath(t) }
|
397
|
+
.select { |t| File.directory?(t) }
|
398
|
+
.all? { |t| Dir.empty?(t) } # When using prebuilt items we end up with empty folders
|
394
399
|
}
|
395
400
|
|
396
|
-
|
397
|
-
root_name = pod_name.split("/").first
|
398
|
-
|
401
|
+
non_prebuilt_items.each do |item|
|
399
402
|
# Remove existing files
|
400
|
-
items_to_delete = Dir.glob("#{PodBuilder::prebuiltpath(root_name)}/**/*")
|
403
|
+
items_to_delete = Dir.glob("#{PodBuilder::prebuiltpath(item.root_name)}/**/*")
|
401
404
|
items_to_delete.each { |t| PodBuilder::safe_rm_rf(t) }
|
402
405
|
end
|
403
406
|
|
404
407
|
# Now copy
|
405
|
-
|
406
|
-
|
407
|
-
source_path = PodBuilder::buildpath_prebuiltpath(root_name)
|
408
|
+
non_prebuilt_items.each do |item|
|
409
|
+
source_path = PodBuilder::buildpath_prebuiltpath(item.root_name)
|
408
410
|
|
409
411
|
unless File.directory?(source_path)
|
410
|
-
puts "Prebuilt items for #{
|
412
|
+
puts "Prebuilt items for #{item.root_name} not found".blue
|
411
413
|
next
|
412
414
|
end
|
413
415
|
|
414
|
-
if podfile_item = podfile_items.detect { |t| t.root_name ==
|
416
|
+
if podfile_item = podfile_items.detect { |t| t.root_name == item.root_name }
|
415
417
|
if Dir.glob("#{source_path}/**/Modules/**/*.swiftmodule/*.swiftinterface").count > 0
|
416
418
|
# We can safely remove .swiftmodule if .swiftinterface exists
|
417
419
|
swiftmodule_files = Dir.glob("#{source_path}/**/Modules/**/*.swiftmodule/*.swiftmodule")
|
@@ -427,7 +429,7 @@ module PodBuilder
|
|
427
429
|
project_folder.select { |t| File.directory?(t) && Dir.empty?(t) }.each { |t| PodBuilder::safe_rm_rf(t) }
|
428
430
|
|
429
431
|
unless Dir.glob("#{source_path}/**/*").select { |t| File.file?(t) }.empty?
|
430
|
-
destination_folder = PodBuilder::prebuiltpath(root_name)
|
432
|
+
destination_folder = PodBuilder::prebuiltpath(item.root_name)
|
431
433
|
FileUtils.mkdir_p(destination_folder)
|
432
434
|
FileUtils.cp_r("#{source_path}/.", destination_folder)
|
433
435
|
end
|
data/lib/pod_builder/podfile.rb
CHANGED
@@ -44,7 +44,11 @@ module PodBuilder
|
|
44
44
|
# https://thi.imhttps://thi.im/posts/swift-serialize-debugging-options/
|
45
45
|
build_settings["SWIFT_SERIALIZE_DEBUGGING_OPTIONS"] = "NO"
|
46
46
|
|
47
|
-
|
47
|
+
if Configuration.react_native_project && item.name.include?("Folly")
|
48
|
+
build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = "9.0" # https://github.com/facebook/flipper/issues/834#issuecomment-899725463
|
49
|
+
else
|
50
|
+
build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = platform.deployment_target.version # Fix compilation warnings on Xcode 12
|
51
|
+
end
|
48
52
|
|
49
53
|
# Ignore deprecation warnings
|
50
54
|
build_settings["GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS"] = "NO"
|
@@ -266,6 +270,11 @@ module PodBuilder
|
|
266
270
|
|
267
271
|
Dir.chdir(PodBuilder::project_path) do
|
268
272
|
bundler_prefix = Configuration.use_bundler ? "bundle exec " : ""
|
273
|
+
|
274
|
+
if Configuration.react_native_project
|
275
|
+
system("#{bundler_prefix}pod deintegrate;")
|
276
|
+
end
|
277
|
+
|
269
278
|
system("#{bundler_prefix}pod install;")
|
270
279
|
end
|
271
280
|
end
|
@@ -591,7 +600,7 @@ module PodBuilder
|
|
591
600
|
if matches&.size == 4 && !stripped_line.start_with?("#")
|
592
601
|
path = matches[2]
|
593
602
|
|
594
|
-
file_exists = File.exist?(File.expand_path(
|
603
|
+
file_exists = [path, "#{path}.rb"].any? { |t| File.exist?(File.expand_path(t)) }
|
595
604
|
|
596
605
|
is_absolute = ["~", "/"].include?(path[0])
|
597
606
|
if is_absolute || !file_exists
|
@@ -641,17 +650,32 @@ module PodBuilder
|
|
641
650
|
end
|
642
651
|
|
643
652
|
def self.prepare_for_react_native_rn_pods_file(podfile_content)
|
653
|
+
use_react_native_open_found = false
|
654
|
+
enable_hermes = false
|
655
|
+
indentation = ""
|
656
|
+
|
644
657
|
lines = []
|
645
658
|
podfile_content.each_line do |line|
|
646
|
-
if line.include?("use_react_native!")
|
659
|
+
if line.include?("use_react_native!(")
|
660
|
+
use_react_native_open_found = true
|
661
|
+
|
647
662
|
matches = line.match(/(\s*)/)
|
648
663
|
unless matches&.size == 2
|
649
664
|
return podfile_content
|
650
665
|
end
|
651
|
-
|
652
666
|
indentation = matches[1]
|
653
|
-
|
667
|
+
end
|
668
|
+
|
669
|
+
if use_react_native_open_found
|
670
|
+
if line.gsub(" ", "").include?(":hermes_enabled=>true")
|
671
|
+
enable_hermes = true
|
672
|
+
end
|
654
673
|
lines.push("#{indentation}# #{line.strip} # pb removed\n")
|
674
|
+
|
675
|
+
if line.strip.end_with?(")")
|
676
|
+
use_react_native_open_found = false
|
677
|
+
lines.push("#{indentation}use_react_native!(:path => rn_config[\"reactNativePath\"], :hermes_enabled => #{enable_hermes ? "true" : "false"}) # pb added\n")
|
678
|
+
end
|
655
679
|
else
|
656
680
|
lines.push(line)
|
657
681
|
end
|
@@ -700,5 +724,34 @@ module PodBuilder
|
|
700
724
|
|
701
725
|
return podfile_content
|
702
726
|
end
|
727
|
+
|
728
|
+
def self.prepare_react_native_compilation_workarounds(podfile_content)
|
729
|
+
return podfile_content + """
|
730
|
+
def prepare_rn_compilation_libevent
|
731
|
+
path = \"Pods/libevent/include/event.h\"
|
732
|
+
replace(path, \"#include <evutil.h>\", \"// #include <evutil.h>\")
|
733
|
+
end
|
734
|
+
|
735
|
+
def prepare_rn_flipper_module_redefinition
|
736
|
+
module_maps = [\"Pods/Target Support Files/Flipper-Fmt/Flipper-Fmt.modulemap\", \"Pods/Target Support Files/fmt/fmt.modulemap\"]
|
737
|
+
if module_maps.all? { |t| File.exist?(t) }
|
738
|
+
commented_module = \"/* \" + File.read(module_maps[0]) + \" */\"
|
739
|
+
File.write(module_maps[0], commented_module)
|
740
|
+
end
|
741
|
+
end
|
742
|
+
|
743
|
+
def replace(path, find, replace)
|
744
|
+
if File.exist?(path)
|
745
|
+
content = File.read(path).gsub(find, replace)
|
746
|
+
File.write(path, content)
|
747
|
+
end
|
748
|
+
end
|
749
|
+
|
750
|
+
post_install do |installer|
|
751
|
+
prepare_rn_compilation_libevent()
|
752
|
+
prepare_rn_flipper_module_redefinition()
|
753
|
+
end
|
754
|
+
"""
|
755
|
+
end
|
703
756
|
end
|
704
757
|
end
|
data/lib/pod_builder/podspec.rb
CHANGED
@@ -242,7 +242,7 @@ module PodBuilder
|
|
242
242
|
podspec += " p1.license = { :type => '#{item.license}' }\n"
|
243
243
|
|
244
244
|
podspec += "\n"
|
245
|
-
podspec += " p1.#{platform.safe_string_name.downcase}.deployment_target
|
245
|
+
podspec += " p1.#{platform.safe_string_name.downcase}.deployment_target = '#{platform.deployment_target.version}'\n"
|
246
246
|
podspec += "\n"
|
247
247
|
|
248
248
|
main_keys, valid = generate_spec_keys_for(item, item.root_name, all_buildable_items, install_using_frameworks)
|
@@ -284,6 +284,34 @@ module PodBuilder
|
|
284
284
|
end
|
285
285
|
end
|
286
286
|
|
287
|
+
def self.copy_resources_and_vendored_items(installer_context, uses_frameworks, base_destination, sandbox)
|
288
|
+
installer_context.umbrella_targets.each do |umbrella|
|
289
|
+
umbrella.specs.each do |spec|
|
290
|
+
root_name = spec.name.split("/").first
|
291
|
+
|
292
|
+
if uses_frameworks
|
293
|
+
destination = File.join(base_destination, root_name)
|
294
|
+
else
|
295
|
+
destination = File.join(base_destination, root_name, root_name)
|
296
|
+
end
|
297
|
+
# Make sure the device target overwrites anything in the simulator build, otherwise iTunesConnect
|
298
|
+
# can get upset about Info.plist containing references to the simulator SDK
|
299
|
+
files = Pathname.glob("build/#{root_name}/*").reject { |f| f.to_s =~ /Pods[^.]+\.framework/ }
|
300
|
+
|
301
|
+
consumer = spec.consumer(umbrella.platform_name)
|
302
|
+
file_accessor = Pod::Sandbox::FileAccessor.new(sandbox.pod_dir(spec.root.name), consumer)
|
303
|
+
files += file_accessor.vendored_libraries
|
304
|
+
files += file_accessor.vendored_frameworks
|
305
|
+
files += file_accessor.resources
|
306
|
+
|
307
|
+
FileUtils.mkdir_p(destination)
|
308
|
+
files.each do |file|
|
309
|
+
FileUtils.cp_r(file, destination)
|
310
|
+
end
|
311
|
+
end
|
312
|
+
end
|
313
|
+
end
|
314
|
+
|
287
315
|
Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_context, user_options|
|
288
316
|
enable_dsym = user_options.fetch('dsym', true)
|
289
317
|
configuration = user_options.fetch('configuration', 'Debug')
|
@@ -303,8 +331,9 @@ Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_conte
|
|
303
331
|
|
304
332
|
build_dir = sandbox_root.parent + 'build'
|
305
333
|
base_destination = sandbox_root.parent + 'Prebuilt'
|
306
|
-
|
334
|
+
|
307
335
|
build_dir.rmtree if build_dir.directory?
|
336
|
+
base_destination.rmtree if base_destination.directory?
|
308
337
|
|
309
338
|
targets = installer_context.umbrella_targets.select { |t| t.specs.any? }
|
310
339
|
raise "\n\nUnsupported target count\n".red unless targets.count == 1
|
@@ -331,6 +360,7 @@ Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_conte
|
|
331
360
|
|
332
361
|
built_items = Dir.glob("#{build_dir}/#{xcodebuild_settings[0].platform_name}.xcarchive/Products/Library/Frameworks/*").reject { |t| File.basename(t, ".*") == "Pods_DummyTarget" }
|
333
362
|
|
363
|
+
specs = installer_context.umbrella_targets.map(&:specs).flatten
|
334
364
|
built_items.each do |built_item|
|
335
365
|
built_item_paths = [built_item]
|
336
366
|
xcodebuild_settings.drop(1).each do |xcodebuild_setting|
|
@@ -345,8 +375,12 @@ Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_conte
|
|
345
375
|
|
346
376
|
next if built_item_paths.count == 0
|
347
377
|
|
348
|
-
|
349
|
-
|
378
|
+
module_name = File.basename(built_item_paths.first, ".*")
|
379
|
+
spec = specs.detect { |t| t.module_name == module_name }
|
380
|
+
|
381
|
+
next if spec.nil?
|
382
|
+
|
383
|
+
xcframework_path = "#{base_destination}/#{spec.name}/#{module_name}.xcframework"
|
350
384
|
framework_params = built_item_paths.map { |t| "-framework '#{t}'"}.join(" ")
|
351
385
|
raise "\n\nFailed packing xcframework!\n".red if !system("xcodebuild -create-xcframework #{framework_params} -output '#{xcframework_path}' > /dev/null 2>&1")
|
352
386
|
|
@@ -354,7 +388,7 @@ Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_conte
|
|
354
388
|
xcodebuild_settings.each do |xcodebuild_setting|
|
355
389
|
dsym_source = "#{build_dir}/#{xcodebuild_setting.platform_name}.xcarchive/dSYMs/"
|
356
390
|
if File.directory?(dsym_source)
|
357
|
-
destination =
|
391
|
+
destination = PodBuilder::buildpath_dsympath
|
358
392
|
FileUtils.mkdir_p(destination)
|
359
393
|
FileUtils.mv(dsym_source, destination)
|
360
394
|
FileUtils.mv("#{destination}/dSYMs", "#{destination}/#{xcodebuild_setting.platform_name}")
|
@@ -367,6 +401,8 @@ Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_conte
|
|
367
401
|
|
368
402
|
built_count = built_items.count
|
369
403
|
Pod::UI.puts "Built #{built_count} #{'item'.pluralize(built_count)}"
|
404
|
+
|
405
|
+
copy_resources_and_vendored_items(installer_context, true, base_destination, sandbox)
|
370
406
|
else
|
371
407
|
case [target.platform_name, uses_frameworks]
|
372
408
|
when [:ios, true] then PodBuilder::build_for_iosish_platform_framework(sandbox, build_dir, target, 'iphoneos', 'iphonesimulator', configuration, PodBuilder::Configuration.deterministic_build)
|
@@ -383,35 +419,9 @@ Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_conte
|
|
383
419
|
|
384
420
|
specs = installer_context.umbrella_targets.map { |t| t.specs.map(&:name) }.flatten.map { |t| t.split("/").first }.uniq
|
385
421
|
built_count = Dir["#{build_dir}/*"].select { |t| specs.include?(File.basename(t)) }.count
|
386
|
-
Pod::UI.puts "Built #{built_count} #{'item'.pluralize(built_count)}, copying..."
|
422
|
+
Pod::UI.puts "Built #{built_count} #{'item'.pluralize(built_count)}, copying..."
|
387
423
|
|
388
|
-
|
389
|
-
|
390
|
-
installer_context.umbrella_targets.each do |umbrella|
|
391
|
-
umbrella.specs.each do |spec|
|
392
|
-
root_name = spec.name.split("/").first
|
393
|
-
|
394
|
-
if uses_frameworks
|
395
|
-
destination = File.join(base_destination, root_name)
|
396
|
-
else
|
397
|
-
destination = File.join(base_destination, root_name, root_name)
|
398
|
-
end
|
399
|
-
# Make sure the device target overwrites anything in the simulator build, otherwise iTunesConnect
|
400
|
-
# can get upset about Info.plist containing references to the simulator SDK
|
401
|
-
files = Pathname.glob("build/#{root_name}/*").reject { |f| f.to_s =~ /Pods[^.]+\.framework/ }
|
402
|
-
|
403
|
-
consumer = spec.consumer(umbrella.platform_name)
|
404
|
-
file_accessor = Pod::Sandbox::FileAccessor.new(sandbox.pod_dir(spec.root.name), consumer)
|
405
|
-
files += file_accessor.vendored_libraries
|
406
|
-
files += file_accessor.vendored_frameworks
|
407
|
-
files += file_accessor.resources
|
408
|
-
|
409
|
-
FileUtils.mkdir_p(destination)
|
410
|
-
files.each do |file|
|
411
|
-
FileUtils.cp_r(file, destination)
|
412
|
-
end
|
413
|
-
end
|
414
|
-
end
|
424
|
+
copy_resources_and_vendored_items(installer_context, uses_frameworks, base_destination, sandbox)
|
415
425
|
|
416
426
|
# Depending on the resource it may happen that it is present twice, both in the .framework and in the parent folder
|
417
427
|
Dir.glob("#{base_destination}/*") do |path|
|
@@ -433,7 +443,7 @@ Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_conte
|
|
433
443
|
if enable_dsym
|
434
444
|
dsym_source = "#{build_dir}/dSYM"
|
435
445
|
if File.directory?(dsym_source)
|
436
|
-
FileUtils.mv(dsym_source,
|
446
|
+
FileUtils.mv(dsym_source, PodBuilder::buildpath_dsympath)
|
437
447
|
end
|
438
448
|
else
|
439
449
|
raise "\n\nNot implemented\n".red
|
data/lib/pod_builder/version.rb
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: 4.
|
4
|
+
version: 4.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Camin
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -219,7 +219,7 @@ homepage: https://github.com/Subito-it/PodBuilder
|
|
219
219
|
licenses:
|
220
220
|
- Apache-2.0
|
221
221
|
metadata: {}
|
222
|
-
post_install_message:
|
222
|
+
post_install_message:
|
223
223
|
rdoc_options: []
|
224
224
|
require_paths:
|
225
225
|
- lib
|
@@ -234,8 +234,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
234
234
|
- !ruby/object:Gem::Version
|
235
235
|
version: '0'
|
236
236
|
requirements: []
|
237
|
-
rubygems_version: 3.
|
238
|
-
signing_key:
|
237
|
+
rubygems_version: 3.2.32
|
238
|
+
signing_key:
|
239
239
|
specification_version: 4
|
240
240
|
summary: Prebuild CocoaPods pods
|
241
241
|
test_files: []
|