Skip to content

Commit 52e8fed

Browse files
committed
Scala: use release flag. Clean up compiler options.
1 parent 269d02e commit 52e8fed

File tree

3 files changed

+15
-21
lines changed

3 files changed

+15
-21
lines changed

xpath-to-xml-scala/build-2.12.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,12 @@ tasks.withType(ScalaCompile) {
8989
'-Yno-adapted-args', // Do not adapt an argument list (either by inserting () or creating a tuple) to match the receiver.
9090
'-Xsource:3', // Turn on future language features.
9191
'-target:jvm-1.8',
92+
'-opt:l:method',
93+
'-opt:l:inline',
94+
'-opt-inline-from:com.github.simy4.xpath.scala.navigator.**,com.github.simy4.xpath.scala.syntax.**',
9295
]
93-
if (!JavaVersion.current().isJava12Compatible()) {
94-
additionalParameters += [
95-
'-opt:l:method',
96-
'-opt:l:inline',
97-
'-opt-inline-from:com.github.simy4.xpath.scala.navigator.**,com.github.simy4.xpath.scala.syntax.**',
98-
]
96+
if (JavaVersion.current().isJava9Compatible()) {
97+
additionalParameters << '-release' << '8'
9998
}
10099
}
101100
}

xpath-to-xml-scala/build-2.13.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,12 @@ tasks.withType(ScalaCompile) {
8787
'-Wnumeric-widen', // Warn when numerics are widened.
8888
'-Xsource:3', // Turn on future language features.
8989
'-target:jvm-1.8',
90+
'-opt:l:method',
91+
'-opt:l:inline',
92+
'-opt-inline-from:com.github.simy4.xpath.scala.navigator.**,com.github.simy4.xpath.scala.syntax.**',
9093
]
91-
if (!JavaVersion.current().isJava12Compatible()) {
92-
additionalParameters += [
93-
'-opt:l:method',
94-
'-opt:l:inline',
95-
'-opt-inline-from:com.github.simy4.xpath.scala.navigator.**,com.github.simy4.xpath.scala.syntax.**',
96-
]
94+
if (!JavaVersion.current().isJava9Compatible()) {
95+
additionalParameters << '-release' << '8'
9796
}
9897
}
9998
}

xpath-to-xml-scala/build-3.gradle

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ javadocJar {
3030
from scaladoc
3131
}
3232

33-
scaladoc {
34-
scalaDocOptions.with {
35-
additionalParameters = [
36-
'-language:macros,implicitConversions'
37-
]
38-
}
39-
}
40-
4133
tasks.withType(ScalaCompile) {
4234
scalaCompileOptions.with {
4335
deprecation = true
@@ -50,7 +42,11 @@ tasks.withType(ScalaCompile) {
5042
'-language:macros,implicitConversions',
5143
'-Xfatal-warnings', // Fail the compilation if there are any warnings.
5244
'-source:3.1', // Turn on future language features.
53-
'-Xtarget:8',
5445
]
46+
if (JavaVersion.current().isJava9Compatible()) {
47+
additionalParameters << '-release' << '8'
48+
} else {
49+
additionalParameters << '-Xtarget:8'
50+
}
5551
}
5652
}

0 commit comments

Comments
 (0)