buildscript { repositories { jcenter() maven { url = "http://files.minecraftforge.net/maven" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' } } plugins { id 'io.franzbecker.gradle-lombok' version '1.11' id 'java' } apply plugin: 'java' apply plugin: 'net.minecraftforge.gradle.forge' repositories { maven { url "https://jitpack.io" } } // Version info String baseversion = "3.0" // Set beta to 0 after changing this int beta = 6 // Set this to 0 for a non-beta release int betaSub = 0 ext.mcversion = "1.12.2" ext.forgeversion = "14.23.1.2598" String mcpversion = "snapshot_20180113" String suffix = "" String shortSuffix = "" if (beta != 0) { suffix += ".$beta" + "-b" if (betaSub != 0) { suffix += "-$betaSub" } shortSuffix = suffix if (System.getenv("TRAVIS_BUILD_NUMBER") != null && beta != 0) { suffix += "+${System.getenv("TRAVIS_BUILD_NUMBER")}" } else { suffix += "+UNOFFICIAL" } } version = ext.modversion = baseversion + suffix group = "org.dimdev.dimdoors" archivesBaseName = "Dimdoors" jar.archiveName = "Dimdoors-" + version + ".jar" // Constant name for travis sourceCompatibility = "1.8" compileJava { //options.compilerArgs += "-proc:only" } minecraft { version = "$mcversion-$forgeversion" runDir = "run" mappings = mcpversion replace '${version}', baseversion + shortSuffix // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. } configurations { embed compile.extendsFrom(embed) } dependencies { embed 'com.flowpowered:flow-math:1.0.3' embed 'org.jgrapht:jgrapht-core:1.1.0' compile 'com.github.DimensionalDevelopment:AnnotatedNBT:-SNAPSHOT' } jar { from configurations.embed.collect { it.isDirectory() ? it : zipTree(it) } } processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace version and mcversion expand 'version': project.version, 'mcversion': project.minecraft.version } // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } task generatePocketSchematics(dependsOn: jar, type: JavaExec, group: "dimdoors") { classpath = files('build/libs/' + jar.archiveName) classpath += sourceSets.main.runtimeClasspath main = "org.dimdev.dimdoors.shared.tools.PocketSchematicGenerator" //noinspection GroovyAssignabilityCheck (IntelliJ is wrong) args "src/main/resources/assets/dimdoors/pockets/schematic" }