67 lines
2.3 KiB
Swift
67 lines
2.3 KiB
Swift
// swift-tools-version: 6.2
|
|
import PackageDescription
|
|
|
|
let concurrencySettings: [SwiftSetting] = [
|
|
.enableExperimentalFeature("StrictConcurrency=complete"),
|
|
.defaultIsolation(MainActor.self),
|
|
.enableUpcomingFeature("NonisolatedNonsendingByDefault"),
|
|
]
|
|
|
|
let pluginSettings: [SwiftSetting] = [
|
|
.enableExperimentalFeature("StrictConcurrency=complete"),
|
|
.enableUpcomingFeature("NonisolatedNonsendingByDefault"),
|
|
]
|
|
|
|
let package = Package(
|
|
name: "gobject-generator",
|
|
platforms: [.macOS(.v14)],
|
|
products: [
|
|
.executable(name: "generator", targets: ["generator"]),
|
|
.plugin(name: "GObjectGeneratorCommandPlugin", targets: ["GObjectGeneratorCommandPlugin"]),
|
|
],
|
|
dependencies: [
|
|
.package(url: "https://github.com/swiftlang/swift-format.git", branch: "release/6.3")
|
|
],
|
|
targets: [
|
|
.target(
|
|
name: "GObjectGeneratorCore",
|
|
dependencies: [],
|
|
swiftSettings: concurrencySettings
|
|
),
|
|
.executableTarget(
|
|
name: "generator",
|
|
dependencies: [
|
|
"GObjectGeneratorCore",
|
|
.product(name: "SwiftFormat", package: "swift-format"),
|
|
],
|
|
swiftSettings: concurrencySettings
|
|
),
|
|
.plugin(
|
|
name: "GObjectGeneratorCommandPlugin",
|
|
capability: .command(
|
|
intent: .custom(
|
|
verb: "generate-gir-bindings",
|
|
description: "Generate Swift bindings from .gir files."
|
|
),
|
|
permissions: [.writeToPackageDirectory(reason: "Write generated Swift files to source directory.")]
|
|
),
|
|
dependencies: ["generator"],
|
|
path: "Sources/GObjectGeneratorCommandPlugin"
|
|
),
|
|
.testTarget(
|
|
name: "GObjectGeneratorCoreTests",
|
|
dependencies: ["GObjectGeneratorCore"],
|
|
swiftSettings: concurrencySettings
|
|
),
|
|
.testTarget(
|
|
name: "GObjectGeneratorCLITests",
|
|
dependencies: ["GObjectGeneratorCore"],
|
|
swiftSettings: concurrencySettings
|
|
),
|
|
.testTarget(
|
|
name: "IntegrationTests",
|
|
dependencies: ["GObjectGeneratorCore"],
|
|
swiftSettings: concurrencySettings
|
|
),
|
|
]
|
|
)
|