File tree Expand file tree Collapse file tree 3 files changed +20
-7
lines changed
src/main/scala/com/sourcegraph/sbtsourcegraph Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 7
7
jobs :
8
8
lsif :
9
9
runs-on : ubuntu-latest
10
- name : " Upload LSIF "
10
+ name : " Upload SCIP "
11
11
steps :
12
12
- uses : actions/checkout@v2
13
13
- uses : actions/setup-java@v3
14
14
with :
15
15
distribution : " temurin"
16
16
cache : " sbt"
17
17
java-version : 17
18
- - run : |
19
- curl -fL "https://github. com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz" | gzip -d > cs && chmod +x cs
20
- ./cs launch com.sourcegraph:scip-java_2.13:latest.stable -M com.sourcegraph.scip_java.ScipJava -- index
18
+ - run : sbt dumpVersion publishLocal
19
+ - run : echo "addSbtPlugin(\" com.sourcegraph\" % \"sbt-sourcegraph\" % \"$(cat VERSION)\")" > project/sourcegraph_generated.sbt
20
+ - run : sbt sourcegraphEnable sourcegraphScip
21
21
- run : yarn global add @sourcegraph/src
22
22
- run : |
23
+ mv target/sbt-sourcegraph/index.scip index.scip
23
24
src code-intel upload "-commit=${GITHUB_SHA}" "-github-token=${GITHUB_TOKEN}"
24
25
env:
25
26
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -84,3 +84,15 @@ scriptedLaunchOpts ++= Seq(
84
84
s " -Dscip-java.version= ${Versions .semanticdbJavacVersion()}" ,
85
85
s " -Dplugin.version= ${version.value}"
86
86
)
87
+
88
+ lazy val dumpVersion = taskKey[Unit ](
89
+ " Dump the version of sbt-sourcegraph to a VERSION file"
90
+ )
91
+ dumpVersion := {
92
+ val versionValue = version.value
93
+
94
+ val path = (ThisBuild / baseDirectory).value / " VERSION"
95
+ IO .write(path, versionValue)
96
+
97
+ sLog.value.info(s " Dumping version [ $versionValue] to path [ $path] " )
98
+ }
Original file line number Diff line number Diff line change @@ -142,13 +142,13 @@ object Versions {
142
142
segments match {
143
143
// Java 1.6 - 1.8
144
144
case " 1" :: lessThan8 :: _ :: Nil => lessThan8.toInt
145
- // Java 17.0.1, ..
146
- case modern :: _ :: _ :: Nil => modern.toInt
145
+ // Java 17.0.1, 11.0.20.1, ..
146
+ case modern :: _ :: _ :: rest => modern.toInt
147
147
// Java 12
148
148
case modern :: Nil => modern.toInt
149
149
case other =>
150
150
sys.error(
151
- s " Cannot process java.home property, unknown format: [ $raw] "
151
+ s " Cannot process [ java.version] property, unknown format: [ $raw] "
152
152
)
153
153
}
154
154
}
You can’t perform that action at this time.
0 commit comments