pod-builder 2.0.0.beta.28 → 2.0.0.beta.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4107227dc691987a44903ad72b9c22645277a11a9b167edce277130277a0af30
4
- data.tar.gz: 398b2a514f5f38c1902d6d7e681c8f88e9bfdfeb65c4cd3272c2c2ead7b82320
3
+ metadata.gz: b58e2c327114bf83714658e6dd24e5a54ab583f42f81b41c193e83b1c4b8b0f2
4
+ data.tar.gz: fc32c5dc1aa63ad240116a0da78bfb10a9acdfb39e192d075b979dbe0828d690
5
5
  SHA512:
6
- metadata.gz: ac4d8ebc2537ab527e0563709a7f7d27d2166a21f3d19e8589324a0d9be34ed59f5f786f79b89ffed8dcf2055ff5aec0d3621c6c2194eae49cb4691634d4666a
7
- data.tar.gz: e54eaa431e3fa993f3c8911fb4f71e9bd21bcb676520cb397eb27e477bc0fb9f59063bd75d401470a7ee3dc8f6b3cb12f444764f1817751dc09576b193e11425
6
+ metadata.gz: 23eb28db1f01119fed69b0a11039049fffe6e74acef44871a61cf7745972ed52d49435febf4ee35647517d001f6292b13b766fc0c18392ae71d4877d8b95ed1a
7
+ data.tar.gz: ce587f760d65fcb04778838fb200f6f018fa8cdfb39ae33eee7f67de4d82ad761fae340abc65beaf92a6d03fdd594deba2819771d461c203b25e2c2e7986b470
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
- This will generate the pod frameworks which can be committed to your repo for a much faster compilation.
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
- Podbuilder comes with a set of commands:
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 an initially empty _PodBuilder.json_ configuration file
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
- 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.
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: `Legacy`.
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
 
@@ -300,18 +306,6 @@ PodBuilder writes a plist and markdown license files of pods specified in the Po
300
306
  }
301
307
  ```
302
308
 
303
- #### `subspecs_to_split`
304
-
305
- Normally when multiple subspecs are specified in a target a single framework is produced. There are rare cases where you specify different subspecs in different targets: a typical case is subspec specifically designed for app extensions, where you want to use a subspec in the main app and another one in the app extension.
306
-
307
- **Warning**: This will work properly only for static frameworks (_static_framework = true_ specified in the podspec). See [issue](https://github.com/CocoaPods/CocoaPods/issues/5708) and [issue](https://github.com/CocoaPods/CocoaPods/issues/5643)
308
-
309
- ```json
310
- {
311
- "subspecs_to_split": ["Podname1/Subspec1", "Podname1/Subspec2", "Podname2/Subspec1", "Podname2/Subspec1"]
312
- }
313
- ```
314
-
315
309
  #### `use_bundler`
316
310
 
317
311
  If you use bundler to pin the version of CocoaPods in your project set this to true. Default false.
@@ -8,7 +8,7 @@ if show_version
8
8
  exit(0)
9
9
  end
10
10
 
11
- if ENV['DEBUGGING']
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)
@@ -79,6 +79,9 @@ Options:
79
79
  # opts.on("-a", "--auto-resolve-deps", "Resolve pod dependencies automatically") do |o|
80
80
  # OPTIONS[:auto_resolve_dependencies] = o
81
81
  # end
82
+ opts.on("-s", "--no-stdin", "Never request interaction with sdtin (e.g. in CI environment)") do |o|
83
+ OPTIONS[:no_stdin_available] = o
84
+ end
82
85
  opts.on("-d", "--debug", "Don't clean build folder") do |o|
83
86
  OPTIONS[:debug] = o
84
87
  end
@@ -108,6 +111,9 @@ Options:
108
111
  opts.on("-w", "--allow-warnings", "Allow warnings") do |o|
109
112
  OPTIONS[:allow_warnings] = o
110
113
  end
114
+ opts.on("-s", "--no-stdin", "Never request interaction with sdtin (e.g. in CI environment)") do |o|
115
+ OPTIONS[:no_stdin_available] = o
116
+ end
111
117
  opts.on("-d", "--debug", "Don't clean build folder") do |o|
112
118
  OPTIONS[:debug] = o
113
119
  end
@@ -367,7 +373,7 @@ end
367
373
 
368
374
  command_ret = -1
369
375
  begin
370
- unless ENV['USER'] != "root"
376
+ unless ENV["USER"] != "root"
371
377
  raise "\n\nFor safety do not run this as root\n".red
372
378
  end
373
379
 
@@ -49,34 +49,27 @@ module PodBuilder
49
49
 
50
50
  restore_file_error = Podfile.restore_file_sanity_check
51
51
 
52
- check_splitted_subspecs_are_buildable(all_buildable_items, installer)
53
52
  check_pods_exists(argument_pods, all_buildable_items)
54
53
 
55
54
  pods_to_build = resolve_pods_to_build(argument_pods, buildable_items)
56
55
  buildable_items -= pods_to_build
57
56
 
58
57
  # We need to split pods to build in 3 groups
59
- # 1. subspecs: because the resulting .framework path is treated differently when added to Configuration.subspecs_to_split
60
- # 2. pods to build in release
61
- # 3. pods to build in debug
58
+ # 1. pods to build in release
59
+ # 2. pods to build in debug
62
60
 
63
61
  check_not_building_development_pods(pods_to_build)
64
62
 
65
- pods_to_build_subspecs = splitted_pods_to_build(pods_to_build, installer)
66
-
67
63
  # Remove dependencies from pods to build
68
64
  all_dependencies_name = pods_to_build.map(&:dependency_names).flatten.uniq
69
65
  pods_to_build.select! { |x| !all_dependencies_name.include?(x.name) }
70
66
 
71
- pods_to_build -= pods_to_build_subspecs.flatten
72
67
  pods_to_build_debug = pods_to_build.select { |x| x.build_configuration == "debug" }
73
68
  pods_to_build_release = pods_to_build - pods_to_build_debug
74
69
 
75
70
  check_dependencies_build_configurations(all_buildable_items)
76
71
 
77
- podfiles_items = pods_to_build_subspecs
78
- podfiles_items.push(pods_to_build_debug)
79
- podfiles_items.push(pods_to_build_release)
72
+ podfiles_items = [pods_to_build_debug] + [pods_to_build_release]
80
73
 
81
74
  install_using_frameworks = Podfile::install_using_frameworks(analyzer)
82
75
 
@@ -125,20 +118,6 @@ module PodBuilder
125
118
 
126
119
  private
127
120
 
128
- def self.splitted_pods_to_build(pods_to_build, installer)
129
- specs_by_target = installer.analysis_result.specs_by_target
130
-
131
- pods_to_build_subspecs = pods_to_build.select { |x| x.is_subspec && Configuration.subspecs_to_split.include?(x.name) }
132
-
133
- pods = []
134
- specs_by_target.each do |target, specs|
135
- grouped = pods_to_build_subspecs.group_by { |t| specs.map(&:name).include?(t.name) }
136
- pods.push(grouped[true])
137
- end
138
-
139
- return pods.compact
140
- end
141
-
142
121
  def self.check_not_building_subspecs(pods_to_build)
143
122
  pods_to_build.each do |pod_to_build|
144
123
  if pod_to_build.include?("/")
@@ -156,55 +135,6 @@ module PodBuilder
156
135
  end
157
136
  end
158
137
 
159
- def self.check_splitted_subspecs_are_buildable(all_buildable_items, installer)
160
- check_splitted_subspecs_are_static(all_buildable_items)
161
- check_splitted_subspecs_have_valid_dependencies(all_buildable_items)
162
- check_splitted_subspecs_not_in_multiple_targets(all_buildable_items, installer)
163
- end
164
-
165
- def self.check_splitted_subspecs_have_valid_dependencies(all_buildable_items)
166
- splitted_items = all_buildable_items.select { |t| Configuration.subspecs_to_split.include?(t.name) }
167
- splitted_items.each do |splitted_item|
168
- common_deps = splitted_item.dependency_names.select { |t| t.start_with?(splitted_item.root_name) }
169
-
170
- if common_deps.count > 0
171
- raise "\n\nSubspecs included in 'subspecs_to_split' cannot have dependencies to other subspecs within the spec.\n\n#{splitted_item.name} has dependencies to: '#{common_deps.join(', ')}'\n\n".red
172
- end
173
- end
174
- end
175
-
176
- def self.check_splitted_subspecs_not_in_multiple_targets(all_buildable_items, installer)
177
- specs_by_target = installer.analysis_result.specs_by_target
178
-
179
- flat_item_names = specs_by_target.values.flatten.map(&:name)
180
-
181
- splitted_items = all_buildable_items.select { |t| Configuration.subspecs_to_split.include?(t.name) }
182
-
183
- splitted_items.each do |splitted_item|
184
- if flat_item_names.count(splitted_item.name) > 1
185
- raise "\n\n'#{splitted_item.name}' is included in 'subspecs_to_split' but it is used in multiple targets. This is unsupported.\nIf possible duplicate the subspec '#{splitted_item.name}' in the podspec using different names for each target.\n".red
186
- end
187
- end
188
- end
189
-
190
- def self.check_splitted_subspecs_are_static(all_buildable_items)
191
- non_static_subspecs = all_buildable_items.select { |x| x.is_subspec && x.is_static == false }
192
- non_static_subspecs_names = non_static_subspecs.map(&:name)
193
-
194
- invalid_subspecs = Configuration.subspecs_to_split & non_static_subspecs_names # intersect
195
-
196
- unless invalid_subspecs.count > 0
197
- return
198
- end
199
-
200
- 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"
201
- if OPTIONS[:allow_warnings]
202
- puts "\n\n#{warn_message}".yellow
203
- else
204
- raise "\n\n#{warn_message}".red
205
- end
206
- end
207
-
208
138
  def self.check_dependencies_build_configurations(pods)
209
139
  pods.each do |pod|
210
140
  pod_dependency_names = pod.dependency_names.select { |x| !pod.has_common_spec(x) }
@@ -31,19 +31,6 @@ module PodBuilder
31
31
  end
32
32
  end
33
33
 
34
- splitted_specs = buildable_items.select { |t| Configuration.subspecs_to_split.include?(t.name) }
35
- splitted_specs.each do |splitted_spec|
36
- root_name = splitted_spec.root_name
37
-
38
- Dir.glob(PodBuilder::prebuiltpath("#{root_name}/Subspecs/*")).each do |path|
39
- basename = File.basename(path)
40
- unless splitted_specs.map(&:podspec_name).include?(basename)
41
- puts "Cleanining up `#{root_name}/#{basename}`, no longer found among dependencies".blue
42
- PodBuilder::safe_rm_rf(path)
43
- end
44
- end
45
- end
46
-
47
34
  puts "Cleaning dSYM folder".yellow
