pod-builder 4.4.5 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -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 +19 -4
- data/lib/pod_builder/core.rb +1 -0
- data/lib/pod_builder/install.rb +16 -96
- data/lib/pod_builder/podfile.rb +13 -9
- data/lib/pod_builder/swizzles.rb +186 -0
- data/lib/pod_builder/templates/build_podfile.template +3 -4
- data/lib/pod_builder/version.rb +1 -1
- metadata +3 -3
- 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: d0ab7c5e2b626fdced7e32539cd701cdf1dc36fe5e921351edab3aab860f3550
|
4
|
+
data.tar.gz: ed1f4cbad8ebe2bc973aadc12ebfe04adf0c66af1833a49ea5f4ab0df513f6f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d1babbf3946a5e021a17a984cf16afc3b81558af5fdac2ad64bfb0fa2f90b5803130d1ca1d7bc58254e9143e1f3ce14587387ae97eb888d7444cde04fa93739
|
7
|
+
data.tar.gz: a756ebcb9b0bae3b31ba0abba18a3f5638285597582e6432fee80e273efc02d4e92718f31e3b26394398de77757d44b4bea6dc004b181388d51d2af05bd92fbd
|
data/README.md
CHANGED
@@ -203,6 +203,15 @@ _PodBuilder.json_ allows some advanced customizations.
|
|
203
203
|
|
204
204
|
## Supported keys
|
205
205
|
|
206
|
+
#### `development_team`
|
207
|
+
|
208
|
+
Starting with Xcode 14 it is mandatory to sign both frameworks and framework bundles. PodBuilder will try to automatically extract the developer team from the application, however there are cases where this will fail and the development_team needs to be added explicitly in the configuration file.
|
209
|
+
|
210
|
+
|
211
|
+
#### `development_language`
|
212
|
+
|
213
|
+
Starting with Xcode 14, when the main language is different than english, it might be necessary to explicitly set the default app language to properly localize app's extensions. Use the ISO 639-1 code.
|
214
|
+
|
206
215
|
#### `spec_overrides`
|
207
216
|
|
208
217
|
This hash allows to add/replace keys in a podspec specification. This can be useful to solve compilation issue or change compilation behaviour (e.g. compile framework statically by specifying `static_framework = true`) without having to fork the repo.
|
@@ -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))
|
@@ -78,6 +78,7 @@ module PodBuilder
|
|
78
78
|
attr_accessor :pre_actions
|
79
79
|
attr_accessor :post_actions
|
80
80
|
attr_accessor :development_team
|
81
|
+
attr_accessor :development_language
|
81
82
|
end
|
82
83
|
|
83
84
|
@build_settings = DEFAULT_BUILD_SETTINGS
|
@@ -119,6 +120,7 @@ module PodBuilder
|
|
119
120
|
@post_actions = {}
|
120
121
|
|
121
122
|
@development_team = ""
|
123
|
+
@development_language = nil
|
122
124
|
|
123
125
|
def self.check_inited
|
124
126
|
raise "\n\nNot inited, run `pod_builder init`\n".red if podbuilder_path.nil?
|
@@ -252,7 +254,11 @@ module PodBuilder
|
|
252
254
|
Configuration.development_team = value
|
253
255
|
end
|
254
256
|
end
|
255
|
-
|
257
|
+
if value = json["development_language"]
|
258
|
+
if value.is_a?(String) && value.length > 0
|
259
|
+
Configuration.development_language = value
|
260
|
+
end
|
261
|
+
end
|
256
262
|
Configuration.build_settings.freeze
|
257
263
|
|
258
264
|
sanity_check()
|
@@ -297,6 +303,7 @@ module PodBuilder
|
|
297
303
|
config["build_using_repo_paths"] = Configuration.build_using_repo_paths
|
298
304
|
config["react_native_project"] = Configuration.react_native_project
|
299
305
|
config["development_team"] = Configuration.development_team
|
306
|
+
config["development_language"] = Configuration.development_language || "en"
|
300
307
|
|
301
308
|
File.write(config_path, JSON.pretty_generate(config))
|
302
309
|
end
|
@@ -323,13 +330,21 @@ module PodBuilder
|
|
323
330
|
|
324
331
|
return File.join(path, Configuration.configuration_filename)
|
325
332
|
end
|
326
|
-
|
333
|
+
|
334
|
+
@@podbuilder_path_cache = nil
|
327
335
|
def self.podbuilder_path
|
336
|
+
if path = @@podbuilder_path_cache
|
337
|
+
return path
|
338
|
+
end
|
339
|
+
|
328
340
|
paths = Dir.glob("#{PodBuilder::home}/**/.pod_builder")
|
329
341
|
paths.reject! { |t| t.match(/pod-builder-.*\/Example\/#{File.basename(Configuration.base_path)}\/\.pod_builder$/i) }
|
330
342
|
raise "\n\nToo many .pod_builder found `#{paths.join("\n")}`\n".red if paths.count > 1
|
331
|
-
|
332
|
-
|
343
|
+
|
344
|
+
path = paths.count > 0 ? File.dirname(paths.first) : nil
|
345
|
+
@@podbuilder_path_cache = path
|
346
|
+
|
347
|
+
return path
|
333
348
|
end
|
334
349
|
end
|
335
350
|
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
|
@@ -521,3 +426,18 @@ module PodBuilder
|
|
521
426
|
end
|
522
427
|
end
|
523
428
|
end
|
429
|
+
|
430
|
+
# CocoaPods seems to hard code the development language to english
|
431
|
+
# By monkey patching the project save we make sure that the to manually rewrite the
|
432
|
+
# development language if it has been manually specified in PodBuilder's configuration
|
433
|
+
class Xcodeproj::Project
|
434
|
+
alias_method :swz_save, :save
|
435
|
+
|
436
|
+
def save(save_path = nil)
|
437
|
+
if development_language = PodBuilder::Configuration.development_language
|
438
|
+
root_object.development_region = development_language
|
439
|
+
end
|
440
|
+
|
441
|
+
swz_save(save_path)
|
442
|
+
end
|
443
|
+
end
|
data/lib/pod_builder/podfile.rb
CHANGED
@@ -3,8 +3,6 @@ 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
|
|
@@ -254,8 +252,6 @@ module PodBuilder
|
|
254
252
|
podfile_content = Podfile.update_project_entries(podfile_content, Podfile.method(:podfile_path_transform))
|
255
253
|
podfile_content = Podfile.update_require_entries(podfile_content, Podfile.method(:podfile_path_transform))
|
256
254
|
|
257
|
-
podfile_content = add_pre_install_actions(podfile_content)
|
258
|
-
|
259
255
|
project_podfile_path = PodBuilder::project_path("Podfile")
|
260
256
|
File.write(project_podfile_path, podfile_content)
|
261
257
|
end
|
@@ -273,8 +269,6 @@ module PodBuilder
|
|
273
269
|
podfile_content = Podfile.update_project_entries(podfile_content, Podfile.method(:podfile_path_transform))
|
274
270
|
podfile_content = Podfile.update_require_entries(podfile_content, Podfile.method(:podfile_path_transform))
|
275
271
|
|
276
|
-
podfile_content = add_pre_install_actions(podfile_content)
|
277
|
-
|
278
272
|
project_podfile_path = PodBuilder::project_path("Podfile")
|
279
273
|
File.write(project_podfile_path, podfile_content)
|
280
274
|
end
|
@@ -375,7 +369,9 @@ module PodBuilder
|
|
375
369
|
return
|
376
370
|
end
|
377
371
|
|
378
|
-
File.read(podfile_path)
|
372
|
+
content = File.read(podfile_path)
|
373
|
+
|
374
|
+
content.each_line do |line|
|
379
375
|
stripped_line = strip_line(line)
|
380
376
|
unless !stripped_line.start_with?("#")
|
381
377
|
next
|
@@ -386,6 +382,10 @@ module PodBuilder
|
|
386
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
|
387
383
|
end
|
388
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
|
389
389
|
end
|
390
390
|
|
391
391
|
def self.resolve_pod_names(names, all_buildable_items)
|
@@ -511,8 +511,12 @@ module PodBuilder
|
|
511
511
|
return add(PODBUILDER_LOCK_ACTION, "pre_install", podfile_content)
|
512
512
|
end
|
513
513
|
|
514
|
-
def self.
|
515
|
-
|
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
|
516
520
|
end
|
517
521
|
|
518
522
|
def self.add(entries, marker, podfile_content)
|
@@ -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,10 +66,6 @@ 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
|
66
|
-
|
67
|
-
# workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
|
68
|
-
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
|
69
|
-
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_duplicate_framework_and_library_names) {}
|
70
69
|
end
|
71
70
|
|
72
71
|
post_install do |installer|
|
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
|
+
version: 5.1.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-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -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
|