Skip to content

armgit / xtool

Public Imported from GitHub
0

Cross-platform Xcode replacement. Build and deploy iOS apps with SwiftPM on Linux, Windows, macOS.

More small changes

Kabir Oberaica540c88724c
diff --git a/Sources/Supersign/Model/Certificate/Certificate.swift b/Sources/Supersign/Model/Certificate.swift
similarity index 100%
rename from Sources/Supersign/Model/Certificate/Certificate.swift
rename to Sources/Supersign/Model/Certificate.swift
diff --git a/Sources/Supersign/Model/Keypair/Keypair.swift b/Sources/Supersign/Model/Keypair.swift
similarity index 100%
rename from Sources/Supersign/Model/Keypair/Keypair.swift
rename to Sources/Supersign/Model/Keypair.swift
diff --git a/Sources/Supersign/Model/Mobileprovision/Mobileprovision.swift b/Sources/Supersign/Model/Mobileprovision.swift
similarity index 100%
rename from Sources/Supersign/Model/Mobileprovision/Mobileprovision.swift
rename to Sources/Supersign/Model/Mobileprovision.swift
diff --git a/Sources/SupersignCLISupport/ConnectionOptions.swift b/Sources/SupersignCLISupport/ConnectionOptions.swift
index c1b55de..a186680 100644
--- a/Sources/SupersignCLISupport/ConnectionOptions.swift
+++ b/Sources/SupersignCLISupport/ConnectionOptions.swift
@@ -3,21 +3,20 @@ import Supersign
import ArgumentParser
struct ConnectionOptions: ParsableArguments {
- @Option(name: .shortAndLong) var udid: String?
+ struct WithoutSearchMode: ParsableArguments {
+ @Option(name: .shortAndLong) var udid: String?
+ }
+ @OptionGroup var base: WithoutSearchMode
@Flag var search: ClientDevice.SearchMode = .all
- init() {}
-
- init(
- udid: String?,
- search: ClientDevice.SearchMode = .all
- ) {
- self.udid = udid
- self.search = search
+ func client() async throws -> ClientDevice {
+ try await base.client(searchMode: search)
}
+}
- func client() async throws -> ClientDevice {
+extension ConnectionOptions.WithoutSearchMode {
+ func client(searchMode search: ClientDevice.SearchMode) async throws -> ClientDevice {
print("Waiting for device to be connected...")
let stream = try await ClientDevice.search(mode: search)
diff --git a/Sources/SupersignCLISupport/SuperchargeCommand.swift b/Sources/SupersignCLISupport/SuperchargeCommand.swift
index 3343348..2f25c2e 100644
--- a/Sources/SupersignCLISupport/SuperchargeCommand.swift
+++ b/Sources/SupersignCLISupport/SuperchargeCommand.swift
@@ -8,7 +8,7 @@ struct InstallSuperchargeCommand: AsyncParsableCommand {
abstract: "Install Supercharge"
)
- @Option(name: .shortAndLong) var udid: String?
+ @OptionGroup var connectionOptions: ConnectionOptions.WithoutSearchMode
func run() async throws {
guard let app = SupersignCLI.config.superchargeApp else {
@@ -17,14 +17,14 @@ struct InstallSuperchargeCommand: AsyncParsableCommand {
let auth = try AuthToken.saved()
- let client = try await ConnectionOptions(udid: udid, search: .usb).client()
+ let client = try await connectionOptions.client(searchMode: .usb)
print("Installing to device: \(client.deviceName) (udid: \(client.udid))")
let installDelegate = SupersignCLIDelegate(preferredTeam: nil)
let installer = IntegratedInstaller(
udid: client.udid,
- lookupMode: .only(.usb),
+ lookupMode: .only(client.connectionType),
appleID: auth.appleID,
token: auth.dsToken,
configureDevice: true,