diff options
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/build.gradle b/build.gradle index 7eddebb..a29d2f8 100644 --- a/build.gradle +++ b/build.gradle @@ -17,27 +17,20 @@ apply plugin: "com.palantir.git-version" version = gitVersion() group = 'co.fantabos.bscv' archivesBaseName = 'boscovicino' + +// Minecraft and Forge versions def minecraftVersion = '1.16.5' +def forgeVersion = '36.2.34' project.ext { // external properties coming from gradle.properties - forgeVersion = getProjectProperty("bscv.forge.version", "1.16.5-36.2.34") 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 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. 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' } dependencies { - minecraft "net.minecraftforge:forge:${project.ext.forgeVersion}" + minecraft "net.minecraftforge:forge:${minecraftVersion}-${forgeVersion}" } jar { @@ -109,10 +102,10 @@ jar { jar.finalizedBy('reobfJar') //copy jar from build/libs to the forge mod folder -tasks.register('copyJar', Copy) { +tasks.register('deployJar', Copy) { if (!project.ext.deployJarDo.toBoolean()) return from project.jar - into project.ext.copyJarTargetGameDir + into project.ext.deployJarTargetDir } publishing { @@ -130,5 +123,5 @@ publishing { build { //dependsOn shadowJar, reobfShadowJar - finalizedBy copyJar + finalizedBy deployJar } |