Hey there, I am trying to enable BodyMacros experimental feature but BodyMacros still cannot be found.
I am on the swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-20-a and the corresponding branch for SwiftSyntax library
Here is my package:
let package = Package(
name: "Swift 6.0 Macros",
platforms: [.macOS(.v14), .iOS(.v17)],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "Swift 6.0 Macros",
targets: ["Swift 6.0 Macros"]
),
.executable(
name: "Swift 6.0 MacrosClient",
targets: [
"Swift 6.0 MacrosClient"
]
),
],
dependencies: [
.package(url: "https://github.com/apple/swift-syntax", revision: "d3a39e42038b59e65186cadcd22467943e0bab8e"),
],
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.
.macro(
name: "Swift 6.0 MacrosMacros",
dependencies: [
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
.product(name: "SwiftCompilerPlugin", package: "swift-syntax")
],
swiftSettings: [
.enableExperimentalFeature("BodyMacros")
]
),
// Library that exposes a macro as part of its API, which is used in client programs.
.target(
name: "Swift 6.0 Macros",
dependencies: [
"Swift 6.0 MacrosMacros",
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
],
swiftSettings: [
.enableExperimentalFeature("BodyMacros")
]
),
// A client of the library, which is able to use the macro in its own code.
.executableTarget(
name: "Swift 6.0 MacrosClient",
dependencies: ["Swift 6.0 Macros"],
swiftSettings: [
.enableExperimentalFeature("BodyMacros"),
]
),
// A test target used to develop the macro implementation.
.testTarget(
name: "Swift 6.0 MacrosTests",
dependencies: [
"Swift 6.0 MacrosMacros",
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"),
]
),
]
)
But the BodyMacro still cannot be found in scope but I can see it in swift-syntax in Xcode.
Any suggestions greatly appreciated