mirror of
https://github.com/TibiNonEst/cauldron-dyeing.git
synced 2024-10-22 17:53:26 -05:00
6c4645fbf3
Fixes #9
113 lines
2.4 KiB
Groovy
113 lines
2.4 KiB
Groovy
plugins {
|
|
alias(libs.plugins.fabric.loom)
|
|
alias(libs.plugins.loom.quiltflower)
|
|
alias(libs.plugins.grgit)
|
|
id "maven-publish"
|
|
}
|
|
|
|
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"
|
|
}
|
|
}
|
|
|
|
maven {
|
|
name = "Quilt"
|
|
url = "https://maven.quiltmc.org/repository/release"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
minecraft libs.minecraft
|
|
mappings variantOf(libs.quilt.mappings) { classifier "intermediary-v2" }
|
|
modImplementation libs.fabric.loader
|
|
|
|
modImplementation libs.fabric.api
|
|
modCompileOnly libs.sodium
|
|
}
|
|
|
|
loom {
|
|
accessWidenerPath.set file("src/main/resources/cauldron-dyeing.accesswidener")
|
|
}
|
|
|
|
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"
|
|
// 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()
|
|
}
|
|
|
|
jar {
|
|
from("LICENSE") {
|
|
rename { "${it}_${project.archivesBaseName}"}
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
from components.java
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
maven {
|
|
url = System.getenv("MAVEN_URL")
|
|
credentials {
|
|
username = System.getenv("MAVEN_USERNAME")
|
|
password = System.getenv("MAVEN_PASSWORD")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
def getMetadata() {
|
|
def build_id = System.getenv("GITHUB_RUN_NUMBER")
|
|
def workflow_id = System.getenv("GITHUB_WORKFLOW")
|
|
|
|
def metadata = ""
|
|
|
|
// Release builds only
|
|
if (workflow_id == "build-release") {
|
|
return metadata
|
|
}
|
|
|
|
if (build_id != null) {
|
|
metadata += "+build.${build_id}"
|
|
} else 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 += "+git.${id}"
|
|
}
|
|
|
|
return metadata
|
|
}
|