[build] Setup project for cross-version Minecraft development
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
plugins {
|
||||
id("de.siphalor.tweed5.publishing")
|
||||
id("de.siphalor.tweed5.minecraft.mod.dummy")
|
||||
}
|
||||
|
||||
|
||||
8
tweed5-minecraft/coat-bridge/build.gradle.kts
Normal file
8
tweed5-minecraft/coat-bridge/build.gradle.kts
Normal file
@@ -0,0 +1,8 @@
|
||||
plugins {
|
||||
id("de.siphalor.tweed5.expanded-sources-jar")
|
||||
id("de.siphalor.tweed5.minecraft.mod.cross-version")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
modImplementation(mcLibs.coat)
|
||||
}
|
||||
11
tweed5-minecraft/conventions/build.gradle.kts
Normal file
11
tweed5-minecraft/conventions/build.gradle.kts
Normal file
@@ -0,0 +1,11 @@
|
||||
import dev.panuszewski.gradle.pluginMarker
|
||||
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("de.siphalor.tweed5:tweed5-conventions")
|
||||
implementation(pluginMarker(mcCommonLibs.plugins.fabric.loom))
|
||||
implementation(pluginMarker(mcCommonLibs.plugins.jcyo))
|
||||
}
|
||||
37
tweed5-minecraft/conventions/settings.gradle.kts
Normal file
37
tweed5-minecraft/conventions/settings.gradle.kts
Normal file
@@ -0,0 +1,37 @@
|
||||
plugins {
|
||||
id("dev.panuszewski.typesafe-conventions") version "0.9.0"
|
||||
}
|
||||
|
||||
typesafeConventions {
|
||||
autoPluginDependencies = false
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
maven {
|
||||
name = "Siphalor"
|
||||
url = uri("https://maven.siphalor.de")
|
||||
mavenContent {
|
||||
includeGroupAndSubgroups("de.siphalor")
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name = "FabricMC"
|
||||
url = uri("https://maven.fabricmc.net")
|
||||
mavenContent {
|
||||
includeGroupAndSubgroups("net.fabricmc")
|
||||
includeGroup("fabric-loom")
|
||||
}
|
||||
}
|
||||
}
|
||||
versionCatalogs {
|
||||
create("libs") {
|
||||
from(files("../../gradle/libs.versions.toml"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
includeBuild("../../conventions")
|
||||
|
||||
rootProject.name = "tweed5-minecraft-conventions"
|
||||
@@ -0,0 +1,63 @@
|
||||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
id("fabric-loom")
|
||||
id("de.siphalor.jcyo")
|
||||
id("de.siphalor.tweed5.minecraft.mod.base")
|
||||
}
|
||||
|
||||
val minecraftVersionDescriptor = project.property("minecraft.version.descriptor") as String
|
||||
val mcProps = Properties().apply {
|
||||
val propFile = project.layout.settingsDirectory.file("gradle/mc-$minecraftVersionDescriptor/gradle.properties").asFile
|
||||
propFile.inputStream().use { load(it) }
|
||||
}
|
||||
|
||||
val mcCatalog = versionCatalogs.named("mcLibs")
|
||||
|
||||
group = "de.siphalor.tweed5.minecraft.${project.name}"
|
||||
val archivesBaseName = "${project.name}-mc$minecraftVersionDescriptor"
|
||||
base {
|
||||
archivesName.set(archivesBaseName)
|
||||
}
|
||||
val shortVersion = project.property("tweed5.version").toString()
|
||||
val minecraftVersion = getMcCatalogVersion("minecraft")
|
||||
version = "$shortVersion+mc$minecraftVersion"
|
||||
|
||||
sourceSets {
|
||||
create("testmod") {
|
||||
compileClasspath += sourceSets.main.get().compileClasspath
|
||||
runtimeClasspath += sourceSets.main.get().runtimeClasspath
|
||||
}
|
||||
}
|
||||
|
||||
// For some reason dependencyResolutionManagement from the settings.gradle doesn't seem to be passed through correctly,
|
||||
// so we're defining the repositories right here
|
||||
repositories {
|
||||
maven {
|
||||
name = "Parchment"
|
||||
url = uri("https://maven.parchmentmc.org")
|
||||
mavenContent {
|
||||
includeGroupAndSubgroups("org.parchmentmc")
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name = "Siphalor"
|
||||
url = uri("https://maven.siphalor.de")
|
||||
mavenContent {
|
||||
includeGroupAndSubgroups("de.siphalor")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft(mcCatalog.findLibrary("minecraft").get())
|
||||
mappings(loom.layered {
|
||||
officialMojangMappings()
|
||||
parchment("org.parchmentmc.data:parchment-$minecraftVersion:${getMcCatalogVersion("parchment")}@zip")
|
||||
})
|
||||
modImplementation(mcCommonLibs.fabric.loader)
|
||||
}
|
||||
|
||||
fun getMcCatalogVersion(name: String): String {
|
||||
return mcCatalog.findVersion(name).get().requiredVersion
|
||||
}
|
||||
1
tweed5-minecraft/gradle.properties
Normal file
1
tweed5-minecraft/gradle.properties
Normal file
@@ -0,0 +1 @@
|
||||
minecraft.version.descriptor = 1.21.10
|
||||
8
tweed5-minecraft/gradle/mc-1.21.10/mcLibs.versions.toml
Normal file
8
tweed5-minecraft/gradle/mc-1.21.10/mcLibs.versions.toml
Normal file
@@ -0,0 +1,8 @@
|
||||
[versions]
|
||||
coat = "1.0.0-beta.23"
|
||||
minecraft = "1.21.10"
|
||||
parchment = "2025.10.12"
|
||||
|
||||
[libraries]
|
||||
coat = { group = "de.siphalor.coat", name = "coat-mc1.21.10", version.ref = "coat" }
|
||||
minecraft = { group = "com.mojang", name = "minecraft", version.ref = "minecraft" }
|
||||
11
tweed5-minecraft/gradle/mcCommonLibs.versions.toml
Normal file
11
tweed5-minecraft/gradle/mcCommonLibs.versions.toml
Normal file
@@ -0,0 +1,11 @@
|
||||
[versions]
|
||||
fabric-loader = "0.17.2"
|
||||
fabric-loom = "1.11-SNAPSHOT"
|
||||
jcyo = "0.4.2"
|
||||
|
||||
[plugins]
|
||||
jcyo = { id = "de.siphalor.jcyo", version.ref = "jcyo" }
|
||||
fabric-loom = { id = "fabric-loom", version.ref = "fabric-loom" }
|
||||
|
||||
[libraries]
|
||||
fabric-loader = { group = "net.fabricmc", name = "fabric-loader", version.ref = "fabric-loader" }
|
||||
@@ -2,25 +2,54 @@ rootProject.name = "tweed5-minecraft"
|
||||
|
||||
pluginManagement {
|
||||
includeBuild("../conventions")
|
||||
includeBuild("conventions")
|
||||
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
maven {
|
||||
name = "Siphalor"
|
||||
url = uri("https://maven.siphalor.de")
|
||||
mavenContent {
|
||||
includeGroupAndSubgroups("de.siphalor")
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name = "FabricMC"
|
||||
url = uri("https://maven.fabricmc.net")
|
||||
mavenContent {
|
||||
includeGroupAndSubgroups("net.fabricmc")
|
||||
includeGroup("fabric-loom")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
versionCatalogs {
|
||||
create("libs") {
|
||||
from(files("../gradle/libs.versions.toml"))
|
||||
}
|
||||
create("mcCommonLibs") {
|
||||
from(files("gradle/mcCommonLibs.versions.toml"))
|
||||
}
|
||||
create("mcLibs") {
|
||||
val mcVersionDescriptor = providers.gradleProperty("minecraft.version.descriptor").get()
|
||||
from(files("gradle/mc-$mcVersionDescriptor/mcLibs.versions.toml"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
includeBuild("../tweed5")
|
||||
|
||||
includeNormalModule("bundle")
|
||||
includeNormalModule("coat-bridge")
|
||||
|
||||
fun includeNormalModule(name: String) {
|
||||
includeAs("tweed5-$name", "$name")
|
||||
includeAs("tweed5-$name", name)
|
||||
}
|
||||
|
||||
fun includeAs(name: String, path: String) {
|
||||
|
||||
Reference in New Issue
Block a user