cocoapods-pack 1.0.0 → 1.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: 7af3571aa4edfe460d66288d0fafbad633ae65dda5b32c23d49329553794766c
4
- data.tar.gz: d0e3b054e1a139e537c7ab58102b87362a569e3d82cd0b72e663c3dc169d7e6b
3
+ metadata.gz: 9402ffd0f5fec5e0a6f11e69df8ee7f7bca805926f8d1a33d557242f31750bac
4
+ data.tar.gz: 44bf92af47545da8ead9ed34b3bbd424ca3ed4a189ccf5b18ee304d78dd8fdb8
5
5
  SHA512:
6
- metadata.gz: 7075f5e1bff6c872aa23677ce59023d6cacabe96af84d6e2e0323a5bd20879c591c9b9e09f407d8c5b67f7b0f15a8011d16bb3d8467b3498691deb36f59b53c6
7
- data.tar.gz: d5c00f5e6765dc443489680b42b5a7f8a6ca852d9fdddc233e317673d0aef145e9497139d418b4c78b1b90355cd21894233c4f83c8629218d9a1602383b47599
6
+ metadata.gz: 14835189ad2ec33212a4522b69121856dd0f9a6e9c3ea2b837156342c94aebf20fa69960d9382fd2e668249d31ad6f0178e11c3c9ee4a8b750ab0746621e9a39
7
+ data.tar.gz: 9457e753fc27a00cd9609e9ab2fcba821aabdaff9973dd5ae85660a972066dade90b3d7f78a6467715319802b9bd2d127d0a7a75b8d67d63e647f1a21f73a395
data/Gemfile.lock CHANGED
@@ -1,13 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-pack (1.0.0)
5
- rubyzip (~> 1.1)
4
+ cocoapods-pack (1.0.1)
5
+ cocoapods (>= 1.10, < 2.0)
6
+ rubyzip (~> 2.0)
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
9
10
  specs:
10
- CFPropertyList (3.0.4)
11
+ CFPropertyList (3.0.5)
11
12
  rexml
12
13
  activesupport (5.2.6)
13
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -81,7 +82,7 @@ GEM
81
82
  nap (1.1.0)
82
83
  netrc (0.11.0)
83
84
  parallel (1.21.0)
84
- parser (3.0.2.0)
85
+ parser (3.0.3.1)
85
86
  ast (~> 2.4.1)
86
87
  pry (0.14.1)
87
88
  coderay (~> 1.1)
@@ -89,7 +90,7 @@ GEM
89
90
  public_suffix (4.0.6)
90
91
  rainbow (3.0.0)
91
92
  rake (13.0.6)
92
- regexp_parser (2.1.1)
93
+ regexp_parser (2.2.0)
93
94
  rexml (3.2.5)
94
95
  rspec (3.10.0)
95
96
  rspec-core (~> 3.10.0)
@@ -113,11 +114,11 @@ GEM
113
114
  rubocop-ast (>= 0.6.0)
114
115
  ruby-progressbar (~> 1.7)
115
116
  unicode-display_width (>= 1.4.0, < 2.0)
116
- rubocop-ast (1.13.0)
117
+ rubocop-ast (1.14.0)
117
118
  parser (>= 3.0.1.1)
118
119
  ruby-macho (2.5.1)
119
120
  ruby-progressbar (1.11.0)
120
- rubyzip (1.3.0)
121
+ rubyzip (2.3.2)
121
122
  thread_safe (0.3.6)
122
123
  typhoeus (1.4.0)
123
124
  ethon (>= 0.9.0)
@@ -138,7 +139,6 @@ PLATFORMS
138
139
  DEPENDENCIES
139
140
  activesupport (~> 5.0)
140
141
  bundler (~> 2.0)
141
- cocoapods (>= 1.10, < 2.0)
142
142
  cocoapods-pack!
143
143
  pry (~> 0.10)
144
144
  rake (~> 13.0)
@@ -23,12 +23,13 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ['lib']
24
24
 
25
25
  spec.required_ruby_version = '>= 2.5.0'
26
- spec.add_development_dependency 'bundler', '~> 2.0'
26
+
27
+ spec.add_dependency 'cocoapods', '>= 1.10', '< 2.0'
28
+ spec.add_dependency 'rubyzip', '~> 2.0'
27
29
 
28
30
  spec.add_development_dependency 'activesupport', '~> 5.0'
29
- spec.add_development_dependency 'cocoapods', '>= 1.10', '< 2.0'
31
+ spec.add_development_dependency 'bundler', '~> 2.0'
30
32
  spec.add_development_dependency 'pry', '~> 0.10'
31
33
  spec.add_development_dependency 'rake', '~> 13.0'
32
34
  spec.add_development_dependency 'rspec', '~> 3.0'
