pod-builder 4.4.4 → 5.0.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/Gemfile +1 -1
- data/README.md +4 -0
- data/lib/pod_builder/command/build.rb +0 -18
- data/lib/pod_builder/command/init.rb +1 -0
- data/lib/pod_builder/configuration.rb +20 -3
- data/lib/pod_builder/core.rb +1 -0
- data/lib/pod_builder/install.rb +1 -96
- data/lib/pod_builder/podfile.rb +28 -10
- data/lib/pod_builder/rome/post_install.rb +8 -1
- data/lib/pod_builder/swizzles.rb +186 -0
- data/lib/pod_builder/templates/build_podfile.template +12 -3
- data/lib/pod_builder/version.rb +1 -1
- data/pod-builder.gemspec +2 -2
- metadata +9 -9
- data/lib/pod_builder/podfile/pre_actions_swizzles.rb +0 -84
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6509579a498f83ab8b171004c0b3096a306b85b547392c2a6e16525d5f976fe9
|
4
|
+
data.tar.gz: 66bd6e1a6bf224b02ec05dbd51e5001ad0f2c29aa03baba43037e7d4616057fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbd9e59727c97c102429d4af1fe1b6a2c2e67c8b4460fd52582b6b3f0410abb6788340c3821d931d46524795a67e13102612f3444e9e44c2c4078840c13ab13e
|
7
|
+
data.tar.gz: 59ff68c1e2b9130f647d25152ad9729105ffbc55e3e77d89e0221bf6bc06da45d612d258e46f1102e0f8d1e20cdb47704c88256b4ecbf0bba33593efed8184cc
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -371,6 +371,10 @@ PodBuilder leverages CocoaPods to compile pods into frameworks. Every compiled f
|
|
371
371
|
|
372
372
|
# FAQ
|
373
373
|
|
374
|
+
### **I get an _'Failed getting 'DEVELOPMENT_TEAM' build setting'_ when building**
|
375
|
+
|
376
|
+
PodBuilder might fail to automatically extract the developer team from your current project which is required to sign executables. Add the `development_team` key in PodBuilder.json file with your development team identifier.
|
377
|
+
|
374
378
|
### **I get an _'`PodWithError` does not specify a Swift version and none of the targets (`DummyTarget`)'_ when building**
|
375
379
|
|
376
380
|
The podspec of the Pod you're trying to build doesn't specify the swift_version which is required in recent versions of CocoaPods. Either contact the author/mantainer of the Pod asking it to fix the podspec or add a `spec_overrides` in _PodBuilder.json_.
|
@@ -150,8 +150,6 @@ module PodBuilder
|
|
150
150
|
|
151
151
|
Podfile::install
|
152
152
|
|
153
|
-
sanity_checks
|
154
|
-
|
155
153
|
if (restore_file_error = restore_file_error) && Configuration.restore_enabled
|
156
154
|
puts "\n\n⚠️ Podfile.restore was found invalid and was overwritten. Error:\n #{restore_file_error}".red
|
157
155
|
end
|
@@ -263,22 +261,6 @@ module PodBuilder
|
|
263
261
|
return buildable_subspecs - pods_to_build
|
264
262
|
end
|
265
263
|
|
266
|
-
def self.sanity_checks
|
267
|
-
lines = File.read(PodBuilder::project_path("Podfile")).split("\n")
|
268
|
-
stripped_lines = lines.map { |x| Podfile.strip_line(x) }.select { |x| !x.start_with?("#")}
|
269
|
-
|
270
|
-
expected_stripped = Podfile::PRE_INSTALL_ACTIONS.map { |x| Podfile.strip_line(x) }
|
271
|
-
|
272
|
-
if !expected_stripped.all? { |x| stripped_lines.include?(x) }
|
273
|
-
warn_message = "PodBuilder's pre install actions missing from application Podfile!\n"
|
274
|
-
if OPTIONS[:allow_warnings]
|
275
|
-
puts "\n\n#{warn_message}".yellow
|
276
|
-
else
|
277
|
-
raise "\n\n#{warn_message}\n".red
|
278
|
-
end
|
279
|
-
end
|
280
|
-
end
|
281
|
-
|
282
264
|
def self.resolve_pods_to_build(argument_pods, buildable_items)
|
283
265
|
pods_to_build = []
|
284
266
|
|
@@ -31,6 +31,7 @@ module PodBuilder
|
|
31
31
|
|
32
32
|
podfile_content = File.read(prebuilt_podfile_path)
|
33
33
|
|
34
|
+
podfile_content = Podfile.add_configuration_load_block(podfile_content)
|
34
35
|
podfile_content = Podfile.add_install_block(podfile_content)
|
35
36
|
podfile_content = Podfile.update_path_entries(podfile_content, Init.method(:podfile_path_transform))
|
36
37
|
podfile_content = Podfile.update_project_entries(podfile_content, Init.method(:podfile_path_transform))
|
@@ -77,6 +77,7 @@ module PodBuilder
|
|
77
77
|
attr_accessor :build_xcframeworks_exclude
|
78
78
|
attr_accessor :pre_actions
|
79
79
|
attr_accessor :post_actions
|
80
|
+
attr_accessor :development_team
|
80
81
|
end
|
81
82
|
|
82
83
|
@build_settings = DEFAULT_BUILD_SETTINGS
|
@@ -116,6 +117,8 @@ module PodBuilder
|
|
116
117
|
|
117
118
|
@pre_actions = {}
|
118
119
|
@post_actions = {}
|
120
|
+
|
121
|
+
@development_team = ""
|
119
122
|
|
120
123
|
def self.check_inited
|
121
124
|
raise "\n\nNot inited, run `pod_builder init`\n".red if podbuilder_path.nil?
|
@@ -244,6 +247,11 @@ module PodBuilder
|
|
244
247
|
Configuration.post_actions = PodBuilder::Actions.load(value)
|
245
248
|
end
|
246
249
|
end
|
250
|
+
if value = json["development_team"]
|
251
|
+
if value.is_a?(String) && value.length > 0
|
252
|
+
Configuration.development_team = value
|
253
|
+
end
|
254
|
+
end
|
247
255
|
|
248
256
|
Configuration.build_settings.freeze
|
249
257
|
|
@@ -288,6 +296,7 @@ module PodBuilder
|
|
288
296
|
config["deterministic_build"] = Configuration.deterministic_build
|
289
297
|
config["build_using_repo_paths"] = Configuration.build_using_repo_paths
|
290
298
|
config["react_native_project"] = Configuration.react_native_project
|
299
|
+
config["development_team"] = Configuration.development_team
|
291
300
|
|
292
301
|
File.write(config_path, JSON.pretty_generate(config))
|
293
302
|
end
|
@@ -314,13 +323,21 @@ module PodBuilder
|
|
314
323
|
|
315
324
|
return File.join(path, Configuration.configuration_filename)
|
316
325
|
end
|
317
|
-
|
326
|
+
|
327
|
+
@@podbuilder_path_cache = nil
|
318
328
|
def self.podbuilder_path
|
329
|
+
if path = @@podbuilder_path_cache
|
330
|
+
return path
|
331
|
+
end
|
332
|
+
|
319
333
|
paths = Dir.glob("#{PodBuilder::home}/**/.pod_builder")
|
320
334
|
paths.reject! { |t| t.match(/pod-builder-.*\/Example\/#{File.basename(Configuration.base_path)}\/\.pod_builder$/i) }
|
321
335
|
raise "\n\nToo many .pod_builder found `#{paths.join("\n")}`\n".red if paths.count > 1
|
322
|
-
|
323
|
-
|
336
|
+
|
337
|
+
path = paths.count > 0 ? File.dirname(paths.first) : nil
|
338
|
+
@@podbuilder_path_cache = path
|
339
|
+
|
340
|
+
return path
|
324
341
|
end
|
325
342
|
end
|
326
343
|
end
|
data/lib/pod_builder/core.rb
CHANGED
data/lib/pod_builder/install.rb
CHANGED
@@ -1,102 +1,7 @@
|
|
1
1
|
require 'digest'
|
2
2
|
require 'colored'
|
3
3
|
require 'highline/import'
|
4
|
-
|
5
|
-
# The following begin/end clause contains a set of monkey patches of the original CP implementation
|
6
|
-
|
7
|
-
# The Pod::Target and Pod::Installer::Xcode::PodTargetDependencyInstaller swizzles patch
|
8
|
-
# the following issues:
|
9
|
-
# - https://github.com/CocoaPods/Rome/issues/81
|
10
|
-
# - https://github.com/leavez/cocoapods-binary/issues/50
|
11
|
-
begin
|
12
|
-
require 'cocoapods/installer/xcode/pods_project_generator/pod_target_dependency_installer.rb'
|
13
|
-
|
14
|
-
class Pod::Specification
|
15
|
-
Pod::Specification.singleton_class.send(:alias_method, :swz_from_hash, :from_hash)
|
16
|
-
Pod::Specification.singleton_class.send(:alias_method, :swz_from_string, :from_string)
|
17
|
-
|
18
|
-
def self.from_string(*args)
|
19
|
-
spec = swz_from_string(*args)
|
20
|
-
|
21
|
-
if overrides = PodBuilder::Configuration.spec_overrides[spec.name]
|
22
|
-
overrides.each do |k, v|
|
23
|
-
if spec.attributes_hash[k].is_a?(Hash)
|
24
|
-
current = spec.attributes_hash[k]
|
25
|
-
spec.attributes_hash[k] = current.merge(v)
|
26
|
-
else
|
27
|
-
spec.attributes_hash[k] = v
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
spec
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
class Pod::Target
|
37
|
-
attr_accessor :mock_dynamic_framework
|
38
|
-
|
39
|
-
alias_method :swz_build_type, :build_type
|
40
|
-
|
41
|
-
def build_type
|
42
|
-
if mock_dynamic_framework == true
|
43
|
-
if defined?(Pod::BuildType) # CocoaPods 1.9 and later
|
44
|
-
Pod::BuildType.new(linkage: :dynamic, packaging: :framework)
|
45
|
-
elsif defined?(Pod::Target::BuildType) # CocoaPods 1.7, 1.8
|
46
|
-
Pod::Target::BuildType.new(linkage: :dynamic, packaging: :framework)
|
47
|
-
else
|
48
|
-
raise "\n\nBuildType not found. Open an issue reporting your CocoaPods version\n".red
|
49
|
-
end
|
50
|
-
else
|
51
|
-
swz_build_type()
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
class Pod::PodTarget
|
57
|
-
@@modules_override = Hash.new
|
58
|
-
|
59
|
-
def self.modules_override= (x)
|
60
|
-
@@modules_override = x
|
61
|
-
end
|
62
|
-
|
63
|
-
def self.modules_override
|
64
|
-
return @@modules_override
|
65
|
-
end
|
66
|
-
|
67
|
-
alias_method :swz_defines_module?, :defines_module?
|
68
|
-
|
69
|
-
def defines_module?
|
70
|
-
return @@modules_override.has_key?(name) ? @@modules_override[name] : swz_defines_module?
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
# Starting from CocoaPods 1.10.0 and later resources are no longer copied inside the .framework
|
75
|
-
# when building static frameworks. While this is correct when using CP normally, for redistributable
|
76
|
-
# frameworks we require resources to be shipped along the binary
|
77
|
-
class Pod::Installer::Xcode::PodsProjectGenerator::PodTargetInstaller
|
78
|
-
alias_method :swz_add_files_to_build_phases, :add_files_to_build_phases
|
79
|
-
|
80
|
-
def add_files_to_build_phases(native_target, test_native_targets, app_native_targets)
|
81
|
-
target.mock_dynamic_framework = target.build_as_static_framework?
|
82
|
-
swz_add_files_to_build_phases(native_target, test_native_targets, app_native_targets)
|
83
|
-
target.mock_dynamic_framework = false
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
class Pod::Installer::Xcode::PodTargetDependencyInstaller
|
88
|
-
alias_method :swz_wire_resource_bundle_targets, :wire_resource_bundle_targets
|
89
|
-
|
90
|
-
def wire_resource_bundle_targets(resource_bundle_targets, native_target, pod_target)
|
91
|
-
pod_target.mock_dynamic_framework = pod_target.build_as_static_framework?
|
92
|
-
res = swz_wire_resource_bundle_targets(resource_bundle_targets, native_target, pod_target)
|
93
|
-
pod_target.mock_dynamic_framework = false
|
94
|
-
return res
|
95
|
-
end
|
96
|
-
end
|
97
|
-
rescue LoadError
|
98
|
-
# CocoaPods 1.6.2 or earlier
|
99
|
-
end
|
4
|
+
require 'pod_builder/core'
|
100
5
|
|
101
6
|
module PodBuilder
|
102
7
|
class InstallResult
|
data/lib/pod_builder/podfile.rb
CHANGED
@@ -3,11 +3,21 @@ module PodBuilder
|
|
3
3
|
class Podfile
|
4
4
|
PODBUILDER_LOCK_ACTION = ["raise \"\\n🚨 Do not launch 'pod install' manually, use `pod_builder` instead!\\n\" if !File.exist?('pod_builder.lock')"].freeze
|
5
5
|
|
6
|
-
PRE_INSTALL_ACTIONS = ["Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_duplicate_framework_and_library_names) {}", "require 'pod_builder/podfile/pre_actions_swizzles'"].freeze
|
7
|
-
|
8
6
|
def self.from_podfile_items(items, analyzer, build_configuration, install_using_frameworks, build_catalyst, build_xcframeworks)
|
9
7
|
raise "\n\nno items\n".red unless items.count > 0
|
10
8
|
|
9
|
+
# Xcode 14 requires a development team to be specified for the compilation to succeed
|
10
|
+
development_team = Configuration::development_team
|
11
|
+
if development_team.empty?
|
12
|
+
project_path = "#{PodBuilder.project_path}/#{Configuration::project_name}.xcodeproj"
|
13
|
+
development_team = `grep -rh 'DEVELOPMENT_TEAM' '#{project_path}' | uniq`.strip
|
14
|
+
development_team_match = development_team.match(/DEVELOPMENT_TEAM = (.+);/)
|
15
|
+
if development_team.split("\n").count != 1 || development_team_match&.size != 2
|
16
|
+
raise "\n\nFailed getting 'DEVELOPMENT_TEAM' build setting, please add your development team to #{PodBuilder::basepath(Configuration.configuration_filename)} as per documentation".red
|
17
|
+
end
|
18
|
+
development_team = development_team_match[1]
|
19
|
+
end
|
20
|
+
|
11
21
|
sources = analyzer.sources
|
12
22
|
|
13
23
|
cwd = File.dirname(File.expand_path(__FILE__))
|
@@ -27,10 +37,12 @@ module PodBuilder
|
|
27
37
|
|
28
38
|
podfile.sub!("%%%build_configuration%%%", build_configuration.capitalize)
|
29
39
|
|
40
|
+
podfile.sub!("%%%development_team%%%", development_team)
|
41
|
+
|
30
42
|
podfile_build_settings = ""
|
31
43
|
|
32
44
|
pod_dependencies = {}
|
33
|
-
|
45
|
+
|
34
46
|
items.each do |item|
|
35
47
|
build_settings = Configuration.build_settings.dup
|
36
48
|
|
@@ -240,8 +252,6 @@ module PodBuilder
|
|
240
252
|
podfile_content = Podfile.update_project_entries(podfile_content, Podfile.method(:podfile_path_transform))
|
241
253
|
podfile_content = Podfile.update_require_entries(podfile_content, Podfile.method(:podfile_path_transform))
|
242
254
|
|
243
|
-
podfile_content = add_pre_install_actions(podfile_content)
|
244
|
-
|
245
255
|
project_podfile_path = PodBuilder::project_path("Podfile")
|
246
256
|
File.write(project_podfile_path, podfile_content)
|
247
257
|
end
|
@@ -259,8 +269,6 @@ module PodBuilder
|
|
259
269
|
podfile_content = Podfile.update_project_entries(podfile_content, Podfile.method(:podfile_path_transform))
|
260
270
|
podfile_content = Podfile.update_require_entries(podfile_content, Podfile.method(:podfile_path_transform))
|
261
271
|
|
262
|
-
podfile_content = add_pre_install_actions(podfile_content)
|
263
|
-
|
264
272
|
project_podfile_path = PodBuilder::project_path("Podfile")
|
265
273
|
File.write(project_podfile_path, podfile_content)
|
266
274
|
end
|
@@ -361,7 +369,9 @@ module PodBuilder
|
|
361
369
|
return
|
362
370
|
end
|
363
371
|
|
364
|
-
File.read(podfile_path)
|
372
|
+
content = File.read(podfile_path)
|
373
|
+
|
374
|
+
content.each_line do |line|
|
365
375
|
stripped_line = strip_line(line)
|
366
376
|
unless !stripped_line.start_with?("#")
|
367
377
|
next
|
@@ -372,6 +382,10 @@ module PodBuilder
|
|
372
382
|
raise "\n\nUnsupported single line def/pod. `def` and `pod` shouldn't be on the same line, please modify the following line:\n#{line}\n".red if starting_def_found
|
373
383
|
end
|
374
384
|
end
|
385
|
+
|
386
|
+
unless content.include?("PodBuilder::Configuration::load")
|
387
|
+
raise "\n\nUnsupported PodBuilder/Podfile found!\n\nStarting from version 5.x Podfile should contain the following lines:\nrequire 'pod_builder/core'\nPodBuilder::Configuration::load\n\nPlease manually add them to the top of your Podfile\n".red
|
388
|
+
end
|
375
389
|
end
|
376
390
|
|
377
391
|
def self.resolve_pod_names(names, all_buildable_items)
|
@@ -497,8 +511,12 @@ module PodBuilder
|
|
497
511
|
return add(PODBUILDER_LOCK_ACTION, "pre_install", podfile_content)
|
498
512
|
end
|
499
513
|
|
500
|
-
def self.
|
501
|
-
|
514
|
+
def self.add_configuration_load_block(podfile_content)
|
515
|
+
unless podfile_content.include?("require 'pod_builder/core")
|
516
|
+
podfile_content = "require 'pod_builder/core'\nPodBuilder::Configuration::load\n\n" + podfile_content
|
517
|
+
end
|
518
|
+
|
519
|
+
return podfile_content
|
502
520
|
end
|
503
521
|
|
504
522
|
def self.add(entries, marker, podfile_content)
|
@@ -378,9 +378,16 @@ Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_conte
|
|
378
378
|
module_name = File.basename(built_item_paths.first, ".*")
|
379
379
|
spec = specs.detect { |t| t.module_name == module_name }
|
380
380
|
|
381
|
+
# There seems to be a potential bug in CocoaPods-Core (https://github.com/CocoaPods/Core/issues/730)
|
382
|
+
if spec.nil?
|
383
|
+
# Given the above issue when all specs of a pod are subspecs (e.g. specs contains Pod1/Subspec1, Pod1/Subspec2, ...) we'll fail getting the correct specification by relying on module name
|
384
|
+
spec = specs.detect { |t| t.name.split("/").first == module_name }
|
385
|
+
end
|
386
|
+
|
381
387
|
next if spec.nil?
|
382
388
|
|
383
|
-
|
389
|
+
root_name = spec.name.split("/").first
|
390
|
+
xcframework_path = "#{base_destination}/#{root_name}/#{module_name}.xcframework"
|
384
391
|
framework_params = built_item_paths.map { |t| "-framework '#{t}'"}.join(" ")
|
385
392
|
raise "\n\nFailed packing xcframework!\n".red if !system("xcodebuild -create-xcframework #{framework_params} -output '#{xcframework_path}' > /dev/null 2>&1")
|
386
393
|
|
@@ -0,0 +1,186 @@
|
|
1
|
+
require 'xcodeproj'
|
2
|
+
require 'pod_builder/core'
|
3
|
+
require 'digest'
|
4
|
+
|
5
|
+
# Skip warning
|
6
|
+
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_duplicate_framework_and_library_names) {}
|
7
|
+
|
8
|
+
# workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
|
9
|
+
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
|
10
|
+
|
11
|
+
# The following begin/end clause contains a set of monkey patches of the original CP implementation
|
12
|
+
|
13
|
+
# The Pod::Target and Pod::Installer::Xcode::PodTargetDependencyInstaller swizzles patch
|
14
|
+
# the following issues:
|
15
|
+
# - https://github.com/CocoaPods/Rome/issues/81
|
16
|
+
# - https://github.com/leavez/cocoapods-binary/issues/50
|
17
|
+
begin
|
18
|
+
require 'cocoapods/installer/xcode/pods_project_generator/pod_target_dependency_installer.rb'
|
19
|
+
|
20
|
+
class Pod::Specification
|
21
|
+
Pod::Specification.singleton_class.send(:alias_method, :swz_from_hash, :from_hash)
|
22
|
+
Pod::Specification.singleton_class.send(:alias_method, :swz_from_string, :from_string)
|
23
|
+
|
24
|
+
def self.from_string(*args)
|
25
|
+
spec = swz_from_string(*args)
|
26
|
+
|
27
|
+
if overrides = PodBuilder::Configuration.spec_overrides[spec.name]
|
28
|
+
overrides.each do |k, v|
|
29
|
+
if spec.attributes_hash[k].is_a?(Hash)
|
30
|
+
current = spec.attributes_hash[k]
|
31
|
+
spec.attributes_hash[k] = current.merge(v)
|
32
|
+
else
|
33
|
+
spec.attributes_hash[k] = v
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
spec
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
class Pod::Target
|
43
|
+
attr_accessor :mock_dynamic_framework
|
44
|
+
|
45
|
+
alias_method :swz_build_type, :build_type
|
46
|
+
|
47
|
+
def build_type
|
48
|
+
if mock_dynamic_framework == true
|
49
|
+
if defined?(Pod::BuildType) # CocoaPods 1.9 and later
|
50
|
+
Pod::BuildType.new(linkage: :dynamic, packaging: :framework)
|
51
|
+
elsif defined?(Pod::Target::BuildType) # CocoaPods 1.7, 1.8
|
52
|
+
Pod::Target::BuildType.new(linkage: :dynamic, packaging: :framework)
|
53
|
+
else
|
54
|
+
raise "\n\nBuildType not found. Open an issue reporting your CocoaPods version\n".red
|
55
|
+
end
|
56
|
+
else
|
57
|
+
swz_build_type()
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
class Pod::PodTarget
|
63
|
+
@@modules_override = Hash.new
|
64
|
+
|
65
|
+
def self.modules_override= (x)
|
66
|
+
@@modules_override = x
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.modules_override
|
70
|
+
return @@modules_override
|
71
|
+
end
|
72
|
+
|
73
|
+
alias_method :swz_defines_module?, :defines_module?
|
74
|
+
|
75
|
+
def defines_module?
|
76
|
+
return @@modules_override.has_key?(name) ? @@modules_override[name] : swz_defines_module?
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# Starting from CocoaPods 1.10.0 and later resources are no longer copied inside the .framework
|
81
|
+
# when building static frameworks. While this is correct when using CP normally, for redistributable
|
82
|
+
# frameworks we require resources to be shipped along the binary
|
83
|
+
class Pod::Installer::Xcode::PodsProjectGenerator::PodTargetInstaller
|
84
|
+
alias_method :swz_add_files_to_build_phases, :add_files_to_build_phases
|
85
|
+
|
86
|
+
def add_files_to_build_phases(native_target, test_native_targets, app_native_targets)
|
87
|
+
target.mock_dynamic_framework = target.build_as_static_framework?
|
88
|
+
swz_add_files_to_build_phases(native_target, test_native_targets, app_native_targets)
|
89
|
+
target.mock_dynamic_framework = false
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
class Pod::Installer::Xcode::PodTargetDependencyInstaller
|
94
|
+
alias_method :swz_wire_resource_bundle_targets, :wire_resource_bundle_targets
|
95
|
+
|
96
|
+
def wire_resource_bundle_targets(resource_bundle_targets, native_target, pod_target)
|
97
|
+
pod_target.mock_dynamic_framework = pod_target.build_as_static_framework?
|
98
|
+
res = swz_wire_resource_bundle_targets(resource_bundle_targets, native_target, pod_target)
|
99
|
+
pod_target.mock_dynamic_framework = false
|
100
|
+
return res
|
101
|
+
end
|
102
|
+
end
|
103
|
+
rescue LoadError
|
104
|
+
# CocoaPods 1.6.2 or earlier
|
105
|
+
end
|
106
|
+
|
107
|
+
class Pod::Generator::FileList
|
108
|
+
alias_method :swz_initialize, :initialize
|
109
|
+
|
110
|
+
def initialize(paths)
|
111
|
+
paths.uniq!
|
112
|
+
swz_initialize(paths)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
class Pod::Generator::CopyXCFrameworksScript
|
117
|
+
alias_method :swz_initialize, :initialize
|
118
|
+
|
119
|
+
def initialize(xcframeworks, sandbox_root, platform)
|
120
|
+
xcframeworks.uniq! { |t| t.path }
|
121
|
+
swz_initialize(xcframeworks, sandbox_root, platform)
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
class Pod::Generator::EmbedFrameworksScript
|
126
|
+
alias_method :swz_initialize, :initialize
|
127
|
+
|
128
|
+
def initialize(*args)
|
129
|
+
raise "\n\nUnsupported CocoaPods version\n".red if (args.count == 0 || args.count > 2)
|
130
|
+
|
131
|
+
frameworks_by_config = args[0]
|
132
|
+
frameworks_by_config.keys.each do |key|
|
133
|
+
items = frameworks_by_config[key]
|
134
|
+
items.uniq! { |t| t.source_path }
|
135
|
+
frameworks_by_config[key] = items
|
136
|
+
end
|
137
|
+
|
138
|
+
if args.count == 2
|
139
|
+
# CocoaPods 1.10.0 and newer
|
140
|
+
xcframeworks_by_config = args[1]
|
141
|
+
xcframeworks_by_config.keys.each do |key|
|
142
|
+
items = xcframeworks_by_config[key]
|
143
|
+
items.uniq! { |t| t.path }
|
144
|
+
xcframeworks_by_config[key] = items
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
swz_initialize(*args)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
class Pod::Generator::CopyResourcesScript
|
153
|
+
alias_method :swz_initialize, :initialize
|
154
|
+
|
155
|
+
def initialize(resources_by_config, platform)
|
156
|
+
resources_by_config.keys.each do |key|
|
157
|
+
items = resources_by_config[key]
|
158
|
+
items.uniq!
|
159
|
+
|
160
|
+
colliding_resources = items.group_by { |t| File.basename(t) }.values.select { |t| t.count > 1 }
|
161
|
+
|
162
|
+
unless colliding_resources.empty?
|
163
|
+
message = ""
|
164
|
+
colliding_resources.each do |resources|
|
165
|
+
resources.map! { |t| File.expand_path(t.gsub("${PODS_ROOT}", "#{Dir.pwd}/Pods")) }
|
166
|
+
# check that files are identical.
|
167
|
+
# For files with paths that are resolved (e.g containing ${PODS_ROOT}) we use the file hash
|
168
|
+
# we fallback to the filename for the others
|
169
|
+
hashes = resources.map { |t| File.exists?(t) ? Digest::MD5.hexdigest(File.read(t)) : File.basename(t) }
|
170
|
+
if hashes.uniq.count > 1
|
171
|
+
message += resources.join("\n") + "\n"
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
unless message.empty?
|
176
|
+
message = "\n\nThe following resources have the same name and will collide once copied into application bundle:\n" + message
|
177
|
+
raise message
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
resources_by_config[key] = items
|
182
|
+
end
|
183
|
+
|
184
|
+
swz_initialize(resources_by_config, platform)
|
185
|
+
end
|
186
|
+
end
|
@@ -1,4 +1,7 @@
|
|
1
1
|
require 'cfpropertylist'
|
2
|
+
require 'pod_builder/core'
|
3
|
+
|
4
|
+
PodBuilder::Configuration::load
|
2
5
|
|
3
6
|
%%%sources%%%
|
4
7
|
|
@@ -63,8 +66,14 @@ pre_install do |installer|
|
|
63
66
|
# set a random version to please CocoaPods, the proper version will be overridden by set_build_settings()
|
64
67
|
target.root_spec.swift_version = "1.0"
|
65
68
|
end
|
69
|
+
end
|
66
70
|
|
67
|
-
|
68
|
-
|
69
|
-
|
71
|
+
post_install do |installer|
|
72
|
+
installer.pods_project.targets.each do |target|
|
73
|
+
target.build_configurations.each do |config|
|
74
|
+
config.build_settings['DEVELOPMENT_TEAM'] = '%%%development_team%%%'
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
installer.pods_project.save
|
70
79
|
end
|
data/lib/pod_builder/version.rb
CHANGED
data/pod-builder.gemspec
CHANGED
@@ -25,8 +25,8 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.add_development_dependency "bundler", "~> 2.0"
|
27
27
|
spec.add_development_dependency "rake", ">= 12.3.3"
|
28
|
-
spec.add_development_dependency "ruby-debug-ide"
|
29
|
-
spec.add_development_dependency "debase", '0.2.
|
28
|
+
spec.add_development_dependency "ruby-debug-ide"
|
29
|
+
spec.add_development_dependency "debase", '0.2.5.beta2'
|
30
30
|
|
31
31
|
spec.add_runtime_dependency 'xcodeproj'
|
32
32
|
spec.add_runtime_dependency 'colored'
|
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
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Camin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -42,30 +42,30 @@ dependencies:
|
|
42
42
|
name: ruby-debug-ide
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: debase
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.2.
|
61
|
+
version: 0.2.5.beta2
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.2.
|
68
|
+
version: 0.2.5.beta2
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: xcodeproj
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -206,12 +206,12 @@ files:
|
|
206
206
|
- lib/pod_builder/install.rb
|
207
207
|
- lib/pod_builder/licenses.rb
|
208
208
|
- lib/pod_builder/podfile.rb
|
209
|
-
- lib/pod_builder/podfile/pre_actions_swizzles.rb
|
210
209
|
- lib/pod_builder/podfile_cp.rb
|
211
210
|
- lib/pod_builder/podfile_item.rb
|
212
211
|
- lib/pod_builder/podspec.rb
|
213
212
|
- lib/pod_builder/rome/post_install.rb
|
214
213
|
- lib/pod_builder/rome/pre_install.rb
|
214
|
+
- lib/pod_builder/swizzles.rb
|
215
215
|
- lib/pod_builder/templates/build_podfile.template
|
216
216
|
- lib/pod_builder/templates/build_podspec.template
|
217
217
|
- lib/pod_builder/version.rb
|
@@ -1,84 +0,0 @@
|
|
1
|
-
require 'xcodeproj'
|
2
|
-
require 'pod_builder/core'
|
3
|
-
require 'digest'
|
4
|
-
|
5
|
-
class Pod::Generator::FileList
|
6
|
-
alias_method :swz_initialize, :initialize
|
7
|
-
|
8
|
-
def initialize(paths)
|
9
|
-
paths.uniq!
|
10
|
-
swz_initialize(paths)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
class Pod::Generator::CopyXCFrameworksScript
|
15
|
-
alias_method :swz_initialize, :initialize
|
16
|
-
|
17
|
-
def initialize(xcframeworks, sandbox_root, platform)
|
18
|
-
xcframeworks.uniq! { |t| t.path }
|
19
|
-
swz_initialize(xcframeworks, sandbox_root, platform)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
class Pod::Generator::EmbedFrameworksScript
|
24
|
-
alias_method :swz_initialize, :initialize
|
25
|
-
|
26
|
-
def initialize(*args)
|
27
|
-
raise "\n\nUnsupported CocoaPods version\n".red if (args.count == 0 || args.count > 2)
|
28
|
-
|
29
|
-
frameworks_by_config = args[0]
|
30
|
-
frameworks_by_config.keys.each do |key|
|
31
|
-
items = frameworks_by_config[key]
|
32
|
-
items.uniq! { |t| t.source_path }
|
33
|
-
frameworks_by_config[key] = items
|
34
|
-
end
|
35
|
-
|
36
|
-
if args.count == 2
|
37
|
-
# CocoaPods 1.10.0 and newer
|
38
|
-
xcframeworks_by_config = args[1]
|
39
|
-
xcframeworks_by_config.keys.each do |key|
|
40
|
-
items = xcframeworks_by_config[key]
|
41
|
-
items.uniq! { |t| t.path }
|
42
|
-
xcframeworks_by_config[key] = items
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
swz_initialize(*args)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
class Pod::Generator::CopyResourcesScript
|
51
|
-
alias_method :swz_initialize, :initialize
|
52
|
-
|
53
|
-
def initialize(resources_by_config, platform)
|
54
|
-
resources_by_config.keys.each do |key|
|
55
|
-
items = resources_by_config[key]
|
56
|
-
items.uniq!
|
57
|
-
|
58
|
-
colliding_resources = items.group_by { |t| File.basename(t) }.values.select { |t| t.count > 1 }
|
59
|
-
|
60
|
-
unless colliding_resources.empty?
|
61
|
-
message = ""
|
62
|
-
colliding_resources.each do |resources|
|
63
|
-
resources.map! { |t| File.expand_path(t.gsub("${PODS_ROOT}", "#{Dir.pwd}/Pods")) }
|
64
|
-
# check that files are identical.
|
65
|
-
# For files with paths that are resolved (e.g containing ${PODS_ROOT}) we use the file hash
|
66
|
-
# we fallback to the filename for the others
|
67
|
-
hashes = resources.map { |t| File.exists?(t) ? Digest::MD5.hexdigest(File.read(t)) : File.basename(t) }
|
68
|
-
if hashes.uniq.count > 1
|
69
|
-
message += resources.join("\n") + "\n"
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
unless message.empty?
|
74
|
-
message = "\n\nThe following resources have the same name and will collide once copied into application bundle:\n" + message
|
75
|
-
raise message
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
resources_by_config[key] = items
|
80
|
-
end
|
81
|
-
|
82
|
-
swz_initialize(resources_by_config, platform)
|
83
|
-
end
|
84
|
-
end
|