pod-builder 2.3.0 ā 3.3.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 +4 -4
- data/README.md +33 -10
- data/exe/pod_builder +0 -3
- data/lib/pod_builder/analyze.rb +12 -13
- data/lib/pod_builder/command/build.rb +87 -24
- data/lib/pod_builder/command/deintegrate.rb +11 -9
- data/lib/pod_builder/command/generate_lldbinit.rb +1 -1
- data/lib/pod_builder/command/init.rb +7 -6
- data/lib/pod_builder/command/install_sources.rb +9 -11
- data/lib/pod_builder/command/switch.rb +37 -16
- data/lib/pod_builder/command/sync_podfile.rb +11 -11
- data/lib/pod_builder/command/update.rb +0 -1
- data/lib/pod_builder/configuration.rb +43 -24
- data/lib/pod_builder/core.rb +4 -3
- data/lib/pod_builder/info.rb +1 -1
- data/lib/pod_builder/install.rb +74 -37
- data/lib/pod_builder/licenses.rb +4 -4
- data/lib/pod_builder/podfile.rb +22 -20
- data/lib/pod_builder/podfile/pre_actions_swizzles.rb +1 -1
- data/lib/pod_builder/podfile_item.rb +61 -33
- data/lib/pod_builder/podspec.rb +6 -2
- data/lib/pod_builder/post_actions.rb +46 -0
- data/lib/pod_builder/rome/post_install.rb +19 -17
- data/lib/pod_builder/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0cdcd16503f8c363779e6b63a2a7c7ff66cc867a2092c65fb3a8bcb66758cfb
|
4
|
+
data.tar.gz: 199fc74359e90c198cac6e8c5c1ea1e172ae93ffe584ccccf5c8d324cda0f761
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42587bceee70997a3a91ab5428945e9e98094500ceafca8a7de957fb60784e9e2bc84d9f823fa7c00866c5910e651aa48ad7b200924163a1d9879df241fcd541
|
7
|
+
data.tar.gz: 60f520d51741fbff7d7216d018266182f4786a5b77c7eec21495d5199752edd850dbafaecd9644217d5bfb7643e41cce88d94b09c271372af2602846cd19db5a
|
data/README.md
CHANGED
@@ -216,7 +216,7 @@ As an example here we're setting `module_name` in Google's Advertising SDK:
|
|
216
216
|
}
|
217
217
|
```
|
218
218
|
|
219
|
-
|
219
|
+
#### `skip_pods`
|
220
220
|
|
221
221
|
You may want to skip some pods to be prebuilt, you can do that as follows:
|
222
222
|
|
@@ -229,7 +229,7 @@ You may want to skip some pods to be prebuilt, you can do that as follows:
|
|
229
229
|
```
|
230
230
|
|
231
231
|
|
232
|
-
|
232
|
+
#### `force_prebuild_pods`
|
233
233
|
|
234
234
|
You may want to force some pods to be prebuilt, this might be the case for prebuilt ones (pods with a single vendored .framework) which are dependencies of othere pods
|
235
235
|
|
@@ -244,7 +244,9 @@ You may want to force some pods to be prebuilt, this might be the case for prebu
|
|
244
244
|
|
245
245
|
#### `build_settings`
|
246
246
|
|
247
|
-
|
247
|
+
These settings allow you to specify the build settings to use when compiling prebuilt items. These values won't be reflected in your project once the pod has been built.
|
248
|
+
|
249
|
+
You can override the default values which are:
|
248
250
|
|
249
251
|
```json
|
250
252
|
{
|
@@ -280,9 +282,17 @@ Like `build_settings` but per pod. Pod name can also refer to subspec.
|
|
280
282
|
|
281
283
|
Specify which build system to use to compile frameworks. Either `Legacy` (standard build system) or `Latest` (new build system). Default value: `Latest`.
|
282
284
|
|
283
|
-
#### `
|
285
|
+
#### `build_xcframeworks_all`
|
286
|
+
|
287
|
+
Specify if PodBuilder should build all pods as .xcframeworks. Will enable `library_evolution_support`. Default value: false
|
288
|
+
|
289
|
+
#### `build_xcframeworks_exclude`
|
290
|
+
|
291
|
+
Specify which pods PodBuilder should NOT be built as .xcframeworks when `build_xcframeworks_all` is true. Default value: []
|
284
292
|
|
285
|
-
|
293
|
+
#### `build_xcframeworks_include`
|
294
|
+
|
295
|
+
Specify which pods PodBuilder should be built as .xcframeworks. Will enable `library_evolution_support`. Default value: []
|
286
296
|
|
287
297
|
#### `library_evolution_support`
|
288
298
|
|
@@ -314,6 +324,22 @@ PodBuilder writes a plist and markdown license files of pods specified in the Po
|
|
314
324
|
|
315
325
|
If you use bundler to pin the version of CocoaPods in your project set this to true. Default false.
|
316
326
|
|
327
|
+
#### `post_actions`
|
328
|
+
|
329
|
+
Post actions allow to execute custom scripts after a given command (`switch`, `build`) has been performed.
|
330
|
+
|
331
|
+
You need to specify a `path` to the executable script which is relative to the _PodBuilder_ folder. Optionally you can also specify whether the command should or should not print the output to stdout/stderr by passing a bool to the `quiet` key (default: false).
|
332
|
+
|
333
|
+
```json
|
334
|
+
{
|
335
|
+
"post_actions": {
|
336
|
+
"switch" : { "path": "post_switch_action.rb", "quiet": true },
|
337
|
+
"build" : { "path": "post_buil_action.rb", "quiet": false }
|
338
|
+
}
|
339
|
+
}
|
340
|
+
```
|
341
|
+
|
342
|
+
|
317
343
|
|
318
344
|
# Behind the scenes
|
319
345
|
|
@@ -327,11 +353,8 @@ The podspec of the Pod you're trying to build doesn't specify the swift_version
|
|
327
353
|
|
328
354
|
```json
|
329
355
|
"spec_overrides": {
|
330
|
-
"Google-Mobile-Ads-SDK": {
|
331
|
-
"module_name": "GoogleMobileAds"
|
332
|
-
},
|
333
356
|
"PodWithError": {
|
334
|
-
"swift_version": "5.
|
357
|
+
"swift_version": "5.3"
|
335
358
|
}
|
336
359
|
}
|
337
360
|
```
|
@@ -357,7 +380,7 @@ Please open an issue here. You may also add the name of the pod to the [`skip_po
|
|
357
380
|
|
358
381
|
# Git LFS
|
359
382
|
|
360
|
-
We high encourage to use PodBuilder in combination with Git LFS. Tacking PodBuilder/Prebuilt/**/*.framework
|
383
|
+
We high encourage to use PodBuilder in combination with Git LFS. Tacking `PodBuilder/Prebuilt/**/*.framework/*` and `PodBuilder/Prebuilt/**/*.a` and `PodBuilder/dSYM/**/*` will ensure that your repo size stays under control with all the benefits of having prebuilt dependencies ready to use.
|
361
384
|
|
362
385
|
|
363
386
|
# Try it out!
|
data/exe/pod_builder
CHANGED
@@ -76,9 +76,6 @@ Options:
|
|
76
76
|
opts.on("-w", "--allow-warnings", "Allow warnings") do |o|
|
77
77
|
OPTIONS[:allow_warnings] = o
|
78
78
|
end
|
79
|
-
opts.on("-r", "--parent-deps", "Include all pods that depend on the specified <PODNAME...>") do |o|
|
80
|
-
OPTIONS[:resolve_parent_dependencies] = true
|
81
|
-
end
|
82
79
|
opts.on("-s", "--no-stdin", "Never request interaction with sdtin (e.g. in CI environment)") do |o|
|
83
80
|
OPTIONS[:no_stdin_available] = o
|
84
81
|
end
|
data/lib/pod_builder/analyze.rb
CHANGED
@@ -17,19 +17,18 @@ module PodBuilder
|
|
17
17
|
CLAide::Command::PluginManager.loaded_plugins["cocoapods"].push(pluginspec)
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
Dir.chdir(current_dir)
|
20
|
+
installer = nil
|
21
|
+
analyzer = nil
|
22
|
+
Dir.chdir(path) do
|
23
|
+
config = Pod::Config.new()
|
24
|
+
installer = Pod::Installer.new(config.sandbox, config.podfile, config.lockfile)
|
25
|
+
installer.repo_update = repo_update
|
26
|
+
installer.update = false
|
27
|
+
|
28
|
+
installer.prepare
|
29
|
+
|
30
|
+
analyzer = installer.resolve_dependencies
|
31
|
+
end
|
33
32
|
|
34
33
|
return installer, analyzer
|
35
34
|
end
|
@@ -32,8 +32,6 @@ module PodBuilder
|
|
32
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
35
|
argument_pods.uniq!
|
38
36
|
end
|
39
37
|
|
@@ -43,8 +41,6 @@ module PodBuilder
|
|
43
41
|
}
|
44
42
|
argument_pods = available_argument_pods.uniq
|
45
43
|
|
46
|
-
prebuilt_pods_to_install = prebuilt_items.select { |x| argument_pods.include?(x.root_name) }
|
47
|
-
|
48
44
|
Podfile.restore_podfile_clean(all_buildable_items)
|
49
45
|
|
50
46
|
restore_file_error = Podfile.restore_file_sanity_check
|
@@ -54,28 +50,53 @@ module PodBuilder
|
|
54
50
|
pods_to_build = resolve_pods_to_build(argument_pods, buildable_items)
|
55
51
|
buildable_items -= pods_to_build
|
56
52
|
|
57
|
-
|
53
|
+
argument_pods += pods_to_build.map(&:root_name)
|
54
|
+
argument_pods.uniq!
|
55
|
+
|
56
|
+
# We need to split pods to build in 4 groups
|
58
57
|
# 1. pods to build in release
|
59
58
|
# 2. pods to build in debug
|
59
|
+
# 3. pods to build in release as xcframeworks
|
60
|
+
# 4. pods to build in debug as xcframeworks
|
60
61
|
|
61
62
|
check_not_building_development_pods(pods_to_build)
|
62
63
|
|
64
|
+
# We need to recursively add dependencies to properly split pods in groups.
|
65
|
+
# Example:
|
66
|
+
# 1. PodA has a dep to PodB
|
67
|
+
# 2. PodB is marked to be built as xcframework
|
68
|
+
# 3. We rebuild PodA only (pods_to_build contains only PodA)
|
69
|
+
# 4. We need to add dependencies recursively so that PodB is is added to pods_to_build_release_xcframework
|
70
|
+
pods_to_build = pods_to_build.map { |t| t.recursive_dependencies(all_buildable_items) }.flatten.uniq
|
71
|
+
|
63
72
|
pods_to_build_debug = pods_to_build.select { |x| x.build_configuration == "debug" }
|
64
73
|
pods_to_build_release = pods_to_build - pods_to_build_debug
|
65
74
|
|
75
|
+
pods_to_build_debug_xcframework = pods_to_build_debug.select { |x| x.build_xcframework }
|
76
|
+
pods_to_build_debug -= pods_to_build_debug_xcframework
|
77
|
+
|
78
|
+
pods_to_build_release_xcframework = pods_to_build_release.select { |x| x.build_xcframework }
|
79
|
+
pods_to_build_release -= pods_to_build_release_xcframework
|
80
|
+
|
66
81
|
check_dependencies_build_configurations(all_buildable_items)
|
67
82
|
|
68
|
-
|
83
|
+
# When building mixed framwork/xcframeworks pods xcframeworks should be built last
|
84
|
+
# so that the .xcframework overwrite the .framwork if the same pod needs to be built
|
85
|
+
# in both ways.
|
86
|
+
# For example we might have configured to build onlt PodA as xcframework, another pod
|
87
|
+
# PodB has a dependency to PodA. When Building PodB, PodA gets rebuilt as .framework
|
88
|
+
# but then PodA gets rebuilt again as .xcframework overwriting the .framework.
|
89
|
+
podfiles_items = [pods_to_build_debug] + [pods_to_build_release] + [pods_to_build_debug_xcframework] + [pods_to_build_release_xcframework]
|
69
90
|
|
70
91
|
install_using_frameworks = Podfile::install_using_frameworks(analyzer)
|
71
92
|
if Configuration.react_native_project
|
72
93
|
if install_using_frameworks
|
73
|
-
raise "\n\nOnly static library packaging currently supported for react native projects. Please remove 'use_frameworks!' in #{PodBuilder::basepath("Podfile")}".red
|
94
|
+
raise "\n\nOnly static library packaging currently supported for react native projects. Please remove 'use_frameworks!' in #{PodBuilder::basepath("Podfile")}\n".red
|
74
95
|
end
|
75
96
|
prepare_defines_modules_override(all_buildable_items)
|
76
97
|
else
|
77
98
|
unless install_using_frameworks
|
78
|
-
raise "\n\nOnly framework packaging currently supported. Please add 'use_frameworks!' at root level (not nested in targets) in #{PodBuilder::basepath("Podfile")}".red
|
99
|
+
raise "\n\nOnly framework packaging currently supported. Please add 'use_frameworks!' at root level (not nested in targets) in #{PodBuilder::basepath("Podfile")}\n".red
|
79
100
|
end
|
80
101
|
end
|
81
102
|
|
@@ -84,11 +105,17 @@ module PodBuilder
|
|
84
105
|
install_result = InstallResult.new
|
85
106
|
podfiles_items.reject { |x| x.empty? }.each do |podfile_items|
|
86
107
|
build_configuration = podfile_items.map(&:build_configuration).uniq.first
|
87
|
-
|
108
|
+
|
109
|
+
# We need to recursively find dependencies again because some of the required dependencies might have been moved to a separate group
|
110
|
+
# Example:
|
111
|
+
# 1. PodA has a dep to PodB
|
112
|
+
# 2. PodB is marked to be built as xcframework -> PodB will be added to pods_to_build_release_xcframework and won't be present in
|
113
|
+
# pods_to_build_release and therefore build will fail
|
88
114
|
podfile_items = podfile_items.map { |t| t.recursive_dependencies(all_buildable_items) }.flatten.uniq
|
89
|
-
podfile_content = Podfile.from_podfile_items(podfile_items, analyzer, build_configuration, install_using_frameworks, build_catalyst, Configuration.build_xcframeworks)
|
90
115
|
|
91
|
-
|
116
|
+
podfile_content = Podfile.from_podfile_items(podfile_items, analyzer, build_configuration, install_using_frameworks, build_catalyst, podfile_items.first.build_xcframework)
|
117
|
+
|
118
|
+
install_result += Install.podfile(podfile_content, podfile_items, argument_pods, podfile_items.first.build_configuration)
|
92
119
|
|
93
120
|
FileUtils.rm_f(PodBuilder::basepath("Podfile.lock"))
|
94
121
|
end
|
@@ -106,6 +133,7 @@ module PodBuilder
|
|
106
133
|
builded_pods_and_deps = podfiles_items.flatten.map { |t| t.recursive_dependencies(all_buildable_items) }.flatten.uniq
|
107
134
|
builded_pods_and_deps.select! { |x| !x.is_prebuilt }
|
108
135
|
|
136
|
+
prebuilt_pods_to_install = prebuilt_items.select { |x| argument_pods.include?(x.root_name) }
|
109
137
|
Podfile::write_restorable(builded_pods_and_deps + prebuilt_pods_to_install, all_buildable_items, analyzer)
|
110
138
|
if !OPTIONS.has_key?(:skip_prebuild_update)
|
111
139
|
Podfile::write_prebuilt(all_buildable_items, analyzer)
|
@@ -119,6 +147,8 @@ module PodBuilder
|
|
119
147
|
puts "\n\nā ļø Podfile.restore was found invalid and was overwritten. Error:\n #{restore_file_error}".red
|
120
148
|
end
|
121
149
|
|
150
|
+
Configuration.post_actions[:build]&.execute()
|
151
|
+
|
122
152
|
puts "\n\nš done!\n".green
|
123
153
|
return 0
|
124
154
|
end
|
@@ -126,10 +156,41 @@ module PodBuilder
|
|
126
156
|
private
|
127
157
|
|
128
158
|
def self.should_build_catalyst(installer)
|
129
|
-
|
159
|
+
integrate_targets = installer.podfile.installation_options.integrate_targets
|
160
|
+
|
161
|
+
# NOTE:
|
162
|
+
# When `integrate_targets` is false,
|
163
|
+
# `user_project` is nil and Build Settings cannot be collected,
|
164
|
+
# so collect Build Settings from xcodeproj and root xcodeproj defined in the Podfile
|
165
|
+
# ref:
|
166
|
+
# https://github.com/Subito-it/PodBuilder/issues/39
|
167
|
+
#
|
168
|
+
if integrate_targets
|
169
|
+
build_settings = installer.analysis_result.targets.map { |t| t.user_project.root_object.targets.map { |u| u.build_configuration_list.build_configurations.map { |v| v.build_settings } } }.flatten
|
170
|
+
else
|
171
|
+
# Find all `xcodeproj` in Podfile
|
172
|
+
user_projects_build_settings = installer.analysis_result.targets.map { |t|
|
173
|
+
user_project_path = PodBuilder.basepath + '/' + t.target_definition.user_project_path
|
174
|
+
project = Xcodeproj::Project.open(user_project_path)
|
175
|
+
project.root_object.targets.map { |u| u.build_configuration_list.build_configurations.map { |v| v.build_settings } }
|
176
|
+
}
|
177
|
+
.flatten
|
178
|
+
.compact
|
179
|
+
|
180
|
+
# Find root `xcodeproj`
|
181
|
+
project = Xcodeproj::Project.open(PodBuilder.find_xcodeproj)
|
182
|
+
root_project_build_setting = project
|
183
|
+
.root_object
|
184
|
+
.targets
|
185
|
+
.map { |u| u.build_configuration_list.build_configurations.map { |v| v.build_settings } }
|
186
|
+
.flatten
|
187
|
+
|
188
|
+
build_settings = user_projects_build_settings | root_project_build_setting
|
189
|
+
end
|
190
|
+
|
130
191
|
build_catalyst = build_settings.detect { |t| t["SUPPORTS_MACCATALYST"] == "YES" } != nil
|
131
192
|
|
132
|
-
puts "\nTo support Catalyst you should enable 'build_xcframeworks' in PodBuilder.json\n".red if build_catalyst && !Configuration.
|
193
|
+
puts "\nTo support Catalyst you should enable 'build_xcframeworks' in PodBuilder.json\n".red if build_catalyst && !Configuration.build_xcframeworks_all
|
133
194
|
|
134
195
|
return build_catalyst
|
135
196
|
end
|
@@ -151,11 +212,11 @@ module PodBuilder
|
|
151
212
|
end
|
152
213
|
|
153
214
|
def self.check_pods_exists(pods, buildable_items)
|
154
|
-
raise "\n\nEmpty Podfile
|
215
|
+
raise "\n\nEmpty Podfile?\n".red if buildable_items.nil?
|
155
216
|
|
156
217
|
buildable_items = buildable_items.map(&:root_name)
|
157
218
|
pods.each do |pod|
|
158
|
-
raise "\n\nPod `#{pod}` wasn't found in Podfile.\n\nFound:\n#{buildable_items.join("\n")}\n
|
219
|
+
raise "\n\nPod `#{pod}` wasn't found in Podfile.\n\nFound:\n#{buildable_items.join("\n")}\n".red if !buildable_items.include?(pod)
|
159
220
|
end
|
160
221
|
end
|
161
222
|
|
@@ -169,7 +230,7 @@ module PodBuilder
|
|
169
230
|
pods_with_unaligned_build_configuration = pods_with_common_deps.select { |x| x.build_configuration != pod.build_configuration }
|
170
231
|
pods_with_unaligned_build_configuration.map!(&:name)
|
171
232
|
|
172
|
-
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
|
233
|
+
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\n".red if pods_with_unaligned_build_configuration.count > 0
|
173
234
|
end
|
174
235
|
end
|
175
236
|
|
@@ -200,7 +261,7 @@ module PodBuilder
|
|
200
261
|
if OPTIONS[:allow_warnings]
|
201
262
|
puts "\n\n#{warn_message}".yellow
|
202
263
|
else
|
203
|
-
raise "\n\n#{warn_message}".red
|
264
|
+
raise "\n\n#{warn_message}\n".red
|
204
265
|
end
|
205
266
|
end
|
206
267
|
end
|
@@ -211,15 +272,17 @@ module PodBuilder
|
|
211
272
|
pods_to_build = buildable_items.select { |x| argument_pods.include?(x.root_name) }
|
212
273
|
pods_to_build += other_subspecs(pods_to_build, buildable_items)
|
213
274
|
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
end
|
275
|
+
# Build all pods that depend on the those that were explictly passed by the user
|
276
|
+
dependencies = []
|
277
|
+
buildable_items.each do |pod|
|
278
|
+
if !(pod.dependencies(buildable_items) & pods_to_build).empty?
|
279
|
+
dependencies.push(pod)
|
220
280
|
end
|
221
|
-
pods_to_build += dependencies
|
222
281
|
end
|
282
|
+
log = dependencies.reject { |t| pods_to_build.map(&:root_name).include?(t.root_name) }.map(&:root_name)
|
283
|
+
puts "Adding inverse dependencies: #{log.join(", ")}".blue
|
284
|
+
|
285
|
+
pods_to_build += dependencies
|
223
286
|
|
224
287
|
return pods_to_build.uniq
|
225
288
|
end
|
@@ -43,15 +43,16 @@ module PodBuilder
|
|
43
43
|
|
44
44
|
PodBuilder::safe_rm_rf(Configuration.base_path)
|
45
45
|
|
46
|
-
Dir.chdir(PodBuilder::project_path)
|
47
|
-
|
48
|
-
|
46
|
+
Dir.chdir(PodBuilder::project_path) do
|
47
|
+
bundler_prefix = Configuration.use_bundler ? "bundle exec " : ""
|
48
|
+
system("#{bundler_prefix}pod install;")
|
49
49
|
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
license_base = PodBuilder::project_path(Configuration.license_filename)
|
51
|
+
FileUtils.rm_f("#{license_base}.plist")
|
52
|
+
FileUtils.rm_f("#{license_base}.md")
|
53
53
|
|
54
|
-
|
54
|
+
update_gemfile
|
55
|
+
end
|
55
56
|
|
56
57
|
puts "\n\nš done!\n".green
|
57
58
|
return 0
|
@@ -89,8 +90,9 @@ module PodBuilder
|
|
89
90
|
gemfile_lines.select! { |x| !trim_gemfile_line(x).include?(trim_gemfile_line(podbuilder_line)) }
|
90
91
|
File.write(gemfile_path, gemfile_lines.join("\n"))
|
91
92
|
|
92
|
-
Dir.chdir(PodBuilder::home)
|
93
|
-
|
93
|
+
Dir.chdir(PodBuilder::home) do
|
94
|
+
system("bundle")
|
95
|
+
end
|
94
96
|
end
|
95
97
|
|
96
98
|
def self.trim_gemfile_line(line)
|
@@ -19,7 +19,7 @@ module PodBuilder
|
|
19
19
|
end
|
20
20
|
source_path = File.expand_path(source_path)
|
21
21
|
|
22
|
-
raise "\n\nSpecified path does not exists" unless File.directory?(source_path)
|
22
|
+
raise "\n\nSpecified path does not exists\n".red unless File.directory?(source_path)
|
23
23
|
end
|
24
24
|
|
25
25
|
base_path = PodBuilder::basepath
|
@@ -110,8 +110,9 @@ module PodBuilder
|
|
110
110
|
|
111
111
|
File.write(gemfile_path, gemfile_lines.join("\n"))
|
112
112
|
|
113
|
-
Dir.chdir(PodBuilder::home)
|
114
|
-
|
113
|
+
Dir.chdir(PodBuilder::home) do
|
114
|
+
system("bundle")
|
115
|
+
end
|
115
116
|
end
|
116
117
|
|
117
118
|
def self.trim_gemfile_line(line)
|
@@ -122,11 +123,11 @@ module PodBuilder
|
|
122
123
|
# React-Core.podspec
|
123
124
|
file = "React-Core.podspec"
|
124
125
|
paths = Dir.glob("#{PodBuilder::git_rootpath}/node_modules/**/#{file}")
|
125
|
-
raise "
|
126
|
+
raise "\n\nUnexpected number of #{file} found\n".red if paths.count != 1
|
126
127
|
|
127
128
|
content = File.read(paths[0])
|
128
129
|
expected_header_search_path_prefix = "s.pod_target_xcconfig = { \"HEADER_SEARCH_PATHS\" => \""
|
129
|
-
raise "
|
130
|
+
raise "\n\nExpected header search path entry not found\n".red unless content.include?(expected_header_search_path_prefix)
|
130
131
|
|
131
132
|
content.sub!(expected_header_search_path_prefix, "#{expected_header_search_path_prefix}\\\"$(PODS_ROOT)/Headers/Public/Flipper-Folly\\\" ")
|
132
133
|
File.write(paths[0], content)
|
@@ -134,11 +135,11 @@ module PodBuilder
|
|
134
135
|
# React-CoreModules.podspec
|
135
136
|
file = "React-CoreModules.podspec"
|
136
137
|
paths = Dir.glob("#{PodBuilder::git_rootpath}/node_modules/**/#{file}")
|
137
|
-
raise "
|
138
|
+
raise "\n\nUnexpected number of #{file} found\n".red if paths.count != 1
|
138
139
|
|
139
140
|
content = File.read(paths[0])
|
140
141
|
expected_header_search_path_prefix = "\"HEADER_SEARCH_PATHS\" => \""
|
141
|
-
raise "
|
142
|
+
raise "\n\nExpected header search path entry not found\n".red unless content.include?(expected_header_search_path_prefix)
|
142
143
|
|
143
144
|
content.sub!(expected_header_search_path_prefix, "#{expected_header_search_path_prefix}\\\"$(PODS_ROOT)/Headers/Public/Flipper-Folly\\\" ")
|
144
145
|
File.write(paths[0], content)
|
@@ -45,19 +45,17 @@ module PodBuilder
|
|
45
45
|
dest_path = PodBuilder::basepath("Sources")
|
46
46
|
FileUtils.mkdir_p(dest_path)
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
raise "\n\nFailed cloning #{spec.name}".red if !system("git clone #{spec.repo} #{spec.podspec_name}")
|
48
|
+
Dir.chdir(dest_path) do
|
49
|
+
repo_dir = File.join(dest_path, spec.podspec_name)
|
50
|
+
if !File.directory?(repo_dir)
|
51
|
+
raise "\n\nFailed cloning #{spec.name}".red if !system("git clone #{spec.repo} #{spec.podspec_name}")
|
52
|
+
end
|
54
53
|
end
|
55
54
|
|
56
|
-
Dir.chdir(repo_dir)
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
Dir.chdir(current_dir)
|
55
|
+
Dir.chdir(repo_dir) do
|
56
|
+
puts "Checking out #{spec.podspec_name}".yellow
|
57
|
+
raise "\n\nFailed cheking out #{spec.name}".red if !system(git_hard_checkout_cmd(spec))
|
58
|
+
end
|
61
59
|
end
|
62
60
|
|
63
61
|
def self.git_hard_checkout_cmd(spec)
|