33
- spec.add_dependency 'rubyzip', '~> 1.1'
34
35
  end
@@ -41,6 +41,10 @@ module Pod
41
41
  Dir.glob(File.join(path, 'BCSymbolMaps', '*.bcsymbolmap'))
42
42
  end
43
43
 
44
+ def empty?
45
+ Dir.empty?(File.join(path, 'Products'))
46
+ end
47
+
44
48
  def modules_path
45
49
  "#{framework_path}/Modules"
46
50
  end
@@ -119,6 +123,7 @@ module Pod
119
123
  FileUtils.rm_rf(stage_dir)
120
124
  FileUtils.mkdir_p(stage_dir)
121
125
  source_urls = @source_urls.map { |url| Config.instance.sources_manager.source_with_name_or_url(url) }.map(&:url)
126
+ staged_sources = false
122
127
  available_platforms(podspec).each do |platform|
123
128
  linkage = @use_static_frameworks ? :static : :dynamic
124
129
  podfile = podfile_from_spec(platform, podspec, source_urls, linkage, @is_local)
@@ -129,11 +134,14 @@ module Pod
129
134
  xcarchives = Dir.glob(File.join(xcodebuild_out_dir, '**', '*.xcarchive')).map do |path|
130
135
  XCArchive.new(path, podspec)
131
136
  end
132
- stage_platform_xcframework(platform, sandbox, podspec, xcarchives, xcodebuild_out_dir, stage_dir)
137
+ unless xcarchives.all?(&:empty?)
138
+ stage_platform_xcframework(platform, sandbox, podspec, xcarchives, xcodebuild_out_dir, stage_dir)
139
+ staged_sources = true
140
+ end
133
141
  end
134
142
  stage_additional_artifacts(podspec, stage_dir)
135
143
  zip_output_path = pack(stage_dir, @project_zips_dir, podspec.name)
136
- binary_podspec = generate_binary_podspec(podspec, stage_dir, zip_output_path)
144
+ binary_podspec = generate_binary_podspec(podspec, stage_dir, zip_output_path, staged_sources)
137
145
  validate_binary_podspec(binary_podspec)
138
146
  UI.message "Binary pod for #{podspec.name} created successfully!".green
139
147
  rescue XcodeBuilder::BuildError => e
@@ -212,9 +220,9 @@ module Pod
212
220
  copy_license(podspec, stage_dir)
213
221
  end
214
222
 
215
- def generate_binary_podspec(source_podspec, stage_dir, zip_output_path)
223
+ def generate_binary_podspec(source_podspec, stage_dir, zip_output_path, staged_sources)
216
224
  name = source_podspec.name
217
- spec_generator = SpecGenerator.new(source_podspec, @artifact_repo_url, zip_output_path)
225
+ spec_generator = SpecGenerator.new(source_podspec, @artifact_repo_url, zip_output_path, staged_sources)
218
226
  available_platforms(source_podspec).each do |platform|
219
227
  type = type_from_platform(platform)
220
228
  sandbox = @sandbox_map[platform.name]
@@ -17,5 +17,5 @@
17
17
  #
18
18
 
19
19
  module CocoapodsPack
20
- VERSION = '1.0.0'
20
+ VERSION = '1.0.1'
21
21
  end
@@ -27,12 +27,13 @@ class SpecGenerator
27
27
  vendored_libraries resource_bundles resources preserve_paths cocoapods_version swift_versions].freeze
28
28
  PLATFORM_ATTRIBUTES = %w[frameworks libraries requires_arc xcconfig pod_target_xcconfig user_target_xcconfig].freeze
29
29
 
30
- attr_reader :podspec_path, :platforms, :artifact_repo_url
30
+ attr_reader :podspec_path, :platforms, :artifact_repo_url, :staged_sources
31
31
 
32
- def initialize(source_podspec, artifact_repo_url, zip_output_path)
32
+ def initialize(source_podspec, artifact_repo_url, zip_output_path, staged_sources)
33
33
  @podspec_path = source_podspec
34
34
  @artifact_repo_url = artifact_repo_url
35
35
  @zip_output_path = zip_output_path
36
+ @staged_sources = staged_sources
36
37
  @platforms = []
37
38
  end
38
39
 
@@ -75,10 +76,12 @@ class SpecGenerator
75
76
  end
76
77
 
77
78
  def platform_spec_hash(platform_name, product_name, vendored_frameworks, vendored_libraries)
78
- {
79
- 'vendored_frameworks' => ["#{platform_name}/#{product_name}"] + vendored_frameworks,
80
- 'vendored_libraries' => vendored_libraries
81
- }
79
+ platform_hash = {}
80
+ platform_hash['vendored_frameworks'] ||= []
81
+ platform_hash['vendored_frameworks'] << "#{platform_name}/#{product_name}" if staged_sources
82
+ platform_hash['vendored_frameworks'] += vendored_frameworks
83
+ platform_hash['vendored_libraries'] = vendored_libraries
84
+ platform_hash
82
85
  end
