-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Ability to set executable to Ask to Launch #871
Changes from 2 commits
dc06aa3
7120a91
2ea0bee
fb7c0d1
8cb9c56
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -233,6 +233,14 @@ public class SchemeGenerator { | |
} | ||
locationScenarioReference = XCScheme.LocationScenarioReference(identifier: identifier, referenceType: referenceType.rawValue) | ||
} | ||
|
||
let appExtensionTarget = scheme.build.targets.compactMap { bt -> Target? in | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we instead just use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in my case the share extension needs both the normal app and the extension set for build targets. When either one of the targets is the app extension I set it to askForAppToLaunch otherwise the key can be nil. Using the schemeTarget doesn't have the same result. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahh, okay. Let's not default it at all then. If its not specified in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good to me, this way we don't enforce anything upon the user but let them take care of setting the right values in the |
||
return project.getTarget(bt.target.name) | ||
}.first { $0.type == .appExtension } | ||
|
||
let askAppForLaunch = scheme.run?.askForAppToLaunch ?? ((appExtensionTarget != nil) ? true : nil) | ||
let launchAutomaticallySubstyle = scheme.run?.launchAutomaticallySubstyle ?? ((appExtensionTarget != nil) ? "2" : nil) | ||
|
||
let launchAction = XCScheme.LaunchAction( | ||
runnable: shouldExecuteOnLaunch ? runnables.launch : nil, | ||
buildConfiguration: scheme.run?.config ?? defaultDebugConfig.name, | ||
|
@@ -241,6 +249,7 @@ public class SchemeGenerator { | |
macroExpansion: shouldExecuteOnLaunch ? nil : buildableReference, | ||
selectedDebuggerIdentifier: (scheme.run?.debugEnabled ?? Scheme.Run.debugEnabledDefault) ? XCScheme.defaultDebugger : "", | ||
selectedLauncherIdentifier: (scheme.run?.debugEnabled ?? Scheme.Run.debugEnabledDefault) ? XCScheme.defaultLauncher : "Xcode.IDEFoundation.Launcher.PosixSpawn", | ||
askForAppToLaunch: askAppForLaunch, | ||
allowLocationSimulation: allowLocationSimulation, | ||
locationScenarioReference: locationScenarioReference, | ||
disableMainThreadChecker: scheme.run?.disableMainThreadChecker ?? Scheme.Run.disableMainThreadCheckerDefault, | ||
|
@@ -249,7 +258,7 @@ public class SchemeGenerator { | |
environmentVariables: launchVariables, | ||
language: scheme.run?.language, | ||
region: scheme.run?.region, | ||
launchAutomaticallySubstyle: scheme.run?.launchAutomaticallySubstyle | ||
launchAutomaticallySubstyle: launchAutomaticallySubstyle | ||
) | ||
|
||
let profileAction = XCScheme.ProfileAction( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about defaulting to
false
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the key is by default non-existing instead of false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this value were false, then the property would be nil. Is that what is intended?