cocoapods-pack 1.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.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.rubocop.yml +43 -0
  4. data/Gemfile +8 -0
  5. data/Gemfile.lock +149 -0
  6. data/LICENSE +202 -0
  7. data/README.md +116 -0
  8. data/Rakefile +8 -0
  9. data/cocoapods-pack.gemspec +34 -0
  10. data/endToEndPackMySample.sh +13 -0
  11. data/lib/cocoapods-pack/command/pack.rb +497 -0
  12. data/lib/cocoapods-pack/command.rb +19 -0
  13. data/lib/cocoapods-pack/env_parser.rb +23 -0
  14. data/lib/cocoapods-pack/find_follow.rb +106 -0
  15. data/lib/cocoapods-pack/gem_version.rb +21 -0
  16. data/lib/cocoapods-pack/spec_generator.rb +154 -0
  17. data/lib/cocoapods-pack/xcode_builder.rb +193 -0
  18. data/lib/cocoapods-pack/zip_file_generator.rb +56 -0
  19. data/lib/cocoapods_pack.rb +19 -0
  20. data/lib/cocoapods_plugin.rb +19 -0
  21. data/local_pod.rb +7 -0
  22. data/packMySample.sh +8 -0
  23. data/samples/CLIConsumer/CLIConsumer/dummy.swift +1 -0
  24. data/samples/CLIConsumer/CLIConsumer/main.m +10 -0
  25. data/samples/CLIConsumer/CLIConsumer.xcodeproj/project.pbxproj +329 -0
  26. data/samples/CLIConsumer/CLIConsumer.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  27. data/samples/CLIConsumer/CLIConsumer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  28. data/samples/CLIConsumer/CLIConsumer.xcodeproj/xcshareddata/xcschemes/CLIConsumer.xcscheme +88 -0
  29. data/samples/CLIConsumer/CLIConsumer.xcworkspace/contents.xcworkspacedata +10 -0
  30. data/samples/CLIConsumer/CLIConsumer.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  31. data/samples/CLIConsumer/Podfile +9 -0
  32. data/samples/CLIConsumer/build.sh +13 -0
  33. data/samples/MySample/MIT +1 -0
  34. data/samples/MySample/MySample/Internal/MySample_Internal.h +1 -0
  35. data/samples/MySample/MySample/MyObjCInSwiftSample.swift +7 -0
  36. data/samples/MySample/MySample/MySample.h +7 -0
  37. data/samples/MySample/MySample/MySample.m +10 -0
  38. data/samples/MySample/MySample/MySwiftSample.swift +7 -0
  39. data/samples/MySample/MySample.podspec +45 -0
  40. data/samples/MySample/MySample.xcodeproj/project.pbxproj +379 -0
  41. data/samples/MySample/MySample.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  42. data/samples/MySample/MySampleTests/Info.plist +24 -0
  43. data/samples/MySample/python/a.py +1 -0
  44. data/samples/MySample/python/subpython/b.py +1 -0
  45. data/samples/MySample/resources/a.png +1 -0
  46. data/samples/MySample/resources/lets/go/nuts/b.png +1 -0
  47. data/samples/MySample/resources/lets/go/runit.png +0 -0
  48. data/spec/acceptance_spec.rb +22 -0
  49. data/spec/env_parser_spec.rb +18 -0
  50. data/spec/spec_generator_spec.rb +247 -0
  51. data/spec/spec_helper.rb +47 -0
  52. data/spec/xcode_builder_spec.rb +113 -0
  53. metadata +207 -0
