From bbcce89292d96eafc87b86c0ced3fc4ff01e56f1 Mon Sep 17 00:00:00 2001 From: Kabir Oberai Date: Sun, 27 Jul 2025 17:47:51 -0400 Subject: [PATCH] Create XUtils --- Package.swift | 4 ++++ Sources/PackLib/PackSchema.swift | 1 + Sources/PackLib/Packer.swift | 1 + Sources/PackLib/Planner.swift | 1 + Sources/XToolSupport/DevCommand.swift | 1 + Sources/{PackLib => XUtils}/Foundation+Utils.swift | 0 6 files changed, 8 insertions(+) rename Sources/{PackLib => XUtils}/Foundation+Utils.swift (100%) diff --git a/Package.swift b/Package.swift index 4a702eec..a1e26ff0 100644 --- a/Package.swift +++ b/Package.swift @@ -90,11 +90,14 @@ let package = Package( ], exclude: ["openapi-generator-config.yaml", "patch.js"] ), + // common utilities shared across xtool targets + .target(name: "XUtils"), .target( name: "XKit", dependencies: [ "DeveloperAPI", "CXKit", + "XUtils", .byName(name: "XADI", condition: .when(platforms: [.linux])), .product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"), .product(name: "Dependencies", package: "swift-dependencies"), @@ -165,6 +168,7 @@ let package = Package( .target( name: "PackLib", dependencies: [ + "XUtils", .product(name: "Yams", package: "Yams"), .product(name: "XcodeGenKit", package: "XcodeGen", condition: .when(platforms: [.macOS])), ] diff --git a/Sources/PackLib/PackSchema.swift b/Sources/PackLib/PackSchema.swift index e696d2d6..406ef24a 100644 --- a/Sources/PackLib/PackSchema.swift +++ b/Sources/PackLib/PackSchema.swift @@ -1,5 +1,6 @@ import Foundation import Yams +import XUtils public struct PackSchemaBase: Codable, Sendable { public enum Version: Int, Codable, Sendable { diff --git a/Sources/PackLib/Packer.swift b/Sources/PackLib/Packer.swift index b8523437..ff402bdf 100644 --- a/Sources/PackLib/Packer.swift +++ b/Sources/PackLib/Packer.swift @@ -1,4 +1,5 @@ import Foundation +import XUtils public struct Packer: Sendable { public let buildSettings: BuildSettings diff --git a/Sources/PackLib/Planner.swift b/Sources/PackLib/Planner.swift index cf564305..505755f4 100644 --- a/Sources/PackLib/Planner.swift +++ b/Sources/PackLib/Planner.swift @@ -1,4 +1,5 @@ import Foundation +import XUtils public struct Planner: Sendable { public var buildSettings: BuildSettings diff --git a/Sources/XToolSupport/DevCommand.swift b/Sources/XToolSupport/DevCommand.swift index d2a57ffe..b699ebda 100644 --- a/Sources/XToolSupport/DevCommand.swift +++ b/Sources/XToolSupport/DevCommand.swift @@ -3,6 +3,7 @@ import ArgumentParser import PackLib import XKit import Dependencies +import XUtils struct PackOperation { struct BuildOptions: ParsableArguments { diff --git a/Sources/PackLib/Foundation+Utils.swift b/Sources/XUtils/Foundation+Utils.swift similarity index 100% rename from Sources/PackLib/Foundation+Utils.swift rename to Sources/XUtils/Foundation+Utils.swift