Skip to content

Instantly share code, notes, and snippets.

@vegaasen
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save vegaasen/3286165c9b2313f8af01 to your computer and use it in GitHub Desktop.

Select an option

Save vegaasen/3286165c9b2313f8af01 to your computer and use it in GitHub Desktop.
<?xml version="1.0"?>
<project name="validate-cli" default="install">
<property file="../parent-build.properties"/>
<property file="build.properties"/>
<property name="src.dir" location="src/main/java"/>
<property name="build.dir" location="target"/>
<property name="build.lib.dir" location="${build.dir}/lib"/>
<property name="test.report.dir" location="${build.dir}/report"/>
<path id="src.classpath">
<fileset dir="${lib.dir}/required">
<include name="**/*.jar"/>
</fileset>
<file file="${jar.validate-lib}"/>
</path>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="create-folders">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.lib.dir}"/>
</target>
<target name="compile" depends="clean, create-folders">
<javac source="${java.jdk.version}" target="${java.jdk.version}" debug="${build.debug}" srcdir="${src.dir}"
destdir="${build.dir}" encoding="${encoding.default}" includeantruntime="${ant.includeantruntime}">
<classpath>
<path refid="src.classpath"/>
</classpath>
</javac>
<copy todir="${build.lib.dir}" flatten="true">
<path refid="src.classpath"/>
</copy>
<pathconvert property="mf.classpath" pathsep=" ">
<path refid="src.classpath" />
<flattenmapper />
</pathconvert>
<tstamp/>
<manifest file="MANIFEST.MF">
<attribute name="Code-Url" value="${application.url}"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-Date" value="${TODAY}"/>
<attribute name="Built-Version" value="${application.version}"/>
<attribute name="Main-Class" value="no.difi.vefa.cli.App"/>
<attribute name="Class-Path" value="${mf.classpath}" />
</manifest>
<jar destfile="${build.dir}/${out.jar}" basedir="${build.dir}" includes="**/*.*" manifest="MANIFEST.MF"/>
</target>
<target name="install" depends="compile">
<description>Install the build</description>
</target>
</project>
@vegaasen
Copy link
Author

vegaasen commented Feb 2, 2015

Important! The libaries must be prefixed with the correct folder :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment