cocoapods-xcremotecache 0.0.7 → 0.0.10

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: 3d318ae852c59d8bff4fec2521620ebe59dd8888cc5d0d33a3a9abd8a331b4ac
4
- data.tar.gz: 22ca6c2ee0c87ef89260efcf031dd5c9f3c9b101d483965031f079dc36af49b6
3
+ metadata.gz: 1fc87268b74a697a6b70fb9ec6b33d4c39791b859853ed7b259bd8b1a7863da3
4
+ data.tar.gz: 178209c802e125dc34ae391aae672b4ff23b704cc3ac024817ce3fcefb6b33de
5
5
  SHA512:
6
- metadata.gz: f4619b79b468ffac80c5ed0d7e0339b460e39817b2a763bb0e6a756d839b5baa7bf2a3673cb51b7db24b2d2790fa72cff5e05c5192102cec5231689e2e020284
7
- data.tar.gz: 35a8375ee395f281f008ec6dd4f7f1d6943d15cd78f960875bd302e64ee6daeb4417ee7932ec8c4f23c68a6877d769a83d0b59a9fe78393a2a298d3e5af7e388
6
+ metadata.gz: 57f5a7b4136879cee987bfce46a920b0ea25296e8684d931fae2702f5e37c5d0f00ae81155c271008eaa58e14dad1bdb03316ed3945697e3a2388aafeb79b8bc
7
+ data.tar.gz: 6da51ede43ab92f20fb85b108135549e4e1e98d0934f0c3993a9c8f3f653fb337a5569e9b7435815cf49917e2b05ad64ebdef6352d2713cc882d8344d906c046
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
@@ -24,7 +24,6 @@ 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'
@@ -40,6 +39,7 @@ module CocoapodsXCRemoteCacheModifier
40
39
  'check_platform',
41
40
  'modify_lldb_init',
42
41
  'prettify_meta_files',
42
+ 'fake_src_root',
43
43
  'disable_certificate_verification'
44
44
  ]
45
45
 
@@ -63,6 +63,7 @@ module CocoapodsXCRemoteCacheModifier
63
63
  'remote_commit_file' => "#{BIN_DIR}/arc.rc",
64
64
  'exclude_targets' => [],
65
65
  'prettify_meta_files' => false,
66
+ 'fake_src_root' => "/#{'x' * 10 }",
66
67
  'disable_certificate_verification' => false
67
68
  }
68
69
  @@configuration.merge! default_values.select { |k, v| !@@configuration.key?(k) }
@@ -106,7 +107,7 @@ module CocoapodsXCRemoteCacheModifier
106
107
  # @param mode [String] mode name ('consumer', 'producer', 'producer-fast' etc.)
107
108
  # @param exclude_build_configurations [String[]] list of targets that should have disabled remote cache
108
109
  # @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)
110
+ def self.enable_xcremotecache(target, repo_distance, xc_location, xc_cc_path, mode, exclude_build_configurations, final_target, fake_src_root)
110
111
  srcroot_relative_xc_location = parent_dir(xc_location, repo_distance)
111
112
 
112
113
  target.build_configurations.each do |config|
@@ -121,7 +122,7 @@ module CocoapodsXCRemoteCacheModifier
121
122
  config.build_settings['LIBTOOL'] = ["$SRCROOT/#{srcroot_relative_xc_location}/xclibtool"]
122
123
  config.build_settings['LD'] = ["$SRCROOT/#{srcroot_relative_xc_location}/xcld"]
123
124
 
124
- config.build_settings['XCREMOTE_CACHE_FAKE_SRCROOT'] = FAKE_SRCROOT
125
+ config.build_settings['XCREMOTE_CACHE_FAKE_SRCROOT'] = fake_src_root
125
126
  config.build_settings['XCRC_PLATFORM_PREFERRED_ARCH'] = ["$(LINK_FILE_LIST_$(CURRENT_VARIANT)_$(PLATFORM_PREFERRED_ARCH):dir:standardizepath:file:default=arm64)"]
126
127
  debug_prefix_map_replacement = '$(SRCROOT' + ':dir:standardizepath' * repo_distance + ')'
127
128
  add_cflags!(config.build_settings, '-fdebug-prefix-map', "#{debug_prefix_map_replacement}=$(XCREMOTE_CACHE_FAKE_SRCROOT)")
@@ -146,8 +147,10 @@ module CocoapodsXCRemoteCacheModifier
146
147
  prebuild_script.dependency_file = "$(TARGET_TEMP_DIR)/prebuild.d"
147
148
 
148
149
  # Move prebuild (last element) to the position before compile sources phase (to make it real 'prebuild')
149
- compile_phase_index = target.build_phases.index(target.source_build_phase)
150
- target.build_phases.insert(compile_phase_index, target.build_phases.delete(prebuild_script))
150
+ if !existing_prebuild_script
151
+ compile_phase_index = target.build_phases.index(target.source_build_phase)
152
+ target.build_phases.insert(compile_phase_index, target.build_phases.delete(prebuild_script))
153
+ end
151
154
  elsif mode == 'producer' || mode == 'producer-fast'
152
155
  # Delete existing prebuild build phase (to support switching between modes)
153
156
  target.build_phases.delete_if do |phase|
@@ -180,7 +183,7 @@ module CocoapodsXCRemoteCacheModifier
180
183
  end
181
184
  end
182
185
  mark_script = existing_mark_script || target.new_shell_script_build_phase("[XCRC] Mark")
