E6: remove build-tool plugin (architecturally incompatible with the monorepo-only CLI); rewrite the command plugin as a thin pass-through to swift-gtk-gen. E7: add swift-format as a dependency, format generated output in-process before writeIfChanged, re-enable swift format lint --strict in compile-gate.sh. CamelCase renderer identifiers (enum/bitfield cases, signal trampoline names, _sgtk_* helpers, __result/__ptr temporaries, hardcoded G_TYPE_* GValue constants) and drop generated block comments to reach zero lint findings across all 6 tiers.
67 lines
2.2 KiB
Swift
67 lines
2.2 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: "gir-generator",
|
|
platforms: [.macOS(.v14)],
|
|
products: [
|
|
.executable(name: "swift-gtk-gen", targets: ["swift-gtk-gen"]),
|
|
.plugin(name: "SwiftGtkGenCommandPlugin", targets: ["SwiftGtkGenCommandPlugin"]),
|
|
],
|
|
dependencies: [
|
|
.package(url: "https://github.com/swiftlang/swift-format.git", branch: "release/6.3")
|
|
],
|
|
targets: [
|
|
.target(
|
|
name: "SwiftGtkGenCore",
|
|
dependencies: [],
|
|
swiftSettings: concurrencySettings
|
|
),
|
|
.executableTarget(
|
|
name: "swift-gtk-gen",
|
|
dependencies: [
|
|
"SwiftGtkGenCore",
|
|
.product(name: "SwiftFormat", package: "swift-format"),
|
|
],
|
|
swiftSettings: concurrencySettings
|
|
),
|
|
.plugin(
|
|
name: "SwiftGtkGenCommandPlugin",
|
|
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: ["swift-gtk-gen"],
|
|
path: "Sources/SwiftGtkGenCommandPlugin"
|
|
),
|
|
.testTarget(
|
|
name: "SwiftGtkGenCoreTests",
|
|
dependencies: ["SwiftGtkGenCore"],
|
|
swiftSettings: concurrencySettings
|
|
),
|
|
.testTarget(
|
|
name: "SwiftGtkGenCLITests",
|
|
dependencies: ["SwiftGtkGenCore"],
|
|
swiftSettings: concurrencySettings
|
|
),
|
|
.testTarget(
|
|
name: "IntegrationTests",
|
|
dependencies: ["SwiftGtkGenCore"],
|
|
swiftSettings: concurrencySettings
|
|
),
|
|
]
|
|
)
|