cauldron-dyeing/build.gradle

94 lines
2.1 KiB
Groovy

plugins {
id 'fabric-loom' version '0.10.+'
id 'io.github.juuxel.loom-quiltflower-mini' version '1.2.1'
id 'org.ajoberstar.grgit' version '4.1.0'
}
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"
content {
includeGroup "maven.modrinth"
}
}
}
var apiModules = [
"fabric-api-base",
"fabric-tool-attribute-api-v1",
"fabric-mining-level-api-v1",
"fabric-resource-loader-v0",
"fabric-tag-extensions-v0",
"fabric-object-builder-api-v1"
]
dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API
apiModules.forEach {
include modImplementation(fabricApi.module(it, project.fabric_version))
}
// Sodium
modCompileOnly "maven.modrinth:sodium:${project.sodium_version}"
}
processResources {
inputs.property 'version', project.version
filteringCharset 'UTF-8'
filesMatching('fabric.mod.json') {
expand 'version': project.version
}
}
tasks.withType(JavaCompile) {
it.options.encoding = 'UTF-8'
}
java {
withSourcesJar()
}
jar {
from('LICENSE') {
rename { "${it}_${project.archivesBaseName}"}
}
}
def getMetadata() {
def build_id = System.getenv("GITHUB_RUN_NUMBER")
def metadata = project.minecraft_version
if (grgit != null) {
def head = grgit.head()
def id = head.abbreviatedId
// Flag the build if the build tree is not clean
if (!grgit.status().clean) {
id += "-dirty"
}
metadata += "-${id}"
}
// CI builds only
if (build_id != null) {
metadata += ".${build_id}"
}
return metadata
}