Skip to content
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

Add shell to ExecuteAction #1430

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Sources/ProjectSpec/Scheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ public struct Scheme: Equatable {
public var script: String
public var name: String
public var settingsTarget: String?
public init(name: String, script: String, settingsTarget: String? = nil) {
public var shell: String?
public init(name: String, script: String, shell: String? = nil, settingsTarget: String? = nil) {
self.script = script
self.name = name
self.settingsTarget = settingsTarget
self.shell = shell
}
}

Expand Down Expand Up @@ -400,6 +402,7 @@ extension Scheme.ExecutionAction: JSONObjectConvertible {
script = try jsonDictionary.json(atKeyPath: "script")
name = jsonDictionary.json(atKeyPath: "name") ?? "Run Script"
settingsTarget = jsonDictionary.json(atKeyPath: "settingsTarget")
shell = jsonDictionary.json(atKeyPath: "shell")
}
}

Expand All @@ -409,6 +412,7 @@ extension Scheme.ExecutionAction: JSONEncodable {
"script": script,
"name": name,
"settingsTarget": settingsTarget,
"shell": shell
]
}
}
Expand Down
7 changes: 6 additions & 1 deletion Sources/XcodeGenKit/SchemeGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,12 @@ public class SchemeGenerator {
.first { settingsTarget == $0.buildableReference.blueprintName }?
.buildableReference
}
return XCScheme.ExecutionAction(scriptText: action.script, title: action.name, environmentBuildable: environmentBuildable)
return XCScheme.ExecutionAction(
scriptText: action.script,
title: action.name,
shellToInvoke: action.shell,
environmentBuildable: environmentBuildable
)
}

let schemeTarget: ProjectTarget?
Expand Down