File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
src/main/scala-3/scalafix/internal/sbt Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ pluginCrossBuild / sbtVersion := {
5454 case " 2.12" =>
5555 " 1.4.0"
5656 case _ =>
57+ // remove SemanticdbCachingWorkaroundPlugin when bumping
5758 " 2.0.0-M4" // bin/test-release.sh
5859 }
5960}
Original file line number Diff line number Diff line change 1+ import sbt .*
2+ import sbt .Keys .*
3+ import sbt .plugins .JvmPlugin
4+ import sbt .util .CacheImplicits .given
5+
6+ // https://github.com/sbt/sbt/pull/8086
7+ object SemanticdbCachingWorkaroundPlugin extends AutoPlugin {
8+
9+ override def trigger : PluginTrigger = allRequirements
10+ override def requires : Plugins = JvmPlugin
11+
12+ override lazy val projectSettings : Seq [Def .Setting [? ]] =
13+ Seq (Compile , Test ).flatMap(c =>
14+ inConfig(c)(
15+ compileIncremental := Def .taskIf {
16+ if (semanticdbIncludeInJar.value || ! semanticdbEnabled.value)
17+ compileIncremental.value
18+ else compileIncAndCacheSemanticdbTargetRootTask.value
19+ }.value
20+ )
21+ )
22+
23+ private val compileIncAndCacheSemanticdbTargetRootTask = Def .cachedTask {
24+ val prev = compileIncremental.value
25+ val converter = fileConverter.value
26+ val targetRoot = semanticdbTargetRoot.value
27+
28+ val vfTargetRoot = converter.toVirtualFile(targetRoot.toPath)
29+ Def .declareOutputDirectory(vfTargetRoot)
30+ prev
31+ }
32+ }
You can’t perform that action at this time.
0 commit comments