Get your Mindustry plugin started with this awesome template repository, it features :
-
Jitpack support for using the project as a dependency.
-
GitHub actions for easier testing (the plugin is built for each commit and pull request).
-
Toxopid Gradle plugin for faster Mindustry plugin development and testing.
-
Indra Gradle plugin for easier java development.
- It also comes with
indra.licenser-spotless
, a powerful formatting tool that applies your licence header automatically in your source files with the./gradlew spotlessApply
task (and much more).
- It also comes with
-
Bundling and automatic relocation (isolating your dependencies to avoid class loading issues) with the Shadow gradle plugin.
-
The default relocation is
(plugin-root-package).shadow
(example with gson:fr.xpdustry.template.shadow.gson
). -
Every unused classes is removed from the final jar.
-
-
Very easy configuration :
-
If you're not an advanced user, just editing the properties in
plugin.json
andgradle.properties
is enough. For example :-
Changing
version
inplugin.json
will change the whole project version. -
The project is compiled with the version of Mindustry provided by
minGameVersion
inplugin.json
.
-
-
-
Update
plugin.json
andgradle.properties
. -
Reset
CHANGELOG.md
. -
Start K O D I N G.
-
When ready for release, set the release version in your
plugin.json
, push the change and create a release on GitHub. Once published, the plugin jar will be added to the release and theCHANGELOG.md
file will be updated with the release notes of the release.
This plugin requires :
-
Java 17 or above.
-
Mindustry v140 or above.
-
./gradlew shadowJar
to compile the plugin into a usable jar (will be located atbuilds/libs/(plugin-display-name.jar
). -
./gradlew jar
for a plain jar that contains only the plugin code. -
./gradlew runMindustryServer
to run the plugin in a local Mindustry server. -
./gradlew test
to run the unit tests of the plugin.
-
If you eventually need to change the project licence (
LICENSE.md
andLICENSE_HEADER.md
), also change the licence function call in theindra
configuration of the build script, more info in the Indra wiki. -
If you want to expose some of your plugin dependencies, or you are using a dependency that cannot be relocated like some SQL drivers, you will have to relocate them manually by replacing :
val relocate = tasks.create<ConfigureShadowRelocation>("relocateShadowJar") { target = tasks.shadowJar.get() prefix = project.property("props.root-package").toString() + ".shadow" } tasks.shadowJar { dependsOn(relocate) minimize() }
With :
tasks.shadowJar { val shadowPackage = project.property("props.root-package").toString() + ".shadow" // Put the internal dependencies here relocate("com.example.artifact1", "$shadowPackage.artifact1") relocate("com.example.artifact2", "$shadowPackage.artifact2") minimize { // Put the exposed dependencies and unrelocatable dependencies here exclude(dependency("com.example:artifact3:.*")) exclude(dependency("com.example:some-sql-driver:.*")) } }