pod-builder 5.1.3 → 5.1.4

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: 9a2cb815e28962d60864f492113989c74f22c4f748d885c3d254dbf61498ea71
4
- data.tar.gz: 5447af84ddc6338359cc87cfb3369a3911972c10de1f8baef51806526a30208b
3
+ metadata.gz: 0b85a52e3ba807b8439a542523ff6e38744c83d297356a395dbaf2574c8f43ba
4
+ data.tar.gz: de67f37c0e7aea4cc9f3d6f221f794134d61ba2a46e1b2c8dd2ae00c927bee4f
5
5
  SHA512:
6
- metadata.gz: 73e327fbf2f743922403bf8f9c4658be45172a20fb2bbf6bac29417c8633f44d07eff30c86caa2fe0a2fcdf202bdb8b97a9d5c6d24d497bac64822acb34f8acc
7
- data.tar.gz: 295d055515da012630407a45991266b91edcd102f597a6433670f1448505b61c63ff0c410d3a396ba7085bc49786520ca01feba7cbf19625e681405af4a8b6e3
6
+ metadata.gz: 2736c6181c7e2efb50721cd6d3ad3897e57376d042452ec9b54e3edb44700555e160ccb62cff2b633d82b7a75cf9a9b0dfab2bf1549206b08a03146ecdee1735
7
+ data.tar.gz: 48105f7082152c2a0edcf79eee64f0bdccd536f6fcc389823073520754ebec45ce350d50f52af9f4e86ece11632fc5f8417e9ec182025d229d6c458073ee706e
data/README.md CHANGED
@@ -308,6 +308,14 @@ Specify which pods PodBuilder should NOT be built as .xcframeworks when `build_x
308
308
 
309
309
  Specify which pods PodBuilder should be built as .xcframeworks. Will enable `library_evolution_support`. Default value: []
310
310
 
311
+ #### `generate_coverage`
312
+
313
+ Specify if coverage data for use with profiled execution should be generated. Default value: false
314
+
315
+ #### `remap_coverage_to_project_root`
316
+
317
+ Specify if code coverage source code references should be remapped with relative paths to the project root folder. Default value: false
318
+
311
319
  #### `library_evolution_support`
312
320
 
313
321
  Specify if Swift frameworks should be compiled with library evolution support (BUILD_LIBRARY_FOR_DISTRIBUTION). Default value: false
@@ -75,6 +75,8 @@ module PodBuilder
75
75
  attr_accessor :build_xcframeworks_all
76
76
  attr_accessor :build_xcframeworks_include
77
77
  attr_accessor :build_xcframeworks_exclude
78
+ attr_accessor :generate_coverage
79
+ attr_accessor :remap_coverage_to_project_root
78
80
  attr_accessor :keep_swiftmodules
79
81
  attr_accessor :pre_actions
80
82
  attr_accessor :post_actions
@@ -113,10 +115,13 @@ module PodBuilder
113
115
  @build_using_repo_paths = false
114
116
  @react_native_project = false
115
117
 
116
- @build_xcframeworks_all = false
118
+ @build_xcframeworks_all = true
117
119
  @build_xcframeworks_include = []
118
120
  @build_xcframeworks_exclude = []
119
121
 
122
+ @generate_coverage = false
123
+ @remap_coverage_to_project_root = false
124
+
120
125
  @keep_swiftmodules = false
121
126
 
122
127
  @pre_actions = {}
@@ -242,6 +247,16 @@ module PodBuilder
242
247
  Configuration.build_xcframeworks_exclude = value
243
248
  end
244
249
  end
250
+ if value = json["generate_coverage"]
251
+ if [TrueClass, FalseClass].include?(value.class)
252
+ Configuration.generate_coverage = value
253
+ end
254
+ end
255
+ if value = json["remap_coverage_to_project_root"]
256
+ if [TrueClass, FalseClass].include?(value.class)
257
+ Configuration.remap_coverage_to_project_root = value
258
+ end
259
+ end
245
260
  if value = json["keep_swiftmodules"]
246
261
  if [TrueClass, FalseClass].include?(value.class)
247
262
  Configuration.keep_swiftmodules = value
@@ -329,6 +344,9 @@ module PodBuilder
329
344
  else
330
345
  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
346
  end
347
+ unless Configuration.generate_coverage
348
+ 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
349
+ end
332
350
  end
333
351
 
334
352
  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.4"
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.4
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-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler