chore: trim it more

This commit is contained in:
əlemi 2023-02-02 11:13:18 +01:00
parent cb16fd72bf
commit 59e579d9e1
No known key found for this signature in database
GPG key ID: BBCBFE5D7244634E

View file

@ -17,27 +17,20 @@ apply plugin: "com.palantir.git-version"
version = gitVersion() version = gitVersion()
group = 'co.fantabos.bscv' group = 'co.fantabos.bscv'
archivesBaseName = 'boscovicino' archivesBaseName = 'boscovicino'
// Minecraft and Forge versions
def minecraftVersion = '1.16.5' def minecraftVersion = '1.16.5'
def forgeVersion = '36.2.34'
project.ext { // external properties coming from gradle.properties project.ext { // external properties coming from gradle.properties
forgeVersion = getProjectProperty("bscv.forge.version", "1.16.5-36.2.34")
deployJarDo = getProjectProperty("deployJar.do", "false") deployJarDo = getProjectProperty("deployJar.do", "false")
deployJarTargetDir = getProjectProperty("deployJar.targetDir", getOsGameDir()) deployJarTargetDir = getProjectProperty("deployJar.targetDir", ".")
} }
def getProjectProperty(String property, String fallback) { //allows for custom gradle.properties while retaining default fallback values def getProjectProperty(String property, String fallback) { //allows for custom gradle.properties while retaining default fallback values
return (project.hasProperty(property)) ? project.property(property) : fallback return (project.hasProperty(property)) ? project.property(property) : fallback
} }
def getOsGameDir() {
if (org.gradle.internal.os.OperatingSystem.current().isWindows())
return System.getenv("APPDATA") + "/.minecraft/mods"
else if (org.gradle.internal.os.OperatingSystem.current().isMacOsX())
return System.properties["user.home"] + "/Library/Application Support/minecraft/mods"
else
return System.properties["user.home"] + "/.minecraft/mods"
}
java.toolchain.languageVersion = JavaLanguageVersion.of(8) // Mojang ships Java 8 to end users, so your mod should target Java 8. java.toolchain.languageVersion = JavaLanguageVersion.of(8) // Mojang ships Java 8 to end users, so your mod should target Java 8.
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
@ -88,7 +81,7 @@ minecraft {
sourceSets.main.resources { srcDir 'src/generated/resources' } sourceSets.main.resources { srcDir 'src/generated/resources' }
dependencies { dependencies {
minecraft "net.minecraftforge:forge:${project.ext.forgeVersion}" minecraft "net.minecraftforge:forge:${minecraftVersion}-${forgeVersion}"
} }
jar { jar {
@ -109,10 +102,10 @@ jar {
jar.finalizedBy('reobfJar') jar.finalizedBy('reobfJar')
//copy jar from build/libs to the forge mod folder //copy jar from build/libs to the forge mod folder
tasks.register('copyJar', Copy) { tasks.register('deployJar', Copy) {
if (!project.ext.deployJarDo.toBoolean()) return if (!project.ext.deployJarDo.toBoolean()) return
from project.jar from project.jar
into project.ext.copyJarTargetGameDir into project.ext.deployJarTargetDir
} }
publishing { publishing {
@ -130,5 +123,5 @@ publishing {
build { build {
//dependsOn shadowJar, reobfShadowJar //dependsOn shadowJar, reobfShadowJar
finalizedBy copyJar finalizedBy deployJar
} }