48
35
  module_names = buildable_items.map(&:module_name).uniq
49
36
  Dir.glob(File.join(PodBuilder::dsympath, "**/*.dSYM")).each do |path|
@@ -78,7 +65,7 @@ module PodBuilder
78
65
 
79
66
  paths_to_delete.flatten.each do |path|
80
67
  confirm = ask("#{path} unused.\nDelete it? [Y/N] ") { |yn| yn.limit = 1, yn.validate = /[yn]/i }
81
- if confirm.downcase == 'y'
68
+ if confirm.downcase == 'y' || OPTIONS.has_key?(:no_stdin_available)
82
69
  PodBuilder::safe_rm_rf(path)
83
70
  end
84
71
  end
@@ -37,15 +37,21 @@ module PodBuilder
37
37
  "remove_module_maps": ["glog"]
38
38
  }
39
39
  }.freeze
40
+ DEFAULT_BUILD_SETTINGS_OVERRIDES = {
41
+ "SBTUITestTunnelClient": {
42
+ "ENABLE_BITCODE": "NO"
43
+ }
44
+ }.freeze
40
45
  DEFAULT_SKIP_PODS = ["GoogleMaps"]
41
46
  DEFAULT_FORCE_PREBUILD_PODS = ["GoogleTagManager"]
42
- DEFAULT_BUILD_SYSTEM = "Legacy".freeze # either Latest (New build system) or Legacy (Standard build system)
47
+ DEFAULT_BUILD_SYSTEM = "Latest".freeze # either Latest (New build system) or Legacy (Standard build system)
43
48
  DEFAULT_LIBRARY_EVOLUTION_SUPPORT = false
