cocoapods-xcremotecache 0.0.9 → 0.0.12

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: c55188d92fcdf04e74187bd4c61dc05759f4b88a4a14709c855fe8f4f6edd285
4
- data.tar.gz: f30d155a01be304acd6630a8c976dac97aab670fd4fcab25b3c43294f622a91c
3
+ metadata.gz: 44c934e165d3bedbc93841e34cc60738b7108e04e89cc6bd15da4aa5b404f7a2
4
+ data.tar.gz: c29b65d77ac3843d0c8c6caa4253c6168fd1fb19467b9d1cce643e35a111022c
5
5
  SHA512:
6
- metadata.gz: b1f4d863ffcff4fbb60a547d0ec86e8f1152441d13e046539cc8c773a8d29da7a1beb49324c842c41e4c1d74639d3a6ced669eda3733cb4f989c3ce4b678cebd
7
- data.tar.gz: 7abad465202e061fd629b53237dfd2aa6584c57481f2f00a76441f67c99ea495523e886b629cc3170233412893b8a35728660d1971023ebc645cf71397384927
6
+ metadata.gz: 3bdf484d34a827187b7b6f8fb06153111f2d28ad568579d04737900d96c9cc7f4883e4eb38a9e592642e36900907beb4a7b171f7a5d3455206ac3fa8f8aaf46a
7
+ data.tar.gz: 2e5b3744bdeecbb01109b308af832b1d38312e73c050f5f46ae78dc6a6b7c3909055b4539980293026612bbca2f79dcecd6d481545aab1fe7c455b7bb1705593
data/README.md CHANGED
@@ -53,6 +53,7 @@ An object that is passed to the `xcremotecache` can contain all properties suppo
53
53
  | `xccc_file` | The path where should be placed the `xccc` binary (in the pod installation phase) | `{podfile_dir}/.rc/xccc` | ⬜️ |
54
54
  | `remote_commit_file` | The path of the file with the remote commit sha (in the pod installation phase) | `{podfile_dir}/.rc/arc.rc`| ⬜️ |
55
55
  | `prettify_meta_files` | A Boolean value that opts-in pretty JSON formatting for meta files | `false` | ⬜️ |
56
+ | `fake_src_root` | An arbitrary source location shared between producers and consumers. Should be unique for a project. | `/xxxxxxxxxx` | ⬜️ |
56
57
  | `disable_certificate_verification` | A Boolean value that opts-in SSL certificate validation is disabled | `false` | ⬜️ |
57
58
 
58
59
  ## Uninstalling
@@ -62,7 +63,3 @@ To fully uninstall the plugin, call:
62
63
  ```bash
63
64
  gem uninstall cocoapods-xcremotecache
64
65
  ```
65
-
66
- ## Limitations
67
-
68
- * When `generate_multiple_pod_projects` mode is enabled, only first-party targets are cached by XCRemoteCache (all dependencies are compiled locally).
@@ -24,12 +24,12 @@ module CocoapodsXCRemoteCacheModifier
24
24
  # Registers for CocoaPods plugin hooks
25
25
  module Hooks
26
26
  BIN_DIR = '.rc'
27
- FAKE_SRCROOT = "/#{'x' * 10 }"
28
27
  LLDB_INIT_COMMENT="#RemoteCacheCustomSourceMap"
29
28
  LLDB_INIT_PATH = "#{ENV['HOME']}/.lldbinit"
30
29
  FAT_ARCHIVE_NAME_INFIX = 'arm64-x86_64'
30
+ XCRC_COOCAPODS_ROOT_KEY = 'XCRC_COOCAPODS_ROOT'
31
31
 
32
- # List of plugins' user properties that should be copied to .rcinfo
32
+ # List of plugins' user properties that should not be copied to .rcinfo
33
33
  CUSTOM_CONFIGURATION_KEYS = [
34
34
  'enabled',
35
35
  'xcrc_location',
@@ -39,8 +39,7 @@ module CocoapodsXCRemoteCacheModifier
39
39
  'check_build_configuration',
40
40
  'check_platform',
41
41
  'modify_lldb_init',
42
- 'prettify_meta_files',
43
- 'disable_certificate_verification'
42
+ 'fake_src_root',
44
43
  ]
45
44
 
46
45
  class XCRemoteCache
@@ -63,9 +62,15 @@ module CocoapodsXCRemoteCacheModifier
63
62
  'remote_commit_file' => "#{BIN_DIR}/arc.rc",
64
63
  'exclude_targets' => [],
65
64
  'prettify_meta_files' => false,