83
86
 
84
87
  def platforms_sections
@@ -61,27 +61,27 @@ class XcodeBuilder
61
61
  user_interface.puts "\nBuilding #{target} for iOS...\n".yellow
62
62
  run(create_build_command(target, ios_sim_args, xcodebuild_args, :simulator))
63
63
  run(create_build_command(target, ios_device_args, xcodebuild_args, :device))
64
- user_interface.puts 'iOS build successful.'.green << "\n\n"
64
+ user_interface.puts(+'iOS build successful.'.green << "\n\n")
65
65
  end
66
66
 
67
67
  def build_osx(target, xcodebuild_args)
68
68
  user_interface.puts "\nBuilding #{target} for macOS...\n".yellow
69
69
  run(create_build_command(target, macos_args, xcodebuild_args))
70
- user_interface.puts 'macOS build successful.'.green << "\n\n"
70
+ user_interface.puts(+'macOS build successful.'.green << "\n\n")
71
71
  end
72
72
 
73
73
  def build_watchos(target, xcodebuild_args)
74
74
  user_interface.puts "\nBuilding #{target} for watchOS...\n".yellow
75
75
  run(create_build_command(target, watchos_sim_args, xcodebuild_args, :simulator))
76
76
  run(create_build_command(target, watchos_device_args, xcodebuild_args, :device))
77
- user_interface.puts 'watchOS build successful.'.green << "\n\n"
77
+ user_interface.puts(+'watchOS build successful.'.green << "\n\n")
78
78
  end
79
79
 
80
80
  def build_tvos(target, xcodebuild_args)
81
81
  user_interface.puts "\nBuilding #{target} for tvOS...\n".yellow
82
82
  run(create_build_command(target, tvos_sim_args, xcodebuild_args, :simulator))
83
83
  run(create_build_command(target, tvos_device_args, xcodebuild_args, :device))
84
- user_interface.puts 'tvOS build successful.'.green << "\n\n"
84
+ user_interface.puts(+'tvOS build successful.'.green << "\n\n")
85
85
  end
86
86
 
87
87
  def build_ios_settings(target, type)
@@ -21,14 +21,14 @@ describe_with_private_methods SpecGenerator do
21
21
 
22
22
  it 'generates a ruby podspec' do
23
23
  artifact_repo_url = 'http://example.com/MySample.zip'
24
- spec = SpecGenerator.new source_podspec, artifact_repo_url, temp_file
24
+ spec = SpecGenerator.new source_podspec, artifact_repo_url, temp_file, true
25
25
  expect(spec.generate_ruby_string).to eq(expected_output)
26
26
  expect(spec.generate.to_pretty_json).to eq(Pod::Specification.from_string(expected_output, 'name.podspec').to_pretty_json)
27
27
  end
28
28
 
29
29
  it 'works with multiple platforms' do
30
30
  source_podspec = source_spec
31
- spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
31
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file, true
32
32
  spec.add_platform(Pod::Platform.new(:ios, '8.0'), 'MySample.xcframework')
33
33
  spec.add_platform(Pod::Platform.new(:osx), 'MySample.xcframework')
34
34
  spec.add_platform(Pod::Platform.new(:watchos, '3.0'), 'MySample.xcframework')
@@ -53,7 +53,7 @@ end
53
53
 
54
54
  it 'works with a single platform' do
55
55
  source_podspec = source_spec
56
- spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
56
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file, true
57
57
  spec.add_platform(Pod::Platform.new(:ios), 'MySample.xcframework')
58
58
  expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
59
59
  Pod::Spec.new do |s|
@@ -73,7 +73,7 @@ end
73
73
  source_podspec = source_spec(root: { dependencies: [Pod::Dependency.new('Dependency1', ['~> 1.0']),
74
74
  Pod::Dependency.new('Dependency2', ['>= 0']),
75
75
  Pod::Dependency.new('Dependency3', ['>= 0', '< 2.0'])] })
76
- spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
76
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file, true
77
77
  expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
78
78
  Pod::Spec.new do |s|
79
79
  s.name = 'MySample'
@@ -90,7 +90,7 @@ end
90
90
 
91
91
  it 'works with vendored_libraries' do
92
92
  source_podspec = source_spec(attributes_hash: { 'vendored_libraries' => ['lib1.a', 'lib2.a'] })
93
- spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
93
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file, true
94
94
  expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
95
95
  Pod::Spec.new do |s|
96
96
  s.name = 'MySample'
@@ -104,7 +104,7 @@ end
104
104
 
105
105
  it 'works with platform vendored_libraries' do
