cocoapods-spm 0.1.19 → 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: 390b8c7e38195ff62a087854cda9996df342143f395c2cb9d47b4885e71e952d
4
- data.tar.gz: 5d10f327d7371ac4ef872c5fef2a0f6304e5c1b7b180220d179edac2224ef30f
3
+ metadata.gz: b986d459ae804be2fc06ff417e617b8ae13448b9518ffc6bd47e10ffb54c9686
4
+ data.tar.gz: 271ae72c80ce65582fd40c7da64df2e8038292a26d95da72d38c237441ae4604
5
5
  SHA512:
6
- metadata.gz: 87a3a5ca9dd2f3945d6b1c6c86e75c4a99a6251ae98c650f2fd27f1034959c9bcaf8aa4d62152f88fcde827afe60b11c1f43097024256eda4ef1aa2596ce0841
7
- data.tar.gz: 4dd2b1f719cc17e0b0173912f2e0217b30ba23e7fa383ba27378946f539c26d4340a0eb5b6d3ab6f363c50ab7d88173c7ec6c2f0b4e342aeb2ac0157606f6036
6
+ metadata.gz: d47f81c3534a3a9e283ef04818281e577afd97b2b7776f64788f464ac42915e7a236f458347b9f98577a13746398c119519d2570c48d8ab8e603e84ce2285fca
7
+ data.tar.gz: c26c2bfc9be5d7037b9c40464882edabd2c74615e644365f9ca8aa36e087e29ae2fcabfb42183e24ebc36538c60cd349584239fccae370129d745b35ef85f86e
@@ -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.19
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-09-07 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