@@ -0,0 +1,247 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+ require 'ostruct'
5
+ require 'tempfile'
6
+ require_relative '../lib/cocoapods-pack/spec_generator'
7
+
8
+ describe_with_private_methods SpecGenerator do
9
+ def source_spec(opts = {})
10
+ fixed_root = {
11
+ name: 'MySample',
12
+ dependencies: [],
13
+ attributes_hash: { 'name' => 'MySample' }.merge(opts[:attributes_hash] || {})
14
+ }
15
+ OpenStruct.new(fixed_root.merge(opts[:root] || {}))
16
+ end
17
+
18
+ context 'for dynamic frameworks' do
19
+ let(:use_frameworks) { true }
20
+ temp_file = Tempfile.new('MySample.zip')
21
+
22
+ it 'generates a ruby podspec' do
23
+ artifact_repo_url = 'http://example.com/MySample.zip'
24
+ spec = SpecGenerator.new source_podspec, artifact_repo_url, temp_file
25
+ expect(spec.generate_ruby_string).to eq(expected_output)
26
+ expect(spec.generate.to_pretty_json).to eq(Pod::Specification.from_string(expected_output, 'name.podspec').to_pretty_json)
27
+ end
28
+
29
+ it 'works with multiple platforms' do
30
+ source_podspec = source_spec
31
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
32
+ spec.add_platform(Pod::Platform.new(:ios, '8.0'), 'MySample.xcframework')
33
+ spec.add_platform(Pod::Platform.new(:osx), 'MySample.xcframework')
34
+ spec.add_platform(Pod::Platform.new(:watchos, '3.0'), 'MySample.xcframework')
35
+ expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
36
+ Pod::Spec.new do |s|
37
+ s.name = 'MySample'
38
+ s.source = {:http=>"url/MySample.zip", :sha256=>"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
39
+
40
+ s.ios.deployment_target = '8.0'
41
+ s.ios.vendored_frameworks = 'ios/MySample.xcframework'
42
+
43
+ s.osx.deployment_target = nil
44
+ s.osx.vendored_frameworks = 'osx/MySample.xcframework'
45
+
46
+ s.watchos.deployment_target = '3.0'
47
+ s.watchos.vendored_frameworks = 'watchos/MySample.xcframework'
48
+ end
49
+ )
50
+ expect(spec.generate_ruby_string).to eq(expected_output)
51
+ expect(spec.generate.to_pretty_json).to eq(Pod::Specification.from_string(expected_output, 'name.podspec').to_pretty_json)
52
+ end
53
+
54
+ it 'works with a single platform' do
55
+ source_podspec = source_spec
56
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
57
+ spec.add_platform(Pod::Platform.new(:ios), 'MySample.xcframework')
58
+ expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
59
+ Pod::Spec.new do |s|
60
+ s.name = 'MySample'
61
+ s.source = {:http=>"url/MySample.zip", :sha256=>"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
62
+
63
+ s.platform = :ios
64
+
65
+ s.ios.vendored_frameworks = 'ios/MySample.xcframework'
66
+ end
67
+ )
68
+ expect(spec.generate_ruby_string).to eq(expected_output)
69
+ expect(spec.generate.to_pretty_json).to eq(Pod::Specification.from_string(expected_output, 'name.podspec').to_pretty_json)
70
+ end
71
+
72
+ it 'works with dependencies' do
73
+ source_podspec = source_spec(root: { dependencies: [Pod::Dependency.new('Dependency1', ['~> 1.0']),
74
+ Pod::Dependency.new('Dependency2', ['>= 0']),
75
+ Pod::Dependency.new('Dependency3', ['>= 0', '< 2.0'])] })
76
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
77
+ expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
78
+ Pod::Spec.new do |s|
79
+ s.name = 'MySample'
80
+ s.source = {:http=>"url/MySample.zip", :sha256=>"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
81
+
82
+ s.dependency 'Dependency1', '~> 1.0'
83
+ s.dependency 'Dependency2', '>= 0'
84
+ s.dependency 'Dependency3', '< 2.0', '>= 0'
85
+ end
86
+ )
87
+ expect(spec.generate_ruby_string).to eq(expected_output)
88
+ expect(spec.generate.to_pretty_json).to eq(Pod::Specification.from_string(expected_output, 'name.podspec').to_pretty_json)
89
+ end
90
+
91
+ it 'works with vendored_libraries' do
92
+ source_podspec = source_spec(attributes_hash: { 'vendored_libraries' => ['lib1.a', 'lib2.a'] })
93
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
94
+ expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
95
+ Pod::Spec.new do |s|
96
+ s.name = 'MySample'
97
+ s.source = {:http=>"url/MySample.zip", :sha256=>"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
98
+ s.vendored_libraries = 'lib1.a', 'lib2.a'
99
+ end
100
+ )
101
+ expect(spec.generate_ruby_string).to eq(expected_output)
102
+ expect(spec.generate.to_pretty_json).to eq(Pod::Specification.from_string(expected_output, 'name.podspec').to_pretty_json)
103
+ end
104
+
105
+ it 'works with platform vendored_libraries' do
106
+ source_podspec = source_spec(attributes_hash: { 'ios' => { 'vendored_libraries' => 'ioslib.a' } })
107
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
108
+ spec.add_platform(Pod::Platform.new(:ios), 'MySample.xcframework')
109
+ expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
110
+ Pod::Spec.new do |s|
111
+ s.name = 'MySample'
112
+ s.source = {:http=>"url/MySample.zip", :sha256=>"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
113
+
114
+ s.platform = :ios
115
+
116
+ s.ios.vendored_frameworks = 'ios/MySample.xcframework'
117
+ s.ios.vendored_libraries = 'ioslib.a'
118
+ end
119
+ )
120
+ expect(spec.generate_ruby_string).to eq(expected_output)
121
+ expect(spec.generate.to_pretty_json).to eq(Pod::Specification.from_string(expected_output, 'name.podspec').to_pretty_json)
122
+ end
123
+
124
+ it 'works with vendored_frameworks' do
125
+ source_podspec = source_spec(attributes_hash: { 'vendored_frameworks' => ['lib1.framework', 'lib2.framework'] })
126
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
127
+ expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
128
+ Pod::Spec.new do |s|
129
+ s.name = 'MySample'
130
+ s.source = {:http=>"url/MySample.zip", :sha256=>"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
131
+ s.vendored_frameworks = 'lib1.framework', 'lib2.framework'
132
+ end
133
+ )
134
+ expect(spec.generate_ruby_string).to eq(expected_output)
135
+ expect(spec.generate.to_pretty_json).to eq(Pod::Specification.from_string(expected_output, 'name.podspec').to_pretty_json)
136
+ end
137
+
138
+ it 'works with platform vendored_frameworks' do
139
+ source_podspec = source_spec(attributes_hash: { 'ios' => { 'vendored_frameworks' => 'ioslib.framework' } })
140
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
141
+ spec.add_platform(Pod::Platform.new(:ios), 'MySample.xcframework')
142
+ expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
143
+ Pod::Spec.new do |s|
144
+ s.name = 'MySample'
145
+ s.source = {:http=>"url/MySample.zip", :sha256=>"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
146
+
147
+ s.platform = :ios
148
+
149
+ s.ios.vendored_frameworks = 'ios/MySample.xcframework', 'ioslib.framework'
150
+ end
151
+ )
152
+ expect(spec.generate_ruby_string).to eq(expected_output)
153
+ expect(spec.generate.to_pretty_json).to eq(Pod::Specification.from_string(expected_output, 'name.podspec').to_pretty_json)
154
+ end
155
+
156
+ it 'works with glob paths' do
157
+ source_podspec = source_spec(attributes_hash: { 'ios' => { 'vendored_libraries' => '*.a' } })
158
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
159
+ spec.add_platform(Pod::Platform.new(:ios), 'MySample.xcframework')
160
+ expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
161
+ Pod::Spec.new do |s|
162
+ s.name = 'MySample'
163
+ s.source = {:http=>"url/MySample.zip", :sha256=>"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
164
+
165
+ s.platform = :ios
166
+
167
+ s.ios.vendored_frameworks = 'ios/MySample.xcframework'
168
+ s.ios.vendored_libraries = '*.a'
169
+ end
170
+ )
171
+ expect(spec.generate_ruby_string).to eq(expected_output)
172
+ expect(spec.generate.to_pretty_json).to eq(Pod::Specification.from_string(expected_output, 'name.podspec').to_pretty_json)
173
+ end
174
+
175
+ it 'works with resources' do
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
178
+ expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
179
+ Pod::Spec.new do |s|
180
+ s.name = 'MySample'
181
+ s.source = {:http=>"url/MySample.zip", :sha256=>"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
182
+ s.resources = 'a.png'
183
+ s.preserve_paths = 'script.sh', 'run.sh'
184
+ end
185
+ )
186
+ expect(spec.generate_ruby_string).to eq(expected_output)
187
+ expect(spec.generate.to_pretty_json).to eq(Pod::Specification.from_string(expected_output, 'name.podspec').to_pretty_json)
188
+ end
189
+
190
+ xit 'works with module maps and static libraries' do
191
+ source_podspec = source_spec(root: { module_map: 'module.modulemap' })
192
+ spec = SpecGenerator.new source_podspec, 'url/MySample.zip', temp_file
193
+ spec.add_platform(Pod::Platform.new(:ios, '7.0'), 'MySample.xcframework')
194
+ expected_output = %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
195
+ Pod::Spec.new do |s|
196
+ s.name = 'MySample'
197
+ s.source = {:http=>"url/MySample.zip", :sha256=>"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
198
+
199
+ s.platform = :ios, '7.0'
200
+
201
+ s.ios.module_map = 'ios/include/module.modulemap'
202
+ s.ios.vendored_frameworks = 'ios/MySample.xcframework'
203
+ end
204
+ )
205
+ expect(spec.generate_ruby_string).to eq(expected_output)
206
+ expect(spec.generate.to_pretty_json).to eq(Pod::Specification.from_string(expected_output, 'name.podspec').to_pretty_json)
207
+ end
208
+ end
209
+
210
+ let :source_podspec do
211
+ description = <<-DESCRIPTION
212
+ A longer description of MySample in Markdown format.
213
+ It's lines.
214
+ DESCRIPTION
215
+ source_spec(attributes_hash: { 'name' => 'MySample',
216
+ 'version' => '0.0.1',
217
+ 'summary' => 'A short description of MySample.',
218
+ 'description' => description,
219
+ 'homepage' => 'http://squareup.com/',
220
+ 'license' =>
221
+ { 'type' => 'MIT',
222
+ 'text' => "Copyright 2012\nPermission is granted to...\n" },
223
+ 'authors' => { 'Jack Dorsey' => 'notsoeasytogivethisaway@gmail.com' },
224
+ 'swift_versions' => '5.0',
225
+ 'platforms' => { 'ios' => nil },
226
+ 'source' => { 'git' => 'local only', 'tag' => '0.0.1' },
227
+ 'source_files' => ['MySample', 'MySample/**/*.{h,m,swift}'],
228
+ 'exclude_files' => 'MySample/Exclude',
229
+ 'artifact_repo_url' => 'http://example.com/my.zip' })
230
+ end
231
+
232
+ let :expected_output do
233
+ %(# Generated by cocoapods-pack #{CocoapodsPack::VERSION} - Do not manually modify.
234
+ Pod::Spec.new do |s|
235
+ s.name = 'MySample'
236
+ s.version = '0.0.1'
237
+ s.summary = 'A short description of MySample.'
238
+ s.license = {"type"=>"MIT", "text"=>"Copyright 2012\\nPermission is granted to...\\n"}
239
+ s.authors = {"Jack Dorsey"=>"notsoeasytogivethisaway@gmail.com"}
240
+ s.homepage = 'http://squareup.com/'
241
+ s.description = 'A longer description of MySample in Markdown format.\\nIt\\'s lines.\\n'
242
+ s.source = {:http=>"http://example.com/MySample.zip", :sha256=>"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
243
+ s.swift_versions = '5.0'
244
+ end
245
+ )
246
+ end
247
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/setup'
4
+ require 'pp'
5
+ require 'rspec'
6
+ require 'cocoapods'
7
+
8
+ module Kernel
9
+ # Like describe, but makes all private/protected instance methods of the clazz public
10
+ def describe_with_private_methods(clazz, *additional_desc, &block)
11
+ if clazz.is_a?(Module)
12
+ methods = clazz.private_instance_methods(false) + clazz.protected_methods(false)
13
+ clazz.send(:public, *methods)
14
+ end
15
+ describe(clazz, *additional_desc, &block)
16
+ end
17
+ end
18
+
19
+ module Pod
20
+ # Disable the wrapping so the output is deterministic in the tests.
21
+ #
22
+ UI.disable_wrap = true
23
+
24
+ # Redirects the messages to an internal store.
25
+ #
26
+ module UI
27
+ @output = ''
28
+ @warnings = ''
29
+
30
+ class << self
31
+ attr_accessor :output
32
+ attr_accessor :warnings
33
+
34
+ def puts(message = '')
35
+ @output << "#{message}\n"
36
+ end
37
+
38
+ def warn(message = '', _actions = [])
39
+ @warnings << "#{message}\n"
40
+ end
41
+
42
+ def print(message)
43
+ @output << message
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,113 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+ require_relative '../lib/cocoapods-pack/xcode_builder'
5
+
6
+ describe_with_private_methods XcodeBuilder do
7
+ let(:xcodebuild_opts) { nil }
8
+
9
+ subject do
10
+ ui = spy
11
+ XcodeBuilder.new('xcodeproject_path', xcodebuild_opts, 'xcodebuild_outdir', ui)
12
+ end
13
+
14
+ it 'breaks when giving a bad platform' do
15
+ expect { subject.build(:windows, 'target') }.to raise_error("Unknown platform: 'windows'")
16
+ end
17
+
18
+ it 'raises BuildError if shellout fails' do
19
+ expect { subject.build(:windows, 'target') }.to raise_error("Unknown platform: 'windows'")
20
+ end
21
+
22
+ it 'breaks with unknown type' do
23
+ builder = subject
24
+ mock_status = instance_double(Process::Status, success?: false, exitstatus: 42)
25
+ allow(builder).to receive(:warn)
26
+ allow(builder).to receive(:shellout).and_return(['error stderr', mock_status])
27
+ expected_error_message = "Failed to execute 'xcodebuild this will totally fail'. Exit status: 42"
28
+ expect { builder.run('xcodebuild this will totally fail') }.to raise_error(XcodeBuilder::BuildError, expected_error_message)
29
+ end
30
+
31
+ it 'executes xcodebuild in shell for osx' do
32
+ builder = subject
33
+ allow(builder).to receive(:run)
34
+ builder.build(:osx, 'PodsTarget')
35
+ expect(builder).to have_received(:run).with(%w[xcodebuild ONLY_ACTIVE_ARCH=NO SKIP_INSTALL=NO
36
+ BUILD_LIBRARY_FOR_DISTRIBUTION=YES
37
+ -project xcodeproject_path
38
+ -scheme "PodsTarget"
39
+ -configuration Release
40
+ EXCLUDED_SOURCE_FILE_NAMES=*-dummy.m
41
+ -destination "generic/platform=macOS"
42
+ archive
43
+ -archivePath xcodebuild_outdir/PodsTarget.xcarchive].join(' '))
44
+ end
45
+
46
+ it 'executes xcodebuild in shell for ios' do
47
+ builder = subject
48
+ allow(builder).to receive(:run)
49
+ builder.build(:ios, 'PodsTarget')
50
+ expect(builder).to have_received(:run).twice
51
+ expect(builder).to have_received(:run).with(%w[xcodebuild ONLY_ACTIVE_ARCH=NO SKIP_INSTALL=NO
52
+ BUILD_LIBRARY_FOR_DISTRIBUTION=YES
53
+ -project xcodeproject_path
54
+ -scheme "PodsTarget"
55
+ -configuration Release
56
+ EXCLUDED_SOURCE_FILE_NAMES=*-dummy.m
57
+ -destination "generic/platform=iOS Simulator"
58
+ archive
59
+ -archivePath xcodebuild_outdir/PodsTarget-simulator.xcarchive].join(' '))
60
+ expect(builder).to have_received(:run).with(%w[xcodebuild ONLY_ACTIVE_ARCH=NO SKIP_INSTALL=NO
61
+ BUILD_LIBRARY_FOR_DISTRIBUTION=YES
62
+ -project xcodeproject_path
63
+ -scheme "PodsTarget"
64
+ -configuration Release
65
+ EXCLUDED_SOURCE_FILE_NAMES=*-dummy.m
66
+ -destination "generic/platform=iOS"
67
+ archive
68
+ -archivePath xcodebuild_outdir/PodsTarget-device.xcarchive].join(' '))
69
+ end
70
+
71
+ it 'executes xcodebuild in shell for watchos' do
72
+ builder = subject
73
+ allow(builder).to receive(:run)
74
+ builder.build(:watchos, 'PodsTarget')
75
+ expect(builder).to have_received(:run).twice
76
+ expect(builder).to have_received(:run).with(%w[xcodebuild ONLY_ACTIVE_ARCH=NO SKIP_INSTALL=NO
77
+ BUILD_LIBRARY_FOR_DISTRIBUTION=YES
78
+ -project xcodeproject_path
79
+ -scheme "PodsTarget"
80
+ -configuration Release
81
+ EXCLUDED_SOURCE_FILE_NAMES=*-dummy.m
82
+ -destination "generic/platform=watchOS Simulator"
83
+ archive
84
+ -archivePath xcodebuild_outdir/PodsTarget-simulator.xcarchive].join(' '))
85
+ expect(builder).to have_received(:run).with(%w[xcodebuild ONLY_ACTIVE_ARCH=NO SKIP_INSTALL=NO
86
+ BUILD_LIBRARY_FOR_DISTRIBUTION=YES
87
+ -project xcodeproject_path
88
+ -scheme "PodsTarget"
89
+ -configuration Release
90
+ EXCLUDED_SOURCE_FILE_NAMES=*-dummy.m
91
+ -destination "generic/platform=watchOS"
92
+ archive
93
+ -archivePath xcodebuild_outdir/PodsTarget-device.xcarchive].join(' '))
94
+ end
95
+
96
+ context 'with non-nil xcodebuild_opts' do
97
+ let(:xcodebuild_opts) { 'CODE_SIGNING_REQUIRED=NO' }
98
+ it 'passes xcodebuild_opts to xcodebuild' do
99
+ allow(subject).to receive(:run)
100
+ subject.build(:osx, 'PodsTarget')
101
+ expect(subject).to have_received(:run).with(%w[xcodebuild ONLY_ACTIVE_ARCH=NO SKIP_INSTALL=NO
102
+ BUILD_LIBRARY_FOR_DISTRIBUTION=YES
103
+ -project xcodeproject_path
104
+ -scheme "PodsTarget"
105
+ -configuration Release
106
+ EXCLUDED_SOURCE_FILE_NAMES=*-dummy.m
107
+ -destination "generic/platform=macOS"
108
+ CODE_SIGNING_REQUIRED=NO
109
+ archive
110
+ -archivePath xcodebuild_outdir/PodsTarget.xcarchive].join(' '))
111
+ end
112
+ end
113
+ end
metadata ADDED
@@ -0,0 +1,207 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cocoapods-pack
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Square Inc.
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-11-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activesupport
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '5.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '5.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: cocoapods
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '1.10'
48
+ - - "<"
49
+ - !ruby/object:Gem::Version
50
+ version: '2.0'
51
+ type: :development
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '1.10'
58
+ - - "<"
59
+ - !ruby/object:Gem::Version
60
+ version: '2.0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: pry
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '0.10'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '0.10'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rake
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '13.0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '13.0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: rspec
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '3.0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ 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
+ description: |
118
+ A CocoaPods plugin that converts a given podspec into its binary version.
119
+ For a given podspec, a zip file will be produced containing the binary representation of the original podspec sources.
120
+ Each platform is packed as an `xcframework` within the zip file.
121
+ Other attributes such as `resource_bundles` specified in the source podspec will also be packed.
122
+ A binary podspec is also generated that can be published to a CocoaPods specs repo.
123
+ email:
124
+ executables: []
125
+ extensions: []
126
+ extra_rdoc_files: []
127
+ files:
128
+ - ".gitignore"
129
+ - ".rubocop.yml"
130
+ - Gemfile
131
+ - Gemfile.lock
132
+ - LICENSE
133
+ - README.md
134
+ - Rakefile
135
+ - cocoapods-pack.gemspec
136
+ - endToEndPackMySample.sh
137
+ - lib/cocoapods-pack/command.rb
138
+ - lib/cocoapods-pack/command/pack.rb
139
+ - lib/cocoapods-pack/env_parser.rb
140
+ - lib/cocoapods-pack/find_follow.rb
141
+ - lib/cocoapods-pack/gem_version.rb
142
+ - lib/cocoapods-pack/spec_generator.rb
143
+ - lib/cocoapods-pack/xcode_builder.rb
144
+ - lib/cocoapods-pack/zip_file_generator.rb
145
+ - lib/cocoapods_pack.rb
146
+ - lib/cocoapods_plugin.rb
147
+ - local_pod.rb
148
+ - packMySample.sh
149
+ - samples/CLIConsumer/CLIConsumer.xcodeproj/project.pbxproj
150
+ - samples/CLIConsumer/CLIConsumer.xcodeproj/project.xcworkspace/contents.xcworkspacedata
151
+ - samples/CLIConsumer/CLIConsumer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
152
+ - samples/CLIConsumer/CLIConsumer.xcodeproj/xcshareddata/xcschemes/CLIConsumer.xcscheme
153
+ - samples/CLIConsumer/CLIConsumer.xcworkspace/contents.xcworkspacedata
154
+ - samples/CLIConsumer/CLIConsumer.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
155
+ - samples/CLIConsumer/CLIConsumer/dummy.swift
156
+ - samples/CLIConsumer/CLIConsumer/main.m
157
+ - samples/CLIConsumer/Podfile
158
+ - samples/CLIConsumer/build.sh
159
+ - samples/MySample/MIT
160
+ - samples/MySample/MySample.podspec
161
+ - samples/MySample/MySample.xcodeproj/project.pbxproj
162
+ - samples/MySample/MySample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
163
+ - samples/MySample/MySample/Internal/MySample_Internal.h
164
+ - samples/MySample/MySample/MyObjCInSwiftSample.swift
165
+ - samples/MySample/MySample/MySample.h
166
+ - samples/MySample/MySample/MySample.m
167
+ - samples/MySample/MySample/MySwiftSample.swift
168
+ - samples/MySample/MySampleTests/Info.plist
169
+ - samples/MySample/python/a.py
170
+ - samples/MySample/python/subpython/b.py
171
+ - samples/MySample/resources/a.png
172
+ - samples/MySample/resources/lets/go/nuts/b.png
173
+ - samples/MySample/resources/lets/go/runit.png
174
+ - spec/acceptance_spec.rb
175
+ - spec/env_parser_spec.rb
176
+ - spec/spec_generator_spec.rb
177
+ - spec/spec_helper.rb
178
+ - spec/xcode_builder_spec.rb
179
+ homepage: https://github.com/square/cocoapods-pack
180
+ licenses:
181
+ - Apache-2.0
182
+ metadata: {}
183
+ post_install_message:
184
+ rdoc_options: []
185
+ require_paths:
186
+ - lib
187
+ required_ruby_version: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - ">="
190
+ - !ruby/object:Gem::Version
191
+ version: 2.5.0
192
+ required_rubygems_version: !ruby/object:Gem::Requirement
193
+ requirements:
194
+ - - ">="
195
+ - !ruby/object:Gem::Version
196
+ version: '0'
197
+ requirements: []
198
+ rubygems_version: 3.0.9
199
+ signing_key:
200
+ specification_version: 4
201
+ summary: Converts a source podspec into its binary form.
202
+ test_files:
203
+ - spec/acceptance_spec.rb
204
+ - spec/env_parser_spec.rb
205
+ - spec/spec_generator_spec.rb
206
+ - spec/spec_helper.rb
207
+ - spec/xcode_builder_spec.rb