pod-builder 5.1.3 → 5.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a2cb815e28962d60864f492113989c74f22c4f748d885c3d254dbf61498ea71
4
- data.tar.gz: 5447af84ddc6338359cc87cfb3369a3911972c10de1f8baef51806526a30208b
3
+ metadata.gz: f4933e55a3964f7ac116ee774b3ba1b5e576f58e3ac75c47154c9ec9dc5b3796
4
+ data.tar.gz: 8123dd9ddda019f7bb1701e36400d369e44728df85315f40c2ddffaf4a9a6d1f
5
5
  SHA512:
6
- metadata.gz: 73e327fbf2f743922403bf8f9c4658be45172a20fb2bbf6bac29417c8633f44d07eff30c86caa2fe0a2fcdf202bdb8b97a9d5c6d24d497bac64822acb34f8acc
7
- data.tar.gz: 295d055515da012630407a45991266b91edcd102f597a6433670f1448505b61c63ff0c410d3a396ba7085bc49786520ca01feba7cbf19625e681405af4a8b6e3
6
+ metadata.gz: 247d0d6e6ee175425d37cb98fe73b899deaaae483d1fbc1f39f26182ff5bb9667ff6ace2605ae558fd3eea3eca9969e4eb83e171ed6ce0e20b702c65d995fa4d
7
+ data.tar.gz: 61020f110c8c329de3bc5c2c67442ecbc6fd826186ebe6552db6c56c5ec3c00e992e0a0320bfc813185f631c096b48b4f0259b28b26b827b56e7ca705a734184
data/README.md CHANGED
@@ -242,6 +242,18 @@ You may want to skip some pods to be prebuilt, you can do that as follows:
242
242
  }
243
243
  ```
244
244
 
245
+ #### `skip_build_configuration_check`
246
+
247
+ PodBuilder performs validation checks to prevent building pods that are marked to be built with different build configurations. In some edge case scenarious you might want to skip these checks as follows:
248
+
249
+ ```json
250
+ {
251
+ "skip_build_configuration_check": [
252
+ "PodA"
253
+ ]
254
+ }
255
+ ```
256
+
245
257
 
246
258
  #### `force_prebuild_pods`
247
259
 
@@ -308,6 +320,14 @@ Specify which pods PodBuilder should NOT be built as .xcframeworks when `build_x
308
320
 
309
321
  Specify which pods PodBuilder should be built as .xcframeworks. Will enable `library_evolution_support`. Default value: []
310
322
 
323
+ #### `generate_coverage`
324
+
325
+ Specify if coverage data for use with profiled execution should be generated. Default value: false
326
+
327
+ #### `remap_coverage_to_project_root`
328
+
329
+ Specify if code coverage source code references should be remapped with relative paths to the project root folder. Default value: false
330
+
311
331
  #### `library_evolution_support`
312
332
 
313
333
  Specify if Swift frameworks should be compiled with library evolution support (BUILD_LIBRARY_FOR_DISTRIBUTION). Default value: false
@@ -232,6 +232,8 @@ module PodBuilder
232
232
  end
233
233
 
234
234
  def self.check_dependencies_build_configurations(pods)
235
+ pods = pods.reject { |t| Configuration::skip_build_configuration_check.include?(t.name) }
236
+
235
237
  pods.each do |pod|
236
238
  pod_dependency_names = pod.dependency_names.select { |x| !pod.has_common_spec(x) }
237
239
 
@@ -241,7 +243,9 @@ module PodBuilder
241
243
  pods_with_unaligned_build_configuration = pods_with_common_deps.select { |x| x.build_configuration != pod.build_configuration }
242
244
  pods_with_unaligned_build_configuration.map!(&:name)
243
245
 
244
- 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
246
+ if pods_with_unaligned_build_configuration.count > 0
247
+ 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
248
+ end
245
249
  end
246
250
  end
247
251
 
@@ -54,6 +54,7 @@ module PodBuilder
54
54
  attr_accessor :spec_overrides
55
55
  attr_accessor :skip_licenses
