cocoapods-pack 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
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
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 7af3571aa4edfe460d66288d0fafbad633ae65dda5b32c23d49329553794766c
4
+ data.tar.gz: d0e3b054e1a139e537c7ab58102b87362a569e3d82cd0b72e663c3dc169d7e6b
5
+ SHA512:
6
+ metadata.gz: 7075f5e1bff6c872aa23677ce59023d6cacabe96af84d6e2e0323a5bd20879c591c9b9e09f407d8c5b67f7b0f15a8011d16bb3d8467b3498691deb36f59b53c6
7
+ data.tar.gz: d5c00f5e6765dc443489680b42b5a7f8a6ca852d9fdddc233e317673d0aef145e9497139d418b4c78b1b90355cd21894233c4f83c8629218d9a1602383b47599
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ .DS_Store
2
+ pkg
3
+ .idea/
4
+ *.gem
5
+ build
6
+ tmp
7
+ out
8
+ samples/CLIConsumer/build
9
+ samples/CLIConsumer/Pods
10
+ samples/CLIConsumer/Podfile.lock
data/.rubocop.yml ADDED
@@ -0,0 +1,43 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.5
3
+
4
+ Naming/FileName:
5
+ Exclude:
6
+ - 'samples/MySample/MySample.podspec'
7
+
8
+ Metrics/LineLength:
9
+ Max: 336
10
+
11
+ Metrics/BlockLength:
12
+ Max: 1500
13
+
14
+ Metrics/ClassLength:
15
+ Enabled: false
16
+
17
+ Metrics/MethodLength:
18
+ Max: 100
19
+
20
+ Metrics/CyclomaticComplexity:
21
+ Enabled: false
22
+
23
+ Metrics/PerceivedComplexity:
24
+ Enabled: false
25
+
26
+ Metrics/AbcSize:
27
+ Enabled: false
28
+
29
+ AssignmentInCondition:
30
+ Enabled: false
31
+
32
+ Style/Documentation:
33
+ Enabled: false
34
+
35
+ Metrics/ParameterLists:
36
+ Enabled: false
37
+
38
+ Lint/PercentStringArray:
39
+ Exclude:
40
+ - 'spec/xcode_builder_spec.rb'
41
+
42
+ Layout/HeredocIndentation:
43
+ Enabled: false
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in cocoapods-pack.gemspec
6
+ gemspec
7
+
8
+ gem 'rubocop', '0.93.0'
data/Gemfile.lock ADDED
@@ -0,0 +1,149 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ cocoapods-pack (1.0.0)
5
+ rubyzip (~> 1.1)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ CFPropertyList (3.0.4)
11
+ rexml
12
+ activesupport (5.2.6)
13
+ concurrent-ruby (~> 1.0, >= 1.0.2)
14
+ i18n (>= 0.7, < 2)
15
+ minitest (~> 5.1)
16
+ tzinfo (~> 1.1)
17
+ addressable (2.8.0)
18
+ public_suffix (>= 2.0.2, < 5.0)
19
+ algoliasearch (1.27.5)
20
+ httpclient (~> 2.8, >= 2.8.3)
21
+ json (>= 1.5.1)
22
+ ast (2.4.2)
23
+ atomos (0.1.3)
24
+ claide (1.0.3)
25
+ cocoapods (1.11.2)
26
+ addressable (~> 2.8)
27
+ claide (>= 1.0.2, < 2.0)
28
+ cocoapods-core (= 1.11.2)
29
+ cocoapods-deintegrate (>= 1.0.3, < 2.0)
30
+ cocoapods-downloader (>= 1.4.0, < 2.0)
31
+ cocoapods-plugins (>= 1.0.0, < 2.0)
32
+ cocoapods-search (>= 1.0.0, < 2.0)
33
+ cocoapods-trunk (>= 1.4.0, < 2.0)
34
+ cocoapods-try (>= 1.1.0, < 2.0)
35
+ colored2 (~> 3.1)
36
+ escape (~> 0.0.4)
37
+ fourflusher (>= 2.3.0, < 3.0)
38
+ gh_inspector (~> 1.0)
39
+ molinillo (~> 0.8.0)
40
+ nap (~> 1.0)
41
+ ruby-macho (>= 1.0, < 3.0)
42
+ xcodeproj (>= 1.21.0, < 2.0)
43
+ cocoapods-core (1.11.2)
44
+ activesupport (>= 5.0, < 7)
45
+ addressable (~> 2.8)
46
+ algoliasearch (~> 1.0)
47
+ concurrent-ruby (~> 1.1)
48
+ fuzzy_match (~> 2.0.4)
49
+ nap (~> 1.0)
50
+ netrc (~> 0.11)
51
+ public_suffix (~> 4.0)
52
+ typhoeus (~> 1.0)
53
+ cocoapods-deintegrate (1.0.5)
54
+ cocoapods-downloader (1.5.1)
55
+ cocoapods-plugins (1.0.0)
56
+ nap
57
+ cocoapods-search (1.0.1)
58
+ cocoapods-trunk (1.6.0)
59
+ nap (>= 0.8, < 2.0)
60
+ netrc (~> 0.11)
61
+ cocoapods-try (1.2.0)
62
+ coderay (1.1.3)
63
+ colored2 (3.1.2)
64
+ concurrent-ruby (1.1.9)
65
+ diff-lcs (1.4.4)
66
+ escape (0.0.4)
67
+ ethon (0.15.0)
68
+ ffi (>= 1.15.0)
69
+ ffi (1.15.4)
70
+ fourflusher (2.3.1)
71
+ fuzzy_match (2.0.4)
72
+ gh_inspector (1.1.3)
73
+ httpclient (2.8.3)
74
+ i18n (1.8.11)
75
+ concurrent-ruby (~> 1.0)
76
+ json (2.6.1)
77
+ method_source (1.0.0)
78
+ minitest (5.14.4)
79
+ molinillo (0.8.0)
80
+ nanaimo (0.3.0)
81
+ nap (1.1.0)
82
+ netrc (0.11.0)
83
+ parallel (1.21.0)
84
+ parser (3.0.2.0)
85
+ ast (~> 2.4.1)
86
+ pry (0.14.1)
87
+ coderay (~> 1.1)
88
+ method_source (~> 1.0)
89
+ public_suffix (4.0.6)
90
+ rainbow (3.0.0)
91
+ rake (13.0.6)
92
+ regexp_parser (2.1.1)
93
+ rexml (3.2.5)
94
+ rspec (3.10.0)
95
+ rspec-core (~> 3.10.0)
96
+ rspec-expectations (~> 3.10.0)
97
+ rspec-mocks (~> 3.10.0)
98
+ rspec-core (3.10.1)
99
+ rspec-support (~> 3.10.0)
100
+ rspec-expectations (3.10.1)
101
+ diff-lcs (>= 1.2.0, < 2.0)
102
+ rspec-support (~> 3.10.0)
103
+ rspec-mocks (3.10.2)
104
+ diff-lcs (>= 1.2.0, < 2.0)
105
+ rspec-support (~> 3.10.0)
106
+ rspec-support (3.10.3)
107
+ rubocop (0.93.0)
108
+ parallel (~> 1.10)
109
+ parser (>= 2.7.1.5)
110
+ rainbow (>= 2.2.2, < 4.0)
111
+ regexp_parser (>= 1.8)
112
+ rexml
113
+ rubocop-ast (>= 0.6.0)
114
+ ruby-progressbar (~> 1.7)
115
+ unicode-display_width (>= 1.4.0, < 2.0)
116
+ rubocop-ast (1.13.0)
117
+ parser (>= 3.0.1.1)
118
+ ruby-macho (2.5.1)
119
+ ruby-progressbar (1.11.0)
120
+ rubyzip (1.3.0)
121
+ thread_safe (0.3.6)
122
+ typhoeus (1.4.0)
123
+ ethon (>= 0.9.0)
124
+ tzinfo (1.2.9)
125
+ thread_safe (~> 0.1)
126
+ unicode-display_width (1.8.0)
127
+ xcodeproj (1.21.0)
128
+ CFPropertyList (>= 2.3.3, < 4.0)
129
+ atomos (~> 0.1.3)
130
+ claide (>= 1.0.2, < 2.0)
131
+ colored2 (~> 3.1)
132
+ nanaimo (~> 0.3.0)
133
+ rexml (~> 3.2.4)
134
+
135
+ PLATFORMS
136
+ x86_64-darwin-20
137
+
138
+ DEPENDENCIES
139
+ activesupport (~> 5.0)
140
+ bundler (~> 2.0)
141
+ cocoapods (>= 1.10, < 2.0)
142
+ cocoapods-pack!
143
+ pry (~> 0.10)
144
+ rake (~> 13.0)
145
+ rspec (~> 3.0)
146
+ rubocop (= 0.93.0)
147
+
148
+ BUNDLED WITH
149
+ 2.2.29
data/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,116 @@
1
+ # cocoapods-pack
2
+
3
+ A CocoaPods plugin that converts a given podspec into its binary version.
4
+
5
+ For a given podspec, a zip file will be produced containing the binary representation of the original podspec sources. Each platform is packed as an `xcframework` within the zip file. Other attributes such as `resource_bundles` specified in the source podspec will also be packed. A binary podspec is also generated that can be published to a CocoaPods specs repo.
6
+
7
+ You may choose to use `cocoapods-pack` as a packaging tool and write your own Swift Package Manager `Package.swift` file for the generated package instead.
8
+
9
+ Finally, you may choose to write your own CocoaPods plugin that leverages `cocoapods-pack` to prebuild CocoaPods dependencies before integrating them into a project.
10
+
11
+
12
+ ## Installation
13
+
14
+ ```
15
+ gem install cocoapods-pack
16
+ ```
17
+
18
+ ## Usage
19
+ ```
20
+ $ pod pack SOURCE ARTIFACT_REPO_URL
21
+
22
+ Converts the provided `SOURCE` into a binary version with each platform packed
23
+ as an `xcframework`. The process includes installing a CocoaPods sandbox,
24
+ building it for device and simulator using the 'Release' configuration, zipping
25
+ the output and generating a new podspec that uses the `ARTIFACT_REPO_URL`
26
+ provided as the source. The generated podspec is also validated.
27
+
28
+ Options:
29
+
30
+ --use-static-frameworks Produce a framework that wraps a
31
+ static library from the source
32
+ files. By default dynamic
33
+ frameworks are used.
34
+ --generate-module-map If specified, instead of using
35
+ the default generated umbrella
36
+ module map one will be generated
37
+ based on the frameworks header
38
+ dirs.
39
+ --allow-warnings Lint validates even if warnings
40
+ are present.
41
+ --repo-update Force running `pod repo update`
42
+ before install.
43
+ --out-dir Optional directory to use to
44
+ output results into. Defaults to
45
+ current working directory.
46
+ --skip-validation Skips linting the generated
47
+ binary podspec.
48
+ --skip-platforms Comma-delimited platforms to
49
+ skip when creating a binary.
50
+ --xcodebuild-opts Options to be passed through to
51
+ xcodebuild.
52
+ --use-json Use JSON for the generated
53
+ binary podspec.
54
+ --sources=https://github.com/artsy/Specs,master The sources from which to pull
55
+ dependant pods (defaults to all
56
+ available repos). Multiple
57
+ sources must be comma-delimited.
58
+ --allow-root Allows CocoaPods to run as root
59
+ --silent Show nothing
60
+ --verbose Show more debugging information
61
+ --no-ansi Show output without ANSI codes
62
+ --help Show help banner of specified
63
+ command
64
+ ```
65
+
66
+ ## Examples
67
+
68
+ To run some of the examples in this repo make sure you run `bundle install` first.
69
+
70
+ ```
71
+ bundle exec pod pack samples/MySample/MySample.podspec https://url/to/MySample.zip --out-dir=out
72
+ ```
73
+
74
+ If you wish to skip a specific platform the source podspec provides:
75
+
76
+ ```
77
+ bundle exec pod pack samples/MySample/MySample.podspec https://url/to/MySample.zip --skip-platforms=watchos --out-dir=out
78
+ ```
79
+
80
+ Using static linking:
81
+
82
+ ```
83
+ bundle exec pod pack samples/MySample/MySample.podspec https://url/to/MySample.zip --use-static-frameworks --out-dir=out
84
+ ```
85
+
86
+ Additional `xcodebuild` options can be passed using `--xcodebuild-opts `, example:
87
+
88
+ ```
89
+ bundle exec pod pack samples/MySample/MySample.podspec https://url/to/MySample.zip --use-static-frameworks --xcodebuild-opts=ENABLE_BITCODE=NO --out-dir=out
90
+ ```
91
+
92
+ You may also specify a remote podspec without the need to clone its sources locally, for example:
93
+
94
+ ```
95
+ bundle exec pod pack https://raw.githubusercontent.com/Alamofire/Alamofire/master/Alamofire.podspec https://url/to/Alamofire.zip --out-dir=out --allow-warnings
96
+ ```
97
+
98
+ ## Developing
99
+
100
+ Install Ruby >= 2.5.0 and set up with:
101
+
102
+ ```
103
+ $ bundle
104
+ ```
105
+
106
+ To run the unit tests use `rake`:
107
+
108
+ ```
109
+ $ bundle exec rake spec
110
+ ```
111
+
112
+ Or, for a more thorough output which include test names:
113
+
114
+ ```
115
+ $ bundle exec rspec --format d
116
+ ```
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rspec/core/rake_task'
4
+ require 'bundler/gem_tasks'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'cocoapods-pack/gem_version.rb'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'cocoapods-pack'
9
+ spec.version = CocoapodsPack::VERSION
10
+ spec.authors = ['Square Inc.']
11
+ spec.license = 'Apache-2.0'
12
+ spec.summary = 'Converts a source podspec into its binary form.'
13
+ spec.description = <<~DESC
14
+ A CocoaPods plugin that converts a given podspec into its binary version.
15
+ For a given podspec, a zip file will be produced containing the binary representation of the original podspec sources.
16
+ Each platform is packed as an `xcframework` within the zip file.
17
+ Other attributes such as `resource_bundles` specified in the source podspec will also be packed.
18
+ A binary podspec is also generated that can be published to a CocoaPods specs repo.
19
+ DESC
20
+ spec.homepage = 'https://github.com/square/cocoapods-pack'
21
+ spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
22
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
23
+ spec.require_paths = ['lib']
24
+
25
+ spec.required_ruby_version = '>= 2.5.0'
26
+ spec.add_development_dependency 'bundler', '~> 2.0'
27
+
28
+ spec.add_development_dependency 'activesupport', '~> 5.0'
29
+ spec.add_development_dependency 'cocoapods', '>= 1.10', '< 2.0'
30
+ spec.add_development_dependency 'pry', '~> 0.10'
31
+ spec.add_development_dependency 'rake', '~> 13.0'
32
+ spec.add_development_dependency 'rspec', '~> 3.0'
33
+ spec.add_dependency 'rubyzip', '~> 1.1'
34
+ end
@@ -0,0 +1,13 @@
1
+ #!/bin/bash
2
+
3
+ # Compiles and runs CLIConsumer mac app, which uses the MySample pod and ensures the binary version of MySample works end-to-end.
4
+
5
+ set -e
6
+ set -x
7
+
8
+ rm -rf out/
9
+ echo Building MySample...
10
+ bundle exec ruby local_pod.rb pack --allow-warnings samples/MySample/MySample.podspec --out-dir=out https://example.com --no-repo-update --use-static-frameworks --skip-platforms=watchos --skip-validation $@
11
+
12
+ echo Building CLIConsumer, which uses MySample pod
13
+ ./samples/CLIConsumer/build.sh