97 lines
2.9 KiB
Groovy
97 lines
2.9 KiB
Groovy
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'
|
|
|
|
// Version info
|
|
String baseversion = "3.0.0" // Set beta to 0 after changing this
|
|
int beta = 3 // Set this to 0 for a non-beta release
|
|
ext.mcversion = "1.12.2"
|
|
ext.forgeversion = "14.23.1.2555"
|
|
String mcpversion = "snapshot_20171007"
|
|
|
|
String suffix = ""
|
|
String shortSuffix = ""
|
|
if (beta != 0) {
|
|
suffix += "-beta$beta"
|
|
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.jar" // Constant name for travis
|
|
|
|
sourceCompatibility = "1.8"
|
|
compileJava {
|
|
options.compilerArgs += [
|
|
//"-proc:only", // TODO: have generated code available for debugging
|
|
"-processor", "org.dimdev.ddutils.nbt.SavedToNBTProcessor,lombok.launch.AnnotationProcessorHider\$AnnotationProcessor"
|
|
]
|
|
}
|
|
|
|
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'
|
|
compile project(':AnnotatedNBT')
|
|
}
|
|
|
|
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/dimdoors.jar')
|
|
classpath += sourceSets.main.runtimeClasspath
|
|
main = "org.dimdev.dimdoors.shared.tools.PocketSchematicGenerator"
|
|
//noinspection GroovyAssignabilityCheck (IntelliJ is wrong)
|
|
args "src/main/resources/assets/dimdoors/pockets/schematic"
|
|
}
|