diff options
Diffstat (limited to 'build.xml')
-rw-r--r-- | build.xml | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..9d581a4 --- /dev/null +++ b/build.xml @@ -0,0 +1,56 @@ +<?xml version="1.0"?> +<project name="Cardbase" default="main" basedir="."> + + <property name="jar.name" value="cardbase" /> + <property name="src.dir" location="src" /> + <property name="build.dir" location="bin" /> + <property name="dist.dir" location="dist" /> + <property name="lib.dir" value="lib" /> + <property name="res.dir" value="res" /> + <property name="main-class" value="eu.equalparts.cardbase.standalone.CardbaseCLI" /> + + <target name="init"> + <mkdir dir="${build.dir}" /> + </target> + + <!-- external libraries classpath, we don't need sources and javadoc --> + <path id="classpath"> + <fileset dir="${basedir}/"> + <include name="${lib.dir}/*.jar" /> + <exclude name="${lib.dir}/*sources.jar"/> + <exclude name="${lib.dir}/*javadoc.jar"/> + </fileset> + </path> + + <!-- To work with external libraries, need classpath to compile --> + <target name="compile" depends="init" description="compile the source"> + <javac includeantruntime="false" srcdir="${src.dir}" destdir="${build.dir}" classpathref="classpath" /> + </target> + + <!-- jar it, and declares the ext libraries in manifest.mf file --> + <target name="jar" depends="compile" description="package, output to JAR"> + + <mkdir dir="${dist.dir}" /> + + <jar jarfile="${dist.dir}/${jar.name}.jar" basedir="${build.dir}"> + + <zipgroupfileset dir="${lib.dir}" includes="*.jar" excludes="*sources.jar, *javadoc.jar" /> + <fileset dir="${res.dir}" includes="**" excludes="" /> + + <manifest> + <attribute name="Main-Class" value="${main-class}" /> + <attribute name="Class-Path" value="${classpath.name}" /> + </manifest> + </jar> + </target> + + <!-- Clean up temporary directories --> + <target name="clean" description="clean up"> + <delete dir="${build.dir}" /> + <delete dir="${dist.dir}" /> + </target> + + <!-- Default, run this --> + <target name="main" depends="clean, compile, jar" /> + +</project>
\ No newline at end of file |