-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
136 lines (115 loc) · 4.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?xml version="1.0" encoding="UTF-8"?>
<project name="gitconfig4j" default="build" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<description>GIT like configuration management, Juan Timoteo Ponce Ortiz.</description>
<property file="build.properties" />
<path id="compile.classpath">
<fileset dir="${lib.dir}" includes="*.jar" />
</path>
<path id="src.path">
<pathelement location="${project.src}" />
</path>
<path id="run.classpath">
<path refid="compile.classpath" />
<path location="${project.build}" />
<path location="${project.config}" />
<path location="${project.resources}" />
</path>
<path id="test.classpath">
<path refid="run.classpath" />
</path>
<target name="init">
<mkdir dir="${project.config}" />
<mkdir dir="${project.resources}" />
<mkdir dir="${project.src}" />
<mkdir dir="${project.test}" />
<mkdir dir="${lib.dir}" />
</target>
<target name="prepare" depends="init,resolve">
<mkdir dir="${project.build}" />
</target>
<target name="resolve" description="--> retreive dependencies with ivy">
<ivy:retrieve />
</target>
<target name="build" depends="compile,test" description="Build the project incrementally.">
</target>
<target name="clean">
<delete dir="${project.build}" />
</target>
<target name="compile" depends="prepare" description="Compile the sources (checked in and generated)">
<copy todir="${project.build}">
<fileset dir="${project.src}">
<include name="**/*.properties" />
</fileset>
<fileset dir="${project.config}">
<include name="*.properties" />
<include name="*.xml" />
</fileset>
</copy>
<javac encoding="iso-8859-1" destdir="${project.build}" classpathref="compile.classpath" includes="**/*.java" debug="true">
<src path="${project.src}" />
</javac>
</target>
<target name="compile-test" depends="compile">
<javac encoding="iso-8859-1" destdir="${project.build}" classpathref="test.classpath" includes="**/*.java" debug="true">
<src path="${project.test}" />
</javac>
</target>
<target name="jar" depends="build" description="Build a distribution jar file">
<delete dir="${project.build.dist}" />
<mkdir dir="${project.build.dist}" />
<copy todir="${project.build.dist}/config">
<fileset dir="${project.config}" includes="*" />
</copy>
<copy todir="${project.build.dist}/resources">
<fileset dir="${project.resources}" includes="**/*" />
</copy>
<jar destfile="${project.build.dist}/${dist.jar.name}" basedir="${project.build.dist}" excludes="**">
<manifest>
<attribute name="Built-By" value="${application.author}" />
<section name="common">
<attribute name="Specification-Title" value="${application.name}" />
<attribute name="Specification-Version" value="${application.release}" />
<attribute name="Specification-Vendor" value="${application.author}" />
<attribute name="Implementation-Title" value="${application.name}" />
<attribute name="Implementation-Version" value="${application.release}" />
</section>
<attribute name="Main-Class" value="${main.class}" />
</manifest>
<fileset dir="${project.build}">
<include name="**" />
<exclude name="**/*Test.class" />
<exclude name="*.*" />
<exclude name="dist/" />
<exclude name="report/" />
</fileset>
</jar>
</target>
<target name="dist" depends="jar">
<delete dir="${project.dist}" />
<mkdir dir="${project.dist}" />
<zip destfile="${project.dist}/${release.name}">
<zipfileset dir="${project.build.dist}"/>
</zip>
</target>
<target name="test" depends="compile-test">
<property name="junit.dest" value="${project.build.report}/junit" />
<mkdir dir="${junit.dest}" />
<junit fork="yes" forkmode="once" printsummary="yes" haltonfailure="yes">
<jvmarg value="-Dcurrent.env=test" />
<classpath>
<path refid="test.classpath" />
</classpath>
<formatter type="plain" usefile="false" />
<formatter type="xml" />
<batchtest todir="${junit.dest}">
<fileset dir="${project.test}">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
<junitreport todir="${junit.dest}">
<fileset dir="${junit.dest}" includes="TEST-*.xml" />
<report format="frames" todir="${junit.dest}" />
</junitreport>
</target>
</project>