-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
75 lines (64 loc) · 2.32 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Project MedianFilter SPM_2015
Author: Antonio Mallia (423458)
-->
<project name="MedianFilter" default="jar" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<!-- Propery set-->
<property name="src-dir" value="src" />
<property name="lib-dir" value="lib" />
<property name="bin-dir" value="bin" />
<property name="dist-dir" value="dist" />
<property name="doc-dir" value="doc" />
<property name="target" value="1.8" />
<property name="source" value="1.8" />
<property name="debuglevel" value="source,lines,vars" />
<property name="main-class" value="it.antoniomallia.spm.test.TestExec" />
<!-- Compile Classpath -->
<path id="compile.classpath">
<fileset dir="${lib-dir}">
<include name="*.jar" />
</fileset>
</path>
<!-- Clean project-->
<target name="clean" description="Delete bin folder">
<delete dir="${bin-dir}" />
<delete dir="${dist-dir}" />
<ivy:cleancache/>
</target>
<target name="bootstrap" description="Install ivy">
<mkdir dir="${user.home}/.ant/lib"/>
<get dest="${user.home}/.ant/lib/ivy.jar" src="https://repo1.maven.org/maven2/org/apache/ivy/ivy/2.4.0/ivy-2.4.0.jar"/>
</target>
<!-- Init Project-->
<target name="init" depends="bootstrap" >
<ivy:resolve/>
<ivy:retrieve />
<mkdir dir="${bin-dir}" />
<mkdir dir="${dist-dir}" />
<copy file="${src-dir}/log4j2.xml" tofile="${bin-dir}/log4j2.xml"/>
</target>
<!-- Build Project with javac 1.8-->
<target name="build" depends="init" description="Build the project">
<javac debug="true" debuglevel="${debuglevel}" destdir="${bin-dir}" includeantruntime="false" source="${source}" target="${target}">
<src path="${src-dir}" />
<classpath refid="compile.classpath" />
</javac>
</target>
<!-- Pack the project in a Jar-->
<target name="jar" description="Pack in a Jar" depends="build">
<jar destfile="${dist-dir}/${ant.project.name}.jar">
<fileset dir="${bin-dir}" />
<zipgroupfileset dir="${lib-dir}" />
<manifest>
<attribute name="Main-Class" value="${main-class}" />
</manifest>
</jar>
</target>
<!-- JavaDoc-->
<target name="javadoc" description="Generate Javadoc">
<javadoc destdir="${doc-dir}" sourcepath="${src-dir}" author="true" use="true">
<classpath refid="compile.classpath" />
</javadoc>
</target>
</project>