pod-builder 1.9.3 → 2.0.0.beta.22
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 +4 -4
- data/.gitignore +9 -0
- data/README.md +50 -13
- data/exe/pod_builder +39 -28
- data/lib/pod_builder/analyze.rb +32 -7
- data/lib/pod_builder/analyzer.rb +16 -0
- data/lib/pod_builder/command/build.rb +44 -161
- data/lib/pod_builder/command/build_all.rb +2 -2
- data/lib/pod_builder/command/clean.rb +34 -55
- data/lib/pod_builder/command/clear_lldbinit.rb +7 -3
- data/lib/pod_builder/command/deintegrate.rb +29 -7
- data/lib/pod_builder/command/generate_lfs.rb +3 -3
- data/lib/pod_builder/command/generate_podspec.rb +3 -2
- data/lib/pod_builder/command/info.rb +1 -1
- data/lib/pod_builder/command/init.rb +37 -14
- data/lib/pod_builder/command/install_sources.rb +21 -14
- data/lib/pod_builder/command/none.rb +2 -2
- data/lib/pod_builder/command/restore_all.rb +4 -4
- data/lib/pod_builder/command/switch.rb +137 -95
- data/lib/pod_builder/command/sync_podfile.rb +5 -3
- data/lib/pod_builder/command/update.rb +5 -6
- data/lib/pod_builder/command/update_lldbinit.rb +11 -9
- data/lib/pod_builder/configuration.rb +88 -13
- data/lib/pod_builder/core.rb +93 -12
- data/lib/pod_builder/info.rb +32 -98
- data/lib/pod_builder/install.rb +255 -195
- data/lib/pod_builder/licenses.rb +4 -4
- data/lib/pod_builder/podfile.rb +283 -73
- data/lib/pod_builder/podfile/post_actions.rb +9 -15
- data/lib/pod_builder/podfile_cp.rb +93 -0
- data/lib/pod_builder/podfile_item.rb +181 -82
- data/lib/pod_builder/podspec.rb +144 -135
- data/lib/pod_builder/rome/post_install.rb +240 -0
- data/lib/pod_builder/rome/pre_install.rb +6 -0
- data/lib/pod_builder/templates/build_podfile.template +3 -3
- data/lib/pod_builder/version.rb +1 -1
- data/pod-builder.gemspec +6 -6
- metadata +27 -80
- data/Example/Frameworks/PodBuilder.json +0 -32
- data/Example/PodBuilderExample.xcodeproj/project.pbxproj +0 -416
- data/Example/PodBuilderExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- data/Example/PodBuilderExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- data/Example/PodBuilderExample.xcodeproj/project.xcworkspace/xcuserdata/tomas.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- data/Example/PodBuilderExample.xcodeproj/xcuserdata/tomas.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- data/Example/PodBuilderExample.xcworkspace/contents.xcworkspacedata +0 -10
- data/Example/PodBuilderExample/AppDelegate.swift +0 -47
- data/Example/PodBuilderExample/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -98
- data/Example/PodBuilderExample/Assets.xcassets/Contents.json +0 -6
- data/Example/PodBuilderExample/Base.lproj/LaunchScreen.storyboard +0 -25
- data/Example/PodBuilderExample/Base.lproj/Main.storyboard +0 -24
- data/Example/PodBuilderExample/Info.plist +0 -45
- data/Example/PodBuilderExample/ViewController.swift +0 -25
- data/Example/Podfile +0 -8
- data/Example/Podfile.lock +0 -16
- data/Example/Pods/Alamofire/LICENSE +0 -19
- data/Example/Pods/Alamofire/README.md +0 -242
- data/Example/Pods/Alamofire/Source/AFError.swift +0 -460
- data/Example/Pods/Alamofire/Source/Alamofire.swift +0 -465
- data/Example/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift +0 -37
- data/Example/Pods/Alamofire/Source/MultipartFormData.swift +0 -580
- data/Example/Pods/Alamofire/Source/NetworkReachabilityManager.swift +0 -233
- data/Example/Pods/Alamofire/Source/Notifications.swift +0 -55
- data/Example/Pods/Alamofire/Source/ParameterEncoding.swift +0 -483
- data/Example/Pods/Alamofire/Source/Request.swift +0 -654
- data/Example/Pods/Alamofire/Source/Response.swift +0 -567
- data/Example/Pods/Alamofire/Source/ResponseSerialization.swift +0 -715
- data/Example/Pods/Alamofire/Source/Result.swift +0 -300
- data/Example/Pods/Alamofire/Source/ServerTrustPolicy.swift +0 -307
- data/Example/Pods/Alamofire/Source/SessionDelegate.swift +0 -725
- data/Example/Pods/Alamofire/Source/SessionManager.swift +0 -896
- data/Example/Pods/Alamofire/Source/TaskDelegate.swift +0 -466
- data/Example/Pods/Alamofire/Source/Timeline.swift +0 -136
- data/Example/Pods/Alamofire/Source/Validation.swift +0 -315
- data/Example/Pods/Manifest.lock +0 -16
- data/Example/Pods/Pods.xcodeproj/project.pbxproj +0 -673
- data/Example/Pods/Pods.xcodeproj/xcuserdata/tomas.xcuserdatad/xcschemes/Alamofire.xcscheme +0 -60
- data/Example/Pods/Pods.xcodeproj/xcuserdata/tomas.xcuserdatad/xcschemes/Pods-PodBuilderExample.xcscheme +0 -60
- data/Example/Pods/Pods.xcodeproj/xcuserdata/tomas.xcuserdatad/xcschemes/xcschememanagement.plist +0 -21
- data/Example/Pods/Target Support Files/Alamofire/Alamofire-dummy.m +0 -5
- data/Example/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch +0 -12
- data/Example/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h +0 -16
- data/Example/Pods/Target Support Files/Alamofire/Alamofire.modulemap +0 -6
- data/Example/Pods/Target Support Files/Alamofire/Alamofire.xcconfig +0 -9
- data/Example/Pods/Target Support Files/Alamofire/Info.plist +0 -26
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Info.plist +0 -26
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-acknowledgements.markdown +0 -26
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-acknowledgements.plist +0 -58
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-dummy.m +0 -5
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-frameworks.sh +0 -153
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-resources.sh +0 -118
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-umbrella.h +0 -16
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample.debug.xcconfig +0 -11
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample.modulemap +0 -6
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample.release.xcconfig +0 -11
- data/lib/pod_builder/cocoapods/specification.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7884fca89b1f5498840e59b6e590836862749f7753f889120d7bd33bdc05a201
|
4
|
+
data.tar.gz: 3936b3ec07e51655f368c2c1001874b4933476d3678096d15184e0a36515be6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c0e8f13ca1a0a3c970c41722bae17a19236295fb3192cf6e5ff52a05507c831bf157363a3725b2184799451cd36a04a8c85c840ec33991f2d75bc890b2b1019
|
7
|
+
data.tar.gz: 5a340dc6930ec07ba988b3836a03a6caa7e2a7c9f033f6b901b5e7363353c1a4487e11ef8908adb0549a19dce1c13b1405a486baaa130f02716e85cd9857cb5c
|
data/.gitignore
CHANGED
@@ -8,3 +8,12 @@
|
|
8
8
|
/tmp/
|
9
9
|
Gemfile.lock
|
10
10
|
.vscode/
|
11
|
+
.DS_Store
|
12
|
+
Example/Pods
|
13
|
+
Example/PodBuilder/Prebuilt
|
14
|
+
|
15
|
+
Example/PodBuilder/dSYM
|
16
|
+
|
17
|
+
Example/PodBuilderExample.xcodeproj/xcuserdata/*.xcuserdatad
|
18
|
+
Example/PodBuilderExample.xcworkspace/xcuserdata
|
19
|
+
Example/Pods
|
data/README.md
CHANGED
@@ -12,18 +12,38 @@ Unless you're using a Ruby version manager you should generally install using `s
|
|
12
12
|
|
13
13
|
$ sudo gem install pod-builder
|
14
14
|
|
15
|
+
# Quick start
|
16
|
+
|
15
17
|
You can the initialize your project to use the tool using the `init` command
|
16
18
|
|
17
19
|
$ cd path-to-your-repo;
|
18
20
|
$ pod_builder init
|
19
21
|
|
20
|
-
This will add a
|
22
|
+
This will add a _PodBuilder_ folder which will contain all files needed and generated by the PodBuilder.
|
23
|
+
|
24
|
+
To prebuild all dependencies run
|
25
|
+
|
26
|
+
$ pod_builder build_all
|
27
|
+
|
28
|
+
To prebuild just one or more specific dependencies run
|
29
|
+
|
30
|
+
$ pod_builder build Pod1 Pod2
|
31
|
+
|
32
|
+
This will generate the pod frameworks which can be committed to your repo for a much faster compilation.
|
33
|
+
|
34
|
+
Should PodBuilder not work the way you expect you can get rid of it by running
|
35
|
+
|
36
|
+
$ pod_builder deintegrate
|
37
|
+
|
38
|
+
Which will restore all changes that PodBUilder applied to the project (the PodBuilder folder and the changes to the Podfile).
|
39
|
+
|
40
|
+
# Usage
|
21
41
|
|
22
42
|
## Podfile
|
23
43
|
|
24
44
|
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:
|
25
45
|
|
26
|
-
### 1.
|
46
|
+
### 1. PodBuilder/Podfile (aka PodBuilder-Podfile)
|
27
47
|
|
28
48
|
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.
|
29
49
|
|
@@ -31,7 +51,7 @@ This is your original Podfile and remains your **master Podfile** that you will
|
|
31
51
|
|
32
52
|
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**
|
33
53
|
|
34
|
-
### 3.
|
54
|
+
### 3. PodBuilder/Podfile.restore (aka Restore-Podfile)
|
35
55
|
|
36
56
|
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**
|
37
57
|
|
@@ -48,7 +68,7 @@ Podbuilder comes with a set of commands:
|
|
48
68
|
- `install_sources`: installs sources of pods to debug into prebuild frameworks
|
49
69
|
- `switch`: switch between prebuilt, development or standard pod in the Application-Podfile
|
50
70
|
- `clean`: removes unused prebuilt frameworks, dSYMs and source files added by install_sources
|
51
|
-
- `sync_podfile`: updates the Application with all pods declared in the PodBuilder-Podfile file
|
71
|
+
- `sync_podfile`: updates the Application-Podfile with all pods declared in the PodBuilder-Podfile file
|
52
72
|
- `info`: outputs json-formatted information reflecting the current status of prebuilt pods
|
53
73
|
|
54
74
|
Commands can be run from anywhere in your project's repo that is **required to be under git**.
|
@@ -59,8 +79,8 @@ This will sets up a project to use PodBuilder.
|
|
59
79
|
|
60
80
|
The following will happen:
|
61
81
|
|
62
|
-
- Create a
|
63
|
-
- Copy your original Podfile to
|
82
|
+
- Create a _PodBuilder_ folder in your repo's root.
|
83
|
+
- Copy your original Podfile to _PodBuilder/Podfile_ (PodBuilder-Podfile)
|
64
84
|
- Add an initially empty _PodBuilder.json_ configuration file
|
65
85
|
- Modify the original Podfile (Application-Podfile) with some minor customizations
|
66
86
|
- Create/Update your Gemfile adding the `gem 'pod-builder'` entry
|
@@ -75,18 +95,20 @@ Running `pod_builder build [pod name]` will precompile the pod that should be in
|
|
75
95
|
|
76
96
|
The following will happen:
|
77
97
|
|
78
|
-
- Create one or more (if there are dependencies) _.framework_ file/s under
|
98
|
+
- Create one or more (if there are dependencies) _.framework_ file/s under _PodBuilder/Prebuilt_ along with its corresponding _dSYM_ files (if applicable)
|
79
99
|
- Update the Application-Podfile replacing the pod definition with the precompiled ones
|
80
100
|
- Update/create the Podfile.restore (Restore-Podfile)
|
81
101
|
- Update/create PodBuilder.podspec which is a local podspec for your prebuilt frameworks (more on this later)
|
82
102
|
|
103
|
+
By default PodBuilder will only rebuild pods when changes are detected in source code. This behaviour can be overridden by passing the `--force` flag.
|
104
|
+
|
83
105
|
#### `build_all` command
|
84
106
|
|
85
107
|
As `build` but will prebuild all pods defined in PodBuilder-Podfile.
|
86
108
|
|
87
109
|
#### `update` command
|
88
110
|
|
89
|
-
If you decide not to commit the
|
111
|
+
If you decide not to commit the _Prebuilt_ and _dSYM_ folders you can use this command to rebuild all those frameworks that are out-of-sync with the Restore-Podfile or that were built with a different version of the Swift compiler.
|
90
112
|
|
91
113
|
#### `restore_all` command
|
92
114
|
|
@@ -94,7 +116,7 @@ Will recompile all pods to the versions defined in the Restore-Podfile. You woul
|
|
94
116
|
|
95
117
|
#### `install_sources` command
|
96
118
|
|
97
|
-
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
|
119
|
+
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 _PodBuilder/Sources_ and with some [tricks](https://medium.com/@t.camin/debugging-prebuilt-frameworks-c9f52d42600b) restores the ability to use the debugger and step into the code of your prebuilt dependencies. 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.
|
98
120
|
|
99
121
|
#### `update_lldbinit` command
|
100
122
|
|
@@ -117,7 +139,7 @@ Using the switch command you can choose to integrate it:
|
|
117
139
|
- development. The _Development Pod_ used by CocoaPods
|
118
140
|
- prebuilt. Use the prebuilt pod
|
119
141
|
|
120
|
-
To support development pods you should specify the path(s) that contain the pods sources in
|
142
|
+
To support development pods you should specify the path(s) that contain the pods sources in _PodBuilder/PodBuilderDevPodsPaths.json_ as follows
|
121
143
|
|
122
144
|
```json
|
123
145
|
[
|
@@ -248,6 +270,10 @@ Like `build_settings` but per pod. Pod name can also refer to subspec.
|
|
248
270
|
|
249
271
|
Specify which build system to use to compile frameworks. Either `Legacy` (standard build system) or `Latest` (new build system). Default value: `Legacy`.
|
250
272
|
|
273
|
+
#### `library_evolution_support`
|
274
|
+
|
275
|
+
Specify if Swift frameworks should be compiled with library evolution support (BUILD_LIBRARY_FOR_DISTRIBUTION).
|
276
|
+
|
251
277
|
#### `license_filename`
|
252
278
|
|
253
279
|
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).
|
@@ -284,7 +310,7 @@ Normally when multiple subspecs are specified in a target a single framework is
|
|
284
310
|
|
285
311
|
#### `lfs_update_gitattributes`
|
286
312
|
|
287
|
-
Adds a _.gitattributes_ to
|
313
|
+
Adds a _.gitattributes_ to _PodBuilder/Prebuilt_ and _PodBuilder/dSYM_ to exclude large files. If `lfs_include_pods_folder` is true it will add a the same _.gitattributes_ to the application's _Pods_ folder as well.
|
288
314
|
|
289
315
|
|
290
316
|
#### `lfs_include_pods_folder`
|
@@ -292,9 +318,18 @@ Adds a _.gitattributes_ to _Frameworks/Rome_ and _Frameworks/dSYM_ to exclude la
|
|
292
318
|
See [`lfs_update_gitattributes`](#lfs_update_gitattributes).
|
293
319
|
|
294
320
|
|
321
|
+
#### `use_bundler`
|
322
|
+
|
323
|
+
If you use bundler to pin the version of CocoaPods in your project set this to true. Default false.
|
324
|
+
|
325
|
+
#### `build_for_apple_silicon`
|
326
|
+
|
327
|
+
If set to true built frameworks will include iPhone simulator slices for Apple silicon based hardware. Default false.
|
328
|
+
|
329
|
+
|
295
330
|
# Behind the scenes
|
296
331
|
|
297
|
-
PodBuilder leverages CocoaPods code and [cocoapods-rome plugin](https://github.com/CocoaPods/
|
332
|
+
PodBuilder leverages CocoaPods code and [cocoapods-rome plugin](https://github.com/CocoaPods/Prebuilt) 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.
|
298
333
|
|
299
334
|
# FAQ
|
300
335
|
|
@@ -330,7 +365,7 @@ Relaunch the build command passing `-d`, this won't delete the temporary _/tmp/p
|
|
330
365
|
|
331
366
|
### **Do I need to commit compiled frameworks?**
|
332
367
|
|
333
|
-
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
|
368
|
+
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 _Prebuilt_ and _dSYM_ folder to .gitignore and run `pod_builder update` to rebuild all frameworks that need to be recompiled.
|
334
369
|
|
335
370
|
|
336
371
|
### **I get an _'attempt to read non existent folder `/private/tmp/pod_builder/Pods/ podname'_ when building**
|
@@ -358,10 +393,12 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/Subito
|
|
358
393
|
|
359
394
|
|
360
395
|
# Caveats
|
396
|
+
|
361
397
|
Code isn't probably the cleanest I ever wrote but given the usefulness of the tool I decided to publish it nevertheless.
|
362
398
|
|
363
399
|
|
364
400
|
# Authors
|
401
|
+
|
365
402
|
[Tomas Camin](https://github.com/tcamin) ([@tomascamin](https://twitter.com/tomascamin))
|
366
403
|
|
367
404
|
# License
|
data/exe/pod_builder
CHANGED
@@ -36,15 +36,15 @@ Command:
|
|
36
36
|
+ deintegrate Deintegrate prebuild folders
|
37
37
|
+ build Build a specific pod declared in the PodBuilder-Podfile
|
38
38
|
+ build_all Build all pods declared in the PodBuilder-Podfile
|
39
|
-
+ update Rebuild
|
39
|
+
+ update Rebuild items that are outdated
|
40
40
|
+ restore_all Rebuild all pods declared in the Restore-Podfile
|
41
|
-
+ install_sources Install sources of pods to debug into prebuilt
|
42
|
-
+ update_lldbinit Generate an lldbinit file with setting target.source-map to debug prebuilt
|
41
|
+
+ install_sources Install sources of pods to debug into prebuilt items
|
42
|
+
+ update_lldbinit Generate an lldbinit file with setting target.source-map to debug prebuilt items
|
43
43
|
+ clear_lldbinit Clear an lldbinit file from PodBuilder's customizations
|
44
44
|
+ switch Switch between prebuilt/development/standard pod in the Application-Podfile
|
45
|
-
+ clean Remove prebuild
|
45
|
+
+ clean Remove prebuild items, dSYMs and source files added by `install_sources` command that are no longer in the PodBuilder-Podfile
|
46
46
|
+ sync_podfile Update your Application-Podfile with all pods declared in the PodBuilder-Podfile
|
47
|
-
+ info Print json-formatted informations about prebuilt
|
47
|
+
+ info Print json-formatted informations about prebuilt items
|
48
48
|
|
49
49
|
Options:
|
50
50
|
"
|
@@ -71,12 +71,15 @@ Options:
|
|
71
71
|
opts.on("-u", "--skip-repo-update", "Skip CocoaPods repo update") do |o|
|
72
72
|
OPTIONS[:update_repos] = false
|
73
73
|
end
|
74
|
+
opts.on("-f", "--force", "Rebuild items even when no code change is detected") do |o|
|
75
|
+
OPTIONS[:force_rebuild] = false
|
76
|
+
end
|
74
77
|
opts.on("-w", "--allow-warnings", "Allow warnings") do |o|
|
75
78
|
OPTIONS[:allow_warnings] = o
|
76
79
|
end
|
77
|
-
opts.on("-a", "--auto-resolve-deps", "Resolve pod dependencies automatically") do |o|
|
78
|
-
|
79
|
-
end
|
80
|
+
# opts.on("-a", "--auto-resolve-deps", "Resolve pod dependencies automatically") do |o|
|
81
|
+
# OPTIONS[:auto_resolve_dependencies] = o
|
82
|
+
# end
|
80
83
|
opts.on("-d", "--debug", "Don't clean build folder") do |o|
|
81
84
|
OPTIONS[:debug] = o
|
82
85
|
end
|
@@ -100,6 +103,9 @@ Options:
|
|
100
103
|
opts.on("-u", "--skip-repo-update", "Skip CocoaPods repo update") do |o|
|
101
104
|
OPTIONS[:update_repos] = false
|
102
105
|
end
|
106
|
+
opts.on("-f", "--force", "Rebuild items even when no code change is detected") do |o|
|
107
|
+
OPTIONS[:force_rebuild] = false
|
108
|
+
end
|
103
109
|
opts.on("-w", "--allow-warnings", "Allow warnings") do |o|
|
104
110
|
OPTIONS[:allow_warnings] = o
|
105
111
|
end
|
@@ -119,7 +125,7 @@ Usage:
|
|
119
125
|
|
120
126
|
$ pod_builder update [OPTIONS]
|
121
127
|
|
122
|
-
Rebuild
|
128
|
+
Rebuild items that are outdated
|
123
129
|
|
124
130
|
Options:
|
125
131
|
"
|
@@ -129,7 +135,7 @@ Options:
|
|
129
135
|
opts.on("-w", "--allow-warnings", "Allow warnings") do |o|
|
130
136
|
OPTIONS[:allow_warnings] = o
|
131
137
|
end
|
132
|
-
opts.on("-r", "--dry", "Determine which
|
138
|
+
opts.on("-r", "--dry", "Determine which items need to be updated") do |o|
|
133
139
|
OPTIONS[:dry_run] = o
|
134
140
|
end
|
135
141
|
opts.on("-d", "--debug", "Don't clean build folder") do |o|
|
@@ -224,10 +230,13 @@ Usage:
|
|
224
230
|
|
225
231
|
$ pod_builder clean
|
226
232
|
|
227
|
-
Remove unused
|
233
|
+
Remove unused prebuild data, dSYM and source folders.
|
228
234
|
|
229
235
|
Options:
|
230
|
-
"
|
236
|
+
"
|
237
|
+
opts.on("-u", "--skip-repo-update", "Skip CocoaPods repo update") do |o|
|
238
|
+
OPTIONS[:update_repos] = false
|
239
|
+
end
|
231
240
|
end,
|
232
241
|
:call => [
|
233
242
|
PodBuilder::Command::Clean
|
@@ -241,7 +250,7 @@ Usage:
|
|
241
250
|
|
242
251
|
$ pod_builder install_sources
|
243
252
|
|
244
|
-
Install source of prebuilt pods to be able to step into and debug
|
253
|
+
Install source of prebuilt pods to be able to step into and debug prebuilt's code.
|
245
254
|
|
246
255
|
"
|
247
256
|
end,
|
@@ -258,9 +267,9 @@ Usage:
|
|
258
267
|
$ pod_builder update_lldbinit <LLDBINIT_PATH> <PATH>
|
259
268
|
|
260
269
|
Update LLDBINIT_PATH setting target.source-map in order to be able to step into
|
261
|
-
and debug prebuilt
|
270
|
+
and debug prebuilt prebuilt's code.
|
262
271
|
|
263
|
-
Specify the PATH of the folder containing the source code of prebuilt
|
272
|
+
Specify the PATH of the folder containing the source code of prebuilt items. PATH can be relative to PodBuilder's Prebuilt folder.
|
264
273
|
|
265
274
|
"
|
266
275
|
end,
|
@@ -289,9 +298,9 @@ Usage:
|
|
289
298
|
opts.banner = "
|
290
299
|
Usage:
|
291
300
|
|
292
|
-
$ pod_builder switch
|
301
|
+
$ pod_builder switch [OPTIONS] PODNAME[s]
|
293
302
|
|
294
|
-
Switch integration between prebuilt/development/default pod version.
|
303
|
+
Switch integration between prebuilt/development/default pod version. Multiple space separated pods can be passed
|
295
304
|
|
296
305
|
Options:
|
297
306
|
"
|
@@ -304,6 +313,9 @@ Options:
|
|
304
313
|
opts.on("-s", "--default", "Default version specified in PodBuilder-Podfile") do |o|
|
305
314
|
OPTIONS[:switch_mode] = "default"
|
306
315
|
end
|
316
|
+
opts.on("-a", "--all", "Include dependencies") do |o|
|
317
|
+
OPTIONS[:switch_all] = true
|
318
|
+
end
|
307
319
|
end,
|
308
320
|
:call => [
|
309
321
|
PodBuilder::Command::Switch
|
@@ -321,7 +333,12 @@ Usage:
|
|
321
333
|
You may want to run this command when you add a new pod to the PodBuilder-Podfile
|
322
334
|
and you want to integrate it in the project without rebuilding it.
|
323
335
|
|
324
|
-
|
336
|
+
Options:
|
337
|
+
"
|
338
|
+
opts.on("-u", "--skip-repo-update", "Skip CocoaPods repo update") do |o|
|
339
|
+
OPTIONS[:update_repos] = false
|
340
|
+
end
|
341
|
+
end,
|
325
342
|
:call => [
|
326
343
|
PodBuilder::Command::SyncPodfile
|
327
344
|
]
|
@@ -357,9 +374,11 @@ Usage:
|
|
357
374
|
else
|
358
375
|
PodBuilder::Configuration.load
|
359
376
|
|
377
|
+
PodBuilder::add_lockfile
|
378
|
+
|
360
379
|
subcommand[:opts].order!
|
361
380
|
subcommand[:call].each do |k|
|
362
|
-
if (ret = k.call
|
381
|
+
if (ret = k.call) && ret == -1
|
363
382
|
puts subcommand[:opts].help
|
364
383
|
end
|
365
384
|
end
|
@@ -374,8 +393,6 @@ begin
|
|
374
393
|
raise "\n\nFor safety do not run this as root\n".red
|
375
394
|
end
|
376
395
|
|
377
|
-
PodBuilder::add_lock_file
|
378
|
-
valid_lock_file = true
|
379
396
|
command_ret = parse_commandline
|
380
397
|
rescue Exception => e
|
381
398
|
error = e.to_s
|
@@ -392,14 +409,8 @@ rescue Exception => e
|
|
392
409
|
ensure
|
393
410
|
if command_ret == 0
|
394
411
|
PodBuilder::clean_basepath
|
395
|
-
|
396
|
-
if !OPTIONS.has_key?(:debug)
|
397
|
-
PodBuilder::safe_rm_rf(PodBuilder::Configuration.build_path)
|
398
|
-
end
|
399
|
-
end
|
400
|
-
if valid_lock_file
|
401
|
-
PodBuilder::remove_lock_file
|
402
412
|
end
|
413
|
+
PodBuilder::remove_lockfile
|
403
414
|
|
404
415
|
exit(command_ret)
|
405
416
|
end
|
data/lib/pod_builder/analyze.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
require '
|
1
|
+
require 'rubygems/specification'
|
2
|
+
require 'pod_builder/rome/pre_install.rb'
|
3
|
+
require 'pod_builder/rome/post_install.rb'
|
2
4
|
|
3
5
|
module PodBuilder
|
4
6
|
class Analyze
|
@@ -6,6 +8,14 @@ module PodBuilder
|
|
6
8
|
#
|
7
9
|
def self.installer_at(path, repo_update = false)
|
8
10
|
CLAide::Command::PluginManager.load_plugins("cocoapods")
|
11
|
+
|
12
|
+
# Manually load inline podbuilder-rome plugin
|
13
|
+
pluginspec = Gem::Specification.new("podbuilder-rome", PodBuilder::VERSION)
|
14
|
+
pluginspec.activate
|
15
|
+
|
16
|
+
if !CLAide::Command::PluginManager.loaded_plugins["cocoapods"].map(&:name).include?(pluginspec.name)
|
17
|
+
CLAide::Command::PluginManager.loaded_plugins["cocoapods"].push(pluginspec)
|
18
|
+
end
|
9
19
|
|
10
20
|
current_dir = Dir.pwd
|
11
21
|
Dir.chdir(path)
|
@@ -40,15 +50,30 @@ module PodBuilder
|
|
40
50
|
checkout_options.merge!(analyzer.sandbox.checkout_sources)
|
41
51
|
|
42
52
|
all_specs = analysis_result.specifications
|
53
|
+
|
54
|
+
supported_platforms = analyzer.instance_variable_get("@result").targets.map { |t| t.platform.safe_string_name.downcase }
|
55
|
+
all_podfile_items = all_specs.map { |spec| PodfileItem.new(spec, all_specs, checkout_options, supported_platforms) }
|
43
56
|
|
44
|
-
|
57
|
+
names = analyzer.explicit_pods().map(&:name)
|
45
58
|
|
46
|
-
|
59
|
+
podfile_pods = []
|
60
|
+
last_count = -1
|
61
|
+
while podfile_pods.count != last_count do
|
62
|
+
last_count = podfile_pods.count
|
47
63
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
64
|
+
updated_names = []
|
65
|
+
names.each do |name|
|
66
|
+
if pod = all_podfile_items.detect { |t| t.name == name }
|
67
|
+
podfile_pods.push(pod)
|
68
|
+
updated_names += pod.dependency_names
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
names = updated_names.uniq
|
73
|
+
podfile_pods.uniq!
|
74
|
+
end
|
75
|
+
|
76
|
+
return podfile_pods.sort_by(&:name)
|
52
77
|
end
|
53
78
|
end
|
54
79
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'cocoapods/installer/analyzer.rb'
|
2
|
+
|
3
|
+
module Pod
|
4
|
+
class Installer
|
5
|
+
class Analyzer
|
6
|
+
def explicit_pods
|
7
|
+
pods = []
|
8
|
+
podfile.root_target_definitions[0].children.each do |children|
|
9
|
+
pods += children.dependencies
|
10
|
+
end
|
11
|
+
|
12
|
+
pods.flatten.uniq.sort
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -3,7 +3,7 @@ require 'pod_builder/core'
|
|
3
3
|
module PodBuilder
|
4
4
|
module Command
|
5
5
|
class Build
|
6
|
-
def self.call
|
6
|
+
def self.call
|
7
7
|
Configuration.check_inited
|
8
8
|
PodBuilder::prepare_basepath
|
9
9
|
|
@@ -13,20 +13,28 @@ module PodBuilder
|
|
13
13
|
return -1
|
14
14
|
end
|
15
15
|
|
16
|
-
raise "\n\nPlease rename your Xcode installation path removing spaces, current `#{`xcode-select -p`.strip()}`\n" if `xcode-select -p`.strip().include?(" ")
|
16
|
+
raise "\n\nPlease rename your Xcode installation path removing spaces, current `#{`xcode-select -p`.strip()}`\n".red if `xcode-select -p`.strip().include?(" ")
|
17
17
|
|
18
18
|
Podfile.sanity_check()
|
19
19
|
check_not_building_subspecs(argument_pods)
|
20
20
|
|
21
|
-
|
21
|
+
puts "Loading Podfile".yellow
|
22
|
+
|
23
|
+
install_update_repo = OPTIONS.fetch(:update_repos, true)
|
22
24
|
installer, analyzer = Analyze.installer_at(PodBuilder::basepath, install_update_repo)
|
23
25
|
|
24
26
|
all_buildable_items = Analyze.podfile_items(installer, analyzer)
|
25
27
|
prebuilt_items = all_buildable_items.select { |x| x.is_prebuilt }
|
26
28
|
buildable_items = all_buildable_items - prebuilt_items
|
27
29
|
|
28
|
-
|
29
|
-
|
30
|
+
build_all = argument_pods.first == "*"
|
31
|
+
if build_all
|
32
|
+
argument_pods = all_buildable_items.map(&:root_name).uniq
|
33
|
+
else
|
34
|
+
argument_pods = Podfile::resolve_pod_names(argument_pods, all_buildable_items)
|
35
|
+
deps = all_buildable_items.select { |t| argument_pods.include?(t.root_name) }.map(&:dependency_names).flatten.map { |t| t.split("/").first }
|
36
|
+
argument_pods += deps
|
37
|
+
argument_pods.uniq!
|
30
38
|
end
|
31
39
|
|
32
40
|
available_argument_pods = argument_pods.select { |x| all_buildable_items.map(&:root_name).include?(x) }
|
@@ -41,10 +49,10 @@ module PodBuilder
|
|
41
49
|
|
42
50
|
restore_file_error = Podfile.restore_file_sanity_check
|
43
51
|
|
44
|
-
check_splitted_subspecs_are_static(all_buildable_items
|
52
|
+
check_splitted_subspecs_are_static(all_buildable_items)
|
45
53
|
check_pods_exists(argument_pods, all_buildable_items)
|
46
54
|
|
47
|
-
pods_to_build = resolve_pods_to_build(argument_pods, buildable_items
|
55
|
+
pods_to_build = resolve_pods_to_build(argument_pods, buildable_items)
|
48
56
|
buildable_items -= pods_to_build
|
49
57
|
|
50
58
|
# We need to split pods to build in 3 groups
|
@@ -52,7 +60,7 @@ module PodBuilder
|
|
52
60
|
# 2. pods to build in release
|
53
61
|
# 3. pods to build in debug
|
54
62
|
|
55
|
-
check_not_building_development_pods(pods_to_build
|
63
|
+
check_not_building_development_pods(pods_to_build)
|
56
64
|
|
57
65
|
pods_to_build_subspecs = pods_to_build.select { |x| x.is_subspec && Configuration.subspecs_to_split.include?(x.name) }
|
58
66
|
|
@@ -73,34 +81,37 @@ module PodBuilder
|
|
73
81
|
licenses = []
|
74
82
|
|
75
83
|
podfiles_items.select { |x| x.count > 0 }.each do |podfile_items|
|
76
|
-
|
77
|
-
podfile_content = Podfile.from_podfile_items(podfile_items, analyzer)
|
84
|
+
build_configuration = podfile_items.map(&:build_configuration).uniq.first
|
78
85
|
|
79
|
-
|
80
|
-
|
81
|
-
|
86
|
+
podfile_items = podfile_items.map { |t| t.recursive_dependencies(all_buildable_items) }.flatten.uniq
|
87
|
+
podfile_content = Podfile.from_podfile_items(podfile_items, analyzer, build_configuration)
|
88
|
+
|
89
|
+
licenses += Install.podfile(podfile_content, podfile_items, podfile_items.first.build_configuration)
|
82
90
|
|
83
91
|
# remove lockfile which gets unexplicably created
|
84
92
|
FileUtils.rm_f(PodBuilder::basepath("Podfile.lock"))
|
85
93
|
end
|
86
94
|
|
87
|
-
|
95
|
+
Clean::prebuilt_items(all_buildable_items)
|
88
96
|
|
89
97
|
Licenses::write(licenses, all_buildable_items)
|
90
98
|
|
91
|
-
GenerateLFS::call(
|
99
|
+
GenerateLFS::call()
|
92
100
|
Podspec::generate(all_buildable_items, analyzer)
|
93
101
|
|
94
102
|
builded_pods = podfiles_items.flatten
|
95
|
-
|
103
|
+
|
104
|
+
builded_pods_and_deps = podfiles_items.flatten.map { |t| t.recursive_dependencies(all_buildable_items) }.flatten.uniq
|
105
|
+
builded_pods_and_deps.select! { |x| !x.is_prebuilt }
|
106
|
+
|
96
107
|
Podfile::write_restorable(builded_pods_and_deps + prebuilt_pods_to_install, all_buildable_items, analyzer)
|
97
|
-
if !
|
108
|
+
if !OPTIONS.has_key?(:skip_prebuild_update)
|
98
109
|
Podfile::write_prebuilt(all_buildable_items, analyzer)
|
99
110
|
end
|
100
111
|
|
101
112
|
Podfile::install
|
102
113
|
|
103
|
-
sanity_checks
|
114
|
+
sanity_checks
|
104
115
|
|
105
116
|
if (restore_file_error = restore_file_error) && Configuration.restore_enabled
|
106
117
|
puts "\n\n⚠️ Podfile.restore was found invalid and was overwritten. Error:\n #{restore_file_error}".red
|
@@ -112,88 +123,6 @@ module PodBuilder
|
|
112
123
|
|
113
124
|
private
|
114
125
|
|
115
|
-
def self.license_specifiers
|
116
|
-
acknowledge_files = Dir.glob("#{PodBuilder::Configuration.build_path}/Pods/**/*acknowledgements.plist")
|
117
|
-
raise "Too many ackwnoledge files found" if acknowledge_files.count > 1
|
118
|
-
|
119
|
-
if acknowledge_file = acknowledge_files.first
|
120
|
-
plist = CFPropertyList::List.new(:file => acknowledge_file)
|
121
|
-
data = CFPropertyList.native_types(plist.value)
|
122
|
-
|
123
|
-
return data["PreferenceSpecifiers"]
|
124
|
-
end
|
125
|
-
|
126
|
-
return []
|
127
|
-
end
|
128
|
-
|
129
|
-
def self.add_dependencies(pods, buildable_items)
|
130
|
-
pods.dup.each do |pod|
|
131
|
-
build_configuration = pods.first.build_configuration
|
132
|
-
|
133
|
-
dependencies = pod.dependencies(buildable_items).select { |x| !pods.include?(x) && !pod.has_common_spec(x.name) }
|
134
|
-
dependencies.each { |x| x.build_configuration = build_configuration }
|
135
|
-
pods = dependencies + pods # dependencies should come first
|
136
|
-
end
|
137
|
-
|
138
|
-
return pods
|
139
|
-
end
|
140
|
-
|
141
|
-
def self.expected_common_dependencies(pods_to_build, buildable_items, options)
|
142
|
-
warned_expected_pod_list = []
|
143
|
-
expected_pod_list = []
|
144
|
-
errors = []
|
145
|
-
|
146
|
-
pods_to_build.each do |pod_to_build|
|
147
|
-
pod_to_build.dependency_names.each do |dependency|
|
148
|
-
unless buildable_items.detect { |x| x.root_name == dependency || x.name == dependency } != nil
|
149
|
-
next
|
150
|
-
end
|
151
|
-
|
152
|
-
buildable_items.each do |buildable_pod|
|
153
|
-
unless !pod_to_build.dependency_names.include?(buildable_pod.name)
|
154
|
-
next
|
155
|
-
end
|
156
|
-
|
157
|
-
if buildable_pod.dependency_names.include?(dependency) && !buildable_pod.has_subspec(dependency) && !buildable_pod.has_common_spec(dependency) then
|
158
|
-
expected_pod_list += pods_to_build.map(&:root_name) + [buildable_pod.root_name]
|
159
|
-
expected_pod_list.uniq!
|
160
|
-
|
161
|
-
expected_list = expected_pod_list.join(" ")
|
162
|
-
if !warned_expected_pod_list.include?(expected_list)
|
163
|
-
errors.push("Can't build #{pod_to_build.name} because it has common dependencies (#{dependency}) with #{buildable_pod.name}.\n\nUse `pod_builder build #{expected_list}` instead or use `pod_builder build -a #{pod_to_build.name}` to automatically resolve missing dependencies\n\n")
|
164
|
-
errors.uniq!
|
165
|
-
warned_expected_pod_list.push(expected_list)
|
166
|
-
|
167
|
-
if options.has_key?(:auto_resolve_dependencies)
|
168
|
-
puts "`#{pod_to_build.name}` has the following dependencies:\n`#{pod_to_build.dependency_names.join("`, `")}`\nWhich are in common with `#{buildable_pod.name}` and requires it to be recompiled\n\n".yellow
|
169
|
-
end
|
170
|
-
end
|
171
|
-
end
|
172
|
-
end
|
173
|
-
end
|
174
|
-
end
|
175
|
-
|
176
|
-
return expected_pod_list, errors
|
177
|
-
end
|
178
|
-
|
179
|
-
def self.expected_parent_dependencies(pods_to_build, buildable_items, options)
|
180
|
-
expected_pod_list = []
|
181
|
-
errors = []
|
182
|
-
|
183
|
-
buildable_items_dependencies = buildable_items.map(&:dependency_names).flatten.uniq
|
184
|
-
pods_to_build.each do |pod_to_build|
|
185
|
-
if buildable_items_dependencies.include?(pod_to_build.name)
|
186
|
-
parent = buildable_items.detect { |x| x.dependency_names.include?(pod_to_build.name) }
|
187
|
-
|
188
|
-
expected_pod_list += (pods_to_build + [parent]).map(&:root_name)
|
189
|
-
expected_pod_list.uniq!
|
190
|
-
errors.push("Can't build #{pod_to_build.name} because it is a dependency of #{parent.name}.\n\nUse `pod_builder build #{expected_pod_list.join(" ")}` instead\n\n")
|
191
|
-
end
|
192
|
-
end
|
193
|
-
|
194
|
-
return expected_pod_list, errors
|
195
|
-
end
|
196
|
-
|
197
126
|
def self.check_not_building_subspecs(pods_to_build)
|
198
127
|
pods_to_build.each do |pod_to_build|
|
199
128
|
if pod_to_build.include?("/")
|
@@ -203,7 +132,7 @@ module PodBuilder
|
|
203
132
|
end
|
204
133
|
|
205
134
|
def self.check_pods_exists(pods, buildable_items)
|
206
|
-
raise "
|
135
|
+
raise "\n\nEmpty Podfile?".red if buildable_items.nil?
|
207
136
|
|
208
137
|
buildable_items = buildable_items.map(&:root_name)
|
209
138
|
pods.each do |pod|
|
@@ -211,7 +140,7 @@ module PodBuilder
|
|
211
140
|
end
|
212
141
|
end
|
213
142
|
|
214
|
-
def self.check_splitted_subspecs_are_static(all_buildable_items
|
143
|
+
def self.check_splitted_subspecs_are_static(all_buildable_items)
|
215
144
|
non_static_subspecs = all_buildable_items.select { |x| x.is_subspec && x.is_static == false }
|
216
145
|
non_static_subspecs_names = non_static_subspecs.map(&:name)
|
217
146
|
|
@@ -221,11 +150,11 @@ module PodBuilder
|
|
221
150
|
return
|
222
151
|
end
|
223
152
|
|
224
|
-
warn_message = "The following pods `#{invalid_subspecs.join(" ")}` are non static
|
225
|
-
if
|
153
|
+
warn_message = "The following pods `#{invalid_subspecs.join(" ")}` are non static binaries which are being splitted over different targets. Beware that this is an unsafe setup as per https://github.com/CocoaPods/CocoaPods/issues/5708 and https://github.com/CocoaPods/CocoaPods/issues/5643\n\nYou can ignore this error by passing the `--allow-warnings` flag to the build command\n"
|
154
|
+
if OPTIONS[:allow_warnings]
|
226
155
|
puts "\n\n⚠️ #{warn_message}".yellow
|
227
156
|
else
|
228
|
-
raise "\n\n🚨️ #{warn_message}".
|
157
|
+
raise "\n\n🚨️ #{warn_message}".red
|
229
158
|
end
|
230
159
|
end
|
231
160
|
|
@@ -239,14 +168,14 @@ module PodBuilder
|
|
239
168
|
pods_with_unaligned_build_configuration = pods_with_common_deps.select { |x| x.build_configuration != pod.build_configuration }
|
240
169
|
pods_with_unaligned_build_configuration.map!(&:name)
|
241
170
|
|
242
|
-
raise "
|
171
|
+
raise "\n\nDependencies of `#{pod.name}` don't have the same build configuration (#{pod.build_configuration}) of `#{pods_with_unaligned_build_configuration.join(",")}`'s dependencies".red if pods_with_unaligned_build_configuration.count > 0
|
243
172
|
end
|
244
173
|
end
|
245
174
|
|
246
|
-
def self.check_not_building_development_pods(pods
|
247
|
-
if (development_pods = pods.select { |x| x.is_development_pod }) && development_pods.count > 0 && (
|
175
|
+
def self.check_not_building_development_pods(pods)
|
176
|
+
if (development_pods = pods.select { |x| x.is_development_pod }) && development_pods.count > 0 && (OPTIONS[:allow_warnings].nil? && Configuration.allow_building_development_pods == false)
|
248
177
|
pod_names = development_pods.map(&:name).join(", ")
|
249
|
-
raise "
|
178
|
+
raise "\n\nThe following pods are in development mode: `#{pod_names}`, won't proceed building.\n\nYou can ignore this error by passing the `--allow-warnings` flag to the build command\n".red
|
250
179
|
end
|
251
180
|
end
|
252
181
|
|
@@ -259,7 +188,7 @@ module PodBuilder
|
|
259
188
|
return buildable_subspecs - pods_to_build
|
260
189
|
end
|
261
190
|
|
262
|
-
def self.sanity_checks
|
191
|
+
def self.sanity_checks
|
263
192
|
lines = File.read(PodBuilder::project_path("Podfile")).split("\n")
|
264
193
|
stripped_lines = lines.map { |x| Podfile.strip_line(x) }.select { |x| !x.start_with?("#")}
|
265
194
|
|
@@ -267,7 +196,7 @@ module PodBuilder
|
|
267
196
|
|
268
197
|
if !expected_stripped.all? { |x| stripped_lines.include?(x) }
|
269
198
|
warn_message = "PodBuilder's post install actions missing from application Podfile!\n"
|
270
|
-
if
|
199
|
+
if OPTIONS[:allow_warnings]
|
271
200
|
puts "\n\n⚠️ #{warn_message}".yellow
|
272
201
|
else
|
273
202
|
raise "\n\n🚨️ #{warn_message}".red
|
@@ -275,60 +204,14 @@ module PodBuilder
|
|
275
204
|
end
|
276
205
|
end
|
277
206
|
|
278
|
-
def self.resolve_pods_to_build(argument_pods, buildable_items
|
207
|
+
def self.resolve_pods_to_build(argument_pods, buildable_items)
|
279
208
|
pods_to_build = []
|
280
209
|
|
281
|
-
|
282
|
-
|
283
|
-
loop do
|
284
|
-
pods_to_build = buildable_items.select { |x| argument_pods.include?(x.root_name) }
|
285
|
-
pods_to_build += other_subspecs(pods_to_build, buildable_items)
|
286
|
-
tmp_buildable_items = buildable_items - pods_to_build
|
287
|
-
|
288
|
-
expected_pods, errors = fn.call(pods_to_build, tmp_buildable_items, options)
|
289
|
-
if expected_pods.count > 0
|
290
|
-
if !options.has_key?(:auto_resolve_dependencies) && expected_pods.count > 0
|
291
|
-
raise "\n\n#{errors.join("\n")}".red
|
292
|
-
else
|
293
|
-
argument_pods = expected_pods.uniq
|
294
|
-
end
|
295
|
-
end
|
296
|
-
|
297
|
-
if !options.has_key?(:auto_resolve_dependencies) || expected_pods.count == 0
|
298
|
-
break
|
299
|
-
end
|
300
|
-
end
|
301
|
-
end
|
210
|
+
pods_to_build = buildable_items.select { |x| argument_pods.include?(x.root_name) }
|
211
|
+
pods_to_build += other_subspecs(pods_to_build, buildable_items)
|
302
212
|
|
303
213
|
return pods_to_build
|
304
|
-
end
|
305
|
-
|
306
|
-
def self.clean_frameworks_folder(buildable_items)
|
307
|
-
puts "Cleaning framework folder".yellow
|
308
|
-
|
309
|
-
expected_frameworks = buildable_items.map { |x| "#{x.module_name}.framework" }
|
310
|
-
expected_frameworks += buildable_items.map { |x| x.vendored_items }.flatten.map { |x| File.basename(x) }
|
311
|
-
expected_frameworks.uniq!
|
312
|
-
|
313
|
-
existing_frameworks = Dir.glob("#{PodBuilder::basepath("Rome")}/*.framework")
|
314
|
-
|
315
|
-
existing_frameworks.each do |existing_framework|
|
316
|
-
existing_framework_name = File.basename(existing_framework)
|
317
|
-
if !expected_frameworks.include?(existing_framework_name)
|
318
|
-
puts "Cleanining up `#{existing_framework_name}`, no longer found among dependencies".blue
|
319
|
-
FileUtils.rm_rf(existing_framework)
|
320
|
-
end
|
321
|
-
end
|
322
|
-
|
323
|
-
existing_dsyms = Dir.glob("#{PodBuilder::basepath("dSYM")}/**/*.dSYM")
|
324
|
-
existing_dsyms.each do |existing_dsym|
|
325
|
-
existing_dsym_name = File.basename(existing_dsym)
|
326
|
-
if !expected_frameworks.include?(existing_dsym_name.gsub(".dSYM", ""))
|
327
|
-
puts "Cleanining up `#{existing_dsym_name}`, no longer found among dependencies".blue
|
328
|
-
FileUtils.rm_rf(existing_dsym)
|
329
|
-
end
|
330
|
-
end
|
331
|
-
end
|
214
|
+
end
|
332
215
|
end
|
333
216
|
end
|
334
217
|
end
|