44
49
  DEFAULT_PLATFORMS = ["iphoneos", "iphonesimulator", "appletvos", "appletvsimulator"].freeze
45
50
  DEFAULT_BUILD_FOR_APPLE_SILICON = false
46
51
  DEFAULT_BUILD_USING_REPO_PATHS = false
47
52
 
48
53
  private_constant :DEFAULT_BUILD_SETTINGS
54
+ private_constant :DEFAULT_BUILD_SETTINGS_OVERRIDES
49
55
  private_constant :DEFAULT_BUILD_SYSTEM
50
56
  private_constant :DEFAULT_LIBRARY_EVOLUTION_SUPPORT
51
57
 
@@ -61,7 +67,6 @@ module PodBuilder
61
67
  attr_accessor :skip_pods
62
68
  attr_accessor :force_prebuild_pods
63
69
  attr_accessor :license_filename
64
- attr_accessor :subspecs_to_split
65
70
  attr_accessor :development_pods_paths
66
71
  attr_accessor :build_base_path
67
72
  attr_accessor :build_path
@@ -83,7 +88,7 @@ module PodBuilder
83
88
 
84
89
  @allow_building_development_pods = false
85
90
  @build_settings = DEFAULT_BUILD_SETTINGS
86
- @build_settings_overrides = {}
91
+ @build_settings_overrides = DEFAULT_BUILD_SETTINGS_OVERRIDES
87
92
  @build_system = DEFAULT_BUILD_SYSTEM
88
93
  @library_evolution_support = DEFAULT_LIBRARY_EVOLUTION_SUPPORT
89
94
  @base_path = "PodBuilder" # Not nice. This value is used only for initial initization. Once config is loaded it will be an absolute path. FIXME
@@ -92,7 +97,6 @@ module PodBuilder
92
97
  @skip_pods = DEFAULT_SKIP_PODS
93
98
  @force_prebuild_pods = DEFAULT_FORCE_PREBUILD_PODS
94
99
  @license_filename = "Pods-acknowledgements"
95
- @subspecs_to_split = []
96
100
  @development_pods_paths = []
97
101
  @build_base_path = "/tmp/pod_builder".freeze
98
102
  @build_path = build_base_path
@@ -180,11 +184,6 @@ module PodBuilder
180
184
  Configuration.license_filename = value
181
185
  end
182
186
  end
183
- if value = json["subspecs_to_split"]
184
- if value.is_a?(Array) && value.count > 0
185
- Configuration.subspecs_to_split = value
186
- end
187
- end
188
187
  if value = json["project_name"]
189
188
  if value.is_a?(String) && value.length > 0
190
189
  Configuration.project_name = value
@@ -263,7 +262,6 @@ module PodBuilder
263
262
  config["build_system"] = Configuration.build_system
264
263
  config["library_evolution_support"] = Configuration.library_evolution_support