183
- mark_script.shell_script = "\"$SCRIPT_INPUT_FILE_0\" mark --configuration $CONFIGURATION --platform $PLATFORM_NAME"
186
+ mark_script.shell_script = "\"$SCRIPT_INPUT_FILE_0\" mark --configuration \"$CONFIGURATION\" --platform $PLATFORM_NAME"
184
187
  mark_script.input_paths = ["$SRCROOT/#{srcroot_relative_xc_location}/xcprepare"]
185
188
  else
186
189
  # Delete existing mark build phase (to support switching between modes or changing the final target)
@@ -328,17 +331,17 @@ module CocoapodsXCRemoteCacheModifier
328
331
  end
329
332
 
330
333
  # Append source rewrite command to the lldbinit content
331
- def self.add_lldbinit_rewrite(lines_content, user_proj_directory)
334
+ def self.add_lldbinit_rewrite(lines_content, user_proj_directory,fake_src_root)
332
335
  all_lines = lines_content.clone
333
336
  all_lines << LLDB_INIT_COMMENT
334
- all_lines << "settings set target.source-map #{FAKE_SRCROOT} #{user_proj_directory}"
337
+ all_lines << "settings set target.source-map #{fake_src_root} #{user_proj_directory}"
335
338
  all_lines << ""
336
339
  all_lines
337
340
  end
338
341
 
339
- def self.save_lldbinit_rewrite(user_proj_directory)
342
+ def self.save_lldbinit_rewrite(user_proj_directory,fake_src_root)
340
343
  lldbinit_lines = clean_lldbinit_content(LLDB_INIT_PATH)
341
- lldbinit_lines = add_lldbinit_rewrite(lldbinit_lines, user_proj_directory) unless user_proj_directory.nil?
344
+ lldbinit_lines = add_lldbinit_rewrite(lldbinit_lines, user_proj_directory,fake_src_root) unless user_proj_directory.nil?
342
345
  File.write(LLDB_INIT_PATH, lldbinit_lines.join("\n"), mode: "w")
343
346
  end
344
347
 
@@ -370,6 +373,7 @@ module CocoapodsXCRemoteCacheModifier
370
373
  final_target = @@configuration['final_target']
371
374
  check_build_configuration = @@configuration['check_build_configuration']
372
375
  check_platform = @@configuration['check_platform']
376
+ fake_src_root = @@configuration['fake_src_root']
373
377
 
374
378
  xccc_location_absolute = "#{user_proj_directory}/#{xccc_location}"
375
379
  xcrc_location_absolute = "#{user_proj_directory}/#{xcrc_location}"
@@ -401,7 +405,7 @@ module CocoapodsXCRemoteCacheModifier
401
405
  next if target.name.start_with?("Pods-")
402
406
  next if target.name.end_with?("Tests")
403
407
  next if exclude_targets.include?(target.name)
404
- enable_xcremotecache(target, 1, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target)
408
+ enable_xcremotecache(target, 1, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target,fake_src_root)
405
409
  end
406
410
 
407
411
  # Create .rcinfo into `Pods` directory as that .xcodeproj reads configuration from .xcodeproj location
@@ -414,7 +418,7 @@ module CocoapodsXCRemoteCacheModifier
414
418
  next if target.source_build_phase.files_references.empty?
415
419
  next if target.name.end_with?("Tests")
416
420
  next if exclude_targets.include?(target.name)
417
- enable_xcremotecache(target, 1, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target)
421
+ enable_xcremotecache(target, 1, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target,fake_src_root)
418
422
  end
419
423
  generated_project.save()
420
424
  end
@@ -454,15 +458,15 @@ module CocoapodsXCRemoteCacheModifier
454
458
  # Attach XCRC to the app targets
455
459
  user_project.targets.each do |target|
456
460
  next if exclude_targets.include?(target.name)
457
- enable_xcremotecache(target, 0, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target)
461
+ enable_xcremotecache(target, 0, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target,fake_src_root)
458
462
  end
459
463
 
460
464
  # Set Target sourcemap
461
465
  if @@configuration['modify_lldb_init']
462
- save_lldbinit_rewrite(user_proj_directory)
466
+ save_lldbinit_rewrite(user_proj_directory,fake_src_root)
463
467
  else
464
468
  Pod::UI.puts "[XCRC] lldbinit modification is disabled. Debugging may behave weirdly"
465
- Pod::UI.puts "[XCRC] put \"settings set target.source-map #{FAKE_SRCROOT} \#{your_project_directory}\" to your \".lldbinit\" "
469
+ Pod::UI.puts "[XCRC] put \"settings set target.source-map #{fake_src_root} \#{your_project_directory}\" to your \".lldbinit\" "
466
470
  end
467
471
 
468
472
  user_project.save()
@@ -13,5 +13,5 @@
13
13
  # limitations under the License.
14
14
 
15
15
  module CocoapodsXcremotecache
16
- VERSION = "0.0.7"
16
+ VERSION = "0.0.10"
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.7
4
+ version: 0.0.10
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-02-21 00:00:00.000000000 Z
12
+ date: 2022-05-11 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: CocoaPods plugin that enables XCRemoteCache with the project.
15
15
  email:
@@ -49,7 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
49
  - !ruby/object:Gem::Version
50
50
  version: '0'
51
51
  requirements: []
52
- rubygems_version: 3.2.32
52
+ rubygems_version: 3.2.33
53
53
  signing_key:
54
54
  specification_version: 4
55
55
  summary: A simple plugin that attaches to the post_install hook and modifies the generated