From abe53a417fa5bacc7ea5b4c36d630c1a967267c3 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Fri, 10 Feb 2023 19:00:47 +0700 Subject: [PATCH] Enable koremods, bump Kotlin to 1.8.0 --- build.gradle.kts | 28 +++++++++++++++------------- gradle.properties | 5 ++++- settings.gradle.kts | 24 ++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 14 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 4a1022857..c759d0761 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -21,6 +21,8 @@ plugins { id("net.minecraftforge.gradle") id("org.spongepowered.mixin") id("org.parchmentmc.librarian.forgegradle") + id("wtf.gofancy.fancygradle") + id("wtf.gofancy.koremods.gradle") } configurations { @@ -148,6 +150,7 @@ dependencies { val kotlin_coroutines_version: String by project val kotlin_serialization_version: String by project val mixin_version: String by project + val koremods_modlauncher_version: String by project minecraft("net.minecraftforge:forge:$mc_version-$forge_version") testImplementation("org.junit.jupiter:junit-jupiter:${jupiter_version}") @@ -161,28 +164,16 @@ dependencies { (this as ExternalModuleDependency).exclude(group = "org.jetbrains", module = "annotations") } as Closure - // Add everything to the classpath correctly klibrary(create("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version", excludeKGroup)) klibrary(create("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version", excludeKGroup)) klibrary(create("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version", excludeKGroup)) klibrary(create("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$kotlin_coroutines_version", excludeKGroup)) klibrary(create("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialization_version", excludeKGroup)) - // Real mod deobf dependency examples - these get remapped to your current mappings - // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency - // runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency - // implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency - - // Examples using mod jars from ./libs + koremods(group = "wtf.gofancy.koremods", name = "koremods-modlauncher", version = koremods_modlauncher_version) compileOnly("yalter.mousetweaks:MouseTweaks:2.23:api") - annotationProcessor("org.spongepowered:mixin:${mixin_version}:processor") - // compile against the JEI API but do not include it at runtime - //compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") - // at runtime, use the full JEI jar - //runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") - if (handleDeps) { val jei_version: String by project val mekanism_version: String by project @@ -331,6 +322,17 @@ repositories { } } + maven(url = "https://maven.gofancy.wtf/releases") { + name = "Garden of Fancy" + + content { + includeGroup("wtf.gofancy.koremods") + includeGroup("wtf.gofancy.fancygradle") + includeGroup("wtf.gofancy.koremods.gradle") + includeGroup("codes.som") + } + } + maven { name = "Kotlin for Forge" url = uri("https://thedarkcolour.github.io/KotlinForForge/") diff --git a/gradle.properties b/gradle.properties index f8b7672a6..f237a0a31 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,6 +10,9 @@ mod_version=1.1 use_commit_hash_in_version=true +koremods_modlauncher_version=0.5.7 +koremods_script_version=0.5.0 + mc_version=1.19.3 parchment_version=2022.12.18-1.19.3 jei_mc_version=1.19.3 @@ -31,7 +34,7 @@ worldedit_fileid=3922622 more_overlays_version=1.21.3-mc1.19 kotlin_for_forge_version=3.1.0 -kotlin_version=1.6.10 +kotlin_version=1.8.0 kotlin_coroutines_version=1.6.0 kotlin_serialization_version=1.3.2 diff --git a/settings.gradle.kts b/settings.gradle.kts index d51bd0be5..022ac9e13 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -5,6 +5,8 @@ buildscript { repositories { // These repositories are only for Gradle plugins, put any other repositories in the repository block further below maven(url = "https://maven.minecraftforge.net") { + name = "Minecraft Forge" + content { includeGroup("net.minecraftforge.gradle") includeGroup("net.minecraftforge") @@ -12,18 +14,33 @@ buildscript { } maven(url = "https://repo.spongepowered.org/repository/maven-public/") { + name = "Spongepowered" + content { includeGroup("org.spongepowered") } } maven(url = "https://maven.parchmentmc.org") { + name = "Parchment mappings" + content { includeGroup("org.parchmentmc") includeGroup("org.parchmentmc.feather") } } + maven(url = "https://maven.gofancy.wtf/releases") { + name = "Garden of Fancy" + + content { + includeGroup("wtf.gofancy.koremods") + includeGroup("wtf.gofancy.fancygradle") + includeGroup("wtf.gofancy.koremods.gradle") + includeGroup("codes.som") + } + } + mavenCentral() } @@ -31,11 +48,18 @@ buildscript { val kotlin_version: String by settings val forge_gradle_version: String by settings val mixingradle_version: String by settings + val koremods_modlauncher_version: String by settings + val koremods_script_version: String by settings classpath(group = "net.minecraftforge.gradle", name = "ForgeGradle", version = forge_gradle_version) classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}") classpath("org.spongepowered:mixingradle:${mixingradle_version}") classpath(group = "org.parchmentmc", name = "librarian", version = "1.+") + + classpath(group = "wtf.gofancy.koremods", name = "koremods-gradle", version = "0.1.23") + classpath(group = "wtf.gofancy.fancygradle", name = "wtf.gofancy.fancygradle.gradle.plugin", version = "1.1.2-3") + classpath(group = "wtf.gofancy.koremods", name = "koremods-modlauncher", version = koremods_modlauncher_version) + classpath(group = "wtf.gofancy.koremods", name = "koremods-script", version = koremods_script_version) } }