chore: trim it more
This commit is contained in:
parent
cb16fd72bf
commit
59e579d9e1
1 changed files with 8 additions and 15 deletions
23
build.gradle
23
build.gradle
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue