forked from SHsuperCM/Stonecutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
KikuGie edited this page Jan 12, 2024
·
9 revisions
In your settings.gradle
include following fields:
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
maven {
url = "https://maven.kikugie.dev/releases"
}
}
}
plugins {
id "dev.kikugie.stonecutter" version "0.3.+"
}
stonecutter {
shared {
versions "1.20.2", "1.20.1", "1.19.4" // these specify directories used in `versions`, as well as versions used in comments
vcsVersion "1.20.2"
}
create rootProject
}
After reloading stonecutter.gradle
will be added to the root directory.
Create a versions
directory in your project. For each version specified in settings.gradle
create a subdirectory with gradle.properties
file in it.
Any value specified in version's properties override the global one. Important one is mappings version (yarn or one of your choice) and you will likely need to specify Minecraft and Fabric API overrides.
After adding Stonecutter build.gradle
will run for each version.
It shouldn't require many changes, but there are some recommended ones:
version = "${property("mod.version")}+${stonecutter.current.version}" // include game version in the mod filename
dependencies {
minecraft "com.mojang:minecraft:${stonecutter.current.version}" // provide version with stonecutter
}
if (stonecutter.current.isActive) { // run configs for non-active version would be invalid
loom {
runConfigs.all {
ideConfigGenerated = true // generate IDE tasks for running client, server and testmod, datagen if those are present
runDir "../../run" // use a global run directory for all versions
}
}
}
Applied to stonecutter.gradle
file.
Chiseled tasks run in parallel for all versions. Example of a chiseled build task:
stonecutter.registerChiseled tasks.register("chiseledBuild", stonecutter.chiseled) {
setGroup "build"
ofTask "build"
}