66
- 'disable_certificate_verification' => false
65
+ 'fake_src_root' => "/#{'x' * 10 }",
66
+ 'disable_certificate_verification' => false,
67
+ 'custom_rewrite_envs' => []
67
68
  }
68
69
  @@configuration.merge! default_values.select { |k, v| !@@configuration.key?(k) }
70
+ # Always include XCRC_COOCAPODS_ROOT_KEY in custom_rewrite_envs
71
+ unless @@configuration['custom_rewrite_envs'].include?(XCRC_COOCAPODS_ROOT_KEY)
72
+ @@configuration['custom_rewrite_envs'] << XCRC_COOCAPODS_ROOT_KEY
73
+ end
69
74
  end
70
75
 
71
76
  def self.validate_configuration()
@@ -106,8 +111,10 @@ module CocoapodsXCRemoteCacheModifier
106
111
  # @param mode [String] mode name ('consumer', 'producer', 'producer-fast' etc.)
107
112
  # @param exclude_build_configurations [String[]] list of targets that should have disabled remote cache
108
113
  # @param final_target [String] name of target that should trigger marking
109
- def self.enable_xcremotecache(target, repo_distance, xc_location, xc_cc_path, mode, exclude_build_configurations, final_target)
114
+ def self.enable_xcremotecache(target, repo_distance, xc_location, xc_cc_path, mode, exclude_build_configurations, final_target, fake_src_root)
110
115
  srcroot_relative_xc_location = parent_dir(xc_location, repo_distance)
116
+ # location of the entrite CocoaPods project, relative to SRCROOT
117
+ srcroot_relative_project_location = parent_dir('', repo_distance)
111
118
 
112
119
  target.build_configurations.each do |config|
113
120
  # apply only for relevant Configurations
@@ -121,8 +128,9 @@ module CocoapodsXCRemoteCacheModifier
121
128
  config.build_settings['LIBTOOL'] = ["$SRCROOT/#{srcroot_relative_xc_location}/xclibtool"]
122
129
  config.build_settings['LD'] = ["$SRCROOT/#{srcroot_relative_xc_location}/xcld"]
123
130
 
124
- config.build_settings['XCREMOTE_CACHE_FAKE_SRCROOT'] = FAKE_SRCROOT
131
+ config.build_settings['XCREMOTE_CACHE_FAKE_SRCROOT'] = fake_src_root
125
132
  config.build_settings['XCRC_PLATFORM_PREFERRED_ARCH'] = ["$(LINK_FILE_LIST_$(CURRENT_VARIANT)_$(PLATFORM_PREFERRED_ARCH):dir:standardizepath:file:default=arm64)"]
133
+ config.build_settings[XCRC_COOCAPODS_ROOT_KEY] = ["$SRCROOT/#{srcroot_relative_project_location}"]
126
134
  debug_prefix_map_replacement = '$(SRCROOT' + ':dir:standardizepath' * repo_distance + ')'
127
135
  add_cflags!(config.build_settings, '-fdebug-prefix-map', "#{debug_prefix_map_replacement}=$(XCREMOTE_CACHE_FAKE_SRCROOT)")
128
136
  add_swiftflags!(config.build_settings, '-debug-prefix-map', "#{debug_prefix_map_replacement}=$(XCREMOTE_CACHE_FAKE_SRCROOT)")
@@ -203,6 +211,7 @@ module CocoapodsXCRemoteCacheModifier
203
211
  # Remove Fake src root for ObjC & Swift
204
212
  config.build_settings.delete('XCREMOTE_CACHE_FAKE_SRCROOT')
205
213
  config.build_settings.delete('XCRC_PLATFORM_PREFERRED_ARCH')
214
+ config.build_settings.delete(XCRC_COOCAPODS_ROOT_KEY)
206
215
  remove_cflags!(config.build_settings, '-fdebug-prefix-map')
207
216
  remove_swiftflags!(config.build_settings, '-debug-prefix-map')
208
217
  end
@@ -308,7 +317,7 @@ module CocoapodsXCRemoteCacheModifier
308
317
  end
309
318
 
310
319
  # Remove .lldbinit rewrite
311
- save_lldbinit_rewrite(nil) unless !@@configuration['modify_lldb_init']
320
+ save_lldbinit_rewrite(nil,nil) unless !@@configuration['modify_lldb_init']
312
321
  end
313
322
 
314
323
  # Returns the content (array of lines) of the lldbinit with stripped XCRemoteCache rewrite
@@ -330,17 +339,17 @@ module CocoapodsXCRemoteCacheModifier
330
339
  end
