mirror of
https://github.com/FabricMC/fabric.git
synced 2024-12-02 12:28:13 -05:00
Set the java compiler --release arg when building on j9+.
Thanks to https://github.com/FabricMC/fabric-example-mod/pull/71 for this snippet.
This commit is contained in:
parent
c932210082
commit
c2f49c1532
1 changed files with 9 additions and 2 deletions
11
build.gradle
11
build.gradle
|
@ -64,8 +64,15 @@ allprojects {
|
||||||
apply plugin: "fabric-loom"
|
apply plugin: "fabric-loom"
|
||||||
apply plugin: "net.minecrell.licenser"
|
apply plugin: "net.minecrell.licenser"
|
||||||
|
|
||||||
sourceCompatibility = 1.8
|
tasks.withType(JavaCompile).configureEach {
|
||||||
targetCompatibility = 1.8
|
def targetVersion = 8
|
||||||
|
if (JavaVersion.current().isJava9Compatible()) {
|
||||||
|
it.options.release = targetVersion
|
||||||
|
} else {
|
||||||
|
sourceCompatibility = JavaVersion.toVersion(targetVersion)
|
||||||
|
targetCompatibility = JavaVersion.toVersion(targetVersion)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
group = "net.fabricmc.fabric-api"
|
group = "net.fabricmc.fabric-api"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue