buildcraft/buildcraft_resources/build.xml

139 lines
4.6 KiB
XML
Raw Normal View History

2012-09-02 19:36:44 +02:00
<project name="Buildcraft" basedir="../../" default="main">
<!-- Properties -->
<property name="build.dir" value="build"/>
2013-08-07 23:54:17 +02:00
<property name="src.dir" value="buildcraft.mc15" />
<property name="lang.dir" value="buildcraft.localization" />
<property name="resource.dir" value="mc.devel" />
2012-09-02 19:36:44 +02:00
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="${build.dir}/dist"/>
2013-08-07 23:54:17 +02:00
<property name="forge.dir" value="${build.dir}/forge" />
<property name="mcp.dir" value="${forge.dir}/mcp" />
2012-12-21 15:51:38 +01:00
2012-09-02 19:36:44 +02:00
<property name="clientsrc.dir" value="${mcp.dir}/src/minecraft"/>
2013-08-07 23:54:17 +02:00
<property name="mc.version" value="1.6.2"/>
<property name="forge.version" value="9.10.0.807"/>
2013-08-09 10:05:08 +02:00
<property name="bc.version" value="4.0.1"/>
2013-08-07 23:54:17 +02:00
<property name="bc.version.full" value="${bc.version}"/>
2012-09-02 19:36:44 +02:00
<echo message="Starting build for ${bc.version.full}"/>
<!-- Targets -->
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="setup">
2013-08-07 23:54:17 +02:00
<!-- Pull localizations -->
<echo message="Pulling localizations..." />
<exec dir="${lang.dir}" executable="git" osfamily="windows" failonerror="true">
<arg line="pull" />
</exec>
2013-08-07 23:54:17 +02:00
<echo message="Unpacking Forge..." />
2012-12-21 15:51:38 +01:00
<unzip dest="${build.dir}">
2012-09-02 19:36:44 +02:00
<fileset dir="${resource.dir}">
2012-11-20 22:30:28 +01:00
<include name="minecraftforge-src-${mc.version}-${forge.version}.zip"/>
2012-09-02 19:36:44 +02:00
</fileset>
</unzip>
2012-12-21 15:51:38 +01:00
2012-09-02 19:36:44 +02:00
<chmod file="${forge.dir}/install.sh" perm="+x"/>
2012-12-21 15:51:38 +01:00
2012-09-02 19:36:44 +02:00
<!-- Install forge -->
2013-08-07 23:54:17 +02:00
<echo message="Installing Forge..." />
2012-09-02 19:36:44 +02:00
<exec dir="${forge.dir}" executable="cmd" osfamily="windows">
<arg line="/c install.cmd"/>
</exec>
<exec dir="${forge.dir}" executable="sh" osfamily="unix">
<arg value="install.sh" />
</exec>
2013-08-07 23:54:17 +02:00
<!-- Set build number -->
<buildnumber file="${src.dir}/buildcraft_resources/build.number"/>
2012-09-08 21:46:17 +02:00
2012-09-02 19:36:44 +02:00
<!-- Copy BC source -->
<copy todir="${clientsrc.dir}">
<fileset dir="${src.dir}/common">
<exclude name="**/buildcraft/devel"/>
</fileset>
<filterset>
<filter token="VERSION" value="${bc.version.full}" />
2013-08-07 23:54:17 +02:00
<filter token="BUILD_NUMBER" value="${build.number}" />
2012-09-02 19:36:44 +02:00
</filterset>
</copy>
</target>
<target name="compile" depends="setup">
<!-- Recompile -->
<exec dir="${mcp.dir}" executable="cmd" osfamily="windows">
<arg line="/c recompile.bat"/>
</exec>
<exec dir="${mcp.dir}" executable="sh" osfamily="unix">
<arg value="recompile.sh" />
</exec>
<!-- Reobf -->
<exec dir="${mcp.dir}" executable="cmd" osfamily="windows">
2013-04-13 19:01:56 +02:00
<arg line="/c reobfuscate.bat --srgnames"/>
2012-09-02 19:36:44 +02:00
</exec>
<exec dir="${mcp.dir}" executable="sh" osfamily="unix">
2013-04-13 19:01:56 +02:00
<arg value="reobfuscate.sh --srgnames" />
2012-09-02 19:36:44 +02:00
</exec>
<!-- Copy BC classes -->
<copy todir="${classes.dir}/client">
<fileset dir="${mcp.dir}/reobf/minecraft"/>
</copy>
<!-- Copy resources -->
2012-09-02 19:36:44 +02:00
<copy todir="${classes.dir}/client">
<fileset dir="${src.dir}/buildcraft_resources">
<exclude name="build.xml"/>
2013-08-07 23:54:17 +02:00
<exclude name="build.number"/>
</fileset>
2012-09-02 19:36:44 +02:00
</copy>
<copy todir="${classes.dir}/client" overwrite="true" failonerror="true">
<fileset dir="${src.dir}/buildcraft_resources">
<include name="mcmod.info"/>
</fileset>
2013-08-07 23:54:17 +02:00
<filterset>
<filter token="VERSION" value="${bc.version.full} (${build.number})" />
</filterset>
</copy>
2013-08-07 23:54:17 +02:00
<!-- Copy localizations -->
<copy todir="${classes.dir}/client">
<fileset dir="${lang.dir}">
<exclude name="README.md"/>
2013-08-07 23:54:17 +02:00
</fileset>
</copy>
2012-09-02 19:36:44 +02:00
</target>
<target name="package" depends="compile">
<jar destfile="${jar.dir}/buildcraft-A-${bc.version.full}.jar" basedir="${classes.dir}/client"/>
2013-08-07 23:54:17 +02:00
<copy todir="${jar.dir}/changelog">
<fileset dir="${src.dir}/buildcraft_resources/changelog">
<include name="*" />
</fileset>
</copy>
2012-09-02 19:36:44 +02:00
</target>
<target name="main" depends="clean,package" />
2012-09-02 19:36:44 +02:00
</project>