From aab0faa13c8414f0d7f3be96e1c0703bc4070cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Tue, 14 Jun 2016 20:21:21 +0200 Subject: [PATCH] Improved build scripts --- build.gradle | 29 +++++++++++------------------ gradle.properties | 8 ++++++++ 2 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 gradle.properties diff --git a/build.gradle b/build.gradle index ec7edb5..0114fcb 100644 --- a/build.gradle +++ b/build.gradle @@ -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' +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..284a1e4 --- /dev/null +++ b/gradle.properties @@ -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 \ No newline at end of file