265
264
  config["license_filename"] = Configuration.license_filename
266
- config["subspecs_to_split"] = Configuration.subspecs_to_split
267
265
  config["restore_enabled"] = Configuration.restore_enabled
268
266
  config["allow_building_development_pods"] = Configuration.allow_building_development_pods
269
267
  config["use_bundler"] = Configuration.use_bundler
@@ -177,10 +177,13 @@ module PodBuilder
177
177
  return InstallResult.new(licenses, prebuilt_info)
178
178
  rescue Exception => e
179
179
  if File.directory?("#{Configuration.build_path}/Pods/Pods.xcodeproj")
180
- if ENV['DEBUGGING']
180
+ activate_pod_scheme()
181
+
182
+ if ENV["DEBUGGING"]
181
183
  system("xed #{Configuration.build_path}/Pods")
182
- else
184
+ elsif !OPTIONS.has_key?(:no_stdin_available)
183
185
  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 }
186
+
184
187
  if confirm.downcase == 'y'
185
188
  system("xed #{Configuration.build_path}/Pods")
186
189
  end
@@ -217,9 +220,6 @@ module PodBuilder
217
220
 
218
221
  podbuilder_file = File.join(path, Configuration.prebuilt_info_filename)
219
222
  entry = podfile_item.entry(true, false)
220
- if Configuration.subspecs_to_split.include?(podfile_item.name)
221
- entry.gsub!("'#{podfile_item.name}'", "'#{podfile_item.root_name}'")
222
- end
223
223
 
224
224
  data = {}
225
225
  data["entry"] = entry
@@ -233,7 +233,7 @@ module PodBuilder
233
233
  subspec_self_deps = subspecs_deps.select { |x| x.start_with?("#{prebuilt_name}/") }
234
234
  data["specs"] = (specs.map(&:name) + subspec_self_deps).uniq
235
235
  data["is_static"] = podfile_item.is_static
236
- data["original_compile_path"] = Configuration.build_path
236
+ data["original_compile_path"] = Pathname.new(Configuration.build_path).realpath.to_s
237
237
  if hash = build_folder_hash(podfile_item, gitignored_files)
238
238
  data["build_folder_hash"] = hash
239
239
  end
@@ -313,11 +313,8 @@ module PodBuilder
313
313
  podspec_path = item.prebuilt_podspec_path
314
314
  if last_build_folder_hash = build_folder_hash_in_prebuilt_info_file(item)
315
315
  if last_build_folder_hash == build_folder_hash(item, gitignored_files)
316
- if Configuration.subspecs_to_split.include?(item.name)
317
- puts "No changes detected to '#{item.name}', will skip rebuild".blue
318
- else
319
- puts "No changes detected to '#{item.root_name}', will skip rebuild".blue
320
- end
316
+ puts "No changes detected to '#{item.root_name}', will skip rebuild".blue
317
+
321
318
  replaced_items.push(item)
322
319
 
323
320
  podfile_items.select { |t| t.root_name == item.root_name }.each do |replace_item|
@@ -341,7 +338,7 @@ module PodBuilder
341
338
  end
342
339
 
343
340
  def self.install
344
- puts "Prebuilding items".yellow
341
+ puts "Preparing build".yellow
345
342
 
346
343
  CLAide::Command::PluginManager.load_plugins("cocoapods")
347
344
 
@@ -385,33 +382,21 @@ module PodBuilder
385
382
 
386
383
  non_prebuilt_items = podfile_items.reject(&:is_prebuilt)
387
384
 
388
- splitted_pods = non_prebuilt_items.map { |t| splitted_pod(t, podfile_items) }.flatten.uniq
389
- splitted_pods_root_name = splitted_pods.map { |t| t.root_name }.uniq
390
-
391
- pod_names = non_prebuilt_items.reject { |t| splitted_pods_root_name.include?(t.root_name) }.map(&:root_name).uniq + splitted_pods.map(&:name)
385
+ pod_names = non_prebuilt_items.map(&:root_name).uniq
392
386
 
