Open
Description
hi, thanks your good job to create swift-syntax-xcframeworks
- I downloaded
swift-syntax-xcframeworks
framework as local - create package to write macro as following
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
import CompilerPluginSupport
let package = Package(
name: "Singleton",
platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), .macCatalyst(.v13)],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "Singleton",
targets: ["Singleton"]
),
.executable(
name: "SingletonClient",
targets: ["SingletonClient"]
),
],
dependencies: [
// Depend on the Swift 5.9 release of SwiftSyntax
// .package(url: "https://github.com/apple/swift-syntax.git", from: "509.0.0"),
// .package(name: "swift-syntax-xcframeworks", path: "./SwiftSyntaxWrapper"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
// Macro implementation that performs the source transformation of a macro.
.binaryTarget(name: "swift-syntax-xcframeworks", path: "./SwiftSyntaxWrapper"),
.macro(
name: "SingletonMacros",
dependencies: [
// .product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
// .product(name: "SwiftCompilerPlugin", package: "swift-syntax")
.product(name: "SwiftSyntaxWrapper", package: "swift-syntax-xcframeworks"),
]
),
// Library that exposes a macro as part of its API, which is used in client programs.
.target(name: "Singleton", dependencies: ["SingletonMacros"]),
// A client of the library, which is able to use the macro in its own code.
.executableTarget(name: "SingletonClient", dependencies: ["Singleton"]),
// A test target used to develop the macro implementation.
.testTarget(
name: "SingletonTests",
dependencies: [
"SingletonMacros",
// .product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"),
.product(name: "SwiftSyntaxWrapper", package: "swift-syntax-xcframeworks"),
]
),
]
)
- build package with Xcode16.0
Error:
/Users/kaijin/Documents/iOS/Swift/SwiftMacro/Singleton/Sources/SingletonMacros/SingletonMacro.swift:1:8: Module 'SwiftCompilerPlugin' was created for incompatible target arm64-apple-macos10.15: /Users/kaijin/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/SwiftCompilerPlugin-2Q99KEHNKDM9V.swiftmodule
Metadata
Metadata
Assignees
Labels
No labels