Skip to content

Commit

Permalink
Add [Runner.Options.CachePolicy].disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ikesyo committed Nov 15, 2024
1 parent afafa8d commit 2720cde
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Sources/ScipioKit/Runner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,7 @@ extension Runner.Options.BuildOptionsContainer {
}
}
}

extension [Runner.Options.CachePolicy] {
public static let disabled: Self = []
}
4 changes: 2 additions & 2 deletions Sources/scipio/CommandType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ enum CommandType {
var cachePolicies: [Runner.Options.CachePolicy] {
switch self {
case .create:
return []
return .disabled
case .prepare(let cachePolicies):
return cachePolicies
}
Expand Down Expand Up @@ -61,7 +61,7 @@ extension Runner {
private static func cachePolicies(from commandType: CommandType) -> [Runner.Options.CachePolicy] {
switch commandType {
case .create:
return []
return .disabled
case .prepare(let cachePolicies):
return cachePolicies
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/scipio/PrepareCommands.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extension Scipio {
let runnerCachePolicies: [Runner.Options.CachePolicy]
switch cachePolicy {
case .disabled:
runnerCachePolicies = []
runnerCachePolicies = .disabled
case .project:
runnerCachePolicies = [.project]
case .local:
Expand Down
2 changes: 1 addition & 1 deletion Tests/ScipioKitTests/IntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ final class IntegrationTests: XCTestCase {
),
buildOptionsMatrix: buildOptionsMatrix,
shouldOnlyUseVersionsFromResolvedFile: true,
cachePolicies: [],
cachePolicies: .disabled,
overwrite: true,
verbose: false
)
Expand Down
4 changes: 2 additions & 2 deletions Tests/ScipioKitTests/RunnerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ final class RunnerTests: XCTestCase {
isSimulatorSupported: true
),
shouldOnlyUseVersionsFromResolvedFile: true,
cachePolicies: []
cachePolicies: .disabled
)
)

Expand Down Expand Up @@ -655,7 +655,7 @@ final class RunnerTests: XCTestCase {
frameworkType: .mergeable
),
shouldOnlyUseVersionsFromResolvedFile: true,
cachePolicies: []
cachePolicies: .disabled
)
)

Expand Down

0 comments on commit 2720cde

Please sign in to comment.