cocoapods-spm 0.1.18 → 0.1.20

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: 18ebba2af193586dd3ab51895ac5142432388c4d7eab1bf5212b192ccfebfbbb
4
- data.tar.gz: 04e37f5fdd1a9822b6759202d351af855e7047767f02c5a170cf3203ac13b499
3
+ metadata.gz: b986d459ae804be2fc06ff417e617b8ae13448b9518ffc6bd47e10ffb54c9686
4
+ data.tar.gz: 271ae72c80ce65582fd40c7da64df2e8038292a26d95da72d38c237441ae4604
5
5
  SHA512:
6
- metadata.gz: 7c1049403a328d3365e2841e2091d6967129f75f0d835b19029861f893738306d2540c7f7cbaca75b45044ee5885d28b6070dd132d9295bc9a4b91abc10e1d75
7
- data.tar.gz: d1cab52bf70efda3a8c965193a792405ee155a636a80502afcdab623ebb3925b74ec31ec078605188250ee64985abad565bb844fc5558f71b6312dae6582c0f9
6
+ metadata.gz: d47f81c3534a3a9e283ef04818281e577afd97b2b7776f64788f464ac42915e7a236f458347b9f98577a13746398c119519d2570c48d8ab8e603e84ce2285fca
7
+ data.tar.gz: c26c2bfc9be5d7037b9c40464882edabd2c74615e644365f9ca8aa36e087e29ae2fcabfb42183e24ebc36538c60cd349584239fccae370129d745b35ef85f86e
@@ -27,6 +27,19 @@ module Pod
27
27
  variant_prefix = underlying.spec_label(spec).sub("#{underlying.name}-", "")
28
28
  underlying.xcconfig_path("#{variant_prefix}.#{variant}")
29
29
  end
30
+
31
+ %w[
32
+ copy_resources_script_path
33
+ copy_resources_script_input_files_path
34
+ copy_resources_script_output_files_path
35
+ embed_frameworks_script_path
36
+ embed_frameworks_script_input_files_path
37
+ embed_frameworks_script_output_files_path
38
+ ].each do |name|
39
+ define_method(name) do |*_args|
40
+ underlying.send("#{name}_for_spec", spec)
41
+ end
42
+ end
30
43
  end
31
44
  end
32
45
  end
@@ -7,8 +7,11 @@ module Pod
7
7
  def update_script(options = {})
8
8
  script_name = options[:name]
9
9
  content_by_target = options[:content_by_target]
10
+ targets = aggregate_targets + pod_targets.flat_map do |t|
11
+ t.test_specs.map { |s| Target::NonLibrary.new(underlying: t, spec: s) }
12
+ end
10
13
 
11
- aggregate_targets.each do |target|
14
+ targets.each do |target|
12
15
  lines, input_paths, output_paths = content_by_target.call(target)
13
16
  next if input_paths.empty?
14
17
 
@@ -21,8 +24,9 @@ module Pod
21
24
  # Update input/output files
22
25
  user_build_configurations.each_key do |config|
23
26
  append_contents = lambda do |method_name, contents|
24
- target.send(method_name, config).open("a") do |f|
25
- contents.each { |p| f << "\n" << p }
27
+ target.send(method_name, config).open("r+") do |f|
28
+ existing = f.readlines(chomp: true)
29
+ contents.each { |p| f << "\n" << p unless existing.include?(p) }
26
30
  end
27
31
  end
28
32
  append_contents.call("#{script_name}_input_files_path", input_paths)
@@ -114,17 +114,12 @@ module Pod
114
114
  raise Informative, "Unexpected dependency type. Must be either `byName`, `target`, or `product`."
115
115
  end
116
116
  next [] unless match_platform?(hash[type][-1], platform)
117
-
118
- name = hash[type][0]
119
- pkg_name = hash.key?("product") ? hash["product"][1] : self.pkg_name
120
- pkg_desc = pkg_desc_cache[pkg_name]
121
- find_by_target = -> { pkg_desc.targets.select { |t| t.name == name } }
122
- find_by_product = -> { pkg_desc.targets_of_product(name) }
123
- next find_by_target.call if hash.key?("target")
124
- next find_by_product.call if hash.key?("product")
125
-
126
- # byName, could be either a target or a product
127
- next find_by_target.call || find_by_product.call
117
+ next find_dependency_targets(
118
+ pkg_desc_cache,
119
+ hash[type][0],
120
+ pkg_name: hash.key?("product") ? hash["product"][1] : nil,
121
+ type: type
122
+ )
128
123
  end
129
124
  end
130
125
 
@@ -165,6 +160,25 @@ module Pod
165
160
  platform_name = platform.to_s == 'osx' ? 'macos' : platform.to_s
166
161
  condition["platformNames"].include?(platform_name)
167
162
  end
163
+
164
+ def find_dependency_targets(pkg_desc_cache, name, pkg_name: nil, type: nil)
165
+ pkg_desc = pkg_desc_cache[pkg_name || self.pkg_name]
166
+ find_by_target = lambda do
167
+ pkg_desc.targets.select { |t| t.name == name }
168
+ end
169
+
170
+ find_by_product = lambda do
171
+ pkg_desc.targets_of_product(name)
172
+ end
173
+
174
+ find_by_name = lambda do
175
+ pkg_desc_cache.values.flat_map(&:targets).select { |t| t.name == name }
176
+ end
177
+
178
+ return find_by_target.call if type == "target"
179
+ return find_by_product.call if type == "product"
180
+ return find_by_name.call
181
+ end
168
182
  end
169
183
  end
170
184
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-spm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.18
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thuyen Trinh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-10 00:00:00.000000000 Z
11
+ date: 2025-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xcodeproj