cocoapods-xcremotecache 0.0.8 → 0.0.11

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: 4eece05bcb4153a716f7646326bb8dae03fc01f22f829ed016a3bca53c2df720
4
- data.tar.gz: de181437326d7553a3345c1811d1a16f343de388373f9c5d2747c03fd2dca212
3
+ metadata.gz: 35a580b1046422fa075fe4922b61967ceed2b26d9fbbecc799d1397956a0174b
4
+ data.tar.gz: 80794d37cb6102733f0ff743167f9d7268b8bdf0f04f8be56063c4ae7f19cb47
5
5
  SHA512:
6
- metadata.gz: 108860776e61d492b3a530d57441cdac752c4d509bfb2260d11dae80250bd50c54cd029076993a8237da0aed67e289de7dedb790c9cc2f1fd7e4800df30df24e
7
- data.tar.gz: 962ad32c264c26fa98d37efb335e6b6e8016e2a4432c5f9f5240041045aa9c1d66f1cb2bbc1eede2fcfbbaf8150a06217927b9805f42c3b93640f485bd84ee23
6
+ metadata.gz: bb1ed213b18aa38ad521abcc71174419ea83f62e10f11d2cbc2cbffc9894b2aa23dc832b91b208350dd4a9783641e1ed349ffeedbf1b2815d02758a59e5605b7
7
+ data.tar.gz: 7514c19217f180da685f9083a4488d8b95451541343c0b604e2989dfe344b0dc1b241e95b116bd448433072bbdf7e38332522ec9f17be243585c8665eeee462d
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|
@@ -306,7 +309,7 @@ module CocoapodsXCRemoteCacheModifier
306
309
  end
307
310
 
308
311
  # Remove .lldbinit rewrite
309
- save_lldbinit_rewrite(nil) unless !@@configuration['modify_lldb_init']
312
+ save_lldbinit_rewrite(nil,nil) unless !@@configuration['modify_lldb_init']
310
313
  end
311
314
 
312
315
  # Returns the content (array of lines) of the lldbinit with stripped XCRemoteCache rewrite
@@ -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.8"
16
+ VERSION = "0.0.11"
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.8
4
+ version: 0.0.11
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-04 00:00:00.000000000 Z
12
+ date: 2022-05-12 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