mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Improved Application Extension scheme generation (#932)
* Default extensions to launchAutomaticallySubstyle "2" * Don't use debugger launcher with extensions Xcode schemes don't use the LLDB launcher, even when debugging is enabled. Co-authored-by: Yonas Kolb <yonaskolb@users.noreply.github.com>
This commit is contained in:
co-authored by
Yonas Kolb
parent
c8b24acbdd
commit
5ac96741bc
+2
-1
@@ -6,6 +6,7 @@
|
||||
- Add `Scheme.Test.TestTarget.skipped` to allow skipping of an entire test target. [#916](https://github.com/yonaskolb/XcodeGen/pull/916) @codeman9
|
||||
- Added ability to set custom LLDBInit scripts for launch and test schemes [#929](https://github.com/yonaskolb/XcodeGen/pull/929) @polac24
|
||||
- Adds App Clip support. [#909](https://github.com/yonaskolb/XcodeGen/pull/909) @brentleyjones @dflems
|
||||
- Application extension schemes now default to `launchAutomaticallySubstyle = 2` and the correct debugger and launcher identifiers [#932](https://github.com/yonaskolb/XcodeGen/pull/932) @brentleyjones
|
||||
|
||||
#### Internal
|
||||
- Updates CI to run on Xcode 12 beta. [#936](https://github.com/yonaskolb/XcodeGen/pull/936) @dflems
|
||||
@@ -23,7 +24,7 @@
|
||||
#### Fixed
|
||||
- Treat all directories with known UTI as file wrapper. [#896](https://github.com/yonaskolb/XcodeGen/pull/896) @KhaosT
|
||||
- Generated schemes for application extensions now contain `wasCreatedForAppExtension = YES`. [#898](https://github.com/yonaskolb/XcodeGen/issues/898) @muizidn
|
||||
- Allow package dependencies to use `link: false` [#920](https://github.com/yonaskolb/XcodeGen/pull/920) @k-thorat
|
||||
- Allow package dependencies to use `link: false` [#920](https://github.com/yonaskolb/XcodeGen/pull/920) @k-thorat
|
||||
- Fixed issue computing relative paths. [#915](https://github.com/yonaskolb/XcodeGen/pull/915) @andrewreach
|
||||
|
||||
#### Internal
|
||||
|
||||
@@ -240,8 +240,8 @@ public class SchemeGenerator {
|
||||
preActions: scheme.run?.preActions.map(getExecutionAction) ?? [],
|
||||
postActions: scheme.run?.postActions.map(getExecutionAction) ?? [],
|
||||
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",
|
||||
selectedDebuggerIdentifier: selectedDebuggerIdentifier(for: schemeTarget, run: scheme.run),
|
||||
selectedLauncherIdentifier: selectedLauncherIdentifier(for: schemeTarget, run: scheme.run),
|
||||
askForAppToLaunch: scheme.run?.askForAppToLaunch,
|
||||
allowLocationSimulation: allowLocationSimulation,
|
||||
locationScenarioReference: locationScenarioReference,
|
||||
@@ -251,7 +251,7 @@ public class SchemeGenerator {
|
||||
environmentVariables: launchVariables,
|
||||
language: scheme.run?.language,
|
||||
region: scheme.run?.region,
|
||||
launchAutomaticallySubstyle: scheme.run?.launchAutomaticallySubstyle,
|
||||
launchAutomaticallySubstyle: scheme.run?.launchAutomaticallySubstyle ?? launchAutomaticallySubstyle(for: schemeTarget),
|
||||
customLLDBInitFile: scheme.run?.customLLDBInit
|
||||
)
|
||||
|
||||
@@ -290,6 +290,14 @@ public class SchemeGenerator {
|
||||
)
|
||||
}
|
||||
|
||||
private func launchAutomaticallySubstyle(for target: Target?) -> String? {
|
||||
if target?.type.isExtension == true {
|
||||
return "2"
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
private func makeProductRunnables(for target: Target?, buildableReference: XCScheme.BuildableReference) -> (launch: XCScheme.Runnable, profile: XCScheme.BuildableProductRunnable) {
|
||||
let buildable = XCScheme.BuildableProductRunnable(buildableReference: buildableReference)
|
||||
if target?.type.isWatchApp == true {
|
||||
@@ -303,6 +311,22 @@ public class SchemeGenerator {
|
||||
return (buildable, buildable)
|
||||
}
|
||||
}
|
||||
|
||||
private func selectedDebuggerIdentifier(for target: Target?, run: Scheme.Run?) -> String {
|
||||
if target?.type.canUseDebugLauncher != false && run?.debugEnabled ?? Scheme.Run.debugEnabledDefault {
|
||||
return XCScheme.defaultDebugger
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
private func selectedLauncherIdentifier(for target: Target?, run: Scheme.Run?) -> String {
|
||||
if target?.type.canUseDebugLauncher != false && run?.debugEnabled ?? Scheme.Run.debugEnabledDefault {
|
||||
return XCScheme.defaultLauncher
|
||||
} else {
|
||||
return "Xcode.IDEFoundation.Launcher.PosixSpawn"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum SchemeGenerationError: Error, CustomStringConvertible {
|
||||
@@ -380,6 +404,11 @@ extension Scheme {
|
||||
}
|
||||
|
||||
extension PBXProductType {
|
||||
var canUseDebugLauncher: Bool {
|
||||
// Extensions don't use the lldb launcher
|
||||
return !isExtension
|
||||
}
|
||||
|
||||
var isWatchApp: Bool {
|
||||
switch self {
|
||||
case .watchApp, .watch2App:
|
||||
|
||||
+4
-3
@@ -45,14 +45,15 @@
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Production Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
selectedDebuggerIdentifier = ""
|
||||
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
allowLocationSimulation = "YES"
|
||||
launchAutomaticallySubstyle = "2">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
|
||||
+4
-3
@@ -45,14 +45,15 @@
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Production Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
selectedDebuggerIdentifier = ""
|
||||
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
allowLocationSimulation = "YES"
|
||||
launchAutomaticallySubstyle = "2">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
|
||||
Reference in New Issue
Block a user