-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only use the new way to add semanticdb
*except in test where we compile small virtual files
- Loading branch information
Showing
15 changed files
with
91 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,7 +96,9 @@ object TestkitProperties { | |
case None => Nil | ||
} | ||
new TestkitProperties( | ||
Classpath(sprops("inputClasspath")), | ||
Classpath(sprops("semanticdbRootDirectory")) ++ Classpath( | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mlachkar
Author
Collaborator
|
||
sprops("inputClasspath") | ||
), | ||
Classpath(sprops("inputSourceDirectories")).entries, | ||
Classpath(sprops("outputSourceDirectories")).entries, | ||
sourceroot, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
scalafix-tests/unit/src/test/scala/scalafix/tests/util/SemanticdbPlugin.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package scalafix.tests.util | ||
|
||
import java.nio.file.Paths | ||
|
||
import buildinfo.RulesBuildInfo.scalaVersion | ||
import coursier.{Dependency, Fetch, Module, ModuleName, Organization} | ||
|
||
object SemanticdbPlugin { | ||
def semanticdbPluginPath(): String = { | ||
val dep = Dependency( | ||
Module( | ||
Organization("org.scalameta"), | ||
ModuleName(s"semanticdb-scalac_$scalaVersion") | ||
), | ||
"4.3.22" | ||
) | ||
val paths = Fetch() | ||
.addDependencies(dep) | ||
.run() | ||
val semanticdbscalac = paths.collectFirst { | ||
case path if path.toString.contains("semanticdb-scalac_") => | ||
Paths.get(path.toURI).toString | ||
} | ||
semanticdbscalac.getOrElse { | ||
throw new IllegalStateException( | ||
"unable to auto-detect semanticdb-scalac compiler plugin" | ||
) | ||
} | ||
} | ||
} |
this is a breaking change, see scalacenter/sbt-scalafix#173 (comment)