mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Swift packages are normally in `Sources/<target-name>`, but SwiftifyImportMacro is in `Sources/SwiftMacros`, and SwiftifyImport is in `<root>/stdlib/public/core`, which is outside the package root. This sets the correct path for SwiftifyImportMacro, and creates a directory `Sources/PublicCorePortal` with a symlink to `SwiftifyImport.swift`. It also enables LifetimeDependence for SwiftifyImport. These changes are purely to provide information to SourceKit - this file isn't actually used by CMake.
50 lines
1.4 KiB
Swift
50 lines
1.4 KiB
Swift
// swift-tools-version: 6.2
|
|
|
|
// Although this could in theory be used to build macros, it's not actually wired up to CMake.
|
|
// This is here purely to provide LSP IDE features when working on Swift macros.
|
|
|
|
import PackageDescription
|
|
import CompilerPluginSupport
|
|
|
|
let package = Package(
|
|
name: "SwiftifyImport",
|
|
platforms: [.macOS(.v11), .iOS(.v15), .tvOS(.v15), .watchOS(.v8)],
|
|
products: [
|
|
.library(
|
|
name: "SwiftifyImport",
|
|
targets: [
|
|
"SwiftifyImport"
|
|
]
|
|
),
|
|
.library(
|
|
name: "SwiftifyImportMacro",
|
|
targets: [
|
|
"SwiftifyImportMacro"
|
|
]
|
|
)
|
|
],
|
|
dependencies: [
|
|
.package(path: "../../../swift-syntax")
|
|
],
|
|
targets: [
|
|
.macro(
|
|
name: "SwiftifyImportMacro",
|
|
dependencies: [
|
|
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
|
|
.product(name: "SwiftDiagnostics", package: "swift-syntax"),
|
|
.product(name: "SwiftParser", package: "swift-syntax"),
|
|
.product(name: "SwiftSyntax", package: "swift-syntax"),
|
|
.product(name: "SwiftSyntaxBuilder", package: "swift-syntax"),
|
|
.product(name: "SwiftSyntaxMacros", package: "swift-syntax")
|
|
],
|
|
path: "Sources/SwiftMacros",
|
|
),
|
|
.target(
|
|
name: "SwiftifyImport",
|
|
dependencies: ["SwiftifyImportMacro"],
|
|
path: "Sources/PublicCorePortal",
|
|
swiftSettings: [.enableExperimentalFeature("LifetimeDependence")],
|
|
)
|
|
]
|
|
)
|