cocoapods-xcremotecache 0.0.16 → 0.0.18

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: 0d10f7d00729ae888941fcef52d599379a094020de82b5540005ae970d814929
4
- data.tar.gz: 391aee8027c9796ac45b3703b5f5eafc24fd6a555d211e6aa02629ace9f9b887
3
+ metadata.gz: 0fe65fa437fc7501ebf44177cc9ba43f612e11b292587b90e278243ddc6d0772
4
+ data.tar.gz: e54cf53dd5179119053cc66ebd6134e77f03f814ca5422f7b6c6ae35b155eddc
5
5
  SHA512:
6
- metadata.gz: 9df9bb0c507814034d0af16d24337eaec451a1d0456ff727952c9d76a8abef63384bcf5e8fd436d0ee212d5455e65934d409123bba3d2f9e1a81d3f70b91a39f
7
- data.tar.gz: c583acfc889027a047b5144919469a2477b4391994f72d82568838a839a44c91fe982c772dcb3c7296c47f7bb27db2da334907b8cd9640fe1ad17aabb9eaf5ea
6
+ metadata.gz: 380aac0e3a7c62bf45ccd5e695f8dd4d6c4c11e1b38ae8def5ed5739e33df591e18809500fcb15d3400f37bbf4979dc7a1fead96d34a7928f48187dc3fe4059e
7
+ data.tar.gz: abcb62ebea5d39f63521851a17919506ebf277e7b747e5bf738805eab638b48fe1d01e90cea7eee838daff99aaaf1ca4297febfc23848a1b1590958409fab843
@@ -123,7 +123,8 @@ module CocoapodsXCRemoteCacheModifier
123
123
  exclude_build_configurations,
124
124
  final_target,
125
125
  fake_src_root,
126
- exclude_sdks_configurations
126
+ exclude_sdks_configurations,
127
+ enable_swift_driver_integration
127
128
  )
128
129
  srcroot_relative_xc_location = parent_dir(xc_location, repo_distance)
129
130
  # location of the entrite CocoaPods project, relative to SRCROOT
@@ -137,14 +138,15 @@ module CocoapodsXCRemoteCacheModifier
137
138
  elsif mode == 'producer' || mode == 'producer-fast'
138
139
  config.build_settings.delete('CC') if config.build_settings.key?('CC')
139
140
  end
140
- reset_build_setting(config.build_settings, 'SWIFT_EXEC', "$SRCROOT/#{srcroot_relative_xc_location}/xcswiftc", exclude_sdks_configurations)
141
+ swiftc_name = enable_swift_driver_integration ? 'swiftc' : 'xcswiftc'
142
+ reset_build_setting(config.build_settings, 'SWIFT_EXEC', "$SRCROOT/#{srcroot_relative_xc_location}/#{swiftc_name}", exclude_sdks_configurations)
141
143
  reset_build_setting(config.build_settings, 'LIBTOOL', "$SRCROOT/#{srcroot_relative_xc_location}/xclibtool", exclude_sdks_configurations)
142
144
  # Setting LIBTOOL to '' breaks SwiftDriver intengration so resetting it to the original value 'libtool' for all excluded configurations
143
145
  add_build_setting_for_sdks(config.build_settings, 'LIBTOOL', 'libtool', exclude_sdks_configurations)
144
146
  reset_build_setting(config.build_settings, 'LD', "$SRCROOT/#{srcroot_relative_xc_location}/xcld", exclude_sdks_configurations)
145
147
  reset_build_setting(config.build_settings, 'LDPLUSPLUS', "$SRCROOT/#{srcroot_relative_xc_location}/xcldplusplus", exclude_sdks_configurations)
146
148
  reset_build_setting(config.build_settings, 'LIPO', "$SRCROOT/#{srcroot_relative_xc_location}/xclipo", exclude_sdks_configurations)
147
- reset_build_setting(config.build_settings, 'SWIFT_USE_INTEGRATED_DRIVER', 'NO', exclude_sdks_configurations)
149
+ reset_build_setting(config.build_settings, 'SWIFT_USE_INTEGRATED_DRIVER', 'NO', exclude_sdks_configurations) unless enable_swift_driver_integration
148
150
 
149
151
  reset_build_setting(config.build_settings, 'XCREMOTE_CACHE_FAKE_SRCROOT', fake_src_root, exclude_sdks_configurations)
150
152
  reset_build_setting(config.build_settings, 'XCRC_PLATFORM_PREFERRED_ARCH', "$(LINK_FILE_LIST_$(CURRENT_VARIANT)_$(PLATFORM_PREFERRED_ARCH):dir:standardizepath:file:default=arm64)", exclude_sdks_configurations)