56
56
  attr_accessor :skip_pods
57
+ attr_accessor :skip_build_configuration_check
57
58
  attr_accessor :force_prebuild_pods
58
59
  attr_accessor :license_filename
59
60
  attr_accessor :development_pods_paths
@@ -75,6 +76,8 @@ module PodBuilder
75
76
  attr_accessor :build_xcframeworks_all
76
77
  attr_accessor :build_xcframeworks_include
77
78
  attr_accessor :build_xcframeworks_exclude
79
+ attr_accessor :generate_coverage
80
+ attr_accessor :remap_coverage_to_project_root
78
81
  attr_accessor :keep_swiftmodules
79
82
  attr_accessor :pre_actions
80
83
  attr_accessor :post_actions
@@ -92,6 +95,7 @@ module PodBuilder
92
95
  @base_path = "PodBuilder" # Not nice. This value is used only for initial initization. Once config is loaded it will be an absolute path. FIXME
93
96
  @skip_licenses = []
94
97
  @skip_pods = ["GoogleMaps", "React-RCTFabric", "React-Core", "React-CoreModules", "FBReactNativeSpec", "fmt", "RCT-Folly", "React-jsi"] # Not including React-RCTNetwork might loose some debug warnings
98
+ @skip_build_configuration_check = []
95
99
  @force_prebuild_pods = []
96
100
  @license_filename = "Pods-acknowledgements"
97
101
  @development_pods_paths = []
@@ -113,10 +117,13 @@ module PodBuilder
113
117
  @build_using_repo_paths = false
114
118
  @react_native_project = false
115
119
 
116
- @build_xcframeworks_all = false
120
+ @build_xcframeworks_all = true
117
121
  @build_xcframeworks_include = []
118
122
  @build_xcframeworks_exclude = []
119
123
 
124
+ @generate_coverage = false
125
+ @remap_coverage_to_project_root = false
126
+
120
127
  @keep_swiftmodules = false
121
128
 
122
129
  @pre_actions = {}
@@ -162,6 +169,11 @@ module PodBuilder
162
169
  Configuration.skip_pods = value
163
170
  end
164
171
  end
172
+ if value = json["skip_build_configuration_check"]
173
+ if value.is_a?(Array)
174
+ Configuration.skip_build_configuration_check = value
175
+ end
176
+ end
165
177
  if value = json["force_prebuild_pods"]
166
178
  if value.is_a?(Array)
167
179
  Configuration.force_prebuild_pods = value
@@ -242,6 +254,16 @@ module PodBuilder
242
254
  Configuration.build_xcframeworks_exclude = value
243
255
  end
244
256
  end
257
+ if value = json["generate_coverage"]
258
+ if [TrueClass, FalseClass].include?(value.class)
259
+ Configuration.generate_coverage = value
260
+ end
261
+ end
262
+ if value = json["remap_coverage_to_project_root"]
263
+ if [TrueClass, FalseClass].include?(value.class)
264
+ Configuration.remap_coverage_to_project_root = value
265
+ end
266
+ end
245
267
  if value = json["keep_swiftmodules"]
246
268
  if [TrueClass, FalseClass].include?(value.class)
247
269
  Configuration.keep_swiftmodules = value
@@ -298,6 +320,7 @@ module PodBuilder
298
320
  config["spec_overrides"] = Configuration.spec_overrides
299
321
  config["skip_licenses"] = Configuration.skip_licenses
300
322
  config["skip_pods"] = Configuration.skip_pods
323
+ config["skip_build_configuration_check"] = Configuration.skip_build_configuration_check
301
324
  config["force_prebuild_pods"] = Configuration.force_prebuild_pods
302
325
  config["build_settings"] = Configuration.build_settings
303
326
  config["build_settings_overrides"] = Configuration.build_settings_overrides
@@ -329,6 +352,9 @@ module PodBuilder
329
352
  else
330
353
  raise "\n\nInvalid PodBuilder.json configuration: 'build_xcframeworks_all' is false and 'build_xcframeworks_exclude' is not empty\n".red if Configuration.build_xcframeworks_exclude.count > 0