393
387
  pod_names.reject! { |t|
394
388
  folder_path = PodBuilder::buildpath_prebuiltpath(t)
395
389
  File.directory?(folder_path) && Dir.empty?(folder_path) # When using prebuilt items we end up with empty folders
396
390
  }
397
391
 
398
- # Selectively delete destination folder.
399
- # If it's a splitted spec we just need to wipe the Subspecs/#{pod_name}
400
- # If it's not we need to wipe everything except the Subspecs folder
401
392
  pod_names.each do |pod_name|
402
393
  root_name = pod_name.split("/").first
403
- if pod_name.include?("/") # Splitted pod
404
- PodBuilder::safe_rm_rf(PodBuilder::prebuiltpath("#{root_name}/Subspecs/#{pod_name.gsub("/", "_") }"))
405
- else
406
- items_to_delete = Dir.glob("#{PodBuilder::prebuiltpath(root_name)}/**/*")
407
- items_to_delete.reject! { |t| t.include?(PodBuilder::prebuiltpath("#{root_name}/Subspecs")) }
408
394
 
409
- items_to_delete.each { |t| PodBuilder::safe_rm_rf(t) }
410
- end
395
+ items_to_delete = Dir.glob("#{PodBuilder::prebuiltpath(root_name)}/**/*")
396
+ items_to_delete.each { |t| PodBuilder::safe_rm_rf(t) }
411
397
  end
412
398
 
413
399
  # Now copy
414
- splitted_items_copied = false
415
400
  pod_names.each do |pod_name|
416
401
  root_name = pod_name.split("/").first
417
402
  source_path = PodBuilder::buildpath_prebuiltpath(root_name)
@@ -421,18 +406,9 @@ module PodBuilder
421
406
  next
422
407
  end
423
408
 
424
- if Configuration.subspecs_to_split.include?(pod_name)
425
- destination_folder = PodBuilder::prebuiltpath("#{root_name}/Subspecs/#{pod_name.gsub("/", "_") }")
426
- FileUtils.mkdir_p(destination_folder)
427
- unless splitted_items_copied
428
- FileUtils.cp_r("#{source_path}/.", destination_folder)
429
- splitted_items_copied = true
430
- end
431
- else
432
- destination_folder = PodBuilder::prebuiltpath(root_name)
433
- FileUtils.mkdir_p(destination_folder)
434
- FileUtils.cp_r("#{source_path}/.", destination_folder)
435
- end
409
+ destination_folder = PodBuilder::prebuiltpath(root_name)
410
+ FileUtils.mkdir_p(destination_folder)
411
+ FileUtils.cp_r("#{source_path}/.", destination_folder)
436
412
  end
437
413
 
438
414
  # Folder won't exist if no dSYM were generated (all static libs)
@@ -523,8 +499,16 @@ module PodBuilder
523
499
  end
524
500
  end
525
501
 
526
- def self.splitted_pod(podfile_item, podfile_items)
527
- return podfile_items.select { |t| t.root_name == podfile_item.root_name && Configuration.subspecs_to_split.include?(t.name) }
502
+ def self.activate_pod_scheme
503
+ if scheme_file = Dir.glob("#{Configuration.build_path}/Pods/**/xcschememanagement.plist").first
504
+ plist = CFPropertyList::List.new(:file => scheme_file)
505
+ data = CFPropertyList.native_types(plist.value)
506
+
507
+ data["SchemeUserState"]["Pods-DummyTarget.xcscheme"]["isShown"] = true
508
+
509
+ plist.value = CFPropertyList.guess(data)
510
+ plist.save(scheme_file, CFPropertyList::List::FORMAT_BINARY)
511
+ end
528
512
  end
529
513
  end
530
514
  end
