pod-builder 2.0.0.beta.31 → 2.0.0.beta.36
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 +15 -9
- data/exe/pod_builder +14 -8
- data/lib/pod_builder/command/build.rb +30 -2
- data/lib/pod_builder/command/switch.rb +22 -1
- data/lib/pod_builder/command/update.rb +1 -1
- data/lib/pod_builder/configuration.rb +20 -17
- data/lib/pod_builder/install.rb +48 -40
- data/lib/pod_builder/podfile.rb +19 -15
- data/lib/pod_builder/podfile_item.rb +15 -6
- data/lib/pod_builder/podspec.rb +20 -11
- data/lib/pod_builder/rome/post_install.rb +128 -106
- data/lib/pod_builder/version.rb +1 -1
- data/pod-builder.gemspec +3 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 777b8b6cfc8ea30b7472322cde03ea58f8ba36cb7d9b3f345413424f773e223d
|
4
|
+
data.tar.gz: 9feb6584f9c6ef90e56797359919001216746d789838ec706eebe73acc6259b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc6ced09f8669ececcacfdb04831af14bdd12221cf50a67f57f3d5f00019aad02094ae4df8a172932990073051572c02a8c214bd39bf7eb01311c44ee10540b4
|
7
|
+
data.tar.gz: 3fce108fd76d9ed4abb0ec3fa54afc4df93cde2ffbce058edd76b44ee27229dc7f0f6429254db839765635fd109984c3f8243c91311fcb46462a77eaba4bb2e4
|
data/README.md
CHANGED
@@ -12,6 +12,10 @@ 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
|
+
## Requirements
|
16
|
+
|
17
|
+
Ruby 2.6.3 or newer. Cocoapods 1.9.0 or newer
|
18
|
+
|
15
19
|
# Quick start
|
16
20
|
|
17
21
|
You can the initialize your project to use the tool using the `init` command
|
@@ -21,15 +25,15 @@ You can the initialize your project to use the tool using the `init` command
|
|
21
25
|
|
22
26
|
This will add a _PodBuilder_ folder which will contain all files needed and generated by the PodBuilder.
|
23
27
|
|
24
|
-
To prebuild all dependencies run
|
25
|
-
|
26
|
-
$ pod_builder build_all
|
27
|
-
|
28
28
|
To prebuild just one or more specific dependencies run
|
29
29
|
|
30
30
|
$ pod_builder build Pod1 Pod2
|
31
31
|
|
32
|
-
|
32
|
+
To prebuild all dependencies run
|
33
|
+
|
34
|
+
$ pod_builder build_all
|
35
|
+
|
36
|
+
This will generate the pod frameworks which can be committed to your repo (using git LFS is highly suggested) for much faster compilation.
|
33
37
|
|
34
38
|
Should PodBuilder not work the way you expect you can get rid of it by running
|
35
39
|
|
@@ -57,7 +61,7 @@ This acts as a sort of lockfile and reflects the current state of what is instal
|
|
57
61
|
|
58
62
|
## Commands
|
59
63
|
|
60
|
-
|
64
|
+
PodBuilder comes with a rich set of commands:
|
61
65
|
|
62
66
|
- `init`: initializes a project to use PodBuilder
|
63
67
|
- `deintegrate`: deintegrates PodBuilder's initialization
|
@@ -81,7 +85,7 @@ The following will happen:
|
|
81
85
|
|
82
86
|
- Create a _PodBuilder_ folder in your repo's root.
|
83
87
|
- Copy your original Podfile to _PodBuilder/Podfile_ (PodBuilder-Podfile)
|
84
|
-
- Add
|
88
|
+
- Add a _PodBuilder.json_ configuration file
|
85
89
|
- Modify the original Podfile (Application-Podfile) with some minor customizations
|
86
90
|
- Create/Update your Gemfile adding the `gem 'pod-builder'` entry
|
87
91
|
|
@@ -116,7 +120,7 @@ Will recompile all pods to the versions defined in the Restore-Podfile. You woul
|
|
116
120
|
|
117
121
|
#### `install_sources` command
|
118
122
|
|
119
|
-
|
123
|
+
Once you prebuild a pod you can no longer debug its origianl code, 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
124
|
|
121
125
|
#### `generate_lldbinit` command
|
122
126
|
|
@@ -253,6 +257,8 @@ Xcode build settings to use. You can override the default values which are:
|
|
253
257
|
}
|
254
258
|
```
|
255
259
|
|
260
|
+
If your project uses bitcode change "ENABLE_BITCODE" to "YES". Please note that all pods that have dependencies to XCTest need to be add a `"ENABLE_BITCODE": "NO"` to the `build_settings_overrides` below.
|
261
|
+
|
256
262
|
#### `build_settings_overrides`
|
257
263
|
|
258
264
|
Like `build_settings` but per pod. Pod name can also refer to subspec.
|
@@ -272,7 +278,7 @@ Like `build_settings` but per pod. Pod name can also refer to subspec.
|
|
272
278
|
|
273
279
|
#### `build_system`
|
274
280
|
|
275
|
-
Specify which build system to use to compile frameworks. Either `Legacy` (standard build system) or `Latest` (new build system). Default value: `
|
281
|
+
Specify which build system to use to compile frameworks. Either `Legacy` (standard build system) or `Latest` (new build system). Default value: `Latest`.
|
276
282
|
|
277
283
|
#### `library_evolution_support`
|
278
284
|
|
data/exe/pod_builder
CHANGED
@@ -8,7 +8,7 @@ if show_version
|
|
8
8
|
exit(0)
|
9
9
|
end
|
10
10
|
|
11
|
-
if ENV[
|
11
|
+
if ENV["DEBUGGING"]
|
12
12
|
puts "Running in debug, injecting $LOAD_PATH"
|
13
13
|
libdir = File.expand_path("#{File.dirname(__FILE__)}/../lib")
|
14
14
|
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
|
@@ -76,9 +76,9 @@ Options:
|
|
76
76
|
opts.on("-w", "--allow-warnings", "Allow warnings") do |o|
|
77
77
|
OPTIONS[:allow_warnings] = o
|
78
78
|
end
|
79
|
-
|
80
|
-
|
81
|
-
|
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
82
|
opts.on("-s", "--no-stdin", "Never request interaction with sdtin (e.g. in CI environment)") do |o|
|
83
83
|
OPTIONS[:no_stdin_available] = o
|
84
84
|
end
|
@@ -282,7 +282,7 @@ Usage:
|
|
282
282
|
opts.banner = "
|
283
283
|
Usage:
|
284
284
|
|
285
|
-
$ pod_builder switch [OPTIONS] PODNAME
|
285
|
+
$ pod_builder switch [OPTIONS] <PODNAME...>
|
286
286
|
|
287
287
|
Switch integration between prebuilt/development/default pod version. Multiple space separated pods can be passed
|
288
288
|
|
@@ -297,8 +297,14 @@ Options:
|
|
297
297
|
opts.on("-s", "--default", "Default version specified in PodBuilder-Podfile") do |o|
|
298
298
|
OPTIONS[:switch_mode] = "default"
|
299
299
|
end
|
300
|
-
opts.on("-
|
301
|
-
OPTIONS[:
|
300
|
+
opts.on("-c", "--child-deps", "Include dependencies of the specified <PODNAME...>") do |o|
|
301
|
+
OPTIONS[:resolve_child_dependencies] = true
|
302
|
+
end
|
303
|
+
opts.on("-r", "--parent-deps", "Include all pods that depend on the specified <PODNAME...>") do |o|
|
304
|
+
OPTIONS[:resolve_parent_dependencies] = true
|
305
|
+
end
|
306
|
+
opts.on("-u", "--skip-repo-update", "Skip CocoaPods repo update (only when passing --parent-deps") do |o|
|
307
|
+
OPTIONS[:update_repos] = false
|
302
308
|
end
|
303
309
|
end,
|
304
310
|
:call => [
|
@@ -373,7 +379,7 @@ end
|
|
373
379
|
|
374
380
|
command_ret = -1
|
375
381
|
begin
|
376
|
-
unless ENV[
|
382
|
+
unless ENV["USER"] != "root"
|
377
383
|
raise "\n\nFor safety do not run this as root\n".red
|
378
384
|
end
|
379
385
|
|
@@ -72,6 +72,16 @@ module PodBuilder
|
|
72
72
|
podfiles_items = [pods_to_build_debug] + [pods_to_build_release]
|
73
73
|
|
74
74
|
install_using_frameworks = Podfile::install_using_frameworks(analyzer)
|
75
|
+
if Configuration.react_native_project
|
76
|
+
if install_using_frameworks
|
77
|
+
raise "\n\nOnly static library packaging currently supported for react native projects. Please remove 'use_frameworks!' in #{PodBuilder::basepath("Podfile")}".red
|
78
|
+
end
|
79
|
+
prepare_defines_modules_override(all_buildable_items)
|
80
|
+
else
|
81
|
+
unless install_using_frameworks
|
82
|
+
raise "\n\nOnly framework packaging currently supported. Please add 'use_frameworks!' at root level (not nested in targets) in #{PodBuilder::basepath("Podfile")}".red
|
83
|
+
end
|
84
|
+
end
|
75
85
|
|
76
86
|
install_result = InstallResult.new
|
77
87
|
podfiles_items.reject { |x| x.empty? }.each do |podfile_items|
|
@@ -118,6 +128,14 @@ module PodBuilder
|
|
118
128
|
|
119
129
|
private
|
120
130
|
|
131
|
+
def self.prepare_defines_modules_override(all_buildable_items)
|
132
|
+
all_buildable_items.each do |item|
|
133
|
+
unless item.defines_module.nil?
|
134
|
+
Pod::PodTarget.modules_override[item.root_name] = item.defines_module
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
121
139
|
def self.check_not_building_subspecs(pods_to_build)
|
122
140
|
pods_to_build.each do |pod_to_build|
|
123
141
|
if pod_to_build.include?("/")
|
@@ -150,7 +168,7 @@ module PodBuilder
|
|
150
168
|
end
|
151
169
|
|
152
170
|
def self.check_not_building_development_pods(pods)
|
153
|
-
if (development_pods = pods.select { |x| x.is_development_pod }) && development_pods.count > 0 && (OPTIONS[:allow_warnings].nil? && Configuration.allow_building_development_pods == false)
|
171
|
+
if (development_pods = pods.select { |x| x.is_development_pod }) && development_pods.count > 0 && (OPTIONS[:allow_warnings].nil? && Configuration.allow_building_development_pods == false && Configuration.react_native_project == false)
|
154
172
|
pod_names = development_pods.map(&:name).join(", ")
|
155
173
|
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
|
156
174
|
end
|
@@ -187,7 +205,17 @@ module PodBuilder
|
|
187
205
|
pods_to_build = buildable_items.select { |x| argument_pods.include?(x.root_name) }
|
188
206
|
pods_to_build += other_subspecs(pods_to_build, buildable_items)
|
189
207
|
|
190
|
-
|
208
|
+
if OPTIONS[:resolve_parent_dependencies]
|
209
|
+
dependencies = []
|
210
|
+
buildable_items.each do |pod|
|
211
|
+
if !(pod.dependencies(buildable_items) & pods_to_build).empty?
|
212
|
+
dependencies.push(pod)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
pods_to_build += dependencies
|
216
|
+
end
|
217
|
+
|
218
|
+
return pods_to_build.uniq
|
191
219
|
end
|
192
220
|
end
|
193
221
|
end
|
@@ -24,8 +24,29 @@ module PodBuilder
|
|
24
24
|
pod_names_to_switch.push(pod_name_to_switch)
|
25
25
|
end
|
26
26
|
|
27
|
+
if OPTIONS[:resolve_parent_dependencies] == true
|
28
|
+
install_update_repo = OPTIONS.fetch(:update_repos, true)
|
29
|
+
installer, analyzer = Analyze.installer_at(PodBuilder::basepath, install_update_repo)
|
30
|
+
|
31
|
+
all_buildable_items = Analyze.podfile_items(installer, analyzer)
|
32
|
+
|
33
|
+
pod_names_to_switch.each do |pod_name|
|
34
|
+
if pod = (all_buildable_items.detect { |t| t.name == pod_name } || all_buildable_items.detect { |t| t.root_name == pod_name })
|
35
|
+
dependencies = []
|
36
|
+
all_buildable_items.each do |pod|
|
37
|
+
if !(pod.dependency_names & pod_names_to_switch).empty?
|
38
|
+
dependencies.push(pod.root_name)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
pod_names_to_switch += dependencies
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
pod_names_to_switch.uniq!
|
46
|
+
end
|
47
|
+
|
27
48
|
dep_pod_names_to_switch = []
|
28
|
-
if OPTIONS[:
|
49
|
+
if OPTIONS[:resolve_child_dependencies] == true
|
29
50
|
pod_names_to_switch.each do |pod|
|
30
51
|
podspec_path = PodBuilder::prebuiltpath("#{pod}/#{pod}.podspec")
|
31
52
|
unless File.exist?(podspec_path)
|
@@ -18,34 +18,37 @@ module PodBuilder
|
|
18
18
|
"Google-Mobile-Ads-SDK" => {
|
19
19
|
"module_name": "GoogleMobileAds"
|
20
20
|
},
|
21
|
-
"
|
22
|
-
"
|
23
|
-
},
|
24
|
-
"React-Core" => {
|
25
|
-
"remove_module_maps": ["glog"]
|
21
|
+
"glog" => {
|
22
|
+
"pod_target_xcconfig": { "DEFINES_MODULE": "NO" }
|
26
23
|
},
|
27
|
-
"
|
28
|
-
"
|
24
|
+
"DoubleConversion" => {
|
25
|
+
"pod_target_xcconfig": { "DEFINES_MODULE": "NO" }
|
29
26
|
},
|
30
|
-
"React-jsi" => {
|
31
|
-
"remove_module_maps": ["glog"]
|
32
|
-
},
|
33
|
-
"React-cxxreact" => {
|
34
|
-
"remove_module_maps": ["glog"]
|
35
|
-
},
|
36
27
|
"Folly" => {
|
37
|
-
"
|
28
|
+
"pod_target_xcconfig": { "DEFINES_MODULE": "NO" }
|
29
|
+
},
|
30
|
+
"Flipper-DoubleConversion" => {
|
31
|
+
"pod_target_xcconfig": { "DEFINES_MODULE": "NO" }
|
32
|
+
},
|
33
|
+
"Flipper-Folly" => {
|
34
|
+
"pod_target_xcconfig": { "DEFINES_MODULE": "NO" }
|
35
|
+
}
|
36
|
+
}.freeze
|
37
|
+
DEFAULT_BUILD_SETTINGS_OVERRIDES = {
|
38
|
+
"SBTUITestTunnelClient" => {
|
39
|
+
"ENABLE_BITCODE": "NO"
|
38
40
|
}
|
39
41
|
}.freeze
|
40
42
|
DEFAULT_SKIP_PODS = ["GoogleMaps"]
|
41
|
-
DEFAULT_FORCE_PREBUILD_PODS = [
|
42
|
-
DEFAULT_BUILD_SYSTEM = "
|
43
|
+
DEFAULT_FORCE_PREBUILD_PODS = []
|
44
|
+
DEFAULT_BUILD_SYSTEM = "Latest".freeze # either Latest (New build system) or Legacy (Standard build system)
|
43
45
|
DEFAULT_LIBRARY_EVOLUTION_SUPPORT = false
|
44
46
|
DEFAULT_PLATFORMS = ["iphoneos", "iphonesimulator", "appletvos", "appletvsimulator"].freeze
|
45
47
|
DEFAULT_BUILD_FOR_APPLE_SILICON = false
|
46
48
|
DEFAULT_BUILD_USING_REPO_PATHS = false
|
47
49
|
|
48
50
|
private_constant :DEFAULT_BUILD_SETTINGS
|
51
|
+
private_constant :DEFAULT_BUILD_SETTINGS_OVERRIDES
|
49
52
|
private_constant :DEFAULT_BUILD_SYSTEM
|
50
53
|
private_constant :DEFAULT_LIBRARY_EVOLUTION_SUPPORT
|
51
54
|
|
@@ -82,7 +85,7 @@ module PodBuilder
|
|
82
85
|
|
83
86
|
@allow_building_development_pods = false
|
84
87
|
@build_settings = DEFAULT_BUILD_SETTINGS
|
85
|
-
@build_settings_overrides =
|
88
|
+
@build_settings_overrides = DEFAULT_BUILD_SETTINGS_OVERRIDES
|
86
89
|
@build_system = DEFAULT_BUILD_SYSTEM
|
87
90
|
@library_evolution_support = DEFAULT_LIBRARY_EVOLUTION_SUPPORT
|
88
91
|
@base_path = "PodBuilder" # Not nice. This value is used only for initial initization. Once config is loaded it will be an absolute path. FIXME
|
data/lib/pod_builder/install.rb
CHANGED
@@ -20,7 +20,12 @@ begin
|
|
20
20
|
|
21
21
|
if overrides = PodBuilder::Configuration.spec_overrides[spec.name]
|
22
22
|
overrides.each do |k, v|
|
23
|
-
spec.attributes_hash[k]
|
23
|
+
if spec.attributes_hash[k].is_a?(Hash)
|
24
|
+
current = spec.attributes_hash[k]
|
25
|
+
spec.attributes_hash[k] = current.merge(v)
|
26
|
+
else
|
27
|
+
spec.attributes_hash[k] = v
|
28
|
+
end
|
24
29
|
end
|
25
30
|
end
|
26
31
|
|
@@ -47,6 +52,24 @@ begin
|
|
47
52
|
end
|
48
53
|
end
|
49
54
|
end
|
55
|
+
|
56
|
+
class Pod::PodTarget
|
57
|
+
@@modules_override = Hash.new
|
58
|
+
|
59
|
+
def self.modules_override= (x)
|
60
|
+
@@modules_override = x
|
61
|
+
end
|
62
|
+
|
63
|
+
def self.modules_override
|
64
|
+
return @@modules_override
|
65
|
+
end
|
66
|
+
|
67
|
+
alias_method :swz_defines_module?, :defines_module?
|
68
|
+
|
69
|
+
def defines_module?
|
70
|
+
return @@modules_override.has_key?(name) ? @@modules_override[name] : swz_defines_module?
|
71
|
+
end
|
72
|
+
end
|
50
73
|
|
51
74
|
# Starting from CocoaPods 1.10.0 and later resources are no longer copied inside the .framework
|
52
75
|
# when building static frameworks. While this is correct when using CP normally, for redistributable
|
@@ -71,28 +94,6 @@ begin
|
|
71
94
|
return res
|
72
95
|
end
|
73
96
|
end
|
74
|
-
|
75
|
-
class Pod::Target::BuildSettings
|
76
|
-
alias_method :swz_save_as, :save_as
|
77
|
-
|
78
|
-
@specs_remove_module_maps = Hash.new
|
79
|
-
|
80
|
-
class << self
|
81
|
-
attr_accessor :specs_remove_module_maps
|
82
|
-
end
|
83
|
-
|
84
|
-
def save_as(path)
|
85
|
-
Pod::Target::BuildSettings.specs_remove_module_maps.each do |root_name, module_maps_to_remove|
|
86
|
-
if target.name == root_name
|
87
|
-
module_maps_to_remove.each do |module_map_to_remove|
|
88
|
-
xcconfig.attributes["OTHER_CFLAGS"] = xcconfig.attributes["OTHER_CFLAGS"].gsub(/-fmodule-map-file=\S*#{module_map_to_remove}.modulemap.*?(\s|$)/, '')
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
swz_save_as(path)
|
94
|
-
end
|
95
|
-
end
|
96
97
|
rescue LoadError
|
97
98
|
# CocoaPods 1.6.2 or earlier
|
98
99
|
end
|
@@ -160,8 +161,6 @@ module PodBuilder
|
|
160
161
|
FileUtils.touch(lock_file)
|
161
162
|
|
162
163
|
prebuilt_entries = use_prebuilt_entries_for_unchanged_pods(podfile_path, podfile_items)
|
163
|
-
|
164
|
-
prepare_for_static_framework_workarounds(podfile_content, podfile_items)
|
165
164
|
|
166
165
|
install
|
167
166
|
|
@@ -177,10 +176,13 @@ module PodBuilder
|
|
177
176
|
return InstallResult.new(licenses, prebuilt_info)
|
178
177
|
rescue Exception => e
|
179
178
|
if File.directory?("#{Configuration.build_path}/Pods/Pods.xcodeproj")
|
180
|
-
|
179
|
+
activate_pod_scheme()
|
180
|
+
|
181
|
+
if ENV["DEBUGGING"]
|
181
182
|
system("xed #{Configuration.build_path}/Pods")
|
182
183
|
elsif !OPTIONS.has_key?(:no_stdin_available)
|
183
184
|
confirm = ask("\n\nOh no! Something went wrong during prebuild phase! Do you want to open the prebuild project to debug the error, you will need to add and run the Pods-Dummy scheme? [Y/N] ".red) { |yn| yn.limit = 1, yn.validate = /[yn]/i }
|
185
|
+
|
184
186
|
if confirm.downcase == 'y'
|
185
187
|
system("xed #{Configuration.build_path}/Pods")
|
186
188
|
end
|
@@ -241,16 +243,6 @@ module PodBuilder
|
|
241
243
|
return ret
|
242
244
|
end
|
243
245
|
private
|
244
|
-
|
245
|
-
def self.prepare_for_static_framework_workarounds(podfile_content, podfile_items)
|
246
|
-
unless podfile_content.include?("use_modular_headers!")
|
247
|
-
return
|
248
|
-
end
|
249
|
-
|
250
|
-
podfile_items.each do |podfile_item|
|
251
|
-
Pod::Target::BuildSettings.specs_remove_module_maps[podfile_item.root_name] = podfile_item.remove_module_maps
|
252
|
-
end
|
253
|
-
end
|
254
246
|
|
255
247
|
def self.license_specifiers
|
256
248
|
acknowledge_file = "#{Configuration.build_path}/Pods/Target Support Files/Pods-DummyTarget/Pods-DummyTarget-acknowledgements.plist"
|
@@ -335,7 +327,7 @@ module PodBuilder
|
|
335
327
|
end
|
336
328
|
|
337
329
|
def self.install
|
338
|
-
puts "
|
330
|
+
puts "Preparing build".yellow
|
339
331
|
|
340
332
|
CLAide::Command::PluginManager.load_plugins("cocoapods")
|
341
333
|
|
@@ -403,9 +395,11 @@ module PodBuilder
|
|
403
395
|
next
|
404
396
|
end
|
405
397
|
|
406
|
-
|
407
|
-
|
408
|
-
|
398
|
+
unless Dir.glob("#{source_path}/**/*").select { |t| File.file?(t) }.empty?
|
399
|
+
destination_folder = PodBuilder::prebuiltpath(root_name)
|
400
|
+
FileUtils.mkdir_p(destination_folder)
|
401
|
+
FileUtils.cp_r("#{source_path}/.", destination_folder)
|
402
|
+
end
|
409
403
|
end
|
410
404
|
|
411
405
|
# Folder won't exist if no dSYM were generated (all static libs)
|
@@ -495,5 +489,19 @@ module PodBuilder
|
|
495
489
|
return replace_path
|
496
490
|
end
|
497
491
|
end
|
492
|
+
|
493
|
+
def self.activate_pod_scheme
|
494
|
+
if scheme_file = Dir.glob("#{Configuration.build_path}/Pods/**/xcschememanagement.plist").first
|
495
|
+
plist = CFPropertyList::List.new(:file => scheme_file)
|
496
|
+
data = CFPropertyList.native_types(plist.value)
|
497
|
+
|
498
|
+
if !data.dig("SchemeUserState", "Pods-DummyTarget.xcscheme").nil?
|
499
|
+
data["SchemeUserState"]["Pods-DummyTarget.xcscheme"]["isShown"] = true
|
500
|
+
end
|
501
|
+
|
502
|
+
plist.value = CFPropertyList.guess(data)
|
503
|
+
plist.save(scheme_file, CFPropertyList::List::FORMAT_BINARY)
|
504
|
+
end
|
505
|
+
end
|
498
506
|
end
|
499
507
|
end
|
data/lib/pod_builder/podfile.rb
CHANGED
@@ -37,29 +37,36 @@ module PodBuilder
|
|
37
37
|
item_build_settings = Configuration.build_settings_overrides[item.name] || {}
|
38
38
|
|
39
39
|
# These settings need to be set as is to properly build frameworks
|
40
|
-
build_settings[
|
41
|
-
build_settings[
|
42
|
-
build_settings[
|
40
|
+
build_settings["SWIFT_COMPILATION_MODE"] = "wholemodule"
|
41
|
+
build_settings["ONLY_ACTIVE_ARCH"] = "NO"
|
42
|
+
build_settings["DEBUG_INFORMATION_FORMAT"] = "dwarf-with-dsym"
|
43
43
|
|
44
|
-
build_settings[
|
44
|
+
build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = platform.deployment_target.version # Fix compilation warnings on Xcode 12
|
45
45
|
|
46
46
|
# Don't store .pcm info in binary, see https://forums.swift.org/t/swift-behavior-of-gmodules-and-dsyms/23211/3
|
47
|
-
build_settings[
|
48
|
-
build_settings[
|
47
|
+
build_settings["CLANG_ENABLE_MODULE_DEBUGGING"] = "NO"
|
48
|
+
build_settings["OTHER_SWIFT_FLAGS"] = "$(inherited) -Xfrontend -no-clang-module-breadcrumbs"
|
49
|
+
|
50
|
+
# Ignore deprecation warnings
|
51
|
+
build_settings["GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS"] = "NO"
|
49
52
|
|
50
53
|
# Improve compile speed
|
51
|
-
build_settings[
|
52
|
-
build_settings[
|
53
|
-
build_settings[
|
54
|
+
build_settings["COMPILER_INDEX_STORE_ENABLE"] = "NO"
|
55
|
+
build_settings["SWIFT_INDEX_STORE_ENABLE"] = "NO"
|
56
|
+
build_settings["MTL_ENABLE_INDEX_STORE"] = "NO"
|
54
57
|
|
55
58
|
if Configuration.build_system == "Legacy"
|
56
|
-
build_settings[
|
59
|
+
build_settings["BUILD_LIBRARY_FOR_DISTRIBUTION"] = "NO"
|
57
60
|
raise "\n\nCan't enable library evolution support with legacy build system!".red if Configuration.library_evolution_support
|
58
61
|
elsif Configuration.library_evolution_support
|
59
|
-
build_settings[
|
62
|
+
build_settings["BUILD_LIBRARY_FOR_DISTRIBUTION"] = "YES"
|
60
63
|
end
|
61
64
|
|
62
|
-
build_settings[
|
65
|
+
build_settings["SWIFT_VERSION"] = item_build_settings["SWIFT_VERSION"] || item.swift_version || project_swift_version(analyzer)
|
66
|
+
|
67
|
+
if build_settings["ENABLE_BITCODE"] == "YES"
|
68
|
+
build_settings["BITCODE_GENERATION_MODE"] = "bitcode"
|
69
|
+
end
|
63
70
|
|
64
71
|
item_build_settings.each do |k, v|
|
65
72
|
build_settings[k] = v
|
@@ -387,9 +394,6 @@ module PodBuilder
|
|
387
394
|
def self.install_using_frameworks(analyzer)
|
388
395
|
target_settings = analyzer.podfile.target_definition_list.map(&:uses_frameworks?).uniq
|
389
396
|
if target_settings.count == 1
|
390
|
-
if target_settings.first == false && ENV['DEBUGGING'].nil?
|
391
|
-
raise "\n\nOnly framework packaging currently supported. Please add 'use_frameworks!' at Podfile root level (not nested in targets)".red
|
392
|
-
end
|
393
397
|
return target_settings.first
|
394
398
|
elsif target_settings.count > 1
|
395
399
|
raise "\n\n'use_frameworks!' should be declared only once at Podfile root level (not nested in targets)".red
|
@@ -75,13 +75,13 @@ module PodBuilder
|
|
75
75
|
#
|
76
76
|
attr_accessor :is_external
|
77
77
|
|
78
|
-
# @return [String]
|
78
|
+
# @return [String] Header directory name
|
79
79
|
#
|
80
|
-
attr_accessor :
|
80
|
+
attr_accessor :header_dir
|
81
81
|
|
82
|
-
# @return [
|
82
|
+
# @return [String] The pod's build configuration
|
83
83
|
#
|
84
|
-
attr_accessor :
|
84
|
+
attr_accessor :build_configuration
|
85
85
|
|
86
86
|
# @return [String] The pod's vendored frameworks
|
87
87
|
#
|
@@ -130,6 +130,10 @@ module PodBuilder
|
|
130
130
|
# @return [Array<String>] Default subspecs
|
131
131
|
#
|
132
132
|
attr_accessor :default_subspecs
|
133
|
+
|
134
|
+
# @return [Bool] Defines module
|
135
|
+
#
|
136
|
+
attr_accessor :defines_module
|
133
137
|
|
134
138
|
# Initialize a new instance
|
135
139
|
#
|
@@ -159,6 +163,11 @@ module PodBuilder
|
|
159
163
|
@commit = spec.root.source[:commit]
|
160
164
|
@is_external = false
|
161
165
|
end
|
166
|
+
|
167
|
+
@defines_module = nil # nil is not specified
|
168
|
+
if override = spec.attributes_hash.dig("pod_target_xcconfig", "DEFINES_MODULE")
|
169
|
+
@defines_module = (override == "YES")
|
170
|
+
end
|
162
171
|
|
163
172
|
@vendored_frameworks = extract_vendored_frameworks(spec, all_specs)
|
164
173
|
@vendored_libraries = extract_vendored_libraries(spec, all_specs)
|
@@ -176,6 +185,8 @@ module PodBuilder
|
|
176
185
|
@libraries += extract_array(spec, "library")
|
177
186
|
@libraries += extract_array(spec, "libraries")
|
178
187
|
|
188
|
+
@header_dir = spec.attributes_hash["header_dir"]
|
189
|
+
|
179
190
|
@version = spec.root.version.version
|
180
191
|
@available_versions = spec.respond_to?(:spec_source) ? spec.spec_source.versions(@root_name)&.map(&:to_s) : [@version]
|
181
192
|
|
@@ -212,8 +223,6 @@ module PodBuilder
|
|
212
223
|
@build_configuration = spec.root.attributes_hash.dig("pod_target_xcconfig", "prebuild_configuration") || "release"
|
213
224
|
@build_configuration.downcase!
|
214
225
|
|
215
|
-
@remove_module_maps = spec.root.attributes_hash["remove_module_maps"] || []
|
216
|
-
|
217
226
|
default_license = "MIT"
|
218
227
|
@license = spec.root.attributes_hash.fetch("license", {"type"=>"#{default_license}"})["type"] || default_license
|
219
228
|
@summary = spec.root.attributes_hash.fetch("summary", "A summary for #{@name}")
|
data/lib/pod_builder/podspec.rb
CHANGED
@@ -39,7 +39,7 @@ module PodBuilder
|
|
39
39
|
existing_vendored_frameworks = vendored_frameworks.select(&if_exists)
|
40
40
|
existing_vendored_frameworks_basename = vendored_frameworks.map { |t| File.basename(t) }.select(&if_exists)
|
41
41
|
vendored_frameworks = (existing_vendored_frameworks + existing_vendored_frameworks_basename).uniq
|
42
|
-
|
42
|
+
|
43
43
|
vendored_libraries = item.vendored_libraries
|
44
44
|
if install_using_frameworks
|
45
45
|
existing_vendored_libraries = vendored_libraries.map { |t| "#{item.module_name}/#{t}" }.select(&if_exists)
|
@@ -56,10 +56,10 @@ module PodBuilder
|
|
56
56
|
|
57
57
|
exclude_files = static_frameworks.map { |x| x.vendored_framework_path.nil? ? nil : "#{x.vendored_framework_path}/Info.plist" }.compact.flatten.uniq
|
58
58
|
public_headers = []
|
59
|
-
else
|
59
|
+
else
|
60
60
|
public_headers = Dir.glob(PodBuilder::prebuiltpath("#{item.root_name}/#{item.root_name}/Headers/**/*.h"))
|
61
61
|
vendored_libraries += ["#{item.root_name}/lib#{item.root_name}.a"]
|
62
|
-
vendored_libraries
|
62
|
+
vendored_libraries = vendored_libraries.select(&if_exists)
|
63
63
|
|
64
64
|
resources = ["#{item.root_name}/*.{nib,bundle,xcasset,strings,png,jpg,tif,tiff,otf,ttf,ttc,plist,json,caf,wav,p12,momd}"]
|
65
65
|
|
@@ -97,6 +97,9 @@ module PodBuilder
|
|
97
97
|
if public_headers.count > 0
|
98
98
|
podspec += "#{indentation}#{spec_var}.public_header_files = '#{item.root_name}/Headers/**/*.h'\n"
|
99
99
|
end
|
100
|
+
if !item.header_dir.nil? && !install_using_frameworks
|
101
|
+
podspec += "#{indentation}#{spec_var}.header_dir = '#{item.header_dir}'\n"
|
102
|
+
end
|
100
103
|
|
101
104
|
if item.xcconfig.keys.count > 0
|
102
105
|
xcconfig = Hash.new
|
@@ -122,20 +125,26 @@ module PodBuilder
|
|
122
125
|
podspec += "#{indentation}#{spec_var}.xcconfig = #{xcconfig.to_s}\n"
|
123
126
|
end
|
124
127
|
end
|
125
|
-
if !install_using_frameworks && spec_var == "p1"
|
128
|
+
if !install_using_frameworks && spec_var == "p1" && vendored_libraries.map { |t| File.basename(t) }.include?("lib#{item.root_name}.a" )
|
126
129
|
module_path_files = Dir.glob(PodBuilder.prebuiltpath("#{item.root_name}/**/#{item.root_name}.modulemap"))
|
127
130
|
raise "\n\nToo many module maps found for #{item.root_name}".red if module_path_files.count > 1
|
131
|
+
|
132
|
+
rel_path = Pathname.new(PodBuilder::prebuiltpath).relative_path_from(Pathname.new(PodBuilder::project_path("Pods"))).to_s
|
133
|
+
prebuilt_root_var = "#{item.root_name.upcase.gsub("-", "_")}_PREBUILT_ROOT"
|
134
|
+
|
135
|
+
static_cfg = Hash.new
|
128
136
|
if module_path_file = module_path_files.first
|
129
|
-
rel_path = Pathname.new(PodBuilder::prebuiltpath).relative_path_from(Pathname.new(PodBuilder::project_path("Pods"))).to_s
|
130
|
-
prebuilt_root_var = "#{item.root_name.upcase.gsub("-", "_")}_PREBUILT_ROOT"
|
131
137
|
module_map_rel = module_path_file.gsub(PodBuilder::prebuiltpath("#{item.root_name}/#{item.root_name}/"), "")
|
132
|
-
static_cfg = {
|
133
|
-
"SWIFT_INCLUDE_PATHS" => "$(inherited) \"$(#{prebuilt_root_var})/#{item.root_name}/#{item.root_name}\"",
|
138
|
+
static_cfg = { "SWIFT_INCLUDE_PATHS" => "$(inherited) \"$(#{prebuilt_root_var})/#{item.root_name}/#{item.root_name}\"",
|
134
139
|
"OTHER_CFLAGS" => "$(inherited) -fmodule-map-file=\"$(#{prebuilt_root_var})/#{item.root_name}/#{item.root_name}/#{module_map_rel}\"",
|
135
140
|
"OTHER_SWIFT_FLAGS" => "$(inherited) -Xcc -fmodule-map-file=\"$(#{prebuilt_root_var})/#{item.root_name}/#{item.root_name}/#{module_map_rel}\""
|
136
|
-
}
|
137
|
-
|
138
|
-
|
141
|
+
}
|
142
|
+
end
|
143
|
+
static_cfg[prebuilt_root_var] = "$(PODS_ROOT)/#{rel_path}"
|
144
|
+
|
145
|
+
podspec += "#{indentation}#{spec_var}.xcconfig = #{static_cfg.to_s}\n"
|
146
|
+
# This seems to be a viable workaround to https://github.com/CocoaPods/CocoaPods/issues/9559 and https://github.com/CocoaPods/CocoaPods/issues/8454
|
147
|
+
podspec += "#{indentation}#{spec_var}.user_target_xcconfig = { \"OTHER_LDFLAGS\" => \"$(inherited) -L\\\"$(#{prebuilt_root_var})/#{item.root_name}/#{item.root_name}\\\" -l\\\"#{item.root_name}\\\"\" }\n"
|
139
148
|
end
|
140
149
|
|
141
150
|
deps = item.dependency_names.sort
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'fourflusher'
|
4
4
|
require 'colored'
|
5
5
|
require 'pathname'
|
6
|
+
require 'ruby-progressbar'
|
6
7
|
|
7
8
|
module PodBuilder
|
8
9
|
def self.build_for_iosish_platform_framework(sandbox, build_dir, target, device, simulator, configuration, deterministic_build, build_for_apple_silicon)
|
@@ -20,7 +21,7 @@ module PodBuilder
|
|
20
21
|
excluded_archs = ["i386"] # Fixes https://github.com/Subito-it/PodBuilder/issues/17
|
21
22
|
excluded_archs += build_for_apple_silicon ? [] : ["arm64"]
|
22
23
|
xcodebuild(sandbox, target_label, simulator, deployment_target, configuration, deterministic_build, excluded_archs, {})
|
23
|
-
|
24
|
+
|
24
25
|
spec_names = target.specs.map { |spec| [spec.root.name, spec.root.module_name] }.uniq
|
25
26
|
spec_names.each do |root_name, module_name|
|
26
27
|
device_base = "#{build_dir}/#{configuration}-#{device}/#{root_name}"
|
@@ -66,45 +67,47 @@ module PodBuilder
|
|
66
67
|
FileUtils.rm_rf(simulator_framework_lib)
|
67
68
|
end
|
68
69
|
end
|
69
|
-
|
70
|
+
|
70
71
|
def self.build_for_iosish_platform_lib(sandbox, build_dir, target, device, simulator, configuration, deterministic_build, build_for_apple_silicon, prebuilt_root_paths)
|
71
72
|
raise "\n\nApple silicon hardware still unsupported since it requires to migrate to xcframeworks".red if build_for_apple_silicon
|
72
|
-
|
73
|
+
|
73
74
|
deployment_target = target.platform_deployment_target
|
74
75
|
target_label = target.cocoapods_target_label
|
75
|
-
|
76
|
+
|
76
77
|
spec_names = target.specs.map { |spec| [spec.root.name, spec.root.module_name] }.uniq
|
77
|
-
|
78
|
+
|
78
79
|
xcodebuild(sandbox, target_label, device, deployment_target, configuration, deterministic_build, [], prebuilt_root_paths)
|
79
80
|
excluded_archs = build_for_apple_silicon ? [] : ["arm64"]
|
80
81
|
xcodebuild(sandbox, target_label, simulator, deployment_target, configuration, deterministic_build, excluded_archs, prebuilt_root_paths)
|
81
|
-
|
82
|
+
|
82
83
|
spec_names.each do |root_name, module_name|
|
83
84
|
simulator_base = "#{build_dir}/#{configuration}-#{simulator}/#{root_name}"
|
84
|
-
simulator_lib = "#{simulator_base}/lib#{
|
85
|
-
|
85
|
+
simulator_lib = "#{simulator_base}/lib#{root_name}.a"
|
86
|
+
|
86
87
|
device_base = "#{build_dir}/#{configuration}-#{device}/#{root_name}"
|
87
88
|
device_lib = "#{device_base}/lib#{root_name}.a"
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
# when creating the fat library. A naive workaround is to remove the arm64 from the simulator_lib however this is wrong because
|
92
|
-
# we might actually need to have 2 separated arm64 slices, one for simulator and one for device each built with different
|
93
|
-
# compile time directives (e.g #if targetEnvironment(simulator))
|
94
|
-
#
|
95
|
-
# For the time being we remove the arm64 slice bacause otherwise the `xcrun lipo -create -output ...` would fail.
|
96
|
-
if `xcrun lipo -info #{simulator_lib}`.include?("arm64")
|
97
|
-
`xcrun lipo -remove arm64 #{simulator_lib} -o #{simulator_lib}`
|
98
|
-
end
|
99
|
-
|
100
|
-
raise "Lipo failed on #{device_lib}" unless system("xcrun lipo -create -output #{device_lib} #{device_lib} #{simulator_lib}")
|
89
|
+
|
90
|
+
unless File.file?(device_lib) && File.file?(simulator_lib)
|
91
|
+
next
|
101
92
|
end
|
102
|
-
|
93
|
+
|
94
|
+
# Starting with Xcode 12b3 the simulator binary contains an arm64 slice as well which conflict with the one in the device_lib
|
95
|
+
# when creating the fat library. A naive workaround is to remove the arm64 from the simulator_lib however this is wrong because
|
96
|
+
# we might actually need to have 2 separated arm64 slices, one for simulator and one for device each built with different
|
97
|
+
# compile time directives (e.g #if targetEnvironment(simulator))
|
98
|
+
#
|
99
|
+
# For the time being we remove the arm64 slice bacause otherwise the `xcrun lipo -create -output ...` would fail.
|
100
|
+
if `xcrun lipo -info #{simulator_lib}`.include?("arm64")
|
101
|
+
`xcrun lipo -remove arm64 #{simulator_lib} -o #{simulator_lib}`
|
102
|
+
end
|
103
|
+
|
104
|
+
raise "Lipo failed on #{device_lib}" unless system("xcrun lipo -create -output #{device_lib} #{device_lib} #{simulator_lib}")
|
105
|
+
|
103
106
|
device_headers = Dir.glob("#{device_base}/**/*.h")
|
104
107
|
simulator_headers = Dir.glob("#{simulator_base}/**/*.h")
|
105
108
|
device_headers.each do |device_path|
|
106
109
|
simulator_path = device_path.gsub(device_base, simulator_base)
|
107
|
-
|
110
|
+
|
108
111
|
merge_header_into(device_path, simulator_path)
|
109
112
|
end
|
110
113
|
simulator_only_headers = simulator_headers - device_headers.map { |t| t.gsub(device_base, simulator_base) }
|
@@ -115,12 +118,12 @@ module PodBuilder
|
|
115
118
|
FileUtils.mkdir_p(destination_folder)
|
116
119
|
FileUtils.cp(path, destination_folder)
|
117
120
|
end
|
118
|
-
|
121
|
+
|
119
122
|
swiftmodule_path = "#{simulator_base}/#{root_name}.swiftmodule"
|
120
123
|
if File.directory?(swiftmodule_path)
|
121
124
|
FileUtils.cp_r("#{swiftmodule_path}/.", "#{device_base}/#{root_name}.swiftmodule")
|
122
125
|
end
|
123
|
-
|
126
|
+
|
124
127
|
if File.exist?("#{device_base}/#{root_name}.swiftmodule")
|
125
128
|
# This is a swift pod with a swiftmodule in the root of the prebuilt folder
|
126
129
|
else
|
@@ -130,7 +133,7 @@ module PodBuilder
|
|
130
133
|
if public_headers_path.downcase != module_public_headers_path.downcase && File.directory?(public_headers_path) && File.directory?(module_public_headers_path)
|
131
134
|
# For pods with module_name != name we have to move the modulemap files to the root_name one
|
132
135
|
module_public_headers_path = "#{Configuration.build_path}/Pods/Headers/Public/#{module_name}"
|
133
|
-
FileUtils.cp_r("#{module_public_headers_path}/.", public_headers_path)
|
136
|
+
FileUtils.cp_r("#{module_public_headers_path}/.", public_headers_path, :remove_destination => true)
|
134
137
|
end
|
135
138
|
Dir.glob("#{public_headers_path}/**/*.*").each do |path|
|
136
139
|
destination_folder = "#{device_base}/Headers" + path.gsub(public_headers_path, "")
|
@@ -139,11 +142,11 @@ module PodBuilder
|
|
139
142
|
FileUtils.cp(path, destination_folder)
|
140
143
|
end
|
141
144
|
end
|
142
|
-
|
145
|
+
|
143
146
|
destination_path = "#{build_dir}/#{root_name}"
|
144
147
|
if Dir.glob("#{device_base}/**/*.{a,framework,h}").count > 0
|
145
148
|
FileUtils.mv(device_base, destination_path)
|
146
|
-
|
149
|
+
|
147
150
|
module_maps = Dir.glob("#{destination_path}/**/*.modulemap")
|
148
151
|
module_map_device_base = device_base.gsub(/^\/private/, "") + "/"
|
149
152
|
module_maps.each do |module_map|
|
@@ -154,7 +157,7 @@ module PodBuilder
|
|
154
157
|
end
|
155
158
|
end
|
156
159
|
end
|
157
|
-
|
160
|
+
|
158
161
|
def self.merge_header_into(device_file, simulator_file)
|
159
162
|
unless File.exist?(device_file) || File.exist?(simulator_file)
|
160
163
|
return
|
@@ -163,33 +166,33 @@ module PodBuilder
|
|
163
166
|
device_content = File.file?(device_file) ? File.read(device_file) : ""
|
164
167
|
simulator_content = File.file?(simulator_file) ? File.read(simulator_file) : ""
|
165
168
|
merged_content = %{
|
166
|
-
#if TARGET_OS_SIMULATOR
|
167
|
-
// ->
|
168
|
-
|
169
|
-
#{simulator_content}
|
170
|
-
|
171
|
-
// ->
|
172
|
-
#else
|
173
|
-
// ->
|
174
|
-
|
175
|
-
#{device_content}
|
176
|
-
|
177
|
-
// ->
|
178
|
-
#endif
|
169
|
+
#if TARGET_OS_SIMULATOR
|
170
|
+
// ->
|
171
|
+
|
172
|
+
#{simulator_content}
|
173
|
+
|
174
|
+
// ->
|
175
|
+
#else
|
176
|
+
// ->
|
177
|
+
|
178
|
+
#{device_content}
|
179
|
+
|
180
|
+
// ->
|
181
|
+
#endif
|
179
182
|
}
|
180
183
|
File.write(device_file, merged_content)
|
181
184
|
end
|
182
|
-
|
185
|
+
|
183
186
|
def self.add_simulator_conditional(path)
|
184
187
|
file_content = File.read(path)
|
185
188
|
content = %{
|
186
|
-
#if TARGET_OS_SIMULATOR
|
187
|
-
#{file_content}
|
188
|
-
#endif
|
189
|
+
#if TARGET_OS_SIMULATOR
|
190
|
+
#{file_content}
|
191
|
+
#endif
|
189
192
|
}
|
190
193
|
File.write(path, content)
|
191
194
|
end
|
192
|
-
|
195
|
+
|
193
196
|
def self.xcodebuild(sandbox, target, sdk='macosx', deployment_target=nil, configuration, deterministic_build, exclude_archs, prebuilt_root_paths)
|
194
197
|
args = %W(-project #{sandbox.project_path.realdirpath} -scheme #{target} -configuration #{configuration} -sdk #{sdk})
|
195
198
|
supported_platforms = { 'iphonesimulator' => 'iOS', 'appletvsimulator' => 'tvOS', 'watchsimulator' => 'watchOS' }
|
@@ -259,21 +262,35 @@ module PodBuilder
|
|
259
262
|
project = Xcodeproj::Project.open(project_path)
|
260
263
|
project.targets.each do |target|
|
261
264
|
config = target.build_configurations.find { |config| config.name.eql? configuration }
|
262
|
-
config.build_settings[
|
263
|
-
config.build_settings[
|
265
|
+
config.build_settings["DEBUG_INFORMATION_FORMAT"] = "dwarf-with-dsym"
|
266
|
+
config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
|
264
267
|
end
|
265
268
|
project.save
|
266
269
|
end
|
267
270
|
end
|
268
271
|
|
269
272
|
Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_context, user_options|
|
273
|
+
build_items_count = installer_context.umbrella_targets.map(&:specs).flatten.count * 2
|
274
|
+
progressbar = ProgressBar.create(:length => 80,
|
275
|
+
:total => build_items_count,
|
276
|
+
:title => "Building",
|
277
|
+
:format => "%t |%b>%i|".yellow)
|
278
|
+
|
279
|
+
progressbar_thread = Thread.new {
|
280
|
+
loop do
|
281
|
+
built_pods = Dir.glob("#{PodBuilder::Configuration.build_path}/build/Release*/*").count
|
282
|
+
progressbar.progress = [0, built_pods - 1].max
|
283
|
+
sleep(5)
|
284
|
+
end
|
285
|
+
}
|
286
|
+
|
270
287
|
enable_dsym = user_options.fetch('dsym', true)
|
271
288
|
configuration = user_options.fetch('configuration', 'Debug')
|
272
289
|
uses_frameworks = user_options.fetch('uses_frameworks', true)
|
273
290
|
if user_options["pre_compile"]
|
274
291
|
user_options["pre_compile"].call(installer_context)
|
275
292
|
end
|
276
|
-
|
293
|
+
|
277
294
|
prebuilt_root_paths = JSON.parse(user_options["prebuilt_root_paths"].gsub('=>', ':'))
|
278
295
|
|
279
296
|
sandbox_root = Pathname(installer_context.sandbox_root)
|
@@ -297,72 +314,77 @@ Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_conte
|
|
297
314
|
when [:tvos, false] then PodBuilder::build_for_iosish_platform_lib(sandbox, build_dir, target, 'appletvos', 'appletvsimulator', configuration, PodBuilder::Configuration.deterministic_build, PodBuilder::Configuration.build_for_apple_silicon, prebuilt_root_paths)
|
298
315
|
when [:watchos, false] then PodBuilder::build_for_iosish_platform_lib(sandbox, build_dir, target, 'watchos', 'watchsimulator', configuration, PodBuilder::Configuration.deterministic_build, PodBuilder::Configuration.build_for_apple_silicon, prebuilt_root_paths)
|
299
316
|
else raise "\n\nUnknown platform '#{target.platform_name}'".red end
|
300
|
-
|
317
|
+
end
|
301
318
|
|
302
|
-
|
319
|
+
progressbar.finish
|
320
|
+
progressbar_thread.join
|
303
321
|
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
umbrella.specs.each do |spec|
|
312
|
-
root_name = spec.name.split("/").first
|
313
|
-
|
314
|
-
if uses_frameworks
|
315
|
-
destination = File.join(base_destination, root_name)
|
316
|
-
else
|
317
|
-
destination = File.join(base_destination, root_name, root_name)
|
318
|
-
end
|
319
|
-
# Make sure the device target overwrites anything in the simulator build, otherwise iTunesConnect
|
320
|
-
# can get upset about Info.plist containing references to the simulator SDK
|
321
|
-
files = Pathname.glob("build/#{root_name}/*").reject { |f| f.to_s =~ /Pods[^.]+\.framework/ }
|
322
|
-
|
323
|
-
consumer = spec.consumer(umbrella.platform_name)
|
324
|
-
file_accessor = Pod::Sandbox::FileAccessor.new(sandbox.pod_dir(spec.root.name), consumer)
|
325
|
-
files += file_accessor.vendored_libraries
|
326
|
-
files += file_accessor.vendored_frameworks
|
327
|
-
files += file_accessor.resources
|
328
|
-
|
329
|
-
FileUtils.mkdir_p(destination)
|
330
|
-
files.each do |file|
|
331
|
-
FileUtils.cp_r(file, destination)
|
332
|
-
end
|
333
|
-
end
|
334
|
-
end
|
322
|
+
raise Pod::Informative, 'The build directory was not found in the expected location.' unless build_dir.directory?
|
323
|
+
|
324
|
+
specs = installer_context.umbrella_targets.map { |t| t.specs.map(&:name) }.flatten.map { |t| t.split("/").first }.uniq
|
325
|
+
built_count = Dir["#{build_dir}/*"].select { |t| specs.include?(File.basename(t)) }.count
|
326
|
+
Pod::UI.puts "Built #{built_count} #{'items'.pluralize(built_count)}, copying..."
|
327
|
+
|
328
|
+
base_destination.rmtree if base_destination.directory?
|
335
329
|
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
330
|
+
installer_context.umbrella_targets.each do |umbrella|
|
331
|
+
umbrella.specs.each do |spec|
|
332
|
+
root_name = spec.name.split("/").first
|
333
|
+
|
334
|
+
if uses_frameworks
|
335
|
+
destination = File.join(base_destination, root_name)
|
336
|
+
else
|
337
|
+
destination = File.join(base_destination, root_name, root_name)
|
340
338
|
end
|
339
|
+
# Make sure the device target overwrites anything in the simulator build, otherwise iTunesConnect
|
340
|
+
# can get upset about Info.plist containing references to the simulator SDK
|
341
|
+
files = Pathname.glob("build/#{root_name}/*").reject { |f| f.to_s =~ /Pods[^.]+\.framework/ }
|
341
342
|
|
342
|
-
|
343
|
-
|
343
|
+
consumer = spec.consumer(umbrella.platform_name)
|
344
|
+
file_accessor = Pod::Sandbox::FileAccessor.new(sandbox.pod_dir(spec.root.name), consumer)
|
345
|
+
files += file_accessor.vendored_libraries
|
346
|
+
files += file_accessor.vendored_frameworks
|
347
|
+
begin
|
348
|
+
files += file_accessor.resources
|
349
|
+
rescue
|
350
|
+
end
|
344
351
|
|
352
|
+
FileUtils.mkdir_p(destination)
|
345
353
|
files.each do |file|
|
346
|
-
|
347
|
-
|
348
|
-
FileUtils.rm_rf(file)
|
349
|
-
end
|
350
|
-
end
|
354
|
+
FileUtils.cp_r(file, destination)
|
355
|
+
end
|
351
356
|
end
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
else
|
359
|
-
raise "Not implemented"
|
357
|
+
end
|
358
|
+
|
359
|
+
# Depending on the resource it may happen that it is present twice, both in the .framework and in the parent folder
|
360
|
+
Dir.glob("#{base_destination}/*") do |path|
|
361
|
+
unless File.directory?(path)
|
362
|
+
return
|
360
363
|
end
|
361
364
|
|
362
|
-
|
365
|
+
files = Dir.glob("#{path}/*")
|
366
|
+
framework_files = Dir.glob("#{path}/*.framework/**/*").map { |t| File.basename(t) }
|
363
367
|
|
364
|
-
|
365
|
-
|
368
|
+
files.each do |file|
|
369
|
+
filename = File.basename(file.gsub(/\.xib$/, ".nib"))
|
370
|
+
if framework_files.include?(filename)
|
371
|
+
FileUtils.rm_rf(file)
|
372
|
+
end
|
366
373
|
end
|
367
374
|
end
|
368
|
-
|
375
|
+
|
376
|
+
if enable_dsym
|
377
|
+
dsym_source = "#{build_dir}/dSYM"
|
378
|
+
if File.directory?(dsym_source)
|
379
|
+
FileUtils.mv(dsym_source, sandbox_root.parent)
|
380
|
+
end
|
381
|
+
else
|
382
|
+
raise "Not implemented"
|
383
|
+
end
|
384
|
+
|
385
|
+
build_dir.rmtree if build_dir.directory?
|
386
|
+
|
387
|
+
if user_options["post_compile"]
|
388
|
+
user_options["post_compile"].call(installer_context)
|
389
|
+
end
|
390
|
+
end
|
data/lib/pod_builder/version.rb
CHANGED
data/pod-builder.gemspec
CHANGED
@@ -21,6 +21,8 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
|
+
spec.required_ruby_version = '>= 2.6'
|
25
|
+
|
24
26
|
spec.add_development_dependency "bundler", "~> 2.0"
|
25
27
|
spec.add_development_dependency "rake", ">= 12.3.3"
|
26
28
|
spec.add_development_dependency "ruby-debug-ide", '0.6.1'
|
@@ -33,4 +35,5 @@ Gem::Specification.new do |spec|
|
|
33
35
|
spec.add_runtime_dependency 'cocoapods-core', '~> 1.6'
|
34
36
|
spec.add_runtime_dependency 'CFPropertyList'
|
35
37
|
spec.add_runtime_dependency 'json'
|
38
|
+
spec.add_runtime_dependency 'ruby-progressbar'
|
36
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pod-builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.beta.
|
4
|
+
version: 2.0.0.beta.36
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Camin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -164,6 +164,20 @@ dependencies:
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: ruby-progressbar
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :runtime
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
167
181
|
description: Prebuild CocoaPods pods to make compiling your Xcode projects faster
|
168
182
|
email:
|
169
183
|
- tomas.camin@adevinta.com
|
@@ -226,7 +240,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
226
240
|
requirements:
|
227
241
|
- - ">="
|
228
242
|
- !ruby/object:Gem::Version
|
229
|
-
version: '
|
243
|
+
version: '2.6'
|
230
244
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
231
245
|
requirements:
|
232
246
|
- - ">"
|