Skip to content

Commit

Permalink
Merge branch 'fix/626-remote-runnable-without-buildable-reference'
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil Subbotin committed Jul 31, 2021
2 parents e4f1ee6 + ec8a69b commit 1a590cf
Show file tree
Hide file tree
Showing 5 changed files with 250 additions and 15 deletions.
98 changes: 98 additions & 0 deletions Fixtures/Schemes/RunnableWithoutBuildableReference.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FE7C11D21B6DB70D0041DF02"
BuildableName = "Ava.app"
BlueprintName = "core-ava"
ReferencedContainer = "container:core-ava.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9942115E25C4D3B7000711CE"
BuildableName = "AvaTests.xctest"
BlueprintName = "AvaTests"
ReferencedContainer = "container:core-ava.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Staging"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
askForAppToLaunch = "Yes"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
<RemoteRunnable
runnableDebuggingMode = "1"
BundleIdentifier = "me.ava.Ava-Staging"
RemotePath = "/var/containers/Bundle/Application/018F0933-05E8-4359-9955-39E0523C4246/Ava.app">
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FE7C11D21B6DB70D0041DF02"
BuildableName = "Ava.app"
BlueprintName = "core-ava"
ReferencedContainer = "container:core-ava.xcodeproj">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FE7C11D21B6DB70D0041DF02"
BuildableName = "Ava.app"
BlueprintName = "core-ava"
ReferencedContainer = "container:core-ava.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
2 changes: 1 addition & 1 deletion Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ extension XCScheme {
selectedDebuggerIdentifier = element.attributes["selectedDebuggerIdentifier"] ?? XCScheme.defaultDebugger
selectedLauncherIdentifier = element.attributes["selectedLauncherIdentifier"] ?? XCScheme.defaultLauncher
launchStyle = element.attributes["launchStyle"].flatMap { Style(rawValue: $0) } ?? .auto
askForAppToLaunch = element.attributes["askForAppToLaunch"].map { $0 == "YES" }
askForAppToLaunch = element.attributes["askForAppToLaunch"].map { $0 == "YES" || $0 == "Yes" }
useCustomWorkingDirectory = element.attributes["useCustomWorkingDirectory"] == "YES"
ignoresPersistentStateOnLaunch = element.attributes["ignoresPersistentStateOnLaunch"] == "YES"
debugDocumentVersioning = element.attributes["debugDocumentVersioning"].map { $0 == "YES" } ?? true
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ extension XCScheme {
savedToolIdentifier = element.attributes["savedToolIdentifier"] ?? ""
useCustomWorkingDirectory = element.attributes["useCustomWorkingDirectory"] == "YES"
debugDocumentVersioning = element.attributes["debugDocumentVersioning"].map { $0 == "YES" } ?? true
askForAppToLaunch = element.attributes["askForAppToLaunch"].map { $0 == "YES" }
askForAppToLaunch = element.attributes["askForAppToLaunch"].map { $0 == "YES" || $0 == "Yes" }
ignoresPersistentStateOnLaunch = element.attributes["ignoresPersistentStateOnLaunch"].map { $0 == "YES" } ?? false

let buildableProductRunnableElement = element["BuildableProductRunnable"]
Expand Down
8 changes: 5 additions & 3 deletions Sources/XcodeProj/Scheme/XCScheme+Runnable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ extension XCScheme {
// MARK: - Attributes

public var runnableDebuggingMode: String
public var buildableReference: BuildableReference
public var buildableReference: BuildableReference?

// MARK: - Init

Expand All @@ -18,7 +18,7 @@ extension XCScheme {

init(element: AEXMLElement) throws {
runnableDebuggingMode = element.attributes["runnableDebuggingMode"] ?? "0"
buildableReference = try BuildableReference(element: element["BuildableReference"])
buildableReference = try? BuildableReference(element: element["BuildableReference"])
}

// MARK: - XML
Expand All @@ -27,7 +27,9 @@ extension XCScheme {
let element = AEXMLElement(name: "Runnable",
value: nil,
attributes: ["runnableDebuggingMode": runnableDebuggingMode])
element.addChild(buildableReference.xmlElement())
if let buildableReference = buildableReference {
element.addChild(buildableReference.xmlElement())
}
return element
}

Expand Down
Loading

0 comments on commit 1a590cf

Please sign in to comment.