non-mutable way of creating [XCScheme.TestPlanReference]

This commit is contained in:
yonaskolb 2019-11-12 20:43:57 +11:00
parent cb90212641
commit 6a02474385

View File

@ -194,18 +194,15 @@ public class SchemeGenerator {
let launchVariables = scheme.run.flatMap { $0.environmentVariables.isEmpty ? nil : $0.environmentVariables }
let profileVariables = scheme.profile.flatMap { $0.environmentVariables.isEmpty ? nil : $0.environmentVariables }
var testPlans: [XCScheme.TestPlanReference]?
if let plans = scheme.test?.testPlans, !plans.isEmpty {
testPlans = plans.enumerated().map { index, path in
.init(reference: "container:\(path)", default: index == 0)
}
}
let testPlans = scheme.test?.testPlans.enumerated().map { index, path in
XCScheme.TestPlanReference(reference: "container:\(path)", default: index == 0)
} ?? []
let testAction = XCScheme.TestAction(
buildConfiguration: scheme.test?.config ?? defaultDebugConfig.name,
macroExpansion: buildableReference,
testables: testables,
testPlans: testPlans,
testPlans: testPlans.isEmpty ? nil : testPlans,
preActions: scheme.test?.preActions.map(getExecutionAction) ?? [],
postActions: scheme.test?.postActions.map(getExecutionAction) ?? [],
selectedDebuggerIdentifier: (scheme.test?.debugEnabled ?? Scheme.Test.debugEnabledDefault) ? XCScheme.defaultDebugger : "",