Merge pull request #328 from brentleyjones/fix-launch-actions

Fix launch action to not run frameworks
This commit is contained in:
Yonas Kolb
2018-07-01 22:52:14 +10:00
committed by GitHub
3 changed files with 11 additions and 4 deletions
+5 -1
View File
@@ -70,6 +70,9 @@ public class ProjectGenerator {
}
return XCScheme.ExecutionAction(scriptText: action.script, title: action.name, environmentBuildable: environmentBuildable)
}
let target = project.getTarget(scheme.build.targets.first!.target)
let shouldExecuteOnLaunch = target?.type.isExecutable == true
let buildableReference = buildActionEntries.first!.buildableReference
let productRunable = XCScheme.BuildableProductRunnable(buildableReference: buildableReference)
@@ -107,10 +110,11 @@ public class ProjectGenerator {
)
let launchAction = XCScheme.LaunchAction(
buildableProductRunnable: productRunable,
buildableProductRunnable: shouldExecuteOnLaunch ? productRunable : nil,
buildConfiguration: scheme.run?.config ?? defaultDebugConfig.name,
preActions: scheme.run?.preActions.map(getExecutionAction) ?? [],
postActions: scheme.run?.postActions.map(getExecutionAction) ?? [],
macroExpansion: shouldExecuteOnLaunch ? nil : buildableReference,
commandlineArguments: launchCommandLineArgs,
environmentVariables: launchVariables
)