pod-builder 4.4.5 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 206523829a1e643a482035efc05301e608b0516278c4f7edf8de424bc5fc5437
4
- data.tar.gz: 6b4297d656723d6f73bf2f0972485b9e2fcb717937a86e1191f943e69f4042da
3
+ metadata.gz: 6509579a498f83ab8b171004c0b3096a306b85b547392c2a6e16525d5f976fe9
4
+ data.tar.gz: 66bd6e1a6bf224b02ec05dbd51e5001ad0f2c29aa03baba43037e7d4616057fe
5
5
  SHA512:
6
- metadata.gz: 4ce7485f856f3be1f1b0f2a9a96144c9fe9eaadb1ccfd8d0db0be8019cb24e598a917baf376aaee6b5ef6c0a89f79228125e5b5cec75fd6b415cb4bd01878e0c
7
- data.tar.gz: 6e1a110a204c3cb7e41803590743b6c5f1515ad16aafa0f05afd7ad167853f700d8029b18aec423dae2f3efe6ec22e822a653e3afc2b455835c3446666dab749
6
+ metadata.gz: bbd9e59727c97c102429d4af1fe1b6a2c2e67c8b4460fd52582b6b3f0410abb6788340c3821d931d46524795a67e13102612f3444e9e44c2c4078840c13ab13e
7
+ data.tar.gz: 59ff68c1e2b9130f647d25152ad9729105ffbc55e3e77d89e0221bf6bc06da45d612d258e46f1102e0f8d1e20cdb47704c88256b4ecbf0bba33593efed8184cc
@@ -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))
@@ -323,13 +323,21 @@ module PodBuilder
323
323
 
324
324
  return File.join(path, Configuration.configuration_filename)
325
325
  end
326
-
326
+
327
+ @@podbuilder_path_cache = nil
327
328
  def self.podbuilder_path
329
+ if path = @@podbuilder_path_cache
330
+ return path
331
+ end
332
+
328
333
  paths = Dir.glob("#{PodBuilder::home}/**/.pod_builder")
329
334
  paths.reject! { |t| t.match(/pod-builder-.*\/Example\/#{File.basename(Configuration.base_path)}\/\.pod_builder$/i) }
330
335
  raise "\n\nToo many .pod_builder found `#{paths.join("\n")}`\n".red if paths.count > 1
331
-
332
- return paths.count > 0 ? File.dirname(paths.first) : nil
336
+
337
+ path = paths.count > 0 ? File.dirname(paths.first) : nil
338
+ @@podbuilder_path_cache = path
339
+
340
+ return path
333
341
  end
334
342
  end
335
343
  end
@@ -13,6 +13,7 @@ require 'pod_builder/configuration'
13
13
  require 'pod_builder/podspec'
14
14
  require 'pod_builder/licenses'
15
15
  require 'pod_builder/actions'
16
+ require 'pod_builder/swizzles'
16
17
 
17
18
  require 'core_ext/string'
18
19
 
@@ -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
@@ -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).each_line do |line|
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.add_pre_install_actions(podfile_content)
515
- return add(PRE_INSTALL_ACTIONS + [" "], "pre_install", podfile_content)
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|
@@ -1,3 +1,3 @@
1
1
  module PodBuilder
2
- VERSION = "4.4.5"
2
+ VERSION = "5.0.0"
3
3
  end
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.5
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-07-12 00:00:00.000000000 Z
11
+ date: 2022-09-14 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