Files
MoonriseMC/build.gradle
2024-08-06 21:49:42 -07:00

78 lines
1.8 KiB
Groovy

plugins {
id("xyz.jpenilla.quiet-architectury-loom")
}
/*
* Gets the version name from the latest Git tag
*/
// https://stackoverflow.com/questions/28498688/gradle-script-to-autoversion-and-include-the-commit-hash-in-android
def getGitCommit = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
dependencies {
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
api('ca.spottedleaf:concurrentutil:0.0.2-SNAPSHOT')
api("org.yaml:snakeyaml:${rootProject.snakeyaml_version}")
}
File awFile = file("src/main/resources/moonrise.accesswidener")
allprojects {
group = rootProject.maven_group
version = rootProject.mod_version + "+" + getGitCommit()
plugins.apply("xyz.jpenilla.quiet-architectury-loom")
java {
withSourcesJar()
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenLocal {
mavenContent {
includeModule("ca.spottedleaf", "concurrentutil")
}
}
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.officialMojangMappings()
}
// make build reproducible
tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 21
}
tasks.jar.configure {
from(rootProject.file("LICENSE")) {
rename { "${it}_${rootProject.base.archivesName.get()}"}
}
}
loom {
accessWidenerPath = awFile
mixin {
useLegacyMixinAp = false
}
}
}