331
354
  end
355
+ unless Configuration.generate_coverage
356
+ raise "\n\nInvalid PodBuilder.json configuration: 'remap_coverage_to_project_root' is true but `generate_coverage` is false\n".red if Configuration.remap_coverage_to_project_root
357
+ end
332
358
  end
333
359
 
334
360
  def self.config_path
@@ -43,6 +43,8 @@ module PodBuilder
43
43
 
44
44
  podfile_build_settings = ""
45
45
 
46
+ git_rootpath = PodBuilder::git_rootpath
47
+
46
48
  pod_dependencies = {}
47
49
 
48
50
  items.each do |item|
@@ -87,6 +89,36 @@ module PodBuilder
87
89
  # Don't store .pcm info in binary, see https://forums.swift.org/t/swift-behavior-of-gmodules-and-dsyms/23211/3
88
90
  build_settings["CLANG_ENABLE_MODULE_DEBUGGING"] = "NO"
89
91
  other_swift_flags_override = " $(inherited) -Xfrontend -no-clang-module-breadcrumbs -Xfrontend -no-serialize-debugging-options"
92
+ other_c_flags_override = " $(inherited)"
93
+
94
+ if Configuration.generate_coverage
95
+ other_swift_flags_override += " -profile-coverage-mapping -profile-generate"
96
+ other_c_flags_override += " -fprofile-instr-generate -fcoverage-mapping"
97
+ end
98
+
99
+ if Configuration.remap_coverage_to_project_root
100
+ # Remap coverage path from /tmp/pod_builder/Pods/ItemName -> path relative to project git_root
101
+ replacements = []
102
+ if path = item.path
103
+ replacements << ["#{Configuration.build_path}/Pods/#{item.root_name}", PodBuilder::basepath(path)]
104
+ replacements << ["#{Configuration.build_path}/Pods/#{File.basename(path)}", PodBuilder::basepath(path)]
105
+ else
106
+ replacements << ["#{Configuration.build_path}/Pods/#{item.root_name}", PodBuilder::project_path("Pods/#{item.root_name}")]
107
+ end
108
+ replacements.uniq!
109
+
110
+ replacements.each do |from, to|
111
+ to = "./" + Pathname.new(to).relative_path_from(Pathname.new(git_rootpath)).to_s
112
+
113
+ if from.start_with?("/tmp")
114
+ other_swift_flags_override += " -coverage-prefix-map \"/private#{from}\"=\"#{to}\""
115
+ other_c_flags_override += " -fcoverage-prefix-map=\"/private#{from}\"=\"#{to}\""
116
+ end
117
+
118
+ other_swift_flags_override += " -coverage-prefix-map \"#{from}\"=\"#{to}\""
119
+ other_c_flags_override += " -fcoverage-prefix-map=\"#{from}\"=\"#{to}\""
120
+ end
121
+ end
90
122
 
91
123
  item_build_settings.each do |k, v|
92
124
  # Do not allow to override above settings which are mandatory for a correct compilation
@@ -97,6 +129,7 @@ module PodBuilder
97
129
 
98
130
  # All the below settings should be merged with global (Configuration.build_settings) or per pod build_settings (Configuration.build_settings_overrides)
99
131
  build_settings["OTHER_SWIFT_FLAGS"] = build_settings.fetch("OTHER_SWIFT_FLAGS", "") + other_swift_flags_override
132
+ build_settings["OTHER_CFLAGS"] = build_settings.fetch("OTHER_CFLAGS", "") + other_c_flags_override
100
133
 
101
134
  podfile_build_settings += "set_build_settings(\"#{item.root_name}\", #{build_settings.to_s}, installer)\n "
102
135
 
@@ -1,3 +1,3 @@
1
1
  module PodBuilder
2
- VERSION = "5.1.3"
2
+ VERSION = "5.1.5"
3
3
  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: 5.1.3
4
+ version: 5.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Camin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-20 00:00:00.000000000 Z
11
+ date: 2023-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler