Skip to content

Do release builds in the plugin #92

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

Merged
merged 1 commit into from
Feb 7, 2025
Merged
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
15 changes: 14 additions & 1 deletion Plugins/launch-xcode/launch-xcode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,20 @@ struct LaunchXcode: CommandPlugin {
print("This command is only supported on macOS")
return
#else
let buildResult = try packageManager.build(.all(includingTests: false), parameters: .init(echoLogs: true))
var args = ArgumentExtractor(arguments)
var configuration: PackageManager.BuildConfiguration = .debug
// --release
if args.extractFlag(named: "release") > 0 {
configuration = .release
} else {
// --configuration release
let configurationOptions = args.extractOption(named: "configuration")
if configurationOptions.contains("release") {
configuration = .release
}
}

let buildResult = try packageManager.build(.all(includingTests: false), parameters: .init(configuration: configuration, echoLogs: true))
guard buildResult.succeeded else { return }
guard let buildServiceURL = buildResult.builtArtifacts.map({ $0.url }).filter({ $0.lastPathComponent == "SWBBuildServiceBundle" }).first else {
print("Failed to determine path to built SWBBuildServiceBundle")
Expand Down