pod-builder 2.0.0.beta.18 → 2.0.0.beta.24
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 +2 -2
- data/README.md +13 -13
- data/exe/pod_builder +27 -16
- data/lib/pod_builder/command/build.rb +28 -159
- data/lib/pod_builder/command/build_all.rb +2 -2
- data/lib/pod_builder/command/clean.rb +34 -53
- data/lib/pod_builder/command/clear_lldbinit.rb +6 -2
- data/lib/pod_builder/command/deintegrate.rb +27 -6
- data/lib/pod_builder/command/generate_lfs.rb +1 -1
- 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 +39 -14
- data/lib/pod_builder/command/install_sources.rb +20 -13
- 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 +56 -14
- data/lib/pod_builder/command/sync_podfile.rb +3 -2
- data/lib/pod_builder/command/update.rb +5 -6
- data/lib/pod_builder/command/update_lldbinit.rb +10 -8
- data/lib/pod_builder/configuration.rb +27 -6
- data/lib/pod_builder/core.rb +52 -16
- data/lib/pod_builder/info.rb +11 -11
- data/lib/pod_builder/install.rb +202 -186
- data/lib/pod_builder/licenses.rb +4 -4
- data/lib/pod_builder/podfile.rb +243 -85
- data/lib/pod_builder/podfile/post_actions.rb +9 -14
- data/lib/pod_builder/podfile_cp.rb +93 -0
- data/lib/pod_builder/podfile_item.rb +41 -20
- data/lib/pod_builder/podspec.rb +33 -16
- data/lib/pod_builder/rome/post_install.rb +121 -129
- data/lib/pod_builder/rome/pre_install.rb +1 -1
- data/lib/pod_builder/templates/build_podfile.template +2 -2
- data/lib/pod_builder/version.rb +1 -1
- data/pod-builder.gemspec +2 -2
- metadata +4 -25
- data/Example/Frameworks/.gitignore +0 -6
- data/Example/Frameworks/.pod_builder/pod_builder +0 -0
- data/Example/Frameworks/PodBuilder.json +0 -38
- data/Example/Frameworks/Podfile +0 -23
- data/Example/Frameworks/Podfile.restore +0 -40
- data/Example/PodBuilderExample.xcodeproj/project.pbxproj +0 -411
- 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.xcworkspace/contents.xcworkspacedata +0 -10
- data/Example/PodBuilderExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- data/Example/PodBuilderExample/AppDelegate.swift +0 -51
- 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 -51
- data/Example/Podfile.lock +0 -435
- data/Example/Pods-acknowledgements.md +0 -210
- data/Example/Pods-acknowledgements.plist +0 -206
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58d6868b29d7c33745475969ec3efc788d50e046e4507105a015dd7897eef2a2
|
4
|
+
data.tar.gz: fc638de64c1f6df8946d33a84a3f0dcf82b821c62c0bcc14c98c346f3f07b423
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82ffb0bcbd8ea3cbd79a0bb8d0cbcca8d51799ea419c87afdd53e2832b96564f445956adccfcf79ddb1d5f4f88d2cf05a41a7e106c913f9933cf05559aa523e0
|
7
|
+
data.tar.gz: 9b59baa40cd02c07ee6a46e84f1f20becbd4588c4076056ec323e807ddafc0d53d928465a16c98ab91988aff8ea757c8892bce4dd3c184f7022edd72e2d25847
|
data/.gitignore
CHANGED
@@ -10,9 +10,9 @@ Gemfile.lock
|
|
10
10
|
.vscode/
|
11
11
|
.DS_Store
|
12
12
|
Example/Pods
|
13
|
-
Example/
|
13
|
+
Example/PodBuilder/Prebuilt
|
14
14
|
|
15
|
-
Example/
|
15
|
+
Example/PodBuilder/dSYM
|
16
16
|
|
17
17
|
Example/PodBuilderExample.xcodeproj/xcuserdata/*.xcuserdatad
|
18
18
|
Example/PodBuilderExample.xcworkspace/xcuserdata
|
data/README.md
CHANGED
@@ -19,7 +19,7 @@ You can the initialize your project to use the tool using the `init` command
|
|
19
19
|
$ cd path-to-your-repo;
|
20
20
|
$ pod_builder init
|
21
21
|
|
22
|
-
This will add a
|
22
|
+
This will add a _PodBuilder_ folder which will contain all files needed and generated by the PodBuilder.
|
23
23
|
|
24
24
|
To prebuild all dependencies run
|
25
25
|
|
@@ -35,7 +35,7 @@ Should PodBuilder not work the way you expect you can get rid of it by running
|
|
35
35
|
|
36
36
|
$ pod_builder deintegrate
|
37
37
|
|
38
|
-
Which will restore all changes that PodBUilder applied to the project (the
|
38
|
+
Which will restore all changes that PodBUilder applied to the project (the PodBuilder folder and the changes to the Podfile).
|
39
39
|
|
40
40
|
# Usage
|
41
41
|
|
@@ -43,7 +43,7 @@ Which will restore all changes that PodBUilder applied to the project (the Frame
|
|
43
43
|
|
44
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:
|
45
45
|
|
46
|
-
### 1.
|
46
|
+
### 1. PodBuilder/Podfile (aka PodBuilder-Podfile)
|
47
47
|
|
48
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.
|
49
49
|
|
@@ -51,7 +51,7 @@ This is your original Podfile and remains your **master Podfile** that you will
|
|
51
51
|
|
52
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**
|
53
53
|
|
54
|
-
### 3.
|
54
|
+
### 3. PodBuilder/Podfile.restore (aka Restore-Podfile)
|
55
55
|
|
56
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**
|
57
57
|
|
@@ -79,8 +79,8 @@ This will sets up a project to use PodBuilder.
|
|
79
79
|
|
80
80
|
The following will happen:
|
81
81
|
|
82
|
-
- Create a
|
83
|
-
- 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)
|
84
84
|
- Add an initially empty _PodBuilder.json_ configuration file
|
85
85
|
- Modify the original Podfile (Application-Podfile) with some minor customizations
|
86
86
|
- Create/Update your Gemfile adding the `gem 'pod-builder'` entry
|
@@ -95,7 +95,7 @@ Running `pod_builder build [pod name]` will precompile the pod that should be in
|
|
95
95
|
|
96
96
|
The following will happen:
|
97
97
|
|
98
|
-
- 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)
|
99
99
|
- Update the Application-Podfile replacing the pod definition with the precompiled ones
|
100
100
|
- Update/create the Podfile.restore (Restore-Podfile)
|
101
101
|
- Update/create PodBuilder.podspec which is a local podspec for your prebuilt frameworks (more on this later)
|
@@ -108,7 +108,7 @@ As `build` but will prebuild all pods defined in PodBuilder-Podfile.
|
|
108
108
|
|
109
109
|
#### `update` command
|
110
110
|
|
111
|
-
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.
|
112
112
|
|
113
113
|
#### `restore_all` command
|
114
114
|
|
@@ -116,7 +116,7 @@ Will recompile all pods to the versions defined in the Restore-Podfile. You woul
|
|
116
116
|
|
117
117
|
#### `install_sources` command
|
118
118
|
|
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
|
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.
|
120
120
|
|
121
121
|
#### `update_lldbinit` command
|
122
122
|
|
@@ -139,7 +139,7 @@ Using the switch command you can choose to integrate it:
|
|
139
139
|
- development. The _Development Pod_ used by CocoaPods
|
140
140
|
- prebuilt. Use the prebuilt pod
|
141
141
|
|
142
|
-
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
|
143
143
|
|
144
144
|
```json
|
145
145
|
[
|
@@ -310,7 +310,7 @@ Normally when multiple subspecs are specified in a target a single framework is
|
|
310
310
|
|
311
311
|
#### `lfs_update_gitattributes`
|
312
312
|
|
313
|
-
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.
|
314
314
|
|
315
315
|
|
316
316
|
#### `lfs_include_pods_folder`
|
@@ -329,7 +329,7 @@ If set to true built frameworks will include iPhone simulator slices for Apple s
|
|
329
329
|
|
330
330
|
# Behind the scenes
|
331
331
|
|
332
|
-
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.
|
333
333
|
|
334
334
|
# FAQ
|
335
335
|
|
@@ -365,7 +365,7 @@ Relaunch the build command passing `-d`, this won't delete the temporary _/tmp/p
|
|
365
365
|
|
366
366
|
### **Do I need to commit compiled frameworks?**
|
367
367
|
|
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
|
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.
|
369
369
|
|
370
370
|
|
371
371
|
### **I get an _'attempt to read non existent folder `/private/tmp/pod_builder/Pods/ podname'_ when building**
|
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,7 +71,7 @@ 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
|
74
|
+
opts.on("-f", "--force", "Rebuild items even when no code change is detected") do |o|
|
75
75
|
OPTIONS[:force_rebuild] = false
|
76
76
|
end
|
77
77
|
opts.on("-w", "--allow-warnings", "Allow warnings") do |o|
|
@@ -103,7 +103,7 @@ Options:
|
|
103
103
|
opts.on("-u", "--skip-repo-update", "Skip CocoaPods repo update") do |o|
|
104
104
|
OPTIONS[:update_repos] = false
|
105
105
|
end
|
106
|
-
opts.on("-f", "--force", "Rebuild
|
106
|
+
opts.on("-f", "--force", "Rebuild items even when no code change is detected") do |o|
|
107
107
|
OPTIONS[:force_rebuild] = false
|
108
108
|
end
|
109
109
|
opts.on("-w", "--allow-warnings", "Allow warnings") do |o|
|
@@ -125,7 +125,7 @@ Usage:
|
|
125
125
|
|
126
126
|
$ pod_builder update [OPTIONS]
|
127
127
|
|
128
|
-
Rebuild
|
128
|
+
Rebuild items that are outdated
|
129
129
|
|
130
130
|
Options:
|
131
131
|
"
|
@@ -135,7 +135,7 @@ Options:
|
|
135
135
|
opts.on("-w", "--allow-warnings", "Allow warnings") do |o|
|
136
136
|
OPTIONS[:allow_warnings] = o
|
137
137
|
end
|
138
|
-
opts.on("-r", "--dry", "Determine which
|
138
|
+
opts.on("-r", "--dry", "Determine which items need to be updated") do |o|
|
139
139
|
OPTIONS[:dry_run] = o
|
140
140
|
end
|
141
141
|
opts.on("-d", "--debug", "Don't clean build folder") do |o|
|
@@ -230,10 +230,13 @@ Usage:
|
|
230
230
|
|
231
231
|
$ pod_builder clean
|
232
232
|
|
233
|
-
Remove unused
|
233
|
+
Remove unused prebuild data, dSYM and source folders.
|
234
234
|
|
235
235
|
Options:
|
236
|
-
"
|
236
|
+
"
|
237
|
+
opts.on("-u", "--skip-repo-update", "Skip CocoaPods repo update") do |o|
|
238
|
+
OPTIONS[:update_repos] = false
|
239
|
+
end
|
237
240
|
end,
|
238
241
|
:call => [
|
239
242
|
PodBuilder::Command::Clean
|
@@ -247,7 +250,7 @@ Usage:
|
|
247
250
|
|
248
251
|
$ pod_builder install_sources
|
249
252
|
|
250
|
-
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.
|
251
254
|
|
252
255
|
"
|
253
256
|
end,
|
@@ -264,9 +267,9 @@ Usage:
|
|
264
267
|
$ pod_builder update_lldbinit <LLDBINIT_PATH> <PATH>
|
265
268
|
|
266
269
|
Update LLDBINIT_PATH setting target.source-map in order to be able to step into
|
267
|
-
and debug prebuilt
|
270
|
+
and debug prebuilt prebuilt's code.
|
268
271
|
|
269
|
-
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.
|
270
273
|
|
271
274
|
"
|
272
275
|
end,
|
@@ -310,6 +313,9 @@ Options:
|
|
310
313
|
opts.on("-s", "--default", "Default version specified in PodBuilder-Podfile") do |o|
|
311
314
|
OPTIONS[:switch_mode] = "default"
|
312
315
|
end
|
316
|
+
opts.on("-a", "--all", "Include dependencies") do |o|
|
317
|
+
OPTIONS[:switch_all] = true
|
318
|
+
end
|
313
319
|
end,
|
314
320
|
:call => [
|
315
321
|
PodBuilder::Command::Switch
|
@@ -327,7 +333,12 @@ Usage:
|
|
327
333
|
You may want to run this command when you add a new pod to the PodBuilder-Podfile
|
328
334
|
and you want to integrate it in the project without rebuilding it.
|
329
335
|
|
330
|
-
|
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,
|
331
342
|
:call => [
|
332
343
|
PodBuilder::Command::SyncPodfile
|
333
344
|
]
|
@@ -367,7 +378,7 @@ Usage:
|
|
367
378
|
|
368
379
|
subcommand[:opts].order!
|
369
380
|
subcommand[:call].each do |k|
|
370
|
-
if (ret = k.call
|
381
|
+
if (ret = k.call) && ret == -1
|
371
382
|
puts subcommand[:opts].help
|
372
383
|
end
|
373
384
|
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,14 +13,14 @@ 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
22
|
|
23
|
-
install_update_repo =
|
23
|
+
install_update_repo = OPTIONS.fetch(:update_repos, true)
|
24
24
|
installer, analyzer = Analyze.installer_at(PodBuilder::basepath, install_update_repo)
|
25
25
|
|
26
26
|
all_buildable_items = Analyze.podfile_items(installer, analyzer)
|
@@ -29,9 +29,12 @@ module PodBuilder
|
|
29
29
|
|
30
30
|
build_all = argument_pods.first == "*"
|
31
31
|
if build_all
|
32
|
-
argument_pods =
|
32
|
+
argument_pods = all_buildable_items.map(&:root_name).uniq
|
33
33
|
else
|
34
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!
|
35
38
|
end
|
36
39
|
|
37
40
|
available_argument_pods = argument_pods.select { |x| all_buildable_items.map(&:root_name).include?(x) }
|
@@ -46,10 +49,10 @@ module PodBuilder
|
|
46
49
|
|
47
50
|
restore_file_error = Podfile.restore_file_sanity_check
|
48
51
|
|
49
|
-
check_splitted_subspecs_are_static(all_buildable_items
|
52
|
+
check_splitted_subspecs_are_static(all_buildable_items)
|
50
53
|
check_pods_exists(argument_pods, all_buildable_items)
|
51
54
|
|
52
|
-
pods_to_build = resolve_pods_to_build(argument_pods, buildable_items
|
55
|
+
pods_to_build = resolve_pods_to_build(argument_pods, buildable_items)
|
53
56
|
buildable_items -= pods_to_build
|
54
57
|
|
55
58
|
# We need to split pods to build in 3 groups
|
@@ -57,7 +60,7 @@ module PodBuilder
|
|
57
60
|
# 2. pods to build in release
|
58
61
|
# 3. pods to build in debug
|
59
62
|
|
60
|
-
check_not_building_development_pods(pods_to_build
|
63
|
+
check_not_building_development_pods(pods_to_build)
|
61
64
|
|
62
65
|
pods_to_build_subspecs = pods_to_build.select { |x| x.is_subspec && Configuration.subspecs_to_split.include?(x.name) }
|
63
66
|
|
@@ -83,19 +86,17 @@ module PodBuilder
|
|
83
86
|
podfile_items = podfile_items.map { |t| t.recursive_dependencies(all_buildable_items) }.flatten.uniq
|
84
87
|
podfile_content = Podfile.from_podfile_items(podfile_items, analyzer, build_configuration)
|
85
88
|
|
86
|
-
Install.podfile(podfile_content, podfile_items, podfile_items.first.build_configuration)
|
87
|
-
|
88
|
-
licenses += license_specifiers
|
89
|
+
licenses += Install.podfile(podfile_content, podfile_items, podfile_items.first.build_configuration)
|
89
90
|
|
90
91
|
# remove lockfile which gets unexplicably created
|
91
92
|
FileUtils.rm_f(PodBuilder::basepath("Podfile.lock"))
|
92
93
|
end
|
93
94
|
|
94
|
-
|
95
|
+
Clean::prebuilt_items(all_buildable_items)
|
95
96
|
|
96
97
|
Licenses::write(licenses, all_buildable_items)
|
97
98
|
|
98
|
-
GenerateLFS::call(
|
99
|
+
GenerateLFS::call()
|
99
100
|
Podspec::generate(all_buildable_items, analyzer)
|
100
101
|
|
101
102
|
builded_pods = podfiles_items.flatten
|
@@ -104,13 +105,13 @@ module PodBuilder
|
|
104
105
|
builded_pods_and_deps.select! { |x| !x.is_prebuilt }
|
105
106
|
|
106
107
|
Podfile::write_restorable(builded_pods_and_deps + prebuilt_pods_to_install, all_buildable_items, analyzer)
|
107
|
-
if !
|
108
|
+
if !OPTIONS.has_key?(:skip_prebuild_update)
|
108
109
|
Podfile::write_prebuilt(all_buildable_items, analyzer)
|
109
110
|
end
|
110
111
|
|
111
112
|
Podfile::install
|
112
113
|
|
113
|
-
sanity_checks
|
114
|
+
sanity_checks
|
114
115
|
|
115
116
|
if (restore_file_error = restore_file_error) && Configuration.restore_enabled
|
116
117
|
puts "\n\n⚠️ Podfile.restore was found invalid and was overwritten. Error:\n #{restore_file_error}".red
|
@@ -122,89 +123,6 @@ module PodBuilder
|
|
122
123
|
|
123
124
|
private
|
124
125
|
|
125
|
-
def self.license_specifiers
|
126
|
-
acknowledge_files = Dir.glob("#{PodBuilder::Configuration.build_path}/Pods/**/*acknowledgements.plist")
|
127
|
-
raise "Too many ackwnoledge files found" if acknowledge_files.count > 1
|
128
|
-
|
129
|
-
if acknowledge_file = acknowledge_files.first
|
130
|
-
plist = CFPropertyList::List.new(:file => acknowledge_file)
|
131
|
-
data = CFPropertyList.native_types(plist.value)
|
132
|
-
|
133
|
-
return data["PreferenceSpecifiers"]
|
134
|
-
end
|
135
|
-
|
136
|
-
return []
|
137
|
-
end
|
138
|
-
|
139
|
-
# def self.buildable_dependencies(pod, buildable_items)
|
140
|
-
# deps = []
|
141
|
-
|
142
|
-
# pod.dependency_names.each do |dependency|
|
143
|
-
# buildable_pods = buildable_items.select { |t| t.root_name == dependency }
|
144
|
-
# if buildable_pods.any? { |t| t.source_files.count > 0 }
|
145
|
-
# deps.push(dependency)
|
146
|
-
# end
|
147
|
-
# end
|
148
|
-
|
149
|
-
# return deps
|
150
|
-
# end
|
151
|
-
|
152
|
-
# def self.expected_common_dependencies(pods_to_build, buildable_items, options)
|
153
|
-
# warned_expected_pod_list = []
|
154
|
-
# expected_pod_list = []
|
155
|
-
# errors = []
|
156
|
-
|
157
|
-
# pods_to_build.each do |pod_to_build|
|
158
|
-
# buildable_dependencies(pod_to_build, buildable_items).each do |dependency|
|
159
|
-
# unless buildable_items.detect { |x| x.root_name == dependency || x.name == dependency } != nil
|
160
|
-
# next
|
161
|
-
# end
|
162
|
-
|
163
|
-
# buildable_items.each do |buildable_pod|
|
164
|
-
# unless !buildable_dependencies(pod_to_build, buildable_items).include?(buildable_pod.name)
|
165
|
-
# next
|
166
|
-
# end
|
167
|
-
|
168
|
-
# if buildable_dependencies(buildable_pod, buildable_items).include?(dependency) && !buildable_pod.has_subspec(dependency) && !buildable_pod.has_common_spec(dependency) then
|
169
|
-
# expected_pod_list += pods_to_build.map(&:root_name) + [buildable_pod.root_name]
|
170
|
-
# expected_pod_list.uniq!
|
171
|
-
|
172
|
-
# expected_list = expected_pod_list.join(" ")
|
173
|
-
# if !warned_expected_pod_list.include?(expected_list)
|
174
|
-
# 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")
|
175
|
-
# errors.uniq!
|
176
|
-
# warned_expected_pod_list.push(expected_list)
|
177
|
-
|
178
|
-
# if options.has_key?(:auto_resolve_dependencies)
|
179
|
-
# puts "`#{pod_to_build.name}` has the following dependencies:\n`#{buildable_dependencies(pod_to_build, buildable_items).join("`, `")}`\nWhich are in common with `#{buildable_pod.name}` and requires it to be recompiled\n\n".yellow
|
180
|
-
# end
|
181
|
-
# end
|
182
|
-
# end
|
183
|
-
# end
|
184
|
-
# end
|
185
|
-
# end
|
186
|
-
|
187
|
-
# return expected_pod_list, errors
|
188
|
-
# end
|
189
|
-
|
190
|
-
# def self.expected_parent_dependencies(pods_to_build, buildable_items, options)
|
191
|
-
# expected_pod_list = []
|
192
|
-
# errors = []
|
193
|
-
|
194
|
-
# buildable_items_dependencies = buildable_items.map(&:dependency_names).flatten.uniq
|
195
|
-
# pods_to_build.each do |pod_to_build|
|
196
|
-
# if buildable_items_dependencies.include?(pod_to_build.name)
|
197
|
-
# parent = buildable_items.detect { |x| x.dependency_names.include?(pod_to_build.name) }
|
198
|
-
|
199
|
-
# expected_pod_list += (pods_to_build + [parent]).map(&:root_name)
|
200
|
-
# expected_pod_list.uniq!
|
201
|
-
# 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")
|
202
|
-
# end
|
203
|
-
# end
|
204
|
-
|
205
|
-
# return expected_pod_list, errors
|
206
|
-
# end
|
207
|
-
|
208
126
|
def self.check_not_building_subspecs(pods_to_build)
|
209
127
|
pods_to_build.each do |pod_to_build|
|
210
128
|
if pod_to_build.include?("/")
|
@@ -214,7 +132,7 @@ module PodBuilder
|
|
214
132
|
end
|
215
133
|
|
216
134
|
def self.check_pods_exists(pods, buildable_items)
|
217
|
-
raise "
|
135
|
+
raise "\n\nEmpty Podfile?".red if buildable_items.nil?
|
218
136
|
|
219
137
|
buildable_items = buildable_items.map(&:root_name)
|
220
138
|
pods.each do |pod|
|
@@ -222,7 +140,7 @@ module PodBuilder
|
|
222
140
|
end
|
223
141
|
end
|
224
142
|
|
225
|
-
def self.check_splitted_subspecs_are_static(all_buildable_items
|
143
|
+
def self.check_splitted_subspecs_are_static(all_buildable_items)
|
226
144
|
non_static_subspecs = all_buildable_items.select { |x| x.is_subspec && x.is_static == false }
|
227
145
|
non_static_subspecs_names = non_static_subspecs.map(&:name)
|
228
146
|
|
@@ -232,11 +150,11 @@ module PodBuilder
|
|
232
150
|
return
|
233
151
|
end
|
234
152
|
|
235
|
-
warn_message = "The following pods `#{invalid_subspecs.join(" ")}` are non static
|
236
|
-
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]
|
237
155
|
puts "\n\n⚠️ #{warn_message}".yellow
|
238
156
|
else
|
239
|
-
raise "\n\n🚨️ #{warn_message}".
|
157
|
+
raise "\n\n🚨️ #{warn_message}".red
|
240
158
|
end
|
241
159
|
end
|
242
160
|
|
@@ -250,14 +168,14 @@ module PodBuilder
|
|
250
168
|
pods_with_unaligned_build_configuration = pods_with_common_deps.select { |x| x.build_configuration != pod.build_configuration }
|
251
169
|
pods_with_unaligned_build_configuration.map!(&:name)
|
252
170
|
|
253
|
-
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
|
254
172
|
end
|
255
173
|
end
|
256
174
|
|
257
|
-
def self.check_not_building_development_pods(pods
|
258
|
-
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)
|
259
177
|
pod_names = development_pods.map(&:name).join(", ")
|
260
|
-
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
|
261
179
|
end
|
262
180
|
end
|
263
181
|
|
@@ -270,7 +188,7 @@ module PodBuilder
|
|
270
188
|
return buildable_subspecs - pods_to_build
|
271
189
|
end
|
272
190
|
|
273
|
-
def self.sanity_checks
|
191
|
+
def self.sanity_checks
|
274
192
|
lines = File.read(PodBuilder::project_path("Podfile")).split("\n")
|
275
193
|
stripped_lines = lines.map { |x| Podfile.strip_line(x) }.select { |x| !x.start_with?("#")}
|
276
194
|
|
@@ -278,7 +196,7 @@ module PodBuilder
|
|
278
196
|
|
279
197
|
if !expected_stripped.all? { |x| stripped_lines.include?(x) }
|
280
198
|
warn_message = "PodBuilder's post install actions missing from application Podfile!\n"
|
281
|
-
if
|
199
|
+
if OPTIONS[:allow_warnings]
|
282
200
|
puts "\n\n⚠️ #{warn_message}".yellow
|
283
201
|
else
|
284
202
|
raise "\n\n🚨️ #{warn_message}".red
|
@@ -286,63 +204,14 @@ module PodBuilder
|
|
286
204
|
end
|
287
205
|
end
|
288
206
|
|
289
|
-
def self.resolve_pods_to_build(argument_pods, buildable_items
|
207
|
+
def self.resolve_pods_to_build(argument_pods, buildable_items)
|
290
208
|
pods_to_build = []
|
291
209
|
|
292
|
-
# fns = [method(:expected_common_dependencies), method(:expected_parent_dependencies)]
|
293
|
-
# fns.each do |fn|
|
294
|
-
# loop do
|
295
|
-
# pods_to_build = buildable_items.select { |x| argument_pods.include?(x.root_name) }
|
296
|
-
# pods_to_build += other_subspecs(pods_to_build, buildable_items)
|
297
|
-
# tmp_buildable_items = buildable_items - pods_to_build
|
298
|
-
|
299
|
-
# expected_pods, errors = fn.call(pods_to_build, tmp_buildable_items, options)
|
300
|
-
# if expected_pods.count > 0
|
301
|
-
# if !options.has_key?(:auto_resolve_dependencies) && expected_pods.count > 0
|
302
|
-
# raise "\n\n#{errors.join("\n")}".red
|
303
|
-
# else
|
304
|
-
# argument_pods = expected_pods.uniq
|
305
|
-
# end
|
306
|
-
# end
|
307
|
-
|
308
|
-
# if !options.has_key?(:auto_resolve_dependencies) || expected_pods.count == 0
|
309
|
-
# break
|
310
|
-
# end
|
311
|
-
# end
|
312
|
-
# end
|
313
|
-
|
314
210
|
pods_to_build = buildable_items.select { |x| argument_pods.include?(x.root_name) }
|
315
211
|
pods_to_build += other_subspecs(pods_to_build, buildable_items)
|
316
212
|
|
317
213
|
return pods_to_build
|
318
|
-
end
|
319
|
-
|
320
|
-
def self.clean_frameworks_folder(buildable_items)
|
321
|
-
puts "Cleaning framework folder".yellow
|
322
|
-
|
323
|
-
expected_frameworks = buildable_items.map { |x| "#{x.module_name}.framework" }
|
324
|
-
expected_frameworks += buildable_items.map { |x| x.vendored_frameworks }.flatten.map { |x| File.basename(x) }
|
325
|
-
expected_frameworks.uniq!
|
326
|
-
|
327
|
-
existing_frameworks = Dir.glob(PodBuilder::prebuiltpath("*.framework"))
|
328
|
-
|
329
|
-
existing_frameworks.each do |existing_framework|
|
330
|
-
existing_framework_name = File.basename(existing_framework)
|
331
|
-
if !expected_frameworks.include?(existing_framework_name)
|
332
|
-
puts "Cleanining up `#{existing_framework_name}`, no longer found among dependencies".blue
|
333
|
-
FileUtils.rm_rf(existing_framework)
|
334
|
-
end
|
335
|
-
end
|
336
|
-
|
337
|
-
existing_dsyms = Dir.glob(PodBuilder::dsympath("**/*.dSYM"))
|
338
|
-
existing_dsyms.each do |existing_dsym|
|
339
|
-
existing_dsym_name = File.basename(existing_dsym)
|
340
|
-
if !expected_frameworks.include?(existing_dsym_name.gsub(".dSYM", ""))
|
341
|
-
puts "Cleanining up `#{existing_dsym_name}`, no longer found among dependencies".blue
|
342
|
-
FileUtils.rm_rf(existing_dsym)
|
343
|
-
end
|
344
|
-
end
|
345
|
-
end
|
214
|
+
end
|
346
215
|
end
|
347
216
|
end
|
348
217
|
end
|