pod-builder 0.1.8.beta → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 883d322c0c5ffd3cf34a85d76a055f3a1200400243ae03b109cb93fd3d3fd8be
4
- data.tar.gz: b0237ad432feae58f2b222c4ece477c580425cdd4986ebf148106d3b272a0e3b
3
+ metadata.gz: 2a2b5d6848e10cdd2554d29689b00cbe7a9b8fa7566583143bc3f66aaab1b25e
4
+ data.tar.gz: f971ef9f6e5de1a05167baae0122f6f87466c96a7f98b037df6fd8f4a11bd4b8
5
5
  SHA512:
6
- metadata.gz: 7443c790eb55db4a7565cb846d53a9aea7cdb26e5077f9407c1eddcaa8e217beee1851888ad688b6d683ea65c6274a0abd9cca701b7e21575118fcf479a37013
7
- data.tar.gz: 2b455b666c9a690ef3682b810810e7fdf952c6d67846d193a8bead5b41402aa4afebaf24f3407dbb935461a5a14c1a15322a8a341bb992f15074195dc78e6947
6
+ metadata.gz: 5c496ac0b857343cb573230bcf3304fa83893000109bb5834df80c23c5c48a122d96476fef335c9073d94eb4a57b44b8a5c42aae8989ebfb488bc88cd372d1c5
7
+ data.tar.gz: c6a4109417bbabc92466a8e6f9d815de3caf206b403d2fe72647c2ae73dd06ac05defbfecb069137683dc89f57fcf0431f4a8f2ec73ff930c237da4d856ee310
@@ -8,33 +8,33 @@
8
8
  "name": "No Command",
9
9
  "type": "Ruby",
10
10
  "request": "launch",
11
- "cwd": "/Users/tomas/Documents/Xcode/Subito4",
11
+ "cwd": "~/Desktop",
12
12
  "useBundler": true,
13
13
  "program": "${workspaceRoot}/exe/pod_builder",
14
14
  "showDebuggerOutput": true,
15
15
  "pathToRDebugIDE": "/usr/bin/rdebug-ide",
16
16
  "args": [
17
-
17
+ "-v"
18
18
  ]
19
19
  },
20
20
  {
21
21
  "name": "Init",
22
22
  "type": "Ruby",
23
23
  "request": "launch",
24
- "cwd": "/Users/tomas/Documents/Xcode/Subito4",
24
+ "cwd": "~/Desktop",
25
25
  "useBundler": true,
26
26
  "program": "${workspaceRoot}/exe/pod_builder",
27
27
  "showDebuggerOutput": true,
28
28
  "pathToRDebugIDE": "/usr/bin/rdebug-ide",
29
29
  "args": [
30
- "init",
30
+ "init"
31
31
  ]
32
32
  },
33
33
  {
34
34
  "name": "Deintegrate",
35
35
  "type": "Ruby",
36
36
  "request": "launch",
37
- "cwd": "/Users/tomas/Documents/Xcode/Subito4",
37
+ "cwd": "~/Desktop",
38
38
  "useBundler": true,
39
39
  "program": "${workspaceRoot}/exe/pod_builder",
40
40
  "showDebuggerOutput": true,
@@ -47,7 +47,7 @@
47
47
  "name": "Build",
48
48
  "type": "Ruby",
49
49
  "request": "launch",
50
- "cwd": "/Users/tomas/Documents/Xcode/Subito4",
50
+ "cwd": "~/Desktop",
51
51
  "useBundler": true,
52
52
  "program": "${workspaceRoot}/exe/pod_builder",
53
53
  "showDebuggerOutput": true,
@@ -55,28 +55,29 @@
55
55
  "args": [
56
56
  "build",
57
57
  "-d",
58
- "AppNexusSDK/GoogleAdapterThatDependsOnGooglePod",
58
+ "ADvantage",
59
59
  ]
60
60
  },
