Modern Apps git

xtool.git

Public
git clone https://git.maproj.org/xtool.git
appstore-distribution ▾

xtool.git / Sources / XToolSupport / DevBSPCommand.swift

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