Skip to content

Commit 489729b

Browse files
authored
Merge pull request #24 from olafurpg/force-lsif-java-version
Force lsif-java version
2 parents ca4ec7b + 1f6146b commit 489729b

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v2
1818
- uses: olafurpg/setup-scala@v13
19-
- run: sbt scalafmtCheckAll scalafmtSbtCheck "scalafixAll --check"
19+
- run: sbt checkAll

build.sbt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ developers := List(
2525
)
2626
)
2727

28+
commands +=
29+
Command.command("fixAll") { s =>
30+
"scalafixAll" :: "scalafmtAll" :: "scalafmtSbt" :: s
31+
}
32+
33+
commands +=
34+
Command.command("checkAll") { s =>
35+
"scalafmtCheckAll" :: "scalafmtSbtCheck" ::
36+
"scalafixAll --check" :: "publishLocal" ::
37+
s
38+
}
39+
2840
// Cross-building settings (see https://github.com/sbt/sbt/issues/3473#issuecomment-325729747)
2941
def scala212 = "2.12.13"
3042
def scala210 = "2.10.7"

src/main/scala/com/sourcegraph/sbtsourcegraph/SourcegraphPlugin.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ object SourcegraphPlugin extends AutoPlugin {
2222
taskKey[File](
2323
"Task to generate a single LSIF index for all SemanticDB files in this workspace."
2424
)
25+
val sourcegraphLsifJavaVersion: SettingKey[String] =
26+
settingKey[String]("The version of the `lsif-java` command-line tool.")
2527
val sourcegraphSemanticdbDirectories: TaskKey[List[File]] =
2628
taskKey[List[File]](
2729
"Task to compile all projects in this build and aggregate all SemanticDB directories."
@@ -69,6 +71,10 @@ object SourcegraphPlugin extends AutoPlugin {
6971
import autoImport._
7072

7173
override lazy val buildSettings: Seq[Def.Setting[_]] = List(
74+
sourcegraphLsifJavaVersion := {
75+
scala.util.Properties
76+
.propOrElse("lsif-java-version", Versions.semanticdbJavacVersion())
77+
},
7278
sourcegraphLsif := {
7379
val out = target.in(Sourcegraph).value / "dump.lsif"
7480
out.getParentFile.mkdirs()
@@ -87,7 +93,7 @@ object SourcegraphPlugin extends AutoPlugin {
8793
sourcegraphCoursierBinary.value ::
8894
"launch" ::
8995
"--contrib" ::
90-
"lsif-java" ::
96+
s"lsif-java:${sourcegraphLsifJavaVersion.value}" ::
9197
"--" ::
9298
"index-semanticdb" ::
9399
s"--output=$out" ::

src/main/scala/com/sourcegraph/sbtsourcegraph/Versions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ object Versions {
2525
props.asScala.toMap
2626
} else {
2727
Map(
28-
semanticdbJavacKey -> "0.6.2",
28+
semanticdbJavacKey -> "0.6.3",
2929
"2.12.12" -> scalametaVersion,
3030
"2.13.6" -> scalametaVersion,
3131
"2.11.12" -> scalametaVersion

0 commit comments

Comments
 (0)