DimDoors/build.gradle

104 lines
2.9 KiB
Groovy
Raw Normal View History

buildscript {
repositories {
jcenter()
maven { url = "http://files.minecraftforge.net/maven" }
}
dependencies {
2017-11-24 00:32:59 +01:00
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
2017-12-07 05:54:43 +01:00
plugins {
id 'io.franzbecker.gradle-lombok' version '1.11'
id 'java'
}
2017-12-29 08:18:34 +01:00
apply plugin: 'java'
apply plugin: 'net.minecraftforge.gradle.forge'
2018-01-07 18:27:47 +01:00
repositories {
maven { url "https://jitpack.io" }
}
2017-12-29 08:18:34 +01:00
// Version info
String baseversion = "3.0" // Set beta to 0 after changing this
2018-01-19 13:23:07 +01:00
int beta = 6 // Set this to 0 for a non-beta release
int betaSub = 0
2017-11-24 00:32:59 +01:00
ext.mcversion = "1.12.2"
ext.forgeversion = "14.23.1.2598"
String mcpversion = "snapshot_20180113"
2017-12-29 08:18:34 +01:00
String suffix = ""
String shortSuffix = ""
if (beta != 0) {
suffix += ".$beta" + "-b"
if (betaSub != 0) {
suffix += "-$betaSub"
}
2017-12-29 08:18:34 +01:00
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
2017-12-29 08:18:34 +01:00
sourceCompatibility = "1.8"
compileJava {
2018-01-07 18:27:47 +01:00
//options.compilerArgs += "-proc:only"
}
minecraft {
2017-12-29 08:18:34 +01:00
version = "$mcversion-$forgeversion"
runDir = "run"
2017-12-29 08:18:34 +01:00
mappings = mcpversion
replace '${version}', baseversion + shortSuffix
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}
configurations {
2017-12-29 05:46:29 +01:00
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
2018-01-07 18:27:47 +01:00
expand 'version': project.version, 'mcversion': project.minecraft.version
}
2018-01-07 18:27:47 +01:00
// 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
2017-12-27 08:49:36 +01:00
main = "org.dimdev.dimdoors.shared.tools.PocketSchematicGenerator"
2017-12-22 02:29:37 +01:00
//noinspection GroovyAssignabilityCheck (IntelliJ is wrong)
args "src/main/resources/assets/dimdoors/pockets/schematic"
}