cocoapods-xcremotecache 0.0.14 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/lib/cocoapods-xcremotecache/command/hooks.rb +99 -53
- data/lib/cocoapods-xcremotecache/gem_version.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d10f7d00729ae888941fcef52d599379a094020de82b5540005ae970d814929
|
4
|
+
data.tar.gz: 391aee8027c9796ac45b3703b5f5eafc24fd6a555d211e6aa02629ace9f9b887
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9df9bb0c507814034d0af16d24337eaec451a1d0456ff727952c9d76a8abef63384bcf5e8fd436d0ee212d5455e65934d409123bba3d2f9e1a81d3f70b91a39f
|
7
|
+
data.tar.gz: c583acfc889027a047b5144919469a2477b4391994f72d82568838a839a44c91fe982c772dcb3c7296c47f7bb27db2da334907b8cd9640fe1ad17aabb9eaf5ea
|
data/README.md
CHANGED
@@ -28,7 +28,7 @@ plugin 'cocoapods-xcremotecache'
|
|
28
28
|
2. Configure XCRemoteCache at the top of your `Podfile` definition:
|
29
29
|
```ruby
|
30
30
|
xcremotecache({
|
31
|
-
'cache_addresses' => ['http://localhost:8080/cache/pods'],
|
31
|
+
'cache_addresses' => ['http://localhost:8080/cache/pods'],
|
32
32
|
'primary_repo' => 'https://your.primary.repo.git',
|
33
33
|
'mode' => 'consumer'
|
34
34
|
})
|
@@ -48,13 +48,14 @@ An object that is passed to the `xcremotecache` can contain all properties suppo
|
|
48
48
|
| `exclude_build_configurations` | Comma-separated list of configurations that shouldn't use XCRemoteCache | `[]`| ⬜️ |
|
49
49
|
| `final_target` | A target name that is build at the end of the build chain. Relevant only for a 'producer' mode to mark a given sha as ready to use from cache | `Debug` | ⬜️ |
|
50
50
|
| `check_build_configuration` | A build configuration for which the remote cache availability is performed. Relevant only for a 'consumer' mode | `Debug` | ⬜️ |
|
51
|
-
| `check_platform` | A platform for which the remote cache availability is performed. Relevant only for a 'consumer' mode | `iphonesimulator` | ⬜️
|
51
|
+
| `check_platform` | A platform for which the remote cache availability is performed. Relevant only for a 'consumer' mode | `iphonesimulator` | ⬜️
|
52
52
|
| `modify_lldb_init` | Controls if the pod integration should modify `~/.lldbinit` | `true` | ⬜️ |
|
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
56
|
| `fake_src_root` | An arbitrary source location shared between producers and consumers. Should be unique for a project. | `/xxxxxxxxxx` | ⬜️ |
|
57
57
|
| `disable_certificate_verification` | A Boolean value that opts-in SSL certificate validation is disabled | `false` | ⬜️ |
|
58
|
+
| `exclude_sdks_configurations` | array of sdks to not integrate XCRemoteCache (e.g. "watchos*, watchsimulator*") (Experimental) | `[]`| ⬜️ |
|
58
59
|
|
59
60
|
## Uninstalling
|
60
61
|
|
@@ -3,9 +3,9 @@
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
5
5
|
# You may obtain a copy of the License at
|
6
|
-
#
|
6
|
+
#
|
7
7
|
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
8
|
+
#
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
@@ -29,42 +29,44 @@ module CocoapodsXCRemoteCacheModifier
|
|
29
29
|
FAT_ARCHIVE_NAME_INFIX = 'arm64-x86_64'
|
30
30
|
XCRC_COOCAPODS_ROOT_KEY = 'XCRC_COOCAPODS_ROOT'
|
31
31
|
|
32
|
-
# List of plugins' user properties that should not be copied to .rcinfo
|
32
|
+
# List of plugins' user properties that should not be copied to .rcinfo
|
33
33
|
CUSTOM_CONFIGURATION_KEYS = [
|
34
|
-
'enabled',
|
34
|
+
'enabled',
|
35
35
|
'xcrc_location',
|
36
36
|
'exclude_targets',
|
37
37
|
'exclude_build_configurations',
|
38
38
|
'final_target',
|
39
|
-
'check_build_configuration',
|
40
|
-
'check_platform',
|
39
|
+
'check_build_configuration',
|
40
|
+
'check_platform',
|
41
41
|
'modify_lldb_init',
|
42
42
|
'fake_src_root',
|
43
|
+
'exclude_sdks_configurations'
|
43
44
|
]
|
44
45
|
|
45
46
|
class XCRemoteCache
|
46
47
|
@@configuration = nil
|
47
48
|
|
48
|
-
def self.configure(c)
|
49
|
+
def self.configure(c)
|
49
50
|
@@configuration = c
|
50
51
|
end
|
51
52
|
|
52
53
|
def self.set_configuration_default_values
|
53
54
|
default_values = {
|
54
55
|
'mode' => 'consumer',
|
55
|
-
'enabled' => true,
|
56
|
+
'enabled' => true,
|
56
57
|
'xcrc_location' => "XCRC",
|
57
58
|
'exclude_build_configurations' => [],
|
58
59
|
'check_build_configuration' => 'Debug',
|
59
|
-
'check_platform' => 'iphonesimulator',
|
60
|
-
'modify_lldb_init' => true,
|
60
|
+
'check_platform' => 'iphonesimulator',
|
61
|
+
'modify_lldb_init' => true,
|
61
62
|
'xccc_file' => "#{BIN_DIR}/xccc",
|
62
63
|
'remote_commit_file' => "#{BIN_DIR}/arc.rc",
|
63
64
|
'exclude_targets' => [],
|
64
65
|
'prettify_meta_files' => false,
|
65
66
|
'fake_src_root' => "/#{'x' * 10 }",
|
66
67
|
'disable_certificate_verification' => false,
|
67
|
-
'custom_rewrite_envs' => []
|
68
|
+
'custom_rewrite_envs' => [],
|
69
|
+
'exclude_sdks_configurations' => []
|
68
70
|
}
|
69
71
|
@@configuration.merge! default_values.select { |k, v| !@@configuration.key?(k) }
|
70
72
|
# Always include XCRC_COOCAPODS_ROOT_KEY in custom_rewrite_envs
|
@@ -75,12 +77,12 @@ module CocoapodsXCRemoteCacheModifier
|
|
75
77
|
|
76
78
|
def self.validate_configuration()
|
77
79
|
required_values = [
|
78
|
-
'cache_addresses',
|
80
|
+
'cache_addresses',
|
79
81
|
'primary_repo',
|
80
82
|
'check_build_configuration',
|
81
83
|
'check_platform'
|
82
84
|
]
|
83
|
-
|
85
|
+
|
84
86
|
missing_configuration_values = required_values.select { |v| !@@configuration.key?(v) }
|
85
87
|
unless missing_configuration_values.empty?
|
86
88
|
throw "XCRemoteCache not fully configured. Make sure all required fields are provided. Missing fields are: #{missing_configuration_values.join(', ')}."
|
@@ -105,13 +107,24 @@ module CocoapodsXCRemoteCacheModifier
|
|
105
107
|
end
|
106
108
|
|
107
109
|
# @param target [Target] target to apply XCRemoteCache
|
108
|
-
# @param repo_distance [Integer] distance from the git repo root to the target's $SRCROOT
|
110
|
+
# @param repo_distance [Integer] distance from the git repo root to the target's $SRCROOT
|
109
111
|
# @param xc_location [String] path to the dir with all XCRemoteCache binaries, relative to the repo root
|
110
112
|
# @param xc_cc_path [String] path to the XCRemoteCache clang wrapper, relative to the repo root
|
111
113
|
# @param mode [String] mode name ('consumer', 'producer', 'producer-fast' etc.)
|
112
114
|
# @param exclude_build_configurations [String[]] list of targets that should have disabled remote cache
|
113
115
|
# @param final_target [String] name of target that should trigger marking
|
114
|
-
|
116
|
+
# @param exclude_sdks_configurations [String[]] list of sdks that should have disabled remote cache
|
117
|
+
def self.enable_xcremotecache(
|
118
|
+
target,
|
119
|
+
repo_distance,
|
120
|
+
xc_location,
|
121
|
+
xc_cc_path,
|
122
|
+
mode,
|
123
|
+
exclude_build_configurations,
|
124
|
+
final_target,
|
125
|
+
fake_src_root,
|
126
|
+
exclude_sdks_configurations
|
127
|
+
)
|
115
128
|
srcroot_relative_xc_location = parent_dir(xc_location, repo_distance)
|
116
129
|
# location of the entrite CocoaPods project, relative to SRCROOT
|
117
130
|
srcroot_relative_project_location = parent_dir('', repo_distance)
|
@@ -120,22 +133,27 @@ module CocoapodsXCRemoteCacheModifier
|
|
120
133
|
# apply only for relevant Configurations
|
121
134
|
next if exclude_build_configurations.include?(config.name)
|
122
135
|
if mode == 'consumer'
|
123
|
-
config.build_settings
|
136
|
+
reset_build_setting(config.build_settings, 'CC', "$SRCROOT/#{parent_dir(xc_cc_path, repo_distance)}", exclude_sdks_configurations)
|
124
137
|
elsif mode == 'producer' || mode == 'producer-fast'
|
125
138
|
config.build_settings.delete('CC') if config.build_settings.key?('CC')
|
126
139
|
end
|
127
|
-
config.build_settings
|
128
|
-
config.build_settings
|
129
|
-
|
130
|
-
config.build_settings
|
131
|
-
config.build_settings
|
132
|
-
|
133
|
-
config.build_settings
|
134
|
-
config.build_settings
|
135
|
-
|
140
|
+
reset_build_setting(config.build_settings, 'SWIFT_EXEC', "$SRCROOT/#{srcroot_relative_xc_location}/xcswiftc", exclude_sdks_configurations)
|
141
|
+
reset_build_setting(config.build_settings, 'LIBTOOL', "$SRCROOT/#{srcroot_relative_xc_location}/xclibtool", exclude_sdks_configurations)
|
142
|
+
# Setting LIBTOOL to '' breaks SwiftDriver intengration so resetting it to the original value 'libtool' for all excluded configurations
|
143
|
+
add_build_setting_for_sdks(config.build_settings, 'LIBTOOL', 'libtool', exclude_sdks_configurations)
|
144
|
+
reset_build_setting(config.build_settings, 'LD', "$SRCROOT/#{srcroot_relative_xc_location}/xcld", exclude_sdks_configurations)
|
145
|
+
reset_build_setting(config.build_settings, 'LDPLUSPLUS', "$SRCROOT/#{srcroot_relative_xc_location}/xcldplusplus", exclude_sdks_configurations)
|
146
|
+
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)
|
148
|
+
|
149
|
+
reset_build_setting(config.build_settings, 'XCREMOTE_CACHE_FAKE_SRCROOT', fake_src_root, exclude_sdks_configurations)
|
150
|
+
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)
|
151
|
+
reset_build_setting(config.build_settings, XCRC_COOCAPODS_ROOT_KEY, "$SRCROOT/#{srcroot_relative_project_location}", exclude_sdks_configurations)
|
136
152
|
debug_prefix_map_replacement = '$(SRCROOT' + ':dir:standardizepath' * repo_distance + ')'
|
137
|
-
add_cflags!(config.build_settings, '-fdebug-prefix-map', "#{debug_prefix_map_replacement}=$(XCREMOTE_CACHE_FAKE_SRCROOT)")
|
138
|
-
add_swiftflags!(config.build_settings, '-debug-prefix-map', "#{debug_prefix_map_replacement}=$(XCREMOTE_CACHE_FAKE_SRCROOT)")
|
153
|
+
add_cflags!(config.build_settings, '-fdebug-prefix-map', "#{debug_prefix_map_replacement}=$(XCREMOTE_CACHE_FAKE_SRCROOT)", exclude_sdks_configurations)
|
154
|
+
add_swiftflags!(config.build_settings, '-debug-prefix-map', "#{debug_prefix_map_replacement}=$(XCREMOTE_CACHE_FAKE_SRCROOT)", exclude_sdks_configurations)
|
155
|
+
delete_build_setting(config.build_settings, 'XCRC_DISABLED')
|
156
|
+
add_build_setting_for_sdks(config.build_settings, 'XCRC_DISABLED', 'YES', exclude_sdks_configurations)
|
139
157
|
end
|
140
158
|
|
141
159
|
# Prebuild
|
@@ -156,7 +174,7 @@ module CocoapodsXCRemoteCacheModifier
|
|
156
174
|
prebuild_script.dependency_file = "$(TARGET_TEMP_DIR)/prebuild.d"
|
157
175
|
|
158
176
|
# Move prebuild (last element) to the position before compile sources phase (to make it real 'prebuild')
|
159
|
-
if !existing_prebuild_script
|
177
|
+
if !existing_prebuild_script
|
160
178
|
compile_phase_index = target.build_phases.index(target.source_build_phase)
|
161
179
|
target.build_phases.insert(compile_phase_index, target.build_phases.delete(prebuild_script))
|
162
180
|
end
|
@@ -184,7 +202,7 @@ module CocoapodsXCRemoteCacheModifier
|
|
184
202
|
]
|
185
203
|
postbuild_script.dependency_file = "$(TARGET_TEMP_DIR)/postbuild.d"
|
186
204
|
# Move postbuild (last element) to the position after compile sources phase (to make it real 'postbuild')
|
187
|
-
if !existing_postbuild_script
|
205
|
+
if !existing_postbuild_script
|
188
206
|
compile_phase_index = target.build_phases.index(target.source_build_phase)
|
189
207
|
target.build_phases.insert(compile_phase_index + 1, target.build_phases.delete(postbuild_script))
|
190
208
|
end
|
@@ -214,6 +232,7 @@ module CocoapodsXCRemoteCacheModifier
|
|
214
232
|
config.build_settings.delete('CC') if config.build_settings.key?('CC')
|
215
233
|
config.build_settings.delete('SWIFT_EXEC') if config.build_settings.key?('SWIFT_EXEC')
|
216
234
|
config.build_settings.delete('LIBTOOL') if config.build_settings.key?('LIBTOOL')
|
235
|
+
config.build_settings.delete('LIPO') if config.build_settings.key?('LIPO')
|
217
236
|
config.build_settings.delete('LD') if config.build_settings.key?('LD')
|
218
237
|
config.build_settings.delete('LDPLUSPLUS') if config.build_settings.key?('LDPLUSPLUS')
|
219
238
|
config.build_settings.delete('SWIFT_USE_INTEGRATED_DRIVER') if config.build_settings.key?('SWIFT_USE_INTEGRATED_DRIVER')
|
@@ -226,9 +245,9 @@ module CocoapodsXCRemoteCacheModifier
|
|
226
245
|
end
|
227
246
|
|
228
247
|
# User project is not generated from scratch (contrary to `Pods`), delete all previous XCRemoteCache phases
|
229
|
-
target.build_phases.delete_if {|phase|
|
248
|
+
target.build_phases.delete_if {|phase|
|
230
249
|
# Some phases (e.g. PBXSourcesBuildPhase) don't have strict name check respond_to?
|
231
|
-
if phase.respond_to?(:name)
|
250
|
+
if phase.respond_to?(:name)
|
232
251
|
phase.name != nil && phase.name.start_with?("[XCRC]")
|
233
252
|
end
|
234
253
|
}
|
@@ -240,9 +259,9 @@ module CocoapodsXCRemoteCacheModifier
|
|
240
259
|
end
|
241
260
|
|
242
261
|
def self.download_xcrc_if_needed(local_location)
|
243
|
-
required_binaries = ['xcld', 'xcldplusplus', 'xclibtool', 'xcpostbuild', 'xcprebuild', 'xcprepare', 'xcswiftc']
|
262
|
+
required_binaries = ['xcld', 'xcldplusplus', 'xclibtool', 'xclipo', 'xcpostbuild', 'xcprebuild', 'xcprepare', 'xcswiftc']
|
244
263
|
binaries_exist = required_binaries.reduce(true) do |exists, filename|
|
245
|
-
file_path = File.join(local_location, filename)
|
264
|
+
file_path = File.join(local_location, filename)
|
246
265
|
exists = exists && File.exist?(file_path)
|
247
266
|
end
|
248
267
|
|
@@ -256,13 +275,13 @@ module CocoapodsXCRemoteCacheModifier
|
|
256
275
|
|
257
276
|
if !system("unzip #{local_package_location} -d #{local_location}")
|
258
277
|
throw "Unzipping XCRemoteCache failed"
|
259
|
-
end
|
278
|
+
end
|
260
279
|
end
|
261
280
|
|
262
281
|
def self.download_latest_xcrc_release(local_package_location)
|
263
282
|
release_url = 'https://api.github.com/repos/spotify/XCRemoteCache/releases/latest'
|
264
283
|
asset_url = nil
|
265
|
-
|
284
|
+
|
266
285
|
URI.open(release_url) do |f|
|
267
286
|
assets_array = JSON.parse(f.read)['assets']
|
268
287
|
# Pick fat archive
|
@@ -270,7 +289,7 @@ module CocoapodsXCRemoteCacheModifier
|
|
270
289
|
asset_url = asset_array['url']
|
271
290
|
end
|
272
291
|
|
273
|
-
if asset_url.nil?
|
292
|
+
if asset_url.nil?
|
274
293
|
throw "Downloading XCRemoteCache failed"
|
275
294
|
end
|
276
295
|
|
@@ -281,9 +300,8 @@ module CocoapodsXCRemoteCacheModifier
|
|
281
300
|
end
|
282
301
|
end
|
283
302
|
|
284
|
-
def self.add_cflags!(options, key, value)
|
285
|
-
|
286
|
-
options['OTHER_CFLAGS'] = remove_cflags!(options, key) << "#{key}=#{value}"
|
303
|
+
def self.add_cflags!(options, key, value, exclude_sdks_configurations)
|
304
|
+
reset_build_setting(options, 'OTHER_CFLAGS', remove_cflags!(options, key) << "#{key}=#{value}", exclude_sdks_configurations)
|
287
305
|
end
|
288
306
|
|
289
307
|
def self.remove_cflags!(options, key)
|
@@ -293,9 +311,8 @@ module CocoapodsXCRemoteCacheModifier
|
|
293
311
|
options['OTHER_CFLAGS']
|
294
312
|
end
|
295
313
|
|
296
|
-
def self.add_swiftflags!(options, key, value)
|
297
|
-
|
298
|
-
options['OTHER_SWIFT_FLAGS'] = remove_swiftflags!(options, key) + " #{key} #{value}"
|
314
|
+
def self.add_swiftflags!(options, key, value, exclude_sdks_configurations)
|
315
|
+
reset_build_setting(options, 'OTHER_SWIFT_FLAGS', remove_swiftflags!(options, key) + " #{key} #{value}", exclude_sdks_configurations)
|
299
316
|
end
|
300
317
|
|
301
318
|
def self.remove_swiftflags!(options, key)
|
@@ -303,6 +320,34 @@ module CocoapodsXCRemoteCacheModifier
|
|
303
320
|
options['OTHER_SWIFT_FLAGS']
|
304
321
|
end
|
305
322
|
|
323
|
+
def self.add_build_setting(build_settings, key, value, exclude_sdks_configurations)
|
324
|
+
build_settings[key] = value
|
325
|
+
for exclude_sdks_configuration in exclude_sdks_configurations
|
326
|
+
build_settings["#{key}[sdk=#{exclude_sdks_configuration}]"] = [""]
|
327
|
+
end
|
328
|
+
end
|
329
|
+
|
330
|
+
# Deletes all previous build settings for a key, and sets a new value to all configurations
|
331
|
+
# but the sdks in exclude_sdks_configurations
|
332
|
+
def self.reset_build_setting(build_settings, key, value, exclude_sdks_configurations)
|
333
|
+
delete_build_setting(build_settings, key)
|
334
|
+
add_build_setting(build_settings, key, value, exclude_sdks_configurations)
|
335
|
+
end
|
336
|
+
|
337
|
+
# Delete all build setting for a key, including settings like "[skd=*,arch=*]"
|
338
|
+
def self.delete_build_setting(build_settings, key)
|
339
|
+
for build_setting_key in build_settings.keys
|
340
|
+
build_settings.delete(build_setting_key) if build_setting_key == key || build_setting_key.start_with?("#{key}[")
|
341
|
+
end
|
342
|
+
end
|
343
|
+
|
344
|
+
# Sets value for a key only for a subset of sdk configurations
|
345
|
+
def self.add_build_setting_for_sdks(build_settings, key, value, sdk_configurations)
|
346
|
+
for sdk_configuration in sdk_configurations
|
347
|
+
build_settings["#{key}[sdk=#{sdk_configuration}]"] = value
|
348
|
+
end
|
349
|
+
end
|
350
|
+
|
306
351
|
# Uninstall the XCRemoteCache
|
307
352
|
def self.disable_xcremotecache(user_project, pods_project = nil)
|
308
353
|
user_project.targets.each do |target|
|
@@ -336,7 +381,7 @@ module CocoapodsXCRemoteCacheModifier
|
|
336
381
|
File.open(lldbinit_path) { |file|
|
337
382
|
while(line = file.gets) != nil
|
338
383
|
line = line.strip
|
339
|
-
if line == LLDB_INIT_COMMENT
|
384
|
+
if line == LLDB_INIT_COMMENT
|
340
385
|
# skip current and next lines
|
341
386
|
file.gets
|
342
387
|
next
|
@@ -351,7 +396,7 @@ module CocoapodsXCRemoteCacheModifier
|
|
351
396
|
def self.add_lldbinit_rewrite(lines_content, user_proj_directory,fake_src_root)
|
352
397
|
all_lines = lines_content.clone
|
353
398
|
all_lines << LLDB_INIT_COMMENT
|
354
|
-
all_lines << "settings set target.source-map #{fake_src_root} #{user_proj_directory}"
|
399
|
+
all_lines << "settings set target.source-map #{fake_src_root} #{user_proj_directory}"
|
355
400
|
all_lines << ""
|
356
401
|
all_lines
|
357
402
|
end
|
@@ -413,8 +458,8 @@ module CocoapodsXCRemoteCacheModifier
|
|
413
458
|
# Remote cache is still disabled - no need to force Pods projects/targets regeneration
|
414
459
|
next
|
415
460
|
end
|
416
|
-
|
417
|
-
# Force rebuilding all Pods project, because XCRC build steps and settings need to be added to Pods project/targets
|
461
|
+
|
462
|
+
# Force rebuilding all Pods project, because XCRC build steps and settings need to be added to Pods project/targets
|
418
463
|
# It is relevant only when 'incremental_installation' is enabled, otherwise installed_cache_path does not exist on a disk
|
419
464
|
installed_cache_path = installer_context.sandbox.project_installation_cache_path
|
420
465
|
if !was_previously_enabled && File.exist?(installed_cache_path)
|
@@ -431,7 +476,7 @@ module CocoapodsXCRemoteCacheModifier
|
|
431
476
|
|
432
477
|
user_project = installer_context.umbrella_targets[0].user_project
|
433
478
|
|
434
|
-
begin
|
479
|
+
begin
|
435
480
|
user_proj_directory = File.dirname(user_project.path)
|
436
481
|
set_configuration_default_values
|
437
482
|
|
@@ -452,6 +497,7 @@ module CocoapodsXCRemoteCacheModifier
|
|
452
497
|
check_build_configuration = @@configuration['check_build_configuration']
|
453
498
|
check_platform = @@configuration['check_platform']
|
454
499
|
fake_src_root = @@configuration['fake_src_root']
|
500
|
+
exclude_sdks_configurations = @@configuration['exclude_sdks_configurations'] || []
|
455
501
|
|
456
502
|
xccc_location_absolute = "#{user_proj_directory}/#{xccc_location}"
|
457
503
|
xcrc_location_absolute = "#{user_proj_directory}/#{xcrc_location}"
|
@@ -475,7 +521,7 @@ module CocoapodsXCRemoteCacheModifier
|
|
475
521
|
next if target.name.start_with?("Pods-")
|
476
522
|
next if target.name.end_with?("Tests")
|
477
523
|
next if exclude_targets.include?(target.name)
|
478
|
-
enable_xcremotecache(target, 1, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target,fake_src_root)
|
524
|
+
enable_xcremotecache(target, 1, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target,fake_src_root, exclude_sdks_configurations)
|
479
525
|
end
|
480
526
|
|
481
527
|
# Create .rcinfo into `Pods` directory as that .xcodeproj reads configuration from .xcodeproj location
|
@@ -488,18 +534,18 @@ module CocoapodsXCRemoteCacheModifier
|
|
488
534
|
next if target.source_build_phase.files_references.empty?
|
489
535
|
next if target.name.end_with?("Tests")
|
490
536
|
next if exclude_targets.include?(target.name)
|
491
|
-
enable_xcremotecache(target, 1, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target,fake_src_root)
|
537
|
+
enable_xcremotecache(target, 1, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target,fake_src_root, exclude_sdks_configurations)
|
492
538
|
end
|
493
539
|
generated_project.save()
|
494
540
|
end
|
495
541
|
|
496
542
|
# Manual Pods/.rcinfo generation
|
497
|
-
|
543
|
+
|
498
544
|
# all paths in .rcinfo are relative to the root so paths used in Pods.xcodeproj need to be aligned
|
499
545
|
pods_path = Pathname.new(pods_proj_directory)
|
500
546
|
root_path = Pathname.new(user_proj_directory)
|
501
547
|
root_path_to_pods = root_path.relative_path_from(pods_path)
|
502
|
-
|
548
|
+
|
503
549
|
pods_rcinfo = root_rcinfo.merge({
|
504
550
|
'remote_commit_file' => "#{root_path_to_pods}/#{remote_commit_file}",
|
505
551
|
'xccc_file' => "#{root_path_to_pods}/#{xccc_location}"
|
@@ -511,7 +557,7 @@ module CocoapodsXCRemoteCacheModifier
|
|
511
557
|
|
512
558
|
# Enabled/disable XCRemoteCache for the main (user) project
|
513
559
|
begin
|
514
|
-
# TODO: Do not compile xcc again. `xcprepare` compiles it in pre-install anyway
|
560
|
+
# TODO: Do not compile xcc again. `xcprepare` compiles it in pre-install anyway
|
515
561
|
prepare_result = YAML.load`#{xcrc_location_absolute}/xcprepare --configuration #{check_build_configuration} --platform #{check_platform}`
|
516
562
|
unless prepare_result['result'] || mode != 'consumer'
|
517
563
|
# Uninstall the XCRemoteCache for the consumer mode
|
@@ -529,7 +575,7 @@ module CocoapodsXCRemoteCacheModifier
|
|
529
575
|
# Attach XCRC to the app targets
|
530
576
|
user_project.targets.each do |target|
|
531
577
|
next if exclude_targets.include?(target.name)
|
532
|
-
enable_xcremotecache(target, 0, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target,fake_src_root)
|
578
|
+
enable_xcremotecache(target, 0, xcrc_location, xccc_location, mode, exclude_build_configurations, final_target,fake_src_root, exclude_sdks_configurations)
|
533
579
|
end
|
534
580
|
|
535
581
|
# Set Target sourcemap
|
@@ -3,9 +3,9 @@
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
5
5
|
# You may obtain a copy of the License at
|
6
|
-
#
|
6
|
+
#
|
7
7
|
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
8
|
+
#
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
@@ -13,5 +13,5 @@
|
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
15
|
module CocoapodsXcremotecache
|
16
|
-
VERSION = "0.0.
|
16
|
+
VERSION = "0.0.16"
|
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.
|
4
|
+
version: 0.0.16
|
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:
|
12
|
+
date: 2023-04-15 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: CocoaPods plugin that enables XCRemoteCache with the project.
|
15
15
|
email:
|