From 98c6f642cfe85300b35def66144ef587e03b9f82 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Tue, 18 Jun 2024 11:47:01 -0700 Subject: [PATCH] Explicitly declare toolchains/make compile work consistently Signed-off-by: WillFP --- build.gradle.kts | 33 +++++++++------------- eco-core/core-nms/v1_20_6/build.gradle.kts | 6 ++-- eco-core/core-nms/v1_21/build.gradle.kts | 6 ++-- settings.gradle.kts | 4 +++ 4 files changed, 22 insertions(+), 27 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 98dbd0079..42e042030 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -45,9 +45,10 @@ allprojects { repositories { mavenCentral() - mavenLocal() maven("https://repo.auxilor.io/repository/maven-public/") - maven("https://jitpack.io") + maven("https://jitpack.io") { + content { includeGroupByRegex("com\\.github\\..*") } + } // SuperiorSkyblock2 maven("https://repo.bg-software.com/repository/api/") @@ -159,16 +160,6 @@ allprojects { options.encoding = "UTF-8" } - java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - withSourcesJar() - - toolchain { - languageVersion = JavaLanguageVersion.of(17) - } - } - test { useJUnitPlatform() @@ -181,6 +172,17 @@ allprojects { build { dependsOn(shadowJar) } + + withType().configureEach { + options.release = 17 + } + } + + java { + withSourcesJar() + toolchain { + languageVersion = JavaLanguageVersion.of(21) + } } } @@ -220,12 +222,5 @@ tasks { } } -// Root is Java 21 to support 1.20.6+, rest use Java 17 -java { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 - withSourcesJar() -} - group = "com.willfp" version = findProperty("version")!! \ No newline at end of file diff --git a/eco-core/core-nms/v1_20_6/build.gradle.kts b/eco-core/core-nms/v1_20_6/build.gradle.kts index 5f11cfbff..f9e88edb4 100644 --- a/eco-core/core-nms/v1_20_6/build.gradle.kts +++ b/eco-core/core-nms/v1_20_6/build.gradle.kts @@ -37,10 +37,8 @@ tasks { ) } - java { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 - withSourcesJar() + compileJava { + options.release = 21 } compileKotlin { diff --git a/eco-core/core-nms/v1_21/build.gradle.kts b/eco-core/core-nms/v1_21/build.gradle.kts index 959609f38..c40ee8106 100644 --- a/eco-core/core-nms/v1_21/build.gradle.kts +++ b/eco-core/core-nms/v1_21/build.gradle.kts @@ -37,10 +37,8 @@ tasks { ) } - java { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 - withSourcesJar() + compileJava { + options.release = 21 } compileKotlin { diff --git a/settings.gradle.kts b/settings.gradle.kts index 0e7da322f..014b29a5f 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -5,6 +5,10 @@ pluginManagement { } } +plugins { + id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" +} + rootProject.name = "eco" // Core