diff --git a/README.md b/README.md index 91347ca..3ab898d 100755 --- a/README.md +++ b/README.md @@ -315,7 +315,7 @@ _Note that for the `producer` mode, the prebuild build phase and `xccc`, `xcld`, | `disable_certificate_verification` | A Boolean value that opts-in SSL certificate validation is disabled | `false` | ⬜️ | | `disable_vfs_overlay` | A feature flag to disable virtual file system overlay support (temporary) | `false` | ⬜️ | | `custom_rewrite_envs` | A list of extra ENVs that should be used as placeholders in the dependency list. ENV rewrite process is optimistic - does nothing if an ENV is not defined in the pre/postbuild process. | `[]` | ⬜️ | -| `irrelevant_dependencies_paths` | Regexes of files that should not be included in a list of dependencies. Warning! Be caution when adding entries here - excluding relevant dependencies might lead to targets overcaching. The regex can match either partially of fully the filepath, e.g. `\\.modulemap$` will exclude all `.modulemap` files.. | `[]` | ⬜️ | +| `irrelevant_dependencies_paths` | Regexes of files that should not be included in a list of dependencies. Warning! Add entries here with caution - excluding dependencies that are relevant might lead to a target overcaching. The regex can match either partially or fully the filepath, e.g. `\\.modulemap$` will exclude all `.modulemap` files.. | `[]` | ⬜️ | ## Backend cache server diff --git a/Sources/XCRemoteCache/Config/XCRemoteCacheConfig.swift b/Sources/XCRemoteCache/Config/XCRemoteCacheConfig.swift index a9028bd..80ab797 100644 --- a/Sources/XCRemoteCache/Config/XCRemoteCacheConfig.swift +++ b/Sources/XCRemoteCache/Config/XCRemoteCacheConfig.swift @@ -138,9 +138,9 @@ public struct XCRemoteCacheConfig: Encodable { /// A list of extra ENVs that should be used as placeholders in the dependency list /// ENV rewrite process is optimistic - does nothing if an ENV is not defined in the pre/postbuild process var customRewriteEnvs: [String] = [] - /// Regexes of files that should not be included in a list of dependencies. Warning! Be caution when adding - /// entries here - excluding relevant dependencies might lead to targets overcaching - /// The regex can match either partially of fully the filepath, e.g. `\\.modulemap$` will exclude + /// Regexes of files that should not be included in a list of dependencies. Warning! Add entries here + /// with caution - excluding dependencies that are relevant might lead to a target overcaching + /// Note: The regex can match either partially or fully the filepath, e.g. `\\.modulemap$` will exclude /// all `.modulemap` files var irrelevantDependenciesPaths: [String] = [] } diff --git a/Sources/XCRemoteCache/Dependencies/DependencyProcessor.swift b/Sources/XCRemoteCache/Dependencies/DependencyProcessor.swift index f85bb92..fc20375 100644 --- a/Sources/XCRemoteCache/Dependencies/DependencyProcessor.swift +++ b/Sources/XCRemoteCache/Dependencies/DependencyProcessor.swift @@ -31,7 +31,7 @@ public struct Dependency: Equatable { // Product of the target itself case ownProduct // User-excluded path - case customSkipped + case userExcluded case unknown } @@ -81,7 +81,7 @@ class DependencyProcessorImpl: DependencyProcessor { return files.map { file -> Dependency in let filePath = file.resolvingSymlinksInPath().path if skippedRegexes.contains(where: { filePath.range(of: $0, options: .regularExpression) != nil }) { - return Dependency(url: file, type: .customSkipped) + return Dependency(url: file, type: .userExcluded) } else if filePath.hasPrefix(xcodePath) { return Dependency(url: file, type: .xcode) } else if filePath.hasPrefix(intermediatePath) { @@ -120,8 +120,9 @@ class DependencyProcessorImpl: DependencyProcessor { // because in case of a hit, these will be taken from the artifact // - Customized DERIVED_FILE_DIR may change a directory of // derived files, which by default is under `*/Interemediates` + // - User-specified (in .rcinfo) files to exclude let irrelevantDependenciesType: [Dependency.Kind] = [ - .xcode, .intermediate, .ownProduct, .derivedFile, .customSkipped, + .xcode, .intermediate, .ownProduct, .derivedFile, .userExcluded, ] return !irrelevantDependenciesType.contains(dependency.type) }