61
61
  {
62
62
  "name": "Build All",
63
63
  "type": "Ruby",
64
64
  "request": "launch",
65
- "cwd": "/Users/tomas/Documents/Xcode/Subito4",
65
+ "cwd": "~/Desktop",
66
66
  "useBundler": true,
67
67
  "program": "${workspaceRoot}/exe/pod_builder",
68
68
  "showDebuggerOutput": true,
69
69
  "pathToRDebugIDE": "/usr/bin/rdebug-ide",
70
70
  "args": [
71
71
  "build_all",
72
- "-d"
72
+ "-d",
73
+ "--allow-warnings"
73
74
  ]
74
75
  },
75
76
  {
76
77
  "name": "Restore All",
77
78
  "type": "Ruby",
78
79
  "request": "launch",
79
- "cwd": "/Users/tomas/Documents/Xcode/Subito4",
80
+ "cwd": "~/Desktop",
80
81
  "useBundler": true,
81
82
  "program": "${workspaceRoot}/exe/pod_builder",
82
83
  "showDebuggerOutput": true,
@@ -90,7 +91,7 @@
90
91
  "name": "Clean",
91
92
  "type": "Ruby",
92
93
  "request": "launch",
93
- "cwd": "/Users/tomas/Documents/Xcode/Subito4",
94
+ "cwd": "~/Desktop",
94
95
  "useBundler": true,
95
96
  "program": "${workspaceRoot}/exe/pod_builder",
96
97
  "showDebuggerOutput": true,
@@ -103,7 +104,7 @@
103
104
  "name": "Install sources",
104
105
  "type": "Ruby",
105
106
  "request": "launch",
106
- "cwd": "/Users/tomas/Documents/Xcode/Subito4",
107
+ "cwd": "~/Desktop",
107
108
  "useBundler": true,
108
109
  "program": "${workspaceRoot}/exe/pod_builder",
109
110
  "showDebuggerOutput": true,
@@ -111,6 +112,60 @@
111
112
  "args": [
112
113
  "install_sources"
113
114
  ]
115
+ },
116
+ {
117
+ "name": "Generate podspec",
118
+ "type": "Ruby",
119
+ "request": "launch",
120
+ "cwd": "~/Desktop",
121
+ "useBundler": true,
122
+ "program": "${workspaceRoot}/exe/pod_builder",
123
+ "showDebuggerOutput": true,
124
+ "pathToRDebugIDE": "/usr/bin/rdebug-ide",
125
+ "args": [
126
+ "generate_podspec"
127
+ ]
128
+ },
129
+ {
130
+ "name": "Switch pod",
131
+ "type": "Ruby",
132
+ "request": "launch",
133
+ "cwd": "~/Desktop",
134
+ "useBundler": true,
135
+ "program": "${workspaceRoot}/exe/pod_builder",
136
+ "showDebuggerOutput": true,
137
+ "pathToRDebugIDE": "/usr/bin/rdebug-ide",
138
+ "args": [
139
+ "switch",
140
+ "-p",
141
+ "AFNetworking",
142
+ ]
143
+ },
144
+ {
145
+ "name": "Update LFS",
146
+ "type": "Ruby",
147
+ "request": "launch",
148
+ "cwd": "~/Desktop",
149
+ "useBundler": true,
150
+ "program": "${workspaceRoot}/exe/pod_builder",
151
+ "showDebuggerOutput": true,
152
+ "pathToRDebugIDE": "/usr/bin/rdebug-ide",
153
+ "args": [
154
+ "update_lfs",
155
+ ]
156
+ },
157
+ {
158
+ "name": "Synch Podfile",
159
+ "type": "Ruby",
160
+ "request": "launch",
161
+ "cwd": "~/Desktop",
162
+ "useBundler": true,
163
+ "program": "${workspaceRoot}/exe/pod_builder",
164
+ "showDebuggerOutput": true,
165
+ "pathToRDebugIDE": "/usr/bin/rdebug-ide",
166
+ "args": [
167
+ "synch_podfile",
168
+ ]
114
169
  }
115
170
  ]
116
171
  }
data/README.md CHANGED
@@ -1,45 +1,43 @@
1
1
  ## Beta tool: distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2
