Open DougGregor opened 1 month ago
The "patch" to add the fatalError
is this:
diff --git a/Plugins/Java2SwiftPlugin/Java2SwiftPlugin.swift b/Plugins/Java2SwiftPlugin/Java2SwiftPlugin.swift
index 30be39a..4e753a3 100644
--- a/Plugins/Java2SwiftPlugin/Java2SwiftPlugin.swift
+++ b/Plugins/Java2SwiftPlugin/Java2SwiftPlugin.swift
@@ -20,6 +20,7 @@ fileprivate let Java2SwiftConfigFileName = "Java2Swift.config"
@main
struct Java2SwiftBuildToolPlugin: BuildToolPlugin {
func createBuildCommands(context: PluginContext, target: Target) throws -> [Command] {
+ fatalError("Java2SwiftBuildToolPlugin is not supported.")
guard let sourceModule = target.sourceModule else { return [] }
// Note: Target doesn't have a directoryURL counterpart to directory,
@dschaefer2 i think this is a great repro for the missing rebuilds I had mentioned a couple months back
Is it reproducible with SwiftPM command-line tools:
swift build
,swift test
,swift package
etc?swift build
,swift test
,swift package
etc.Description
If I have a build tool plugin (in my case,
Java2SwiftPlugin
) and a target that uses it (JavaProbablyPrime
), once the target has built, changes to the sources ofJava2SwiftPlugin
won't cause that target to rebuild.Expected behavior
The implementation of a build tool plugin can affect the build of any targets that use that plugin. When the sources to the build tool plugin change, I'd expect those targets to rebuild.
Actual behavior
Changes to the build tool plugin sources do not cause targets using that plugin to rebuild.
Steps to reproduce
git clone https://github.com/swiftlang/swift-java
(tested at b9122bde780a7b66080a6065707977718357cac1)cd Samples/JavaProbablyPrime
swift build
(build succeeds)fatalError
at the beginning ofcreateBuildCommands
inPlugins/Java2SwiftPlugin/Java2SwiftPlugin.swift
(patch below)cd Samples/JavaProbablyPrime
if not already thereswift build
(should fail due to fatal error, but doesn't rebuild so it doesn't fail)Swift Package Manager version/commit hash
6.0
Swift & OS version (output of
swift --version ; uname -a
)