mirror of
https://github.com/TibiNonEst/cauldron-dyeing.git
synced 2025-08-09 04:03:57 -05:00
Improve gradle
Mostly taken from Quilt's template mod. - No longer JIJs FAPI - Update gradle wrapper
This commit is contained in:
parent
4a949172c0
commit
e7ce0084ca
6 changed files with 52 additions and 54 deletions
57
build.gradle
57
build.gradle
|
@ -1,50 +1,33 @@
|
|||
plugins {
|
||||
id 'fabric-loom' version '0.11.+'
|
||||
id 'io.github.juuxel.loom-quiltflower' version '1.6.0'
|
||||
id 'org.quiltmc.quilt-mappings-on-loom' version '4.0.0'
|
||||
id 'org.ajoberstar.grgit' version '5.0.0'
|
||||
alias(libs.plugins.fabric.loom)
|
||||
alias(libs.plugins.loom.quiltflower)
|
||||
alias(libs.plugins.qmol)
|
||||
alias(libs.plugins.grgit)
|
||||
}
|
||||
|
||||
sourceCompatibility = '17'
|
||||
targetCompatibility = '17'
|
||||
|
||||
archivesBaseName = project.archives_base_name
|
||||
version = "${project.mod_version}+${getMetadata()}"
|
||||
group = project.maven_group
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "Modrinth"
|
||||
url = "https://api.modrinth.com/maven"
|
||||
name = 'Modrinth'
|
||||
url = 'https://api.modrinth.com/maven'
|
||||
content {
|
||||
includeGroup "maven.modrinth"
|
||||
includeGroup 'maven.modrinth'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var apiModules = [
|
||||
"fabric-api-base",
|
||||
"fabric-networking-api-v1",
|
||||
"fabric-object-builder-api-v1",
|
||||
"fabric-registry-sync-v0"
|
||||
]
|
||||
|
||||
dependencies {
|
||||
// To change the versions see the gradle.properties file
|
||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||
minecraft libs.minecraft
|
||||
mappings loom.layered {
|
||||
it.mappings("net.fabricmc:yarn:${project.minecraft_version}+build.${project.yarn_mappings}:v2")
|
||||
it.addLayer(quiltMappings.mappings("org.quiltmc:quilt-mappings:${project.minecraft_version}+build.${project.quilt_mappings}:v2"))
|
||||
addLayer quiltMappings.mappings("org.quiltmc:quilt-mappings:${libs.versions.quilt.mappings.get()}:v2")
|
||||
}
|
||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||
modImplementation libs.fabric.loader
|
||||
|
||||
// Fabric API
|
||||
apiModules.forEach {
|
||||
include modImplementation(fabricApi.module(it, project.fabric_version))
|
||||
}
|
||||
|
||||
// Sodium
|
||||
modCompileOnly "maven.modrinth:sodium:${project.sodium_version}"
|
||||
modImplementation libs.fabric.api
|
||||
modCompileOnly libs.sodium
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
@ -58,9 +41,15 @@ processResources {
|
|||
|
||||
tasks.withType(JavaCompile) {
|
||||
it.options.encoding = 'UTF-8'
|
||||
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
|
||||
it.options.release = 17
|
||||
}
|
||||
|
||||
java {
|
||||
// Still required by IDEs such as Eclipse and Visual Studio Code
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
|
@ -71,13 +60,13 @@ jar {
|
|||
}
|
||||
|
||||
def getMetadata() {
|
||||
def build_id = System.getenv("GITHUB_RUN_NUMBER")
|
||||
def workflow_id = System.getenv("GITHUB_WORKFLOW")
|
||||
def build_id = System.getenv('GITHUB_RUN_NUMBER')
|
||||
def workflow_id = System.getenv('GITHUB_WORKFLOW')
|
||||
|
||||
def metadata = project.minecraft_version
|
||||
def metadata = libs.versions.minecraft.get()
|
||||
|
||||
// Release builds only
|
||||
if (workflow_id == "build-release") {
|
||||
if (workflow_id == 'build-release') {
|
||||
return metadata
|
||||
}
|
||||
|
||||
|
@ -89,7 +78,7 @@ def getMetadata() {
|
|||
|
||||
// Flag the build if the build tree is not clean
|
||||
if (!grgit.status().clean) {
|
||||
id += "-dirty"
|
||||
id += '-dirty'
|
||||
}
|
||||
|
||||
metadata += "-${id}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue