cocoapods-packager-next 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b39b25d09d8ddf9ab427081c92687a5b2533c850cb4b97b127285da621e96c63
4
- data.tar.gz: 10ecd53da7141d845a141dbcb7478bf6a28b0249647a60c404f9fc4270f71da5
3
+ metadata.gz: ab20cc4922694c7ee7c1128e7f1966e6c885255ea77bd1bc4a3f9bf804848a35
4
+ data.tar.gz: fe2b58139807305344bd341b7b86c9b6a1f2ea8bd62e71c02edf3512f3def9d4
5
5
  SHA512:
6
- metadata.gz: 5c83e0cd890fb26d6459786d3c36393e6683434aced3f0459d1ecbc612f57c06d937158b6df842ddc28f3716275803bf074c121c493f3c21060d9d946556e6d6
7
- data.tar.gz: d1a8da1698884374d4a0a164eb7399100b4825ac7a763363fab126b8ca8b3a7edb6c8ef5f209b8338d8ef190f00f725d7b3979dd394800a5d6f4ffe7ebf6ad60
6
+ metadata.gz: aff27f5d69858aec0112dca5aa26814e2d2258e67c4e52cb9b28da760eb70b988270d2afc691caac8b7ea587f431029cfda1d6e96623cf21ed10b3eb9cf731a3
7
+ data.tar.gz: d5ac45f643bdf6377d40b73fdf3cfd42fc516ec264b0609c3018840228e412ac2a179bac6f5385777648d607fb04cc49080318fa4bc3f811e4b245d3598ddd12
@@ -7,7 +7,8 @@ Gem::Specification.new do |spec|
7
7
  spec.name = 'cocoapods-packager-next'
8
8
  spec.version = Pod::Packager::VERSION
9
9
  spec.authors = ['Kyle Fuller', 'Boris Bügling', 'Chenguang Wang']
10
- spec.summary = 'A new version of cocoapods-packager, fix many adaptation issues with the new version of Xcode, CocoaPods plugin which allows you to generate a framework or static library from a podspec.'
10
+ spec.summary = 'An alternative to cocoapods-packager, adapted to the latest Xcode.
11
+ CocoaPods plugin which allows you to generate a framework or static library from a podspec.'
11
12
  spec.homepage = 'https://github.com/wwwcg/cocoapods-packager-next'
12
13
  spec.license = 'MIT'
13
14
  spec.files = `git ls-files`.split($/)
@@ -144,10 +144,10 @@ module Pod
144
144
  static_libs = static_libs_in_sandbox('build') + static_libs_in_sandbox('build-sim') + vendored_libraries
145
145
  libs = ios_architectures.map do |arch|
146
146
  library = "#{@static_sandbox_root}/build/package-#{arch}.a"
147
- `libtool -arch_only #{arch} -static -o #{library} #{static_libs.join(' ')}`
148
- library
149
- end
150
-
147
+ `libtool -arch_only #{arch} -static -o #{library} #{static_libs.join(' ')} 2> /dev/null`
148
+ library if File.exist?(library)
149
+ end.compact
150
+
151
151
  `lipo -create -output #{output} #{libs.join(' ')}`
152
152
  end
153
153
 
@@ -198,13 +198,14 @@ module Pod
198
198
  Dir.glob("#{headers_source_root}/**/*.h").
199
199
  each { |h| `ditto #{h} #{@fwk.headers_path}/#{h.sub(headers_source_root, '')}` }
200
200
 
201
+ module_map = nil
201
202
  # If custom 'module_map' is specified add it to the framework distribution
202
203
  # otherwise check if a header exists that is equal to 'spec.name', if so
203
204
  # create a default 'module_map' one using it.
204
- if !@spec.module_map.nil?
205
+ if @spec.module_map
205
206
  module_map_file = @file_accessors.flat_map(&:module_map).first
206
207
  module_map = File.read(module_map_file) if Pathname(module_map_file).exist?
207
- elsif File.exist?("#{@public_headers_root}/#{@spec.name}/#{@spec.name}.h")
208
+ elsif @spec.module_map.nil? && File.exist?("#{@public_headers_root}/#{@spec.name}/#{@spec.name}.h")
208
209
  module_map = <<MAP
209
210
  framework module #{@spec.name} {
210
211
  umbrella header "#{@spec.name}.h"
@@ -277,16 +278,20 @@ MAP
277
278
 
278
279
  def vendored_libraries
279
280
  if @vendored_libraries
280
- @vendored_libraries
281
+ return @vendored_libraries
281
282
  end
282
283
  file_accessors = if @exclude_deps
284
+ puts "Excluding dependencies"
283
285
  @file_accessors
284
286
  else
287
+ puts "Including dependencies"
285
288
  @static_installer.pod_targets.flat_map(&:file_accessors)
286
289
  end
287
290
  libs = file_accessors.flat_map(&:vendored_static_frameworks).map { |f| f + f.basename('.*') } || []
288
291
  libs += file_accessors.flat_map(&:vendored_static_libraries)
289
292
  @vendored_libraries = libs.compact.map(&:to_s)
293
+ puts "Vendored libraries: #{@vendored_libraries}"
294
+
290
295
  @vendored_libraries
291
296
  end
292
297
 
@@ -304,10 +309,28 @@ MAP
304
309
  end
305
310
 
306
311
  def ios_architectures
307
- archs = %w(x86_64 i386 arm64 armv7 armv7s)
312
+ xcode_version_string = `xcodebuild -version`.strip.split()[1]
313
+ xcode_version = Pod::Version.new(xcode_version_string)
314
+ UI.puts "current xcode version: #{xcode_version}"
315
+ archs = if xcode_version >= Pod::Version.new('14.0')
316
+ # i386 & armv7/armv7s has been deprecated in Xcode14
317
+ %w(x86_64 arm64 arm64e)
318
+ elsif xcode_version < Pod::Version.new('10.0')
319
+ %w(x86_64 i386 arm64 armv7 armv7s)
320
+ else
321
+ %w(x86_64 i386 arm64 arm64e armv7 armv7s)
322
+ end
323
+ UI.puts "Initial architectures: #{archs}"
324
+
308
325
  vendored_libraries.each do |library|
309
- archs = `lipo -info #{library}`.split & archs
326
+ library_archs = `lipo -info #{library}`.split
327
+ UI.puts "Architectures for #{library}: #{library_archs}"
328
+
329
+ archs = library_archs & archs
330
+ UI.puts "Intersected architectures: #{archs}"
310
331
  end
332
+
333
+ UI.puts "Final architectures: #{archs}"
311
334
  archs
312
335
  end
313
336
 
@@ -1,5 +1,5 @@
1
1
  module Pod
2
2
  module Packager
3
- VERSION = '2.0.0'.freeze
3
+ VERSION = '2.0.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-packager-next
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Fuller
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-01-15 00:00:00.000000000 Z
13
+ date: 2024-01-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: cocoapods
@@ -164,9 +164,8 @@ requirements: []
164
164
  rubygems_version: 3.4.10
165
165
  signing_key:
166
166
  specification_version: 4
167
- summary: A new version of cocoapods-packager, fix many adaptation issues with the
168
- new version of Xcode, CocoaPods plugin which allows you to generate a framework
169
- or static library from a podspec.
167
+ summary: An alternative to cocoapods-packager, adapted to the latest Xcode. CocoaPods
168
+ plugin which allows you to generate a framework or static library from a podspec.
170
169
  test_files:
171
170
  - spec/command/error_spec.rb
172
171
  - spec/command/package_spec.rb