-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.xml
65 lines (57 loc) · 2.2 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="jar" name="MafScaling">
<property name="src.dir" value="src"/>
<property name="lib.dir" value="lib"/>
<property name="bin.dir" value="bin"/>
<property name="jar.file" value="${ant.project.name}.jar"/>
<path id="lib.path">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<target name="clean">
<delete dir="${bin.dir}"/>
</target>
<target name="init" depends="clean">
<mkdir dir="${bin.dir}"/>
<copy file="log4j.properties" todir="${bin.dir}"/>
<copy file="LICENSE" todir="${bin.dir}"/>
<copy includeemptydirs="false" todir="${bin.dir}">
<fileset dir="${src.dir}">
<exclude name="**/*.java"/>
</fileset>
</copy>
<copy includeemptydirs="false" todir="${bin.dir}">
<fileset dir="resources">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="compile" depends="init">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac destdir="${bin.dir}" includeantruntime="false">
<src path="${src.dir}"/>
<src path="resources"/>
<classpath refid="lib.path"/>
</javac>
</target>
<target name="jar" depends="compile">
<mkdir dir="${bin.dir}/${lib.dir}"/>
<copy todir="${bin.dir}/${lib.dir}" flatten="true">
<path refid="lib.path"/>
</copy>
<manifestclasspath property="manifest.classpath" jarfile="${jar.file}">
<classpath refid="lib.path"/>
</manifestclasspath>
<jar destfile="${jar.file}" basedir="${bin.dir}">
<manifest>
<attribute name="Manifest-Version" value="1.0"/>
<attribute name="Class-Path" value="${manifest.classpath}"/>
<attribute name="Main-Class" value="com.vgi.mafscaling.${ant.project.name}"/>
</manifest>
</jar>
</target>
<target name="run" depends="jar">
<java jar="${jar.file}" failonerror="true" fork="yes"/>
</target>
</project>