Files
Electro-Magic-Tools/build.gradle
T
2018-05-03 23:35:22 +02:00

87 lines
2.1 KiB
Groovy

buildscript {
repositories {
mavenCentral()
maven { url = "http://files.minecraftforge.net/maven" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
}
}
apply plugin: 'forge'
apply plugin: 'signing'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = 1.8
targetCompatibility = 1.8
ext.configFile = file "build.properties"
configFile.withReader {
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
version = config.mod_version + "[" + config.mc_version + "]"
group= config.package_group
archivesBaseName = config.mod_name
minecraft {
version = config.mc_version + "-" + config.forge_version + "-" + config.mc_version
runDir = "run"
replaceIn "EMT.java"
replace "@version@", config.mod_version
if (project.hasProperty('mappings_version'))
mappings = project.mappings_version
}
processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
from(sourceSets.main.resources.srcDirs) {
include '**/*.info'
expand 'version': config.mod_version
}
}
jar {
exclude "baubles/**"
exclude "ic2/**"
exclude "thaumcraft/**"
}
// add a source jar
task sourceJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
// because the normal output has been made to be obfuscated
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
}
tasks.build.dependsOn sourceJar, deobfJar
tasks.withType(JavaCompile) { task ->
task.options.encoding = 'UTF-8'
}
task signJar(dependsOn: 'reobf'){
doLast {
ant.signjar(
destDir: jar.destinationDir,
jar: jar.getArchivePath(),
alias: findProperty('keyStoreAlias') ?: '',
keystore: findProperty('keyStore') ?: '',
storepass: findProperty('keyStorePass') ?: '',
digestalg: findProperty('signDigestAlg') ?: '',
tsaurl: findProperty('signTSAurl') ?: '',
verbose: true
)
}
}