-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
179 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
5.1.1 | ||
5.2.0 |
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
scip-java/src/main/scala/com/sourcegraph/scip_java/buildtools/SystemJavaVersion.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 com.sourcegraph.scip_java.buildtools | ||
|
||
import java.nio.file.Files | ||
|
||
import com.sourcegraph.scip_java.Embedded | ||
|
||
object SystemJavaVersion { | ||
// Returns the output of `System.getProperty("java.version")` from a fresh JVM | ||
// instance using the system JVM installation. We can't use this process since | ||
// it may be running on a separate JVM process (that's the case when we run | ||
// `sbt test` in this build at least). | ||
def detect(): String = { | ||
val tmp = Files.createTempDirectory("java-version") | ||
val jar = Embedded.semanticdbJar(tmp) | ||
try { | ||
os.proc( | ||
"java", | ||
"-cp", | ||
jar.toString(), | ||
"com.sourcegraph.semanticdb_javac.PrintJavaVersion" | ||
) | ||
.call() | ||
.out | ||
.text() | ||
.trim() | ||
} finally { | ||
Files.deleteIfExists(jar) | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
semanticdb-javac/src/main/java/com/sourcegraph/semanticdb_javac/PrintJavaVersion.java
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,7 @@ | ||
package com.sourcegraph.semanticdb_javac; | ||
|
||
public class PrintJavaVersion { | ||
public static void main(String[] args) { | ||
System.out.print(System.getProperty("java.version")); | ||
} | ||
} |
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