diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 627c562c..d34dc9b9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,10 +7,13 @@ on: pull_request: branches: - '*' -env: - DEVELOPER_DIR: "/Applications/Xcode_14.3.1.app/Contents/Developer" jobs: Tests: + strategy: + matrix: + xcode_version: ["14.3.1", "15.0"] + env: + DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode_version }}.app/Contents/Developer" runs-on: macos-13 steps: - uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index 1d78c204..9f7a368a 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ DerivedData/ Tests/**/XCFrameworks/* **/docs + +Package.resolved diff --git a/Package.resolved b/Package.resolved deleted file mode 100644 index 180a021b..00000000 --- a/Package.resolved +++ /dev/null @@ -1,238 +0,0 @@ -{ - "pins" : [ - { - "identity" : "async-http-client", - "kind" : "remoteSourceControl", - "location" : "https://github.com/swift-server/async-http-client.git", - "state" : { - "revision" : "333e60cc90f52973f7ee29cd8e3a7f6adfe79f4e", - "version" : "1.17.0" - } - }, - { - "identity" : "hummingbird-mustache", - "kind" : "remoteSourceControl", - "location" : "https://github.com/hummingbird-project/hummingbird-mustache.git", - "state" : { - "revision" : "fa5617622333da6334252a9d7e3633129b89120d", - "version" : "1.0.3" - } - }, - { - "identity" : "jmespath.swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/adam-fowler/jmespath.swift.git", - "state" : { - "revision" : "4513d319c4aaa6c3b2ac18e1e6566a803515ad91", - "version" : "1.0.2" - } - }, - { - "identity" : "rainbow", - "kind" : "remoteSourceControl", - "location" : "https://github.com/onevcat/Rainbow", - "state" : { - "revision" : "e0dada9cd44e3fa7ec3b867e49a8ddbf543e3df3", - "version" : "4.0.1" - } - }, - { - "identity" : "soto-codegenerator", - "kind" : "remoteSourceControl", - "location" : "https://github.com/soto-project/soto-codegenerator", - "state" : { - "revision" : "7e8e10da05e376ffce0d1721526e20e68d8a81d4", - "version" : "0.8.0" - } - }, - { - "identity" : "soto-core", - "kind" : "remoteSourceControl", - "location" : "https://github.com/soto-project/soto-core.git", - "state" : { - "revision" : "3462ca704a43ded3b5a2903f5df3280dd5fa6b1f", - "version" : "6.5.0" - } - }, - { - "identity" : "soto-smithy", - "kind" : "remoteSourceControl", - "location" : "https://github.com/soto-project/soto-smithy.git", - "state" : { - "revision" : "37c1f08b6a4979873d86cc392015e1244fce7a74", - "version" : "0.3.6" - } - }, - { - "identity" : "swift-algorithms", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-algorithms.git", - "state" : { - "revision" : "b14b7f4c528c942f121c8b860b9410b2bf57825e", - "version" : "1.0.0" - } - }, - { - "identity" : "swift-argument-parser", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-argument-parser.git", - "state" : { - "revision" : "fee6933f37fde9a5e12a1e4aeaa93fe60116ff2a", - "version" : "1.2.2" - } - }, - { - "identity" : "swift-atomics", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-atomics.git", - "state" : { - "revision" : "6c89474e62719ddcc1e9614989fff2f68208fe10", - "version" : "1.1.0" - } - }, - { - "identity" : "swift-collections", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-collections.git", - "state" : { - "revision" : "937e904258d22af6e447a0b72c0bc67583ef64a2", - "version" : "1.0.4" - } - }, - { - "identity" : "swift-crypto", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-crypto.git", - "state" : { - "revision" : "75ec60b8b4cc0f085c3ac414f3dca5625fa3588e", - "version" : "2.2.4" - } - }, - { - "identity" : "swift-driver", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-driver.git", - "state" : { - "branch" : "main", - "revision" : "0100f8da690f587beac79900bd8fab4c092c62ca" - } - }, - { - "identity" : "swift-llbuild", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-llbuild.git", - "state" : { - "branch" : "main", - "revision" : "8d49bd3c84e74bb74ab59fca77282d923f3be520" - } - }, - { - "identity" : "swift-log", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-log.git", - "state" : { - "revision" : "6fe203dc33195667ce1759bf0182975e4653ba1c", - "version" : "1.4.4" - } - }, - { - "identity" : "swift-metrics", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-metrics.git", - "state" : { - "revision" : "e8bced74bc6d747745935e469f45d03f048d6cbd", - "version" : "2.3.4" - } - }, - { - "identity" : "swift-nio", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-nio.git", - "state" : { - "revision" : "2d8e6ca36fe3e8ed74b0883f593757a45463c34d", - "version" : "2.53.0" - } - }, - { - "identity" : "swift-nio-extras", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-nio-extras.git", - "state" : { - "revision" : "0e0d0aab665ff1a0659ce75ac003081f2b1c8997", - "version" : "1.19.0" - } - }, - { - "identity" : "swift-nio-http2", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-nio-http2.git", - "state" : { - "revision" : "6d021a48483dbb273a9be43f65234bdc9185b364", - "version" : "1.26.0" - } - }, - { - "identity" : "swift-nio-ssl", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-nio-ssl.git", - "state" : { - "revision" : "e866a626e105042a6a72a870c88b4c531ba05f83", - "version" : "2.24.0" - } - }, - { - "identity" : "swift-nio-transport-services", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-nio-transport-services.git", - "state" : { - "revision" : "41f4098903878418537020075a4d8a6e20a0b182", - "version" : "1.17.0" - } - }, - { - "identity" : "swift-numerics", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-numerics", - "state" : { - "revision" : "0a5bc04095a675662cf24757cc0640aa2204253b", - "version" : "1.0.2" - } - }, - { - "identity" : "swift-package-manager", - "kind" : "remoteSourceControl", - "location" : "https://github.com/giginet/swift-package-manager.git", - "state" : { - "revision" : "11c88e87e6874a570711d18462ca0ea43ff7ff5e" - } - }, - { - "identity" : "swift-system", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-system.git", - "state" : { - "revision" : "836bc4557b74fe6d2660218d56e3ce96aff76574", - "version" : "1.1.1" - } - }, - { - "identity" : "swift-tools-support-core", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-tools-support-core.git", - "state" : { - "branch" : "main", - "revision" : "3b9d232d49082d9285018010d587765e85fbc052" - } - }, - { - "identity" : "yams", - "kind" : "remoteSourceControl", - "location" : "https://github.com/jpsim/Yams.git", - "state" : { - "revision" : "0d9ee7ea8c4ebd4a489ad7a73d5c6cad55d6fed3", - "version" : "5.0.6" - } - } - ], - "version" : 2 -} diff --git a/Package.swift b/Package.swift index bc245cdb..0517cdf5 100644 --- a/Package.swift +++ b/Package.swift @@ -20,8 +20,8 @@ let package = Package( targets: ["ScipioS3Storage"]), ], dependencies: [ - .package(url: "https://github.com/giginet/swift-package-manager.git", - revision: "11c88e87e6874a570711d18462ca0ea43ff7ff5e"), + .package(url: "https://github.com/apple/swift-package-manager.git", + revision: "swift-5.9-RELEASE"), .package(url: "https://github.com/apple/swift-log.git", .upToNextMinor(from: "1.4.2")), .package(url: "https://github.com/apple/swift-collections", diff --git a/Package@swift-5.8.swift b/Package@swift-5.8.swift new file mode 100644 index 00000000..27d55657 --- /dev/null +++ b/Package@swift-5.8.swift @@ -0,0 +1,94 @@ +// swift-tools-version: 5.6 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription +import Foundation + +let package = Package( + name: "Scipio", + platforms: [ + .macOS(.v12), + ], + products: [ + .executable(name: "scipio", + targets: ["scipio"]), + .library( + name: "ScipioKit", + targets: ["ScipioKit"]), + .library( + name: "ScipioS3Storage", + targets: ["ScipioS3Storage"]), + ], + dependencies: [ + .package(url: "https://github.com/giginet/swift-package-manager.git", + revision: "99575e7a3eb8e66112ec45e2f11ef23a1828b110"), + .package(url: "https://github.com/apple/swift-log.git", + .upToNextMinor(from: "1.4.2")), + .package(url: "https://github.com/apple/swift-collections", + from: "1.0.4"), + .package(url: "https://github.com/apple/swift-argument-parser.git", + from: "1.1.0"), + .package(url: "https://github.com/apple/swift-algorithms.git", + from: "1.0.0"), + .package(url: "https://github.com/onevcat/Rainbow", + .upToNextMinor(from: "4.0.1")), + .package(url: "https://github.com/soto-project/soto-codegenerator", + from: "0.6.0"), + .package(url: "https://github.com/soto-project/soto-core.git", + from: "6.4.0"), + ], + targets: [ + .executableTarget(name: "scipio", + dependencies: [ + .target(name: "ScipioKit"), + .product(name: "ArgumentParser", package: "swift-argument-parser"), + ]), + .target( + name: "ScipioKit", + dependencies: [ + .product(name: "SwiftPMDataModel-auto", package: "swift-package-manager"), + .product(name: "XCBuildSupport", package: "swift-package-manager"), + .product(name: "Logging", package: "swift-log"), + .product(name: "Collections", package: "swift-collections"), + .product(name: "Algorithms", package: "swift-algorithms"), + .product(name: "Rainbow", package: "Rainbow"), + ], + plugins: [ + .plugin(name: "GenerateScipioVersion") + ] + ), + .plugin( + name: "GenerateScipioVersion", + capability: .buildTool() + ), + .target( + name: "ScipioS3Storage", + dependencies: [ + .target(name: "ScipioKit"), + .product(name: "SotoCore", package: "soto-core"), + ], + plugins: [ + .plugin(name: "SotoCodeGeneratorPlugin", package: "soto-codegenerator"), + ] + ), + .testTarget( + name: "ScipioKitTests", + dependencies: [ + .target(name: "ScipioKit"), + ], + exclude: ["Resources/Fixtures/"], + resources: [.copy("Resources/Fixtures")]), + .testTarget( + name: "ScipioS3StorageTests", + dependencies: ["ScipioS3Storage"]), + ] +) + +let isDevelopment = ProcessInfo.processInfo.environment["SCIPIO_DEVELOPMENT"] == "1" + +// swift-docs is not needed for package users +if isDevelopment { + package.dependencies += [ + .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.3.0"), + ] +} diff --git a/README.md b/README.md index 2c4fe46b..3565a73b 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,13 @@ # Scipio ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/giginet/Scipio/tests.yml?style=flat-square&logo=github) +![Swift 5.9](https://img.shields.io/badge/Swift-5.9-FA7343?logo=swift&style=flat-square) ![Swift 5.8](https://img.shields.io/badge/Swift-5.8-FA7343?logo=swift&style=flat-square) +[![Xcode 15.0](https://img.shields.io/badge/Xcode-15.0-147EFB?style=flat-square&logo=xcode&link=https%3A%2F%2Fdeveloper.apple.com%2Fxcode%2F)](https://developer.apple.com/xcode/) +[![Xcode 14.3](https://img.shields.io/badge/Xcode-14.3-147EFB?style=flat-square&logo=xcode&link=https%3A%2F%2Fdeveloper.apple.com%2Fxcode%2F)](https://developer.apple.com/xcode/) [![SwiftPM](https://img.shields.io/badge/SwiftPM-compatible-green?logo=swift&style=flat-square)](https://swift.org/package-manager/) [![Documentation](https://img.shields.io/badge/Documentation-available-green?style=flat-square)](https://giginet.github.io/Scipio/documentation/scipio/) ![Platforms](https://img.shields.io/badge/Platform-iOS%7CmacOS%7CwatchOS%7CtvOS%7CvisionOS-lightgray?logo=apple&style=flat-square) -[![Xcode 14.3](https://img.shields.io/badge/Xcode-14.3-147EFB?style=flat-square&logo=xcode&link=https%3A%2F%2Fdeveloper.apple.com%2Fxcode%2F) -](https://developer.apple.com/xcode/) -[![Xcode 15.0](https://img.shields.io/badge/Xcode-15.0-147EFB?style=flat-square&logo=xcode&link=https%3A%2F%2Fdeveloper.apple.com%2Fxcode%2F) -](https://developer.apple.com/xcode/) [![License](https://img.shields.io/badge/License-MIT-darkgray?style=flat-square) ](https://github.com/giginet/Scipio/blob/main/LICENSE.md) diff --git a/Sources/ScipioKit/Producer/PIF/BuildParametersGenerator.swift b/Sources/ScipioKit/Producer/PIF/BuildParametersGenerator.swift index 4959698b..c20f9d25 100644 --- a/Sources/ScipioKit/Producer/PIF/BuildParametersGenerator.swift +++ b/Sources/ScipioKit/Producer/PIF/BuildParametersGenerator.swift @@ -36,12 +36,18 @@ struct BuildParametersGenerator { } func generate(for sdk: SDK, buildParameters: BuildParameters, destinationDir: AbsolutePath) throws -> AbsolutePath { + #if swift(>=5.9) + let targetArchitecture = buildParameters.triple.arch?.rawValue ?? "arm64" + #else + let targetArchitecture = buildParameters.triple.arch.rawValue + #endif + // Generate the run destination parameters. let runDestination = XCBBuildParameters.RunDestination( platform: sdk.settingValue, sdk: sdk.settingValue, sdkVariant: nil, - targetArchitecture: buildParameters.triple.arch.rawValue, + targetArchitecture: targetArchitecture, supportedArchitectures: [], disableOnlyActiveArch: true ) diff --git a/Sources/ScipioKit/Producer/PIF/PIFCompiler.swift b/Sources/ScipioKit/Producer/PIF/PIFCompiler.swift index f7b58109..e885b33c 100644 --- a/Sources/ScipioKit/Producer/PIF/PIFCompiler.swift +++ b/Sources/ScipioKit/Producer/PIF/PIFCompiler.swift @@ -110,6 +110,17 @@ struct PIFCompiler: Compiler { } private func makeBuildParameters(toolchain: UserToolchain) throws -> BuildParameters { + #if swift(>=5.9) + try .init( + dataPath: descriptionPackage.buildDirectory, + configuration: buildOptions.buildConfiguration.spmConfiguration, + toolchain: toolchain, + destinationTriple: toolchain.triple, + flags: .init(), + enableParseableModuleInterfaces: buildOptions.enableLibraryEvolution, + isXcodeBuildSystemEnabled: true + ) + #else .init( dataPath: descriptionPackage.buildDirectory, configuration: buildOptions.buildConfiguration.spmConfiguration, @@ -119,6 +130,7 @@ struct PIFCompiler: Compiler { enableParseableModuleInterfaces: buildOptions.enableLibraryEvolution, isXcodeBuildSystemEnabled: true ) + #endif } } diff --git a/Sources/ScipioKit/Producer/PIF/ToolchainGenerator.swift b/Sources/ScipioKit/Producer/PIF/ToolchainGenerator.swift index 9bf9b6a4..cd335836 100644 --- a/Sources/ScipioKit/Producer/PIF/ToolchainGenerator.swift +++ b/Sources/ScipioKit/Producer/PIF/ToolchainGenerator.swift @@ -2,6 +2,9 @@ import Foundation import TSCUtility import PackageModel import TSCBasic +#if swift(>=5.9) +import struct Basics.Triple +#endif struct ToolchainGenerator { private let toolchainDirPath: AbsolutePath