diff --git a/Sources/ProjectSpec/Scheme.swift b/Sources/ProjectSpec/Scheme.swift index 4600d38b..28c4a4ac 100644 --- a/Sources/ProjectSpec/Scheme.swift +++ b/Sources/ProjectSpec/Scheme.swift @@ -140,6 +140,10 @@ public struct Scheme: Equatable { lhs.postActions == rhs.postActions && lhs.environmentVariables == rhs.environmentVariables } + + public var shouldUseLaunchSchemeArgsEnv: Bool { + return commandLineArguments.isEmpty && environmentVariables.isEmpty + } } public struct Analyze: BuildAction { @@ -180,6 +184,10 @@ public struct Scheme: Equatable { lhs.postActions == rhs.postActions && lhs.environmentVariables == rhs.environmentVariables } + + public var shouldUseLaunchSchemeArgsEnv: Bool { + return commandLineArguments.isEmpty && environmentVariables.isEmpty + } } public struct Archive: BuildAction { diff --git a/Sources/XcodeGenKit/ProjectGenerator.swift b/Sources/XcodeGenKit/ProjectGenerator.swift index e5417010..5586772b 100644 --- a/Sources/XcodeGenKit/ProjectGenerator.swift +++ b/Sources/XcodeGenKit/ProjectGenerator.swift @@ -100,7 +100,7 @@ public class ProjectGenerator { testables: testables, preActions: scheme.test?.preActions.map(getExecutionAction) ?? [], postActions: scheme.test?.postActions.map(getExecutionAction) ?? [], - shouldUseLaunchSchemeArgsEnv: scheme.test?.commandLineArguments.isEmpty ?? true, + shouldUseLaunchSchemeArgsEnv: scheme.test?.shouldUseLaunchSchemeArgsEnv ?? true, codeCoverageEnabled: scheme.test?.gatherCoverageData ?? false, commandlineArguments: testCommandLineArgs, environmentVariables: testVariables, @@ -121,7 +121,7 @@ public class ProjectGenerator { buildConfiguration: scheme.profile?.config ?? defaultReleaseConfig.name, preActions: scheme.profile?.preActions.map(getExecutionAction) ?? [], postActions: scheme.profile?.postActions.map(getExecutionAction) ?? [], - shouldUseLaunchSchemeArgsEnv: scheme.profile?.commandLineArguments.isEmpty ?? true, + shouldUseLaunchSchemeArgsEnv: scheme.profile?.shouldUseLaunchSchemeArgsEnv ?? true, commandlineArguments: profileCommandLineArgs, environmentVariables: profileVariables )