summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2023-04-13 21:51:04 -0700
committerLinux Build Service Account <lnxbuild@localhost>2023-04-13 21:51:04 -0700
commit4993a08b8d37d5075ea0101a09ed9bbde4687ab9 (patch)
tree1afd9af5b30999f16df84fce9e989cd4cc3b3b16 /java/java.go
parenta4427634397d2a145e136bedbf9f66216fc35e73 (diff)
parente63c47c1e746e17332d16c67db7ae0241effb44e (diff)
Merge e63c47c1e746e17332d16c67db7ae0241effb44e on remote branch
Change-Id: I20797bd3da4b2e010c041b3d3cad23cf9094fef8
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go
index 1e99aa32f..9830d08dd 100644
--- a/java/java.go
+++ b/java/java.go
@@ -526,6 +526,20 @@ func (v javaVersion) String() string {
}
}
+func (v javaVersion) StringForKotlinc() string {
+ // $ ./external/kotlinc/bin/kotlinc -jvm-target foo
+ // error: unknown JVM target version: foo
+ // Supported versions: 1.6, 1.8, 9, 10, 11, 12, 13, 14, 15, 16, 17
+ switch v {
+ case JAVA_VERSION_7:
+ return "1.6"
+ case JAVA_VERSION_9:
+ return "9"
+ default:
+ return v.String()
+ }
+}
+
// Returns true if javac targeting this version uses system modules instead of a bootclasspath.
func (v javaVersion) usesJavaModules() bool {
return v >= 9