Would it theoretically be possible to support both the bundled with toolchain and custom version
I was thinking something along the lines of this:
Currently it adds this in my Package.swift
import CompilerPluginSupport
Would it be possible for this to provide a extension like this.
extension PackageDescription.Package.Dependency {
static func toolchainSwiftSyntax() -> Self {
// maybe this could just be a dependency with a local path under the hood
}
// maybe even allow stating a minimum swift version
static func toolchainSwiftSyntax(minVersion: SwiftVersion) -> Self { ... }
}
Which would allow me to add a dependency version of SwiftSyntax bundled with the toolchain.
This wouldn't prevent me from manually specifying a different swift version (like right now)
Maybe those dependencies provide modules/products with a different name to avoid conflicts with user specified ones.
something like BundledSwiftSyntax, BundledSwiftSyntaxMacros, ...
That way i could choose to accept the tradeoff coming with tying it to the tools versions.
I for one think the added build-time from having to compile swift-syntax is quite significant.