331
340
 
332
341
  # Append source rewrite command to the lldbinit content
333
- def self.add_lldbinit_rewrite(lines_content, user_proj_directory)
342
+ def self.add_lldbinit_rewrite(lines_content, user_proj_directory,fake_src_root)
334
343
  all_lines = lines_content.clone
335
344
  all_lines << LLDB_INIT_COMMENT
336
- all_lines << "settings set target.source-map #{FAKE_SRCROOT} #{user_proj_directory}"
345
+ all_lines << "settings set target.source-map #{fake_src_root} #{user_proj_directory}"
337
346
  all_lines << ""
338
347
  all_lines
339
348
  end
340
349
 
341
- def self.save_lldbinit_rewrite(user_proj_directory)
350
+ def self.save_lldbinit_rewrite(user_proj_directory,fake_src_root)
342
351
  lldbinit_lines = clean_lldbinit_content(LLDB_INIT_PATH)
343
- lldbinit_lines = add_lldbinit_rewrite(lldbinit_lines, user_proj_directory) unless user_proj_directory.nil?
352
+ lldbinit_lines = add_lldbinit_rewrite(lldbinit_lines, user_proj_directory,fake_src_root) unless user_proj_directory.nil?
344
353
  File.write(LLDB_INIT_PATH, lldbinit_lines.join("\n"), mode: "w")
345
354
  end
346
355
 
@@ -372,6 +381,7 @@ module CocoapodsXCRemoteCacheModifier
372
381
  final_target = @@configuration['final_target']
373
382
  check_build_configuration = @@configuration['check_build_configuration']
374
383
  check_platform = @@configuration['check_platform']
384
+ fake_src_root = @@configuration['fake_src_root']
375
385
 
376
386
  xccc_location_absolute = "#{user_proj_directory}/#{xccc_location}"
377
387
  xcrc_location_absolute = "#{user_proj_directory}/#{xcrc_location}"
@@ -403,7 +413,7 @@ module CocoapodsXCRemoteCacheModifier
403
413
  next if target.name.start_with?("Pods-")
404
414
  next if target.name.end_with?("Tests")
405
415
  next if exclude_targets.include?(target.name)
406
- enable_xcremotecache(target, 1, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target)
416
+ enable_xcremotecache(target, 1, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target,fake_src_root)
407
417
  end
408
418
 
409
419
  # Create .rcinfo into `Pods` directory as that .xcodeproj reads configuration from .xcodeproj location
@@ -416,7 +426,7 @@ module CocoapodsXCRemoteCacheModifier
416
426
  next if target.source_build_phase.files_references.empty?
417
427
  next if target.name.end_with?("Tests")
418
428
  next if exclude_targets.include?(target.name)
419
- enable_xcremotecache(target, 1, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target)
429
+ enable_xcremotecache(target, 1, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target,fake_src_root)
420
430
  end
421
431
  generated_project.save()
422
432
  end
@@ -456,15 +466,15 @@ module CocoapodsXCRemoteCacheModifier
456
466
  # Attach XCRC to the app targets
457
467
  user_project.targets.each do |target|
458
468
  next if exclude_targets.include?(target.name)
459
- enable_xcremotecache(target, 0, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target)
469
+ enable_xcremotecache(target, 0, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target,fake_src_root)
460
470
  end
461
471
 
462
472
  # Set Target sourcemap
463
473
  if @@configuration['modify_lldb_init']
464
- save_lldbinit_rewrite(user_proj_directory)
474
+ save_lldbinit_rewrite(user_proj_directory,fake_src_root)
465
475
  else
466
476
  Pod::UI.puts "[XCRC] lldbinit modification is disabled. Debugging may behave weirdly"
467
- Pod::UI.puts "[XCRC] put \"settings set target.source-map #{FAKE_SRCROOT} \#{your_project_directory}\" to your \".lldbinit\" "
477
+ Pod::UI.puts "[XCRC] put \"settings set target.source-map #{fake_src_root} \#{your_project_directory}\" to your \".lldbinit\" "
468
478
  end
469
479
 
470
480
  user_project.save()
@@ -13,5 +13,5 @@
13
13
  # limitations under the License.
14
14
 
15
15
  module CocoapodsXcremotecache
16
- VERSION = "0.0.9"
16
+ VERSION = "0.0.12"
17
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-xcremotecache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bartosz Polaczyk
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-04-12 00:00:00.000000000 Z
12
+ date: 2022-05-19 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: CocoaPods plugin that enables XCRemoteCache with the project.
15
15
  email: