diff --git a/build.gradle b/build.gradle index 4fbc79f..ebe9aad 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,11 @@ plugins { - id 'fabric-loom' version '1.7-SNAPSHOT' + id 'fabric-loom' version '1.9-SNAPSHOT' id 'maven-publish' + id 'org.jetbrains.kotlin.jvm' version "$kotlin_version" } +kotlin_version = project.kotlin_version +fabric_kt_version = project.fabric_kt_version version = project.mod_version group = project.maven_group @@ -15,6 +18,11 @@ repositories { name = "meteor-maven" url = "https://maven.meteordev.org/releases" } + maven { + name = "fabricmc-maven" + url = "https://maven.fabricmc.net/" + } + mavenCentral() } dependencies { @@ -27,6 +35,8 @@ dependencies { implementation "meteordevelopment:orbit:${project.orbit_version}" implementation "org.reflections:reflections:${project.reflections_version}" + modImplementation "net.fabricmc:fabric-language-kotlin:$fabric_kt_version+kotlin.$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-metadata-jvm:$kotlin_version" } processResources { @@ -34,6 +44,7 @@ processResources { filesMatching("fabric.mod.json") { expand "version": project.version + expand "kotlin_version": kotlin_version } } @@ -47,8 +58,6 @@ java { // If you remove this line, sources will not be generated. withSourcesJar() - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 } jar { @@ -73,4 +82,7 @@ publishing { // The repositories here will be used for publishing your artifact, not for // retrieving dependencies. } +} +kotlin { + jvmToolchain(21) } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 1f77a01..c29b164 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,4 +16,6 @@ # Dependencies fabric_version=0.42.0+1.16 orbit_version=0.2.4 - reflections_version=0.10.2 \ No newline at end of file + reflections_version=0.10.2 + kotlin_version=2.1.0 + fabric_kt_version=1.13.0 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a441313..cea7a79 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle b/settings.gradle index 75c4d72..6d7da39 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,4 +7,9 @@ pluginManagement { mavenCentral() gradlePluginPortal() } + plugins { + id 'org.jetbrains.kotlin.jvm' version '2.1.0' + } +} +plugins { } \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 863c05e..60cbde4 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,34 +1,38 @@ { - "schemaVersion": 1, - "id": "opensigma", - "version": "${version}", - "name": "opensigma", - "description": "This is an example description! Tell everyone what your mod is about!", - "authors": [ - "Me!" - ], - "contact": { - "homepage": "https://fabricmc.net/", - "sources": "https://github.com/FabricMC/fabric-example-mod" - }, - "license": "MIT", - "icon": "assets/opensigma/icon.png", - "environment": "*", - "entrypoints": { - "main": [ - "info.opensigma.OpenSigma" - ] - }, - "mixins": [ - "opensigma.mixins.json" - ], - "depends": { - "fabricloader": ">=0.15.11", - "minecraft": "~1.16.4", - "java": ">=8", - "fabric": "*" - }, - "suggests": { - "another-mod": "*" - } + "schemaVersion": 1, + "id": "opensigma", + "version": "${version}", + "name": "opensigma", + "description": "This is an example description! Tell everyone what your mod is about!", + "authors": [ + "Me!" + ], + "contact": { + "homepage": "https://fabricmc.net/", + "sources": "https://github.com/FabricMC/fabric-example-mod" + }, + "license": "MIT", + "icon": "assets/opensigma/icon.png", + "environment": "*", + "entrypoints": { + "main": [ + { + "adapter": "kotlin", + "value": "info.opensigma.OpenSigma" + } + ] + }, + "mixins": [ + "opensigma.mixins.json" + ], + "depends": { + "fabricloader": ">=0.15.11", + "fabric-language-kotlin": ">=1.13.0+kotlin.${kotlin_version}", + "minecraft": "~1.16.4", + "java": ">=8", + "fabric": "*" + }, + "suggests": { + "another-mod": "*" + } } \ No newline at end of file