Improved build scripts

This commit is contained in:
Emmanuel BENOîT 2016-06-14 20:21:21 +02:00
parent 414118f483
commit aab0faa13c
2 changed files with 19 additions and 18 deletions

View file

@ -7,16 +7,16 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
classpath "net.minecraftforge.gradle:ForgeGradle:${forgegradle_version}"
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
version = "0.1-1.9.4"
group= "mmm"
archivesBaseName = "mmm"
version = "${mod_version}-${mc_version}"
group= "${mod_name}"
archivesBaseName = "${mod_name}"
sourceSets {
main {
@ -34,35 +34,28 @@ targetCompat = JavaVersion.VERSION_1_8
minecraft {
version = "1.9.4-12.17.0.1962"
version = "${mc_version}-${forge_version}"
runDir = "run"
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not allways work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "snapshot_20160518"
mappings = "${mappings_version}"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}
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'
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

8
gradle.properties Normal file
View file

@ -0,0 +1,8 @@
forgegradle_version= 2.2-SNAPSHOT
mod_name= mmm
mod_version= 0.1
mc_version= 1.9.4
forge_version= 12.17.0.1963
mappings_version= snapshot_20160518