2
 
3
- # PodBuilder
3
+ # What is PodBuilder
4
4
 
5
- PodBuilder is a complementary tool to [CocoaPods](https://github.com/CocoaPods/CocoaPods) that allows to prebuild pods into frameworks which can then be included into a project’s repo. Instead of committing pod’s source code you add its compiled counterpart. While there is a size penalty in doing so, and some may argue that git isn’t designed to handle large binaries files (check [Git LFS](https://git-lfs.github.com) to overcome that), compilation times will decrease significantly because pod's source files no longer need to be recompiled _very often_. Additionally frameworks contain all architecture so they’re ready to be used both on any device and simulator.
5
+ PodBuilder is a complementary tool to [CocoaPods](https://github.com/CocoaPods/CocoaPods) that allows to prebuild pods into frameworks which can then be included into a project’s repo. Instead of committing pod’s source code you add its compiled counterpart. While there is a size penalty in doing so, which can be overcome by using [Git-LFS](#git-lfs), compilation times will decrease significantly because pod's source files no longer need to be recompiled _very often_. Additionally frameworks contain all architecture so they’re ready to be used both on any device and simulator.
6
6
 
7
- Depending on the size of the project and number of pods this can translate in a significant reduction of compilation times (for a large project we designed this tool for we saw a 5x improvement, but YMMV).
7
+ Depending on the size of the project and number of pods this can translate in a significant reduction of compilation times (for a large project we designed this tool for we saw a 50% faster compile times, but YMMV).
8
8
 
9
- ## Installation
9
+ # Installation
10
10
 
11
- Add this line to your application's Gemfile:
11
+ Like CocoaPods PodBuilder is built with Ruby and will be installable with default version of Ruby available on macOS.
12
12
 
13
- ```ruby
14
- gem 'pod-builder'
15
- ```
13
+ Unless you're using a Ruby version manager you should generally install using `sudo` as follows
16
14
 
17
- And then execute:
15
+ $ sudo gem install pod-builder
18
16
 
19
- $ bundle
17
+ You can the initialize your project to use the tool using the `init` command
20
18
 
21
- Or install it yourself as:
19
+ $ cd path-to-your-repo;
20
+ $ pod_builder init
22
21
 
23
- $ gem install pod-builder
22
+ This will add a _Frameworks_ folder which will contain all files needed and generated by the PodBuilder.
24
23
 
25
- ## Usage
24
+ ## Podfile
26
25
 
27
- The tool relies on 3 Podfiles
26
+ The workflow is very similar to the one you're used to with CocoaPods. The most significant difference is that PodBuilder relies on 3 Podfiles:
28
27
 
29
- 1. _Frameworks/Podfile_ (aka PodBuilder-Podfile): this is your original Podfile. This is still your master Podfile that you will update as needed and is used by PodBuilder to determine which versions and dependencies need to be compiled when prebuilding.
30
- 2. _Podfile_ (aka Application-Podfile): this one is based on the one above but will replace precompiled frameworks with references to the local PodBuilder podspec. It is the Podfile used by your app.
31
- 3. _Frameworks/Podfile.restore_ (aka Restore-Podfile): this acts as a sort of lockfile and reflects the current state of what is installed in the application, pinning pods to a particular tag or commit. This will be particularly useful until Swift reaches ABI stability, because when you check out an old revision of your code you won't be able to get your project running unless the Swift frameworks were compiled with a same version of Xcode you're currently using.
28
+ ### 1. Frameworks/Podfile (aka PodBuilder-Podfile)
32
29
 
33
- The nice thing of this setup is that you can quickly switch between the precompiled and the source code version of a pod. In the Application-Podfile the tool will automatically reference to the local podspec for a precompiled pod but will also leave the original source commented. When you need to get source code version you just switch the 2 comments and run `pod install`, for example when you need to debug a pod's internal implementation.
30
+ This is your original Podfile and remains your **master Podfile** that you will update as needed. It is used by PodBuilder to determine which versions and dependencies need to be compiled when prebuilding.
34
31
 
35
- As an example these are the 2 lines that are automatically added to the Application-Podfile:
32
+ ### 2. Podfile (aka Application-Podfile)
36
33
 
37
- ```ruby
38
- pod 'PodBuilder/AFNetworking', :path => '../Frameworks'
39
- # pod 'AFNetworking'
40
- ```
34
+ Based on the one above but will replace precompiled frameworks with references to the local PodBuilder podspec. **It is autogenerated and shouldn't be manually changed**
41
35
 
42
- ### Commands
36
+ ### 3. Frameworks/Podfile.restore (aka Restore-Podfile)
37
+
38
+ This acts as a sort of lockfile and reflects the current state of what is installed in the application, pinning pods to a particular tag or commit. This will be particularly useful until Swift reaches ABI stability, because when you check out an old revision of your code you won't be able to get your project running unless the Swift frameworks were compiled with a same version of Xcode you're currently using. This file is used internally by PodBuilder and shouldn't be manually changed. **It is autogenerated and shouldn't be manually changed**
39
+
40
+ ## Commands
43
41
 
44
42
  Podbuilder comes with a set of commands:
45
43
 
@@ -47,9 +45,11 @@ Podbuilder comes with a set of commands:
47
45
  - `deintegrate`: deintegrates PodBuilder's initialization
48
46
  - `build`: prebuilts a specific pod declared in the PodBuilder-Podfile
49
47
  - `build_all`: prebuilts all pods declared in the PodBuilder-Podfile
50
- - `restore_all`: rebuilts all pods declared in the Framework/Podfile.restore file
48
+ - `restore_all`: rebuilts all pods declared in the Restore-Podfile file
51
49
  - `install_sources`: installs sources of pods to debug into prebuild frameworks
50
+ - `switch`: switch between prebuilt, development or standard pod in the Application-Podfile
52
51
  - `clean`: removes unused prebuilt frameworks, dSYMs and source files added by install_sources
52
+ - `synch_podfile`: updates the Application with all pods declared in the PodBuilder-Podfile file
53
53
 
54
54
  Commands can be run from anywhere in your project's repo that is **required to be under git**.
55
55
 
@@ -63,10 +63,11 @@ The following will happen:
63
63
  - Copy your original Podfile to _Frameworks/Podfile_ (PodBuilder-Podfile)
64
64
  - Add an initially empty _PodBuilder.json_ configuration file
65
65
  - Modify the original Podfile (Application-Podfile) with some minor customizations
66
+ - Create/Update your Gemfile adding the `gem 'pod-builder'` entry
66
67
 
67
68
  #### `deintegrate` command
68
69
 
69
- This will revert `init`'s changes
70
+ This will revert `init`'s changes.
70
71
 
71
72
  #### `build` command
72
73
 
@@ -85,16 +86,31 @@ As `build` but will prebuild all pods defined in PodBuilder-Podfile.
85
86
 
86
87
  #### `restore_all` command
87
88
 
88
- Will recompile all pods to the versions defined in the Restore-Podfile.
89
+ Will recompile all pods to the versions defined in the Restore-Podfile. You would typically use this when checking out an older revision of your project that might need to rebuild frameworks (e.g. You're using a different version of the Swift compiler) to the exact same version at the time of the commit.
89
90
 
90
91
  #### `install_sources` command
91
92
 
92
93
  When using PodBuilder you loose ability to directly access to the source code of a pod. To overcome this limitation you can use this command which downloads the pod's source code to _Frameworks/Sources_ and with some [tricks](https://medium.com/@t.camin/debugging-prebuilt-frameworks-c9f52d42600b) restores the ability to step into the pods code. This can be very helpful to catch the exact location of a crash when it occurs (showing something more useful than assembly code). It is however advisable to switch to the original pod when doing any advanced debugging during development of code that involves a pod.
93
94
 
95
+ #### `switch` command
96
+
97
+ Once you prebuild a framework you can change the way it is integrated in your project.
98
+
99
+ Using the switch command you can choose to integrate it:
100
+
101
+ - standard. Reverts to the default one used by CocoaPods
102
+ - development. The _Development Pod_ used by CocoaPods
103
+ - prebuilt. Use the prebuilt pod
104
+
94
105
  #### `clean` command
95
106
 
96
107
  Deletes all unused files by PodBuilder, including .frameworks, .dSYMs and _Source_ repos.
97
108
 
109
+ #### `synch_podfile` command
110
+
111
+ Updates the Application with all pods declared in the PodBuilder-Podfile file. This can come in handy when adding a new pod to the PodBuilder-Podfile file you don't won't to prebuild straight away.
112
+
113
+
98
114
  # Configuration file
99
115
 
100
116
  _PodBuilder.json_ allows some advanced customizations.
@@ -119,17 +135,31 @@ As an example here we're setting `module_name` in Google's Advertising SDK:
119
135
  }
120
136
  ```
121
137
 
138
+ ### `skip_pods`
139
+
140
+ You may want to skip some pods to be prebuilt, you can do that as follows:
141
+
142
+ ```json
143
+ {
144
+ "skip_pods": [
145
+ "PodA"
146
+ ]
147
+ }
148
+ ```
149
+
150
+
122
151
  #### `build_settings`
123
152
 
124
153
  Xcode build settings to use. You can override the default values which are:
125
154
 
126
155
  ```json
127
156
  {
128
- "ENABLE_BITCODE": "NO",
129
- "CLANG_ENABLE_MODULE_DEBUGGING": "NO",
130
- "GCC_OPTIMIZATION_LEVEL": "s",
131
- "SWIFT_OPTIMIZATION_LEVEL": "-Osize",
132
- "SWIFT_COMPILATION_MODE": "singlefile"
157
+ "build_settings": {
158
+ "ENABLE_BITCODE": "NO",
159
+ "GCC_OPTIMIZATION_LEVEL": "s",
160
+ "SWIFT_OPTIMIZATION_LEVEL": "-Osize",
161
+ "SWIFT_COMPILATION_MODE": "singlefile"
162
+ }
133
163
  }
134
164
  ```
135
165
 
@@ -154,7 +184,7 @@ Like `build_settings` but per pod. Pod name can also refer to subspec.
154
184
 
155
185
  Specify which build system to use to compile frameworks. Either `Legacy` (standard build system) or `Latest` (new build system). Default value: `Legacy`.
156
186
 
157
- #### `license_file_name`
187
+ #### `license_filename`
158
188
 
159
189
  PodBuilder will create two license files a plist and a markdown file which contains the licenses of each pod specified in the PodBuilder-Podfile. Defailt value: `Pods-acknowledgements`(plist|md).
160
190
 
@@ -168,20 +198,60 @@ PodBuilder writes a plist and markdown license files of pods specified in the Po
168
198
  }
169
199
  ```
170
200
 
201
+ #### `subspecs_to_split`
202
+
203
+ Normally when multiple subspecs are specified in a target a single framework is produced. There are rare cases where you specify different subspecs in different targets: a typical case is subspec specifically designed for app extensions, where you want to use a subspec in the main app and another one in the app extension.
171
204
 
172
- # Under the hood
205
+ **Warning**: This will work properly only for static frameworks (_static_framework = true_ specified in the podspec). See [issue](https://github.com/CocoaPods/CocoaPods/issues/5708) and [issue](https://github.com/CocoaPods/CocoaPods/issues/5643)
206
+
207
+ ```json
208
+ {
209
+ "subspecs_to_split": ["Podname1/Subspec1", "Podname1/Subspec2", "Podname2/Subspec1", "Podname2/Subspec1"]
210
+ }
211
+ ```
212
+
213
+ #### `update_lfs_gitattributes` 
214
+
215
+ Adds files bigger than [`lfs_min_file_size_kb`](#lfs_min_file_size_kb) to _.gitattributes_ when using [Git-LFS](#git-lfs).
216
+
217
+
218
+ #### `lfs_min_file_size_kb`
219
+
220
+ Change the minimum file size to add files to _.gitattributes_ when using [Git-LFS](#git-lfs).
221
+
222
+ # Behind the scenes
173
223
 
174
224
  PodBuilder leverages CocoaPods code and [cocoapods-rome plugin](https://github.com/CocoaPods/Rome) to compile pods into frameworks. Every compiled framework will be boxed (by adding it as a `vendored_framework`) as a subspec of a local podspec. When needed additional settings will be automatically ported from the original podspec, like for example xcconfig settings.
175
225
 
176
226
  # FAQ
177
227
 
228
+ ### **After prebuilding my project no longer compiles**
229
+
230
+ A common problem you may encounter is with Objective-C imports. You should verify that you're properly importing all the headers of your pods with the angle bracket notation `#import <FrameworkName/HeaderFile.h>` instead of directly importing `#import "HeaderFile.h"`.
231
+
232
+ How to proceed in these cases?
233
+ 1. Rebuild all frameworks with PodBuilder
234
+ 2. Switch all your pods (use switch command or manually edit your Application-Podfile) back to the standard integration
235
+ 3. One-by-one switch your pods back to prebuilt, verifying everytime that your Project still compiles.
236
+
237
+
178
238
  ### **Build failed with longish output to the stdout, what should I do next?**
179
239
 
180
240
  Relaunch the build command passing `-d`, this won't delete the temporary _/tmp/pod_builder_ folder on failure. Open _/tmp/pod_builder/Pods/Pods.xcproject_, make the Pods-DummyTarget target visible by clicking on _Show_ under _Product->Scheme->Manage shemes..._ and build from within Xcode. This will help you understand what went wrong. Remeber to verify that you're building the _Release_ build configuration.
181
241
 
182
242
  ### **Do I need to commit compiled frameworks?**
183
243
 
184
- No. If the size of compiled frameworks in your repo is a concern you can choose add the _Rome_ and _dSYM_ folder to .gitignore and re-run `pod_builder build_all` locally on every machine.
244
+ No. If the size of compiled frameworks in your repo is a concern (and for whatever reason you can't use [Git-LFS](#git-lfs)) you can choose add the _Rome_ and _dSYM_ folder to .gitignore and re-run `pod_builder build_all` locally on every machine.
245
+
246
+ ### **I get an _'attempt to read non existent folder `/private/tmp/pod_builder/Pods/ podname'_ when building**
247
+
248
+ Please open an issue here. You may also add the name of the pod to the [`skip_pods`](#skip_pods) key in the configuration file and try rebuilding again.
249
+
250
+ # Git LFS
251
+
252
+ PodBuilder integrates with [Git Large File Storage](https://git-lfs.github.com) to move large files, like the prebuilt frameworks, out of your git repo. This allows to benefit from the compilation speed ups of the precompiled frameworks without impacting on your repo overall size.
253
+
254
+ When [`update_lfs_gitattributes = true`](#update_lfs_gitattributes) PodBuilder will automatically update the _.gitattributes_ with the files generated by PodBuilder when building pods.
185
255
 
186
256
  # Try it out!
187
257
 
@@ -20,18 +20,20 @@ def parse_commandline()
20
20
  opts.banner = "
21
21
  Usage:
22
22
 
23
- $ pod_builder COMMAND
23
+ $ pod_builder COMMAND [OPTIONS]
24
24
 
25
25
  Prebuild CocoaPods pods
26
26
 
27
27
  Command:
28
28
  + init Initialize prebuild folders
29
29
  + deintegrate Deintegrate prebuild folders
30
- + build Build a specific pod declared in your Frameworks/Podfile
31
- + build_all Build all pods declared in your Frameworks/Podfile
32
- + restore_all Rebuild all pods declared in the Frameworks/Podfile.restore
30
+ + build Build a specific pod declared in the PodBuilder-Podfile
31
+ + build_all Build all pods declared in the PodBuilder-Podfile
32
+ + restore_all Rebuild all pods declared in the Restore-Podfile
33
33
  + install_sources Install sources of pods to debug into prebuild frameworks
34
+ + switch Switch between prebuilt/development/standard pod in the Application-Podfile
34
35
  + clean Remove prebuild frameworks, dSYMs and source files added by install_sources no longer in Frameworks/Podfile
36
+ + synch_podfile Update your Application-Podfile with all pods declared in the PodBuilder-Podfile
35
37
 
36
38
  Options:
37
39
  "
@@ -49,15 +51,18 @@ Options:
49
51
  opts.banner = "
50
52
  Usage:
51
53
 
52
- $ pod_builder build <PODNAME...>
54
+ $ pod_builder build [OPTIONS] <PODNAME...>
53
55
 
54
- Prebuild the specified CocoaPods pods
56
+ Prebuild the specified CocoaPods pods.
55
57
 
56
58
  Options:
57
59
  "
58
60
  opts.on("-u", "--update", "Update CocoaPods repos") do |o|
59
61
  OPTIONS[:update_repos] = o
60
62
  end
63
+ opts.on("-w", "--allow-warnings", "Allow warnings") do |o|
64
+ OPTIONS[:allow_warnings] = o
65
+ end
61
66
  opts.on("-d", "--debug", "Don't clean build folder") do |o|
62
67
  OPTIONS[:debug] = o
63
68
  end
@@ -67,11 +72,23 @@ Options:
67
72
  ]
68
73
  },
69
74
 
70
- "build_all" => {
75
+ "build_all" => {
71
76
  :opts => OptionParser.new do |opts|
77
+ opts.banner = "
78
+ Usage:
79
+
80
+ $ pod_builder build_all [OPTIONS]
81
+
82
+ Prebuild all pods specified in the PodBuilder-Podfile.
83
+
84
+ Options:
85
+ "
72
86
  opts.on("-u", "--update", "Update CocoaPods repos") do |o|
73
87
  OPTIONS[:update_repos] = o
74
88
  end
89
+ opts.on("-w", "--allow-warnings", "Allow warnings") do |o|
90
+ OPTIONS[:allow_warnings] = o
91
+ end
75
92
  opts.on("-d", "--debug", "Don't clean build folder") do |o|
76
93
  OPTIONS[:debug] = o
77
94
  end
@@ -81,8 +98,17 @@ Options:
81
98
  ]
82
99
  },
83
100
 
84
- "restore_all" => {
101
+ "restore_all" => {
85
102
  :opts => OptionParser.new do |opts|
103
+ opts.banner = "
104
+ Usage:
105
+
106
+ $ pod_builder restore_all [OPTIONS]
107
+
108
+ Rebuilds all pods to the version specified in the Restore-Podfile.
109
+
110
+ Options:
111
+ "
86
112
  opts.on("-u", "--update", "Update CocoaPods repos") do |o|
87
113
  OPTIONS[:update_repos] = o
88
114
  end
@@ -95,11 +121,18 @@ Options:
95
121
  ]
96
122
  },
97
123
 
98
- "init" => {
124
+ "init" => {
99
125
  :opts => OptionParser.new do |opts|
100
- default_destination = PodBuilder::xcodepath(PodBuilder::Configuration.base_path)
126
+ opts.banner = "
127
+ Usage:
128
+
129
+ $ pod_builder init [OPTIONS]
101
130
 
102
- opts.on("-d", "--destination path", "Prebuilt destination path (defaul: #{default_destination})") do |o|
131
+ Initializes PodBuilder.
132
+
133
+ Options:
134
+ "
135
+ opts.on("-d", "--destination path", "Prebuilt destination path (default: #{PodBuilder::Configuration.base_path})") do |o|
103
136
  OPTIONS[:prebuild_path] = o
104
137
  end
105
138
  end,
@@ -116,40 +149,124 @@ Options:
116
149
  ]
117
150
  },
118
151
 
119
- "deintegrate" => {
152
+ "update_lfs" => {
120
153
  :opts => OptionParser.new do |opts|
154
+ end,
155
+ :call => [
156
+ PodBuilder::Command::GenerateLFS
157
+ ]
158
+ },
159
+
160
+ "deintegrate" => {
161
+ :opts => OptionParser.new do |opts|
162
+ opts.banner = "
163
+ Usage:
164
+
165
+ $ pod_builder deintegrate
166
+
167
+ Remove PodBuilder from your project.
168
+
169
+ Options:
170
+ "
121
171
  end,
122
172
  :call => [
123
173
  PodBuilder::Command::Deintegrate
124
174
  ]
125
175
  },
126
176
 
127
- "clean" => {
177
+ "clean" => {
128
178
  :opts => OptionParser.new do |opts|
179
+ opts.banner = "
180
+ Usage:
181
+
182
+ $ pod_builder clean
183
+
184
+ Remove unused framework, dSYM and source folders.
185
+
186
+ Options:
187
+ "
129
188
  end,
130
189
  :call => [
131
190
  PodBuilder::Command::Clean
132
191
  ]
133
192
  },
134
193
 
135
- "install_sources" => {
194
+ "install_sources" => {
136
195
  :opts => OptionParser.new do |opts|
196
+ opts.banner = "
197
+ Usage:
198
+
199
+ $ pod_builder install_sources
200
+
201
+ Install source of prebuilt pods to be able to step into and debug framework's code.
202
+
203
+ Options:
204
+ "
137
205
  end,
138
206
  :call => [
139
207
  PodBuilder::Command::InstallSources
140
208
  ]
141
- }
209
+ },
210
+
211
+ "switch" => {
212
+ :opts => OptionParser.new do |opts|
213
+ opts.banner = "
214
+ Usage:
215
+
216
+ $ pod_builder switch PODNAME [OPTIONS]
217
+
218
+ Switch integration between prebuilt/development/default pod version.
219
+
220
+ Options:
221
+ "
222
+ opts.on("-p", "--prebuilt", "Use prebuilt") do |o|
223
+ OPTIONS[:switch_mode] = "prebuilt"
224
+ end
225
+ opts.on("-d", "--development", "Development pod") do |o|
226
+ OPTIONS[:switch_mode] = "development"
227
+ end
228
+ opts.on("-s", "--default", "Default version specified in PodBuilder-Podfile") do |o|
229
+ OPTIONS[:switch_mode] = "default"
230
+ end
231
+ end,
232
+ :call => [
233
+ PodBuilder::Command::Switch
234
+ ]
235
+ },
236
+
237
+ "synch_podfile" => {
238
+ :opts => OptionParser.new do |opts|
239
+ opts.banner = "
240
+ Usage:
241
+
242
+ $ pod_builder synch_podfile
243
+
244
+ Rewrite the Application-Podfile based on the PodBuilder-Podfile.
245
+ You may want to run this command when you add a new pod to the PodBuilder-Podfile
246
+ and you want to integrate it in the project without rebuilding it.
247
+
248
+ " end,
249
+ :call => [
250
+ PodBuilder::Command::SynchPodfile
251
+ ]
252
+ }
142
253
  }
143
254
 
144
255
  subcommands["none"][:opts].order!
145
256
 
146
257
  subcommand = subcommands[ARGV.shift]
147
258
 
148
- if subcommand
149
- subcommand[:opts].order!
150
- subcommand[:call].each do |k|
151
- if !k.call(OPTIONS)
152
- puts subcommand[:opts].help
259
+ if subcommand
260
+ if ARGV.include?("--help") || ARGV.include?("-h")
261
+ puts subcommand[:opts].help
262
+ else
263
+ PodBuilder::Configuration.load
264
+
265
+ subcommand[:opts].order!
266
+ subcommand[:call].each do |k|
267
+ if !k.call(OPTIONS)
268
+ puts subcommand[:opts].help
269
+ end
153
270
  end
154
271
  end
155
272
 
@@ -169,7 +286,6 @@ begin
169
286
  raise "\n\nFor safety do not run this as root\n".red
170
287
  end
171
288
 
172
- PodBuilder::Configuration.load
173
289
  command_executed = parse_commandline
174
290
  rescue Exception => e
175
291
  error = e.to_s