Chenille
A gradle plugin that takes care of configuring your minecraft mod project with sensible defaults for common use cases.
Using Chenille
If you are a developer, you can use Chenille in your own project by inserting the following in your build.gradle
:
plugins {
id 'io.github.ladysnake.chenille' version '0.11.3'
}
For the latest version snippet, refer to the Gradle Plugin Portal.
Features
Quilt Setup
Chenille applies the quilt-loom
plugin to your project, unless fabric-loom
was applied first.
Publishing
Chenille can setup publishing to various platforms :
chenille {
configurePublishing {
mainArtifact = remapStandaloneJar.archiveFile
withLadysnakeMaven()
withCurseforgeRelease()
withGithubRelease()
withModrinthRelease()
}
}
The mainArtifact
option determines the main jar to upload.
If left unspecified, it will default to remapJar.archiveFile
.
- Artifactory [
withArtifactory
] publishing requires theartifactory_user
andartifactory_api_key
user-level gradle properties- This method is now deprecated as Jfrog ended their free tier for Open Source projects
- Curseforge [
withCurseforgeRelease
] publishing requires thecurseforge_api_key
user-level property and thecurseforge_id
project-level property - Github [
withGithubRelease
] publishing requires thegithub_api_key
user-level property - Ladysnake Maven [
withLadysnakeMaven
] publishing requires theladysnake_maven_username
andladysnake_maven_password
user-level property - Modrinth [
withModrinthRelease
] publishing requires themodrinth_api_key
user-level property and themodrinth_id
project-level property
On Curseforge and Modrinth, the loader setting will be set to fabric
and quilt
if fabric-loom
is applied, otherwise it will be set to just quilt
.
Setting up at least one publication method with Chenille will trigger the creation of a release
task, which will :
- build and test the project
- verify that the local Git repository is in a state suitable for a release
- no uncommitted files
- on a branch that is named either
main
or after a semantic version (e.g.1.20
or1.19.4
) - on a branch that is up-to-date with its remote
- no existing git tag for the current version (ineffective without GitHub releases)
- parse the changelog file (see below)
- trigger all the publishing
Changelog
Chenille configures your automated github, curseforge, and modrinth releases to use
a changelog file from your project repository (defaulting to /changelog.md
). The expected format is as follows :
------------------------------------------------------
Version x.y.2
------------------------------------------------------
Changelog for version x y 2
------------------------------------------------------
Version x.y.1
------------------------------------------------------
Changelog for version x y 1
Default Repositories
Chenille lets you quickly add some common repositories to your project
by calling the following methods in a chenille.repositories
block :
cotton()
cursemaven()
jamieswhiteshirt()
jitpack()
ladysnake()
lucko()
modrinth()
shedaniel()
terraformers()
To get all these in one shot, you can also call chenille.repositories.allCommonRepositories()
.
Dependency Configurations
Chenille adds dependency configurations for common use cases :
modIncludeImplementation
: short formodImplementation include
modIncludeApi
: short formodApi include
modLocalImplementation
: short formodCompileOnly modLocalRuntime
Test Mod setup
Mods and especially libraries can greatly benefit from having a test mod in the same project.
You can setup such a test mod with automated test cases by calling chenille.configureTestmod()
.
This will configure a testmod
sourceset, as well as the following run configs :
- Testmod Client : starts a minecraft client with your mod and your test mod
- Testmod Server : starts a minecraft server with your mod and your test mod
- Auto Test Server : starts a minecraft server with your mod and your test mod, which shuts down after loading every mixin
- Game Test : runs your automated testing and shuts down immediately afterward
Game tests will automatically be run as part of the check
task, preventing you from building if you got an error.