Skip to content

Commit

Permalink
chore: boring boilerplate needed to work with Kotlin, queue The Kotli…
Browse files Browse the repository at this point in the history
…n Rewrite™!
  • Loading branch information
DataM0del committed Dec 20, 2024
1 parent cac5921 commit b8922ae
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 37 deletions.
18 changes: 15 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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 {
Expand All @@ -27,13 +35,16 @@ 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 {
inputs.property "version", project.version

filesMatching("fabric.mod.json") {
expand "version": project.version
expand "kotlin_version": kotlin_version
}
}

Expand All @@ -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 {
Expand All @@ -73,4 +82,7 @@ publishing {
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
kotlin {
jvmToolchain(21)
}
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@
# Dependencies
fabric_version=0.42.0+1.16
orbit_version=0.2.4
reflections_version=0.10.2
reflections_version=0.10.2
kotlin_version=2.1.0
fabric_kt_version=1.13.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ pluginManagement {
mavenCentral()
gradlePluginPortal()
}
plugins {
id 'org.jetbrains.kotlin.jvm' version '2.1.0'
}
}
plugins {
}
68 changes: 36 additions & 32 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -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": "*"
}
}

0 comments on commit b8922ae

Please sign in to comment.