https://github.com/xpdustry/kotlin-runtime
A mod containing the necessary runtime libraries for Kotlin mods/plugins.
https://github.com/xpdustry/kotlin-runtime
library mindustry mindustry-mod mindustry-plugin
Last synced: 3 months ago
JSON representation
A mod containing the necessary runtime libraries for Kotlin mods/plugins.
- Host: GitHub
- URL: https://github.com/xpdustry/kotlin-runtime
- Owner: xpdustry
- License: mit
- Created: 2022-03-19T09:37:59.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2026-01-16T21:13:43.000Z (6 months ago)
- Last Synced: 2026-01-17T09:11:40.177Z (6 months ago)
- Topics: library, mindustry, mindustry-mod, mindustry-plugin
- Language: Kotlin
- Homepage:
- Size: 455 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# kotlin-runtime
[](https://github.com/xpdustry/kotlin-runtime/releases)
[](https://github.com/Anuken/Mindustry/releases)
[](https://discord.xpdustry.com)
## Description
This mod allows you to write kotlin mods/plugins without having to ship the kotlin runtime.
Thus avoiding conflicts with other mods/plugins.
It currently comes with kotlin version `2.3.20` and the following libraries :
- The standard library (jdk8)
- The reflection library
- The coroutines library
- The serialization library (json only)
- The kotlinx datetime library (for compat)
If you want to use other kotlin libraries, don't mind creating an issue.
This mod also supports android, although you should still avoid certain java 8 features.
## Usage
Besides downloading this mod alongside your mod/plugin,
you need to also make sure you do not include the kotlin stdlib when compiling your project.
To do so, just add the following in your build script:
````gradle
configurations.runtimeClasspath {
exclude("org.jetbrains.kotlin")
exclude("org.jetbrains.kotlinx")
}
````
Or if you need precise exclusions:
```gradle
configurations.runtimeClasspath {
exclude("org.jetbrains.kotlin", "kotlin-stdlib")
exclude("org.jetbrains.kotlin", "kotlin-stdlib-common")
exclude("org.jetbrains.kotlin", "kotlin-stdlib-jdk8")
exclude("org.jetbrains.kotlin", "kotlin-reflect")
// Add the following lines if you use coroutines
exclude("org.jetbrains.kotlinx", "kotlinx-coroutines-core")
exclude("org.jetbrains.kotlinx", "kotlinx-coroutines-jdk8")
// Add the following line if you use serialization
exclude("org.jetbrains.kotlinx", "kotlinx-serialization-core")
exclude("org.jetbrains.kotlinx", "kotlinx-serialization-json")
// Add the following line if you use datetime
exclude("org.jetbrains.kotlinx", "kotlinx-datetime")
}
```
## Requirements
This mod requires Mindustry v157 or later and Java 8 or later.
## Building
- `./gradlew :mergeJar` to only compile the mod (it will be located at `build/libs/kotlin-runtime.jar`).
- `./gradlew :runMindustryServer` to run the mod in a local Mindustry server.
- `./gradlew :runMindustryClient` to run a local Mindustry client.