Last active
August 29, 2015 14:27
-
-
Save bertrandmartel/f0870d6ecbbd1b06f8a4 to your computer and use it in GitHub Desktop.
[ ANT ] compile & archive with source attachment projects with source (/src) and libraries (/libs)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<project default="build" name="compile-archive"> | |
<property name="project-name" value="your-project-name"/> | |
<property name="version" value="1.0" /> | |
<path id="master-classpath"> | |
<fileset dir="${basedir}/libs"> | |
<include name="*.jar"/> | |
</fileset> | |
</path> | |
<target name="compile" description="Compile source"> | |
<mkdir dir="bin" /> | |
<javac srcdir="src" includes="**" destdir="bin" > | |
<classpath refid="master-classpath"/> | |
</javac> | |
<copy todir="bin"> | |
<fileset dir="src" /> | |
</copy> | |
</target> | |
<target name="build" depends="compile"> | |
<jar destfile="${basedir}/release/${project-name}-${version}.jar"> | |
<fileset dir="${basedir}/bin" /> | |
<zipgroupfileset dir="${basedir}/libs" includes="**/*.jar" /> | |
<manifest> | |
<attribute name="Main-Class" value="fr.your.path.to.main.class.if.necessay"/> | |
</manifest> | |
</jar> | |
</target> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment