Modern Apps git

xtool.git

Public
git clone https://git.maproj.org/xtool.git
main ▾

xtool.git / Sources / XToolSupport / DevBSPCommand.swift

DevBSPCommand.swift34 lines · 934 BRaw
1import XCLIUtils
2import XUtils
3import ArgumentParser
4import Foundation
5import XKit
6import PackLib
7import Subprocess
8
9struct DevBSPCommand: AsyncParsableCommand {
10 static let configuration = CommandConfiguration(
11 commandName: "build-server",
12 abstract: "Run build server",
13 )
14
15 @Option
16 var triple: String?
17
18 func run() async throws {
19 guard try await SwiftVersion.current.supportsSwiftBuild else {
20 throw Console.Error("`xtool dev build-server` requires Swift 6.4 or later")
21 }
22 let settings = try await BuildSettings(
23 configuration: .debug,
24 triple: triple ?? PackOperation.defaultTriple
25 )
26 try await Subprocess.run(
27 settings.buildServerInvocation(),
28 input: .currentStandardInput,
29 output: .currentStandardOutput,
30 error: .currentStandardError,
31 )
32 .checkSuccess()
33 }
34}