@@ -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['SWIFT_COMPILATION_MODE'] = 'wholemodule'
41
- build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
42
- build_settings['DEBUG_INFORMATION_FORMAT'] = "dwarf-with-dsym"
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['IPHONEOS_DEPLOYMENT_TARGET'] = platform.deployment_target.version # Fix compilation warnings on Xcode 12
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['CLANG_ENABLE_MODULE_DEBUGGING'] = 'NO'
48
- build_settings['OTHER_SWIFT_FLAGS'] = "$(inherited) -Xfrontend -no-clang-module-breadcrumbs"
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['COMPILER_INDEX_STORE_ENABLE'] = 'NO'
52
- build_settings['SWIFT_INDEX_STORE_ENABLE'] = 'NO'
53
- build_settings['MTL_ENABLE_INDEX_STORE'] = 'NO'
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['BUILD_LIBRARY_FOR_DISTRIBUTION'] = "NO"
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['BUILD_LIBRARY_FOR_DISTRIBUTION'] = "YES"
62
+ build_settings["BUILD_LIBRARY_FOR_DISTRIBUTION"] = "YES"
60
63
  end
61
64
 
62
- build_settings['SWIFT_VERSION'] = item_build_settings["SWIFT_VERSION"] || item.swift_version || project_swift_version(analyzer)
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,7 +394,7 @@ 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?
397
+ if target_settings.first == false && ENV["DEBUGGING"].nil?
391
398
  raise "\n\nOnly framework packaging currently supported. Please add 'use_frameworks!' at Podfile root level (not nested in targets)".red
392
399
  end
393
400
  return target_settings.first
@@ -295,16 +295,14 @@ module PodBuilder
295
295
 
296
296
  root_names = deps.map(&:root_name).uniq
297
297
 
298
- unless Configuration.subspecs_to_split.include?(name)
299
- # We need to build all other common subspecs to properly build the item
300
- # Ex.
301
- # PodA depends on DepA/subspec1
302
- # PodB depends on DepA/subspec2
303
- #
304
- # When building PodA we need to build both DepA subspecs because they might
305
- # contain different code
306
- deps += available_pods.select { |t| root_names.include?(t.root_name) && t.root_name != t.name && !Configuration.subspecs_to_split.include?(t.name) }
307
- end
298
+ # We need to build all other common subspecs to properly build the item
299
+ # Ex.
300
+ # PodA depends on DepA/subspec1
301
+ # PodB depends on DepA/subspec2
302
+ #
303
+ # When building PodA we need to build both DepA subspecs because they might
304
+ # contain different code
305
+ deps += available_pods.select { |t| root_names.include?(t.root_name) && t.root_name != t.name }
308
306
 
309
307
  deps.uniq!
310
308
 
@@ -406,11 +404,7 @@ module PodBuilder
406
404
  end
407
405
 
408
406
  def prebuilt_rel_path
409
- if is_subspec && Configuration.subspecs_to_split.include?(name)
410
- return "Subspecs/#{podspec_name}/#{module_name}.framework"
411
- else
412
- return "#{module_name}.framework"
413
- end
407
+ return "#{module_name}.framework"
414
408
  end
415
409
 
416
410
  def prebuilt_podspec_path(absolute_path = true)
@@ -24,16 +24,12 @@ module PodBuilder
24
24
  indentation = " " * slash_count
25
25
  spec_var = "p#{slash_count}"
26
26
 
27
- subspec_prefix = Configuration.subspecs_to_split.include?(item.name) ? "Subspecs/#{item.podspec_name}/" : ""
28
-
29
27
  if spec_var == "p1" && item.default_subspecs.count > 0
30
28
  podspec += "#{indentation}#{spec_var}.default_subspecs = '#{item.default_subspecs.join("', '")}'\n"
31
29
  end
32
30
 
