DimDoors/build.gradle
2018-04-02 01:30:29 -04:00

114 lines
3.5 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'
repositories {
maven { url "https://jitpack.io" }
ivy {
url 'https://github.com/'
layout 'pattern', {
//noinspection GroovyAssignabilityCheck (IntelliJ is wrong)
artifact '/[organisation]/[module]/raw/master/repository/snapshots/[revision].[ext]'
}
}
}
// Version info
String baseversion = "3.0" // Set beta to 0 after changing this
int beta = 7 // Set this to 0 for a non-beta release
int betaSub = 1
ext.mcversion = "1.12.2"
ext.forgeversion = "14.23.2.2623"
String mcpversion = "snapshot_20180227"
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'
// TODO: Get poly2tri working with Jitpack to avoid having to manually add its dependencies
embed 'greenm01:poly2tri.java:poly2tri-core-0.1.1-SNAPSHOT'
embed group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.5.10' // poly2tri dependency
compileOnly 'com.github.DimensionalDevelopment:AnnotatedNBT:-SNAPSHOT'
compileOnly 'com.github.OpenCubicChunks:CubicChunks:MC_1.12-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.SchematicGenerator"
//noinspection GroovyAssignabilityCheck (IntelliJ is wrong)
args "src/main/resources/assets/dimdoors/pockets/schematic"
}