Skip to content
Snippets Groups Projects
build.xml 2.56 KiB
<?xml version="1.0" encoding="UTF-8"?>
<project name="L2J_DataPack_BETA" default="build" basedir=".">
	<description>
		Copyright (C) 2004-2014 L2J DataPack
		
		This file is part of L2J DataPack.
		
		L2J DataPack is free software: you can redistribute it and/or modify
		it under the terms of the GNU General Public License as published by
		the Free Software Foundation, either version 3 of the License, or
		(at your option) any later version.
		
		L2J DataPack is distributed in the hope that it will be useful,
		but WITHOUT ANY WARRANTY; without even the implied warranty of
		MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
		General Public License for more details.
		
		You should have received a copy of the GNU General Public License
		along with this program. If not, see "http://www.gnu.org/licenses/".
	</description>

	<property name="build" location="build" />
	<property name="build.dist" location="${build}/dist" />
	<property name="build.dist.doc" location="${build.dist}/doc" />
	<property name="build.dist.game" location="${build.dist}/game" />
	<property name="build.dist.login" location="${build.dist}/login" />

	<target name="init" depends="checkRequirements,getDateAndVersion" description="Create the output directories.">
		<mkdir dir="${build}" />
	</target>

	<target name="dist" depends="init" description="Export the files to the output directory.">
		<sync todir="${build.dist}" includeemptydirs="true">
			<fileset dir="dist" />
		</sync>
		<concat destfile="${build.dist.game}/config/l2jdp-version.properties">version=${l2j.version}${line.separator}builddate=${build.tstamp}</concat>
	</target>

	<target name="build" depends="dist">
		<zip destfile="${build}/L2J_DataPack_BETA.zip" basedir="${build.dist}" level="9" />
	</target>

	<target name="checkRequirements" description="Check Requirements.">
		<fail message="Ant 1.8.2 is required. But your version is ${ant.version} and if you are using Eclipse probably is outdated.">
			<condition>
				<not>
					<antversion atleast="1.8.2" />
				</not>
			</condition>
		</fail>
	</target>

	<target name="getDateAndVersion" description="Get Date and Version.">
		<tstamp>
			<format property="build.tstamp" pattern="dd/MM/yyyy HH:mm" />
		</tstamp>
		<exec dir="${basedir}" executable="svnversion" outputproperty="l2j.version">
			<arg value="-c" />
			<redirector>
				<outputfilterchain>
					<tokenfilter>
						<replaceregex pattern="[0-9]+\:" replace="" />
					</tokenfilter>
				</outputfilterchain>
			</redirector>
		</exec>
	</target>
</project>