-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
125 lines (108 loc) · 3.26 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
<project name="xml.entity" default="build" xmlns:ivy="antlib:org.apache.ivy.ant">
<property file="project.properties"/>
<target name="clean">
<delete dir="${tmp.dir}"/>
<mkdir dir="${tmp.dir}"/>
</target>
<target name="retrieve">
<ivy:retrieve
pattern="${lib.dir}/[conf]/[organisation]/[module]-[revision]-[type].[ext]"
sync="true"
/>
<path id="core.lib.path.id">
<fileset dir="${lib.dir}/compile" includes="**/*.jar"/>
</path>
<path id="test.lib.path.id">
<fileset dir="${lib.dir}/test" includes="**/*.jar"/>
</path>
</target>
<target name="compile" depends="clean, retrieve">
<mkdir dir="${src.bin.dir}"/>
<javac
srcdir="${src.dir}"
destdir="${src.bin.dir}"
classpathref="core.lib.path.id"
includeantruntime="false"
target="1.6"
source="1.6"
/>
<path id="bin.source.path.id" path="${src.bin.dir}">
</path>
<mkdir dir="${test.bin.dir}"/>
<javac
srcdir="${test.dir}"
destdir="${test.bin.dir}"
includeantruntime="false"
target="1.6"
source="1.6">
<classpath refid="bin.source.path.id"/>
<classpath refid="test.lib.path.id"/>
</javac>
</target>
<path id="junit.test.path.id">
<path path="${src.bin.dir}"/>
<path path="${test.bin.dir}"/>
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="test" depends="compile">
<junit>
<classpath refid="junit.test.path.id">
</classpath>
<formatter type="xml" />
<test name="xml.entity.AllTests" outfile="${tmp.dir}/results">
</test>
</junit>
</target>
<target name="-define-additional-jar-files">
<fileset dir="${basedir}" id="additional.jar.files">
<include name="LICENSE.txt" />
<include name="README.md" />
</fileset>
</target>
<target name="build-jar" depends="test,-define-additional-jar-files">
<mkdir dir="${artifacts.dir}"/>
<jar destfile="${artifacts.dir}/xml.entity-${version}-jar.jar">
<fileset dir="${src.bin.dir}"/>
<fileset refid="additional.jar.files"/>
<manifest>
<attribute name="version" value="${version}"/>
</manifest>
</jar>
</target>
<target name="build-javadoc-jar" depends="retrieve,-define-additional-jar-files">
<mkdir dir="${artifacts.dir}"/>
<property name="javadoc.dir" value="${tmp.dir}/javadoc"/>
<mkdir dir="${javadoc.dir}"/>
<javadoc sourcepath="${src.dir}" destdir="${javadoc.dir}" classpathref="core.lib.path.id"/>
<jar destfile="${artifacts.dir}/xml.entity-${version}-javadoc.jar">
<fileset dir="${javadoc.dir}">
</fileset>
<fileset refid="additional.jar.files"/>
<manifest>
<attribute name="version" value="${version}"/>
</manifest>
</jar>
</target>
<target name="build-source-jar" depends="-define-additional-jar-files">
<mkdir dir="${artifacts.dir}" />
<jar destfile="${artifacts.dir}/xml.entity-${version}-source.jar">
<fileset dir="${src.dir}">
</fileset>
<fileset refid="additional.jar.files"/>
<manifest>
<attribute name="version" value="${version}" />
</manifest>
</jar>
</target>
<target name="build" depends="build-jar,build-javadoc-jar,build-source-jar" />
<target name="publish" depends="build">
<ivy:publish
resolver="local"
pubrevision="${version}"
overwrite="true"
artifactspattern="${artifacts.dir}/[module]-[revision]-[type].[ext]"
/>
</target>
</project>