33
- if subspec_prefix.length > 0 && Dir["#{PodBuilder::prebuiltpath("#{item.root_name}/#{subspec_prefix}")}/*"].empty?
34
- podspec += "#{indentation}#{spec_var}.source_files = '*.splittedspec'\n"
35
- elsif item.name == name
36
- if_exists = lambda { |t| File.exist?(PodBuilder::prebuiltpath("#{item.root_name}/#{subspec_prefix}#{t}") || "") }
31
+ if item.name == name
32
+ if_exists = lambda { |t| File.exist?(PodBuilder::prebuiltpath("#{item.root_name}/#{t}") || "") }
37
33
 
38
34
  vendored_frameworks = item.vendored_frameworks
39
35
  if item.default_subspecs.count == 0 && install_using_frameworks
@@ -76,7 +72,7 @@ module PodBuilder
76
72
 
77
73
  entries = lambda { |spec_key, spec_value|
78
74
  key = "#{indentation}#{spec_var}.#{spec_key}"
79
- joined_values = spec_value.map { |t| "#{subspec_prefix}#{t}" }.uniq.sort.join("', '")
75
+ joined_values = spec_value.map { |t| "#{t}" }.uniq.sort.join("', '")
80
76
  "#{key} = '#{joined_values}'\n"
81
77
  }
82
78
 
@@ -180,7 +176,7 @@ module PodBuilder
180
176
  end
181
177
  end
182
178
 
183
- return podspec, (valid || Configuration.subspecs_to_split.include?(item.name))
179
+ return podspec, valid
184
180
  end
185
181
 
186
182
  def self.generate_podspec_from(all_buildable_items, platform, install_using_frameworks)
@@ -17,7 +17,8 @@ module PodBuilder
17
17
  target_label = target.cocoapods_target_label
18
18
 
19
19
  xcodebuild(sandbox, target_label, device, deployment_target, configuration, deterministic_build, [], {})
20
- excluded_archs = build_for_apple_silicon ? [] : ["arm64"]
20
+ excluded_archs = ["i386"] # Fixes https://github.com/Subito-it/PodBuilder/issues/17
21
+ excluded_archs += build_for_apple_silicon ? [] : ["arm64"]
21
22
  xcodebuild(sandbox, target_label, simulator, deployment_target, configuration, deterministic_build, excluded_archs, {})
22
23
 
23
24
  spec_names = target.specs.map { |spec| [spec.root.name, spec.root.module_name] }.uniq
@@ -258,14 +259,16 @@ module PodBuilder
258
259
  project = Xcodeproj::Project.open(project_path)
259
260
  project.targets.each do |target|
260
261
  config = target.build_configurations.find { |config| config.name.eql? configuration }
261
- config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf-with-dsym'
262
- config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
262
+ config.build_settings["DEBUG_INFORMATION_FORMAT"] = "dwarf-with-dsym"
263
+ config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
263
264
  end
264
265
  project.save
265
266
  end
266
267
  end
267
268
 
268
269
  Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_context, user_options|
270
+ puts "Building".yellow
271
+
269
272
  enable_dsym = user_options.fetch('dsym', true)
270
273
  configuration = user_options.fetch('configuration', 'Debug')
271
274
  uses_frameworks = user_options.fetch('uses_frameworks', true)
@@ -1,4 +1,4 @@
1
1
  module PodBuilder
2
- VERSION = "2.0.0.beta.28"
2
+ VERSION = "2.0.0.beta.33"
3
3
  end
4
4
 
@@ -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'
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.28
4
+ version: 2.0.0.beta.33
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-09-23 00:00:00.000000000 Z
11
+ date: 2020-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -226,7 +226,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
226
226
  requirements:
227
227
  - - ">="
228
228
  - !ruby/object:Gem::Version
229
- version: '0'
229
+ version: '2.6'
230
230
  required_rubygems_version: !ruby/object:Gem::Requirement
231
231
  requirements:
232
232
  - - ">"