@@ -407,6 +409,11 @@ module CocoapodsXCRemoteCacheModifier
407
409
  File.write(LLDB_INIT_PATH, lldbinit_lines.join("\n"), mode: "w")
408
410
  end
409
411
 
412
+ # Contrary to AbstractTarget.source_build_phase, it only finds a build phase, without creating one if it doesn't exist
413
+ def self.find_source_build_phase(target)
414
+ target.build_phases.find { |bp| bp.class == Xcodeproj::Project::Object::PBXSourcesBuildPhase }
415
+ end
416
+
410
417
  Pod::HooksManager.register('cocoapods-xcremotecache', :pre_install) do |installer_context|
411
418
  # The main responsibility of that hook is forcing Pods regeneration when XCRemoteCache is enabled for the first time
412
419
  # In the post_install hook, this plugin adds extra build settings and steps to all Pods targets, but only when XCRemoteCache
@@ -498,6 +505,7 @@ module CocoapodsXCRemoteCacheModifier
498
505
  check_platform = @@configuration['check_platform']
499
506
  fake_src_root = @@configuration['fake_src_root']
500
507
  exclude_sdks_configurations = @@configuration['exclude_sdks_configurations'] || []
508
+ enable_swift_driver_integration = @@configuration['enable_swift_driver_integration'] || false
501
509
 
502
510
  xccc_location_absolute = "#{user_proj_directory}/#{xccc_location}"
503
511
  xcrc_location_absolute = "#{user_proj_directory}/#{xcrc_location}"
@@ -517,11 +525,13 @@ module CocoapodsXCRemoteCacheModifier
517
525
  # Attach XCRemoteCache to Pods targets
518
526
  # Enable only for native targets which can have compilation steps
519
527
  installer_context.pods_project.native_targets.each do |target|
528
+ # Ensure the PBXSourcesBuildPhase exists as the flow would unnecessary create an empty source build phase otherwise
529
+ next if find_source_build_phase(target).nil?
520
530
  next if target.source_build_phase.files_references.empty?
521
531
  next if target.name.start_with?("Pods-")
522
532
  next if target.name.end_with?("Tests")
523
533
  next if exclude_targets.include?(target.name)
524
- enable_xcremotecache(target, 1, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target,fake_src_root, exclude_sdks_configurations)
534
+ enable_xcremotecache(target, 1, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target,fake_src_root, exclude_sdks_configurations, enable_swift_driver_integration)
525
535
  end
526
536
 
527
537
  # Create .rcinfo into `Pods` directory as that .xcodeproj reads configuration from .xcodeproj location
@@ -534,7 +544,7 @@ module CocoapodsXCRemoteCacheModifier
534
544
  next if target.source_build_phase.files_references.empty?
535
545
  next if target.name.end_with?("Tests")
536
546
  next if exclude_targets.include?(target.name)
537
- enable_xcremotecache(target, 1, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target,fake_src_root, exclude_sdks_configurations)
547
+ enable_xcremotecache(target, 1, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target,fake_src_root, exclude_sdks_configurations, enable_swift_driver_integration)
538
548
  end
539
549
  generated_project.save()
540
550
  end
@@ -575,7 +585,7 @@ module CocoapodsXCRemoteCacheModifier
575
585
  # Attach XCRC to the app targets
576
586
  user_project.targets.each do |target|
577
587
  next if exclude_targets.include?(target.name)
578
- enable_xcremotecache(target, 0, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target,fake_src_root, exclude_sdks_configurations)
588
+ enable_xcremotecache(target, 0, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target,fake_src_root, exclude_sdks_configurations, enable_swift_driver_integration)
579
589
  end
580
590
 
581
591
  # Set Target sourcemap
@@ -13,5 +13,5 @@
13
13
  # limitations under the License.
14
14
 
15
15
  module CocoapodsXcremotecache
16
- VERSION = "0.0.16"
16
+ VERSION = "0.0.18"
17
17
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-xcremotecache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bartosz Polaczyk
8
8
  - Mark Vasiv
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-04-15 00:00:00.000000000 Z
12
+ date: 2023-08-01 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: CocoaPods plugin that enables XCRemoteCache with the project.
15
15
  email:
@@ -34,7 +34,7 @@ homepage: https://github.com/spotify/XCRemoteCache
34
34
  licenses:
35
35
  - Apache-2.0
36
36
  metadata: {}
37
- post_install_message:
37
+ post_install_message:
38
38
  rdoc_options: []
39
39
  require_paths:
40
40
  - lib
@@ -49,8 +49,8 @@ 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.33
53
- signing_key:
52
+ rubygems_version: 3.4.13
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
56
56
  project to use XCRemoteCache. Supports both producing anc consuming parts.