From 97bbc5a3d91ed57e55796777bbfc117ff28e2221 Mon Sep 17 00:00:00 2001 From: isXander Date: Sun, 14 Apr 2024 23:19:21 +0100 Subject: Add Kotlin DSL --- build.gradle.kts | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'build.gradle.kts') diff --git a/build.gradle.kts b/build.gradle.kts index 98ce2a7..f6e65e5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,6 @@ plugins { `java-library` + kotlin("jvm") version "1.9.22" id("dev.architectury.loom") version "1.6.+" @@ -29,10 +30,6 @@ base { archivesName.set(property("modName").toString()) } -java.toolchain { - //languageVersion.set(JavaLanguageVersion.of(17)) -} - stonecutter.expression { when (it) { "controlify" -> isPropDefined("deps.controlify") @@ -85,11 +82,15 @@ repositories { maven("https://maven.isxander.dev/snapshots") maven("https://maven.quiltmc.org/repository/release") maven("https://oss.sonatype.org/content/repositories/snapshots/") - maven("https://api.modrinth.com/maven") { - content { - includeGroup("maven.modrinth") - } + exclusiveContent { + forRepository { maven("https://api.modrinth.com/maven") } + filter { includeGroup("maven.modrinth") } + } + exclusiveContent { + forRepository { maven("https://thedarkcolour.github.io/KotlinForForge/") } + filter { includeGroup("thedarkcolour") } } + maven("https://maven.neoforged.net/releases/") } @@ -115,13 +116,19 @@ dependencies { modImplementation(fabricApi.module(it, fapiVersion)) } modRuntimeOnly("net.fabricmc.fabric-api:fabric-api:$fapiVersion") + + modImplementation("net.fabricmc:fabric-language-kotlin:${findProperty("deps.fabricLangKotlin")}") } if (isNeoforge) { "neoForge"("net.neoforged:neoforge:${findProperty("deps.neoforge")}") + + modImplementation("thedarkcolour:kotlinforforge-neoforge:${findProperty("deps.kotlinForForge")}") } if (isForge) { "forge"("net.minecraftforge:forge:${findProperty("deps.forge")}") + modImplementation("thedarkcolour:kotlinforforge:${findProperty("deps.kotlinForForge")}") + // enable when it's needed // val mixinExtras = findProperty("deps.mixinExtras") // compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:$mixinExtras")!!) @@ -175,7 +182,7 @@ tasks { filesMatching("META-INF/mods.toml") { expand(props) } } - register("releaseMod") { + val releaseMod by registering { group = "mod" dependsOn("publishMods") -- cgit