106
106
  source_podspec = source_spec(attributes_hash: { 'ios' => { 'vendored_libraries' => 'ioslib.a' } })
107
- spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
107
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file, true
108
108
  spec.add_platform(Pod::Platform.new(:ios), 'MySample.xcframework')
109
109
  expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
110
110
  Pod::Spec.new do |s|
@@ -123,7 +123,7 @@ end
123
123
 
124
124
  it 'works with vendored_frameworks' do
125
125
  source_podspec = source_spec(attributes_hash: { 'vendored_frameworks' => ['lib1.framework', 'lib2.framework'] })
126
- spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
126
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file, true
127
127
  expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
128
128
  Pod::Spec.new do |s|
129
129
  s.name = 'MySample'
@@ -137,7 +137,7 @@ end
137
137
 
138
138
  it 'works with platform vendored_frameworks' do
139
139
  source_podspec = source_spec(attributes_hash: { 'ios' => { 'vendored_frameworks' => 'ioslib.framework' } })
140
- spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
140
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file, true
141
141
  spec.add_platform(Pod::Platform.new(:ios), 'MySample.xcframework')
142
142
  expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
143
143
  Pod::Spec.new do |s|
@@ -155,7 +155,7 @@ end
155
155
 
156
156
  it 'works with glob paths' do
157
157
  source_podspec = source_spec(attributes_hash: { 'ios' => { 'vendored_libraries' => '*.a' } })
158
- spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
158
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file, true
159
159
  spec.add_platform(Pod::Platform.new(:ios), 'MySample.xcframework')
160
160
  expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
161
161
  Pod::Spec.new do |s|
@@ -174,7 +174,7 @@ end
174
174
 
175
175
  it 'works with resources' do
176
176
  source_podspec = source_spec(attributes_hash: { 'resources' => ['a.png'], 'preserve_paths' => ['script.sh', 'run.sh'] })
177
- spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
177
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file, true
178
178
  expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
179
179
  Pod::Spec.new do |s|
180
180
  s.name = 'MySample'
@@ -189,7 +189,7 @@ end
189
189
 
190
190
  xit 'works with module maps and static libraries' do
191
191
  source_podspec = source_spec(root: { module_map: 'module.modulemap' })
192
- spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
192
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file, true
193
193
  spec.add_platform(Pod::Platform.new(:ios, '7.0'), 'MySample.xcframework')
194
194
  expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
195
195
  Pod::Spec.new do |s|
metadata CHANGED
@@ -1,23 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-pack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Square Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-17 00:00:00.000000000 Z
11
+ date: 2021-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: cocoapods
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '1.10'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: rubyzip
15
35
  requirement: !ruby/object:Gem::Requirement
16
36
  requirements:
17
37
  - - "~>"
18
38
  - !ruby/object:Gem::Version
19
39
  version: '2.0'
20
- type: :development
40
+ type: :runtime
21
41
  prerelease: false
22
42
  version_requirements: !ruby/object:Gem::Requirement
23
43
  requirements:
@@ -39,23 +59,17 @@ dependencies:
39
59
  - !ruby/object:Gem::Version
40
60
  version: '5.0'
41
61
  - !ruby/object:Gem::Dependency
42
- name: cocoapods
62
+ name: bundler
43
63
  requirement: !ruby/object:Gem::Requirement
44
64
  requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '1.10'
48
- - - "<"
65
+ - - "~>"
49
66
  - !ruby/object:Gem::Version
50
67
  version: '2.0'
51
68
  type: :development
52
69
  prerelease: false
53
70
  version_requirements: !ruby/object:Gem::Requirement
54
71
  requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- version: '1.10'
58
- - - "<"
72
+ - - "~>"
59
73
  - !ruby/object:Gem::Version
60
74
  version: '2.0'
61
75
  - !ruby/object:Gem::Dependency
@@ -100,20 +114,6 @@ dependencies:
100
114
  - - "~>"
101
115
  - !ruby/object:Gem::Version
102
116
  version: '3.0'
103
- - !ruby/object:Gem::Dependency
104
- name: rubyzip
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - "~>"
108
- - !ruby/object:Gem::Version
109
- version: '1.1'
110
- type: :runtime
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - "~>"
115
- - !ruby/object:Gem::Version
116
- version: '1.1'
117
117
  description: |
118
118
  A CocoaPods plugin that converts a given podspec into its binary version.
119
119
  For a given podspec, a zip file will be produced containing the binary representation of the original podspec sources.
@@ -195,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  - !ruby/object:Gem::Version
196
196
  version: '0'
197
197
  requirements: []
198
- rubygems_version: 3.0.9
198
+ rubygems_version: 3.1.6
199
199
  signing_key:
200
200
  specification_version: 4
201
201
  summary: Converts a source podspec into its binary form.