Added a build script

This commit is contained in:
Adubbz 2013-07-04 12:09:20 +10:00
parent 3bdad8c67e
commit 84ddf57362
5 changed files with 131 additions and 3 deletions

4
build.properties Normal file
View file

@ -0,0 +1,4 @@
dir.development=../../
dir.release=../../Biomes O Plenty Releases
release.minecraft.version=1.6.1
release.mod.version=0.5.6

122
build.xml Normal file
View file

@ -0,0 +1,122 @@
<?xml version="1.0" ?>
<project name="Biomes O Plenty" default="build">
<property file="build.properties" prefix="build"/>
<property file="build_number.properties" prefix="build_number"/>
<target name="clean">
<delete file="${build.dir.development}\forge\mcp\src\minecraft\mcmod.info" />
<delete dir="${build.dir.development}\forge\mcp\src\minecraft\biomesoplenty" />
<delete dir="${build.dir.development}\forge\mcp\src\minecraft\forestry" />
<delete dir="${build.dir.development}\forge\mcp\src\minecraft\mods" />
<delete dir="${build.dir.development}\forge\mcp\src\minecraft\powercrystals" />
<delete dir="${build.dir.development}\forge\mcp\src\minecraft\thaumcraft" />
<delete dir="${build.dir.development}\forge\mcp\src\minecraft\thermalexpansion" />
<delete dir="${build.dir.development}\forge\mcp\src\minecraft\net\minecraftforge\fluids" />
<delete dir="${build.dir.development}\forge\mcp\reobf\minecraft" />
</target>
<target name="increment_build_number">
<propertyfile file="build_number.properties">
<entry key="build_number" type="int" operation="+" default="1"/>
</propertyfile>
</target>
<target name="prep">
<copy todir="${build.dir.development}\forge\mcp\src\minecraft">
<fileset dir="${build.dir.development}\source\Biomes O Plenty\src\minecraft\">
<exclude name="**/assets/**"/>
<exclude name="pack.mcmeta"/>
<exclude name="pack.png"/>
</fileset>
</copy>
</target>
<target name="replace_tokens_indev">
<replace dir="${build.dir.development}\forge\mcp\src\minecraft" token="@VERSION@" value="${build.release.mod.version}r${build_number.build_number}" />
<replace dir="${build.dir.development}\forge\mcp\src\minecraft" token="@MCVERSION@" value="${build.release.minecraft.version}" />
</target>
<target name="replace_tokens">
<replace dir="${build.dir.development}\forge\mcp\src\minecraft" token="@VERSION@" value="${build.release.mod.version}" />
<replace dir="${build.dir.development}\forge\mcp\src\minecraft" token="@MCVERSION@" value="${build.release.minecraft.version}" />
</target>
<target name="recompile">
<exec dir="${build.dir.development}\forge\mcp" executable="cmd" osfamily="windows">
<arg line="/c recompile.bat" />
</exec>
<exec dir="${build.dir.development}\forge\mcp" executable="bash" osfamily="unix">
<arg line="recompile.sh" />
</exec>
</target>
<target name="reobfuscate">
<exec dir="${build.dir.development}\forge\mcp" executable="cmd" osfamily="windows">
<arg line="/c reobfuscate_srg.bat" />
</exec>
<exec dir="${build.dir.development}\forge\mcp" executable="bash" osfamily="unix">
<arg line="reobfuscate_srg.sh" />
</exec>
</target>
<target name="build">
<!-- Prep for the build -->
<antcall target="increment_build_number" />
<antcall target="prep" />
<antcall target="replace_tokens_indev" />
<antcall target="recompile" />
<antcall target="reobfuscate" />
<!-- Build the jar -->
<mkdir dir="${build.dir.release}\${build.release.minecraft.version}\${build.release.mod.version}" />
<jar destfile="${build.dir.release}\${build.release.minecraft.version}\${build.release.mod.version}\Biomes-O-Plenty-InDev-${build.release.mod.version}-r${build_number.build_number}-${build.release.minecraft.version}.jar">
<fileset dir="${build.dir.development}\forge\mcp\src\minecraft\" includes="mcmod.info" />
<fileset dir="${build.dir.development}\forge\mcp\reobf\minecraft">
<exclude name="**/forestry/**"/>
<exclude name="**/mods/**"/>
<exclude name="**/powercrystals/**"/>
<exclude name="**/thaumcraft/**"/>
<exclude name="**/thermalexpansion/**"/>
</fileset>
<fileset dir="${build.dir.development}\source\Biomes O Plenty\src\minecraft">
<include name="**/assets/**" />
<include name="pack.mcmeta" />
<include name="pack.png" />
</fileset>
</jar>
<!-- Clean up the MCP source now that we are done -->
<antcall target="clean" />
</target>
<target name="release">
<!-- Prep for the build -->
<antcall target="increment_build_number" />
<antcall target="prep" />
<antcall target="replace_tokens" />
<antcall target="recompile" />
<antcall target="reobfuscate" />
<!-- Build the jar -->
<mkdir dir="${build.dir.release}\${build.release.minecraft.version}\${build.release.mod.version}" />
<jar destfile="${build.dir.release}\${build.release.minecraft.version}\${build.release.mod.version}\Biomes-O-Plenty-${build.release.mod.version}-${build.release.minecraft.version}.jar">
<fileset dir="${build.dir.development}\forge\mcp\src\minecraft\" includes="mcmod.info" />
<fileset dir="${build.dir.development}\forge\mcp\reobf\minecraft">
<exclude name="**/forestry/**"/>
<exclude name="**/mods/**"/>
<exclude name="**/powercrystals/**"/>
<exclude name="**/thaumcraft/**"/>
<exclude name="**/thermalexpansion/**"/>
</fileset>
<fileset dir="${build.dir.development}\source\Biomes O Plenty\src\minecraft">
<include name="**/assets/**" />
<include name="pack.mcmeta" />
<include name="pack.png" />
</fileset>
</jar>
<!-- Clean up the MCP source now that we are done -->
<antcall target="clean" />
</target>
</project>

2
build_number.properties Normal file
View file

@ -0,0 +1,2 @@
#Thu, 04 Jul 2013 12:06:13 +1000
build_number=20

View file

@ -23,7 +23,7 @@ public class Version implements Runnable {
CURRENT, OUTDATED, CONNECTION_ERROR
}
public static final String VERSION = "0.5.6";
public static final String VERSION = "@VERSION@";
private static final String REMOTE_VERSION_FILE = "https://raw.github.com/BiomesOPlenty/BiomesOPlenty/master/version.txt";
private static final String REMOTE_CHANGELOG_ROOT = "https://raw.github.com/BiomesOPlenty/BiomesOPlenty/master/changelog/";

View file

@ -2,8 +2,8 @@
"modid": "BiomesOPlenty",
"name": "Biomes O' Plenty",
"description": "Adds 87 new, unique biomes!",
"version": "0.5.6",
"mcversion": "1.5.2",
"version": "@VERSION@",
"mcversion": "@MCVERSION@",
"url": "www.minecraftforum.net/topic/1495041-",
"updateUrl": "",
"authors": [ "Adubbz", "Amnet", "ted80", "Forstride"],