-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
77 lines (69 loc) · 2.98 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?xml version="1.0"?>
<project name="aracne" default="main" basedir=".">
<!-- Reads Git revision information. -->
<available file=".git" type="dir" property="git.present"/>
<target name="git.revision" description="Store git revision in ${repository.version}" if="git.present">
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false" errorproperty="">
<arg value="describe"/>
<arg value="--tags"/>
<arg value="--always"/>
<arg value="HEAD"/>
</exec>
<condition property="repository.version" value="${git.revision}" else="unknown">
<and>
<isset property="git.revision"/>
<length string="${git.revision}" trim="yes" length="0" when="greater"/>
</and>
</condition>
</target>
<!-- Sets variables which can later be used. -->
<property name="src.dir" location="aracne" />
<property name="common.dir" location="common" />
<property name="lib.dir" location="lib" />
<property name="build.dir" location="bin" />
<property name="dist.dir" location="dist" />
<!-- Deletes the existing build and dist directories. -->
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
</target>
<!-- Creates the build and dist directories. -->
<target name="makedir">
<mkdir dir="${build.dir}" />
<mkdir dir="${dist.dir}" />
</target>
<!-- Compiles the java code. -->
<target name="compile" depends="clean, makedir">
<javac srcdir="${common.dir}" destdir="${build.dir}" includeantruntime="false">
<compilerarg value="-Xlint:deprecation"/>
<compilerarg value="-Xlint:unchecked"/>
<classpath>
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>
<javac srcdir="${src.dir}" destdir="${build.dir}" includeantruntime="false">
<compilerarg value="-Xlint:deprecation"/>
<compilerarg value="-Xlint:unchecked"/>
<classpath>
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>
</target>
<!-- Creates the deployable jar file. -->
<target name="jar" depends="compile, git.revision">
<jar destfile="${dist.dir}\aracne.jar" basedir="${build.dir}">
<manifest>
<attribute name="Main-Class" value="aracne.Aracne" />
<attribute name="Implementation-Version" value="${git.revision}" />
</manifest>
<zipgroupfileset dir="${lib.dir}" includes="**/*.jar"/>
</jar>
</target>
<target name="main" depends="compile, jar">
<description>Build and deploy ARACNe</description>
</target>
</project>