From bbf8bf00ec2c6595624f96797f375f3da47a0c70 Mon Sep 17 00:00:00 2001 From: alongstringofnumbers Date: Fri, 8 Nov 2024 18:23:55 -0700 Subject: [PATCH 1/4] Update some deps, try and fix spotless --- build.gradle | 10 +++++----- settings.gradle | 7 +++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 892add0..7f859bc 100644 --- a/build.gradle +++ b/build.gradle @@ -33,12 +33,12 @@ plugins { id 'base' id 'eclipse' id 'maven-publish' - id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.8' - id 'com.gtnewhorizons.retrofuturagradle' version '1.4.0' - id 'net.darkhax.curseforgegradle' version '1.1.24' apply false + id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.9' + id 'com.gtnewhorizons.retrofuturagradle' version '1.4.1' + id 'net.darkhax.curseforgegradle' version '1.1.25' apply false id 'com.modrinth.minotaur' version '2.8.7' apply false - id 'com.diffplug.spotless' version '6.13.0' apply false - id 'com.palantir.git-version' version '3.0.0' apply false + //id 'com.diffplug.spotless' version '6.13.0' apply false + id 'com.palantir.git-version' version '3.1.0' apply false id 'com.github.johnrengelman.shadow' version '8.1.1' apply false id 'org.jetbrains.kotlin.jvm' version '1.8.0' apply false id 'org.jetbrains.kotlin.kapt' version '1.8.0' apply false diff --git a/settings.gradle b/settings.gradle index 771def3..429377d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,11 @@ pluginManagement { + plugins { + if (enableModernJavaSyntax.toBoolean()) { + id 'com.diffplug.spotless' version '6.23.3' + } else { + id 'com.diffplug.spotless' version '6.13.0' + } + } repositories { maven { // RetroFuturaGradle From ce15cc59fe0341dc974051bd8ec1baf3b9b9263c Mon Sep 17 00:00:00 2001 From: alongstringofnumbers Date: Sun, 10 Nov 2024 20:46:36 -0700 Subject: [PATCH 2/4] Update more Dependencies, allow for running with newer kotlin versions --- build.gradle | 25 +++++++++++++++---------- gradle.properties | 5 +++++ settings.gradle | 12 ++++++++++++ 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 7f859bc..f916caa 100644 --- a/build.gradle +++ b/build.gradle @@ -40,9 +40,9 @@ plugins { //id 'com.diffplug.spotless' version '6.13.0' apply false id 'com.palantir.git-version' version '3.1.0' apply false id 'com.github.johnrengelman.shadow' version '8.1.1' apply false - id 'org.jetbrains.kotlin.jvm' version '1.8.0' apply false - id 'org.jetbrains.kotlin.kapt' version '1.8.0' apply false - id 'com.google.devtools.ksp' version '1.8.0-1.0.9' apply false + //id 'org.jetbrains.kotlin.jvm' version '1.8.0' apply false + //id 'org.jetbrains.kotlin.kapt' version '1.8.0' apply false + //id 'com.google.devtools.ksp' version '1.8.0-1.0.9' apply false id 'de.undercouch.download' version '5.6.0' apply false } @@ -101,6 +101,7 @@ propertyDefaultIfUnset("enableModernJavaSyntax", false) propertyDefaultIfUnset("enableSpotless", false) propertyDefaultIfUnset("enableJUnit", false) propertyDefaultIfUnsetWithEnvVar("deploymentDebug", false, "DEPLOYMENT_DEBUG") +propertyDefaultIfUnset("useNewerKotlinVersion", false) // Project property assertions @@ -518,7 +519,7 @@ configurations { testRuntimeClasspath.extendsFrom(runtimeOnlyNonPublishable) } -String mixinProviderSpec = 'zone.rong:mixinbooter:9.1' +String mixinProviderSpec = 'zone.rong:mixinbooter:10.1' dependencies { if (usesMixins.toBoolean()) { annotationProcessor 'org.ow2.asm:asm-debug-all:5.2' @@ -540,8 +541,8 @@ dependencies { } if (enableJUnit.toBoolean()) { - testImplementation 'org.hamcrest:hamcrest:2.2' - testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2' + testImplementation 'org.hamcrest:hamcrest:3.0' + testImplementation 'org.junit.jupiter:junit-jupiter:5.11.3' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } @@ -563,9 +564,13 @@ dependencies { testCompileOnly "me.eigenraven.java8unsupported:java-8-unsupported-shim:1.0.0" } - compileOnlyApi 'org.jetbrains:annotations:24.1.0' - annotationProcessor 'org.jetbrains:annotations:24.1.0' - patchedMinecraft('net.minecraft:launchwrapper:1.17.2') { + if (useNewerKotlinVersion.toBoolean()) { + implementation 'io.github.chaosunity.forgelin:Forgelin-Continuous:2.0.21.0' + } + + compileOnlyApi 'org.jetbrains:annotations:26.0.1' + annotationProcessor 'org.jetbrains:annotations:26.0.1' + patchedMinecraft('net.minecraft:launchwrapper:1.17.3') { transitive = false } @@ -575,7 +580,7 @@ dependencies { if (includeCommonDevEnvMods.toBoolean()) { if (!(modId.equals('jei'))) { - implementation 'mezz.jei:jei_1.12.2:4.16.1.302' + implementation 'mezz.jei:jei_1.12.2:4.16.1.1013' } if (!(modId.equals('theoneprobe'))) { //noinspection DependencyNotationArgument diff --git a/gradle.properties b/gradle.properties index a38bf26..57f724e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -37,6 +37,11 @@ additionalJavaArguments = # Using this requires that you use a Java 17 JDK for development. enableModernJavaSyntax = true +# Bundles newer Kotlin versions for use with your mod +# This requires newer language provider mods, such as Forgelin-Continuous +# See https://github.com/ChAoSUnItY/Forgelin-Continuous +useNewerKotlinVersion = false + # Enables runClient/runServer tasks for Java 17 and Java 21 using LWJGL3ify. # This is primarily used to test if your mod is compatible with platforms running # Minecraft 1.12.2 on modern versions of Java and LWJGL, and assist in fixing any problems with it. diff --git a/settings.gradle b/settings.gradle index 429377d..9067d47 100644 --- a/settings.gradle +++ b/settings.gradle @@ -5,6 +5,18 @@ pluginManagement { } else { id 'com.diffplug.spotless' version '6.13.0' } + + if (useNewerKotlinVersion.toBoolean()) { + // Kotlin Library is bundled into Forgelin-Continuous + //id 'org.jetbrains.kotlin.jvm' version '2.0.21' apply false + id 'org.jetbrains.kotlin.kapt' version '2.0.21' apply false + id 'com.google.devtools.ksp' version '2.0.21-1.0.27' apply false + + } else { + id 'org.jetbrains.kotlin.jvm' version '1.8.0' apply false + id 'org.jetbrains.kotlin.kapt' version '1.8.0' apply false + id 'com.google.devtools.ksp' version '1.8.0-1.0.9' apply false + } } repositories { maven { From 30788c203ad8849b8b0eb3ded36a4850dd060699 Mon Sep 17 00:00:00 2001 From: alongstringofnumbers Date: Sun, 10 Nov 2024 21:09:59 -0700 Subject: [PATCH 3/4] Minor fixes --- build.gradle | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index f916caa..6120ab8 100644 --- a/build.gradle +++ b/build.gradle @@ -252,7 +252,11 @@ if (enableSpotless.toBoolean()) { target 'src/*/kotlin/**/*.kt' toggleOffOn() - ktfmt('0.39') + if (useNewerKotlinVersion.toBoolean()) { + ktfmt('0.53') + } else { + ktfmt('0.44') + } trimTrailingWhitespace() indentWithSpaces(4) @@ -475,7 +479,7 @@ repositories { url 'https://maven.gtceu.com' } } - if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { + if (usesMixins.toBoolean() || forceEnableMixins.toBoolean() || useNewerKotlinVersion.toBoolean()) { // need to add this here even if we did not above if (!includeWellKnownRepositories.toBoolean()) { maven { From 497f486325b8664ea0dd611478038d9bd9773a63 Mon Sep 17 00:00:00 2001 From: alongstringofnumbers Date: Mon, 11 Nov 2024 16:12:23 -0700 Subject: [PATCH 4/4] Minor fixes --- build.gradle | 2 +- settings.gradle | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 6120ab8..20984b5 100644 --- a/build.gradle +++ b/build.gradle @@ -574,7 +574,7 @@ dependencies { compileOnlyApi 'org.jetbrains:annotations:26.0.1' annotationProcessor 'org.jetbrains:annotations:26.0.1' - patchedMinecraft('net.minecraft:launchwrapper:1.17.3') { + patchedMinecraft('net.minecraft:launchwrapper:1.17.4') { transitive = false } diff --git a/settings.gradle b/settings.gradle index 9067d47..c7c53fb 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,9 +1,9 @@ pluginManagement { plugins { - if (enableModernJavaSyntax.toBoolean()) { - id 'com.diffplug.spotless' version '6.23.3' + if (enableModernJavaSyntax.toBoolean() || enableJava17RunTasks.toBoolean()) { + id 'com.diffplug.spotless' version '6.23.3' apply false } else { - id 'com.diffplug.spotless' version '6.13.0' + id 'com.diffplug.spotless' version '6.13.0' apply false } if (useNewerKotlinVersion.toBoolean()) {