From f548aed04dadfa65407ee756509b59b8c1272846 Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Fri, 2 Aug 2024 17:29:30 +0300 Subject: [PATCH] Remove Kotlin --- .editorconfig | 5 --- build.gradle.kts | 34 +------------------ common/build.gradle.kts | 2 -- .../adorn/compat/jei/AdornJeiPlugin.java | 4 +-- fabric/build.gradle.kts | 4 --- fabric/src/main/resources/fabric.mod.json | 1 - forge/build.gradle.kts | 7 ---- gradle.properties | 6 ---- 8 files changed, 3 insertions(+), 60 deletions(-) diff --git a/.editorconfig b/.editorconfig index 8966d0739..cdd6791b3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,11 +12,6 @@ max_line_length = 160 ij_continuation_indent_size = 4 ij_java_class_count_to_use_import_on_demand = 1000 -[*.{kt,kts}] -# 2147483647 = some max int (infinity) -ij_kotlin_name_count_to_use_star_import = 2147483647 -ij_kotlin_name_count_to_use_star_import_for_members = 2147483647 - [*.{json,mcmeta,json5}] indent_size = 2 ij_json_keep_blank_lines_in_code = 1 diff --git a/build.gradle.kts b/build.gradle.kts index 560a63c94..d9f2c0d1b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,24 +1,19 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import net.fabricmc.loom.api.LoomGradleExtensionAPI import net.fabricmc.loom.task.RemapJarTask -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -import org.jmailen.gradle.kotlinter.KotlinterExtension plugins { // Apply the base plugin which mostly defines useful "build lifecycle" tasks like - // assemble, check and build. The root project doesn't contain any Java or Kotlin code, + // assemble, check and build. The root project doesn't contain any code, // so we won't apply those plugins here. Only the assemble task is used in the root project. // See https://docs.gradle.org/current/userguide/base_plugin.html. base // Set up specific versions of the plugins we're using. // Note that of all these plugins, only the Architectury plugin needs to be applied. - kotlin("jvm") version "1.9.21" apply false - id("architectury-plugin") version "3.4.+" id("dev.architectury.loom") version "1.4.+" apply false - id("org.jmailen.kotlinter") version "3.12.0" apply false id("com.github.johnrengelman.shadow") version "8.1.1" apply false } @@ -62,10 +57,8 @@ tasks { // Do the shared set up for the Minecraft subprojects. subprojects { - apply(plugin = "org.jetbrains.kotlin.jvm") apply(plugin = "dev.architectury.loom") apply(plugin = "architectury-plugin") - apply(plugin = "org.jmailen.kotlinter") // Set Java version. extensions.configure { @@ -151,37 +144,12 @@ subprojects { }) } - extensions.configure { - disabledRules = arrayOf( - // Disable these since we often do grouping on the parameters and args: - // x: Int, y: Int, z: Int - // width: Int, height: Int, depth: Int - "parameter-list-wrapping", - "argument-list-wrapping", - // Used for minimising diffs on listOf - "trailing-comma-on-call-site", - ) - } - tasks { withType { options.encoding = "UTF-8" options.release.set(21) } - withType { - // Set the Kotlin JVM target to match the Java version - // for all Kotlin compilation tasks. - kotlinOptions.jvmTarget = "21" - - kotlinOptions.freeCompilerArgs = listOf( - // Compile lambdas to invokedynamic. - "-Xlambdas=indy", - // Compile interface functions with bodies to default methods. - "-Xjvm-default=all", - ) - } - // Include the license in the jar files. // See the dependencies section above for why this is in quotes. "jar"(Jar::class) { diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 5fb7402e9..e32dae22e 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -16,8 +16,6 @@ loom { } dependencies { - // Add dependencies on the required Kotlin modules. - implementation(kotlin("stdlib-jdk8")) implementation("blue.endless:jankson:${rootProject.property("jankson")}") // Just for @Environment and mixin deps :) diff --git a/common/src/main/java/juuxel/adorn/compat/jei/AdornJeiPlugin.java b/common/src/main/java/juuxel/adorn/compat/jei/AdornJeiPlugin.java index 8a392d926..0d46e416a 100644 --- a/common/src/main/java/juuxel/adorn/compat/jei/AdornJeiPlugin.java +++ b/common/src/main/java/juuxel/adorn/compat/jei/AdornJeiPlugin.java @@ -1,10 +1,10 @@ package juuxel.adorn.compat.jei; +import com.google.common.collect.Lists; import juuxel.adorn.AdornCommon; import juuxel.adorn.block.AdornBlocks; import juuxel.adorn.client.gui.screen.TradingStationScreen; import juuxel.adorn.recipe.AdornRecipes; -import kotlin.collections.CollectionsKt; import me.shedaniel.rei.plugincompatibilities.api.REIPluginCompatIgnore; import mezz.jei.api.IModPlugin; import mezz.jei.api.JeiPlugin; @@ -43,7 +43,7 @@ public void registerRecipes(IRecipeRegistration registration) { private > void registerRecipes( IRecipeRegistration registration, RecipeType type, mezz.jei.api.recipe.RecipeType jeiType) { RecipeManager manager = MinecraftClient.getInstance().world.getRecipeManager(); - registration.addRecipes(jeiType, CollectionsKt.map(manager.listAllOfType(type), RecipeEntry::value)); + registration.addRecipes(jeiType, Lists.transform(manager.listAllOfType(type), RecipeEntry::value)); } @Override diff --git a/fabric/build.gradle.kts b/fabric/build.gradle.kts index ae7b1e8e7..8a26bb925 100644 --- a/fabric/build.gradle.kts +++ b/fabric/build.gradle.kts @@ -68,10 +68,6 @@ dependencies { // Standard Fabric mod setup. modImplementation("net.fabricmc:fabric-loader:${rootProject.property("fabric-loader")}") modImplementation("net.fabricmc.fabric-api:fabric-api:${rootProject.property("fabric-api")}") - modApi("net.fabricmc:fabric-language-kotlin:${rootProject.property("fabric-kotlin")}") { - // TODO: Check if this has been updated - exclude(group = "net.fabricmc", module = "fabric-loader") - } // Bundle Jankson in the mod and use it as a regular "implementation" library. bundle(implementation("blue.endless:jankson:${rootProject.property("jankson")}")!!) diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 7179cf3ff..1d558b20d 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -44,7 +44,6 @@ "depends": { "minecraft": "~1.20.4", "fabricloader": ">=0.15.2", - "fabric-language-kotlin": "^1.10.16", "fabric-api": ">=0.91.2" }, "conflicts": { diff --git a/forge/build.gradle.kts b/forge/build.gradle.kts index 24036040a..053dccf01 100644 --- a/forge/build.gradle.kts +++ b/forge/build.gradle.kts @@ -29,12 +29,6 @@ dependencies { // Add dependency on NeoForge. This is mainly used for generating the patched Minecraft jar with NeoForge classes. neoForge("net.neoforged:neoforge:${rootProject.property("neoforge-version")}") - // Add Kotlin. - implementation(kotlin("stdlib")) - forgeRuntimeLibrary(kotlin("stdlib", version = kotlin.coreLibrariesVersion)) - (bundle(kotlin("stdlib")) as ModuleDependency) - .exclude(group = "org.jetbrains", module = "annotations") - // Depend on the common project. The "namedElements" configuration contains the non-remapped // classes and resources of the project. // It follows Gradle's own convention of xyzElements for "outgoing" configurations like apiElements. @@ -66,7 +60,6 @@ dependencies { tasks { shadowJar { - relocate("kotlin", "juuxel.adorn.relocated.kotlin") relocate("blue.endless.jankson", "juuxel.adorn.relocated.jankson") } diff --git a/gradle.properties b/gradle.properties index 10bbb0de6..1737a6266 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,11 +2,6 @@ org.gradle.jvmargs=-Xmx3G -XX:+UseG1GC # Enable parallel task execution, this makes a multiproject # a bit faster. org.gradle.parallel=true -kotlin.code.style = official -# Disable the default dependency on the Kotlin stdlib. -# This is needed for Fabric mods since we want the Kotlin version -# from Fabric Language Kotlin. -kotlin.stdlib.default.dependency = false # Adorn mod-version = 5.3.0 @@ -19,7 +14,6 @@ menu-mappings = 1.19.3+1 # Fabric fabric-loader = 0.15.2 fabric-api = 0.91.2+1.20.4 -fabric-kotlin = 1.10.16+kotlin.1.9.21 # NeoForge neoforge-version = 20.4.200