-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide an improved DelegatingReporter #1215
Conversation
import scala.collection.JavaConverters._ | ||
import xsbti.Action | ||
|
||
object ReporterTest extends BridgeProviderSpec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a test demonstrating the use of new code action in Scala 2.13.12-bin-286f8d7
176c416
to
9c14244
Compare
**Problem** We need to surface the code action from Scala 2.13.x. **Solution** This adds an alternative DelegatingReporter implementation as a resource. The ZincComponentManager can then substitute the source for 2.13.12 onwards.
val xs = (Compile / sources).value | ||
(xs.filterNot { x => x.getName() == "DelegatingReporter.scala" }) ++ | ||
Seq( | ||
(compilerBridge213 / Compile / scalaSource).value.getParentFile() / "resources" / "scala-2.13.12" / "DelegatingReporter.scala" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason to put this file in resources
, vs the more common approach to have a directory in src
? There are already version folders in internal/compiler-bridge/src/main.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently compiler bridge serves all of 2.13.x series using https://repo1.maven.org/maven2/org/scala-sbt/compiler-bridge_2.13/1.9.2/, so the src/main
would be have the default implementation that works with 2.13.11, and I was gonna implement the source swapping in ZincComponentCompiler - https://github.com/sbt/sbt/blob/1.9.x/zinc-lm-integration/src/main/scala/sbt/internal/inc/ZincComponentCompiler.scala
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so the compilerBridge213_next
project here is just for testing, not for releasing a different artifact.
Problem
We need to surface the code action from Scala 2.13.x.
Solution
This adds an alternative DelegatingReporter implementation as a resource. The ZincComponentManager can then substitute the source for 2.13.12 onwards.