-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
144 lines (128 loc) · 4.68 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
137
138
139
140
141
142
143
144
<?xml version="1.0" encoding="UTF-8"?>
<project name="Augeas Java Bindings" default="build" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<property file="build.properties"/>
<property name="jar" value="augeas-${version}"/>
<property name="jar.file" value="target/${jar}.jar"/>
<property name="src" value="java-augeas-${version}"/>
<property name="src.file" value="target/${src}.tar.gz"/>
<property name="spec" value="java-augeas.spec"/>
<property name="spec.file" value="target/${spec}"/>
<path id="compile.classpath">
<fileset dir="/usr/share/java">
<include name="jna.jar"/>
</fileset>
</path>
<path id="test.classpath">
<fileset dir="/usr/share/java">
<include name="jna.jar"/>
<include name="junit.jar"/>
<include name="junit4.jar"/>
</fileset>
<pathelement location="target/classes"/>
</path>
<target name="init">
<mkdir dir="target/classes"/>
<mkdir dir="target/testclasses"/>
<copy file="README.in"
tofile="README"
overwrite="true"
filtering="true">
<filterset filtersfile="build.properties"/>
</copy>
</target>
<target name="clean" description="cleans up all created artifacts">
<delete dir="target"/>
</target>
<target name="build" depends="init" description="builds the code and jar files">
<javac srcdir="src/main/java"
includes="**/*.java"
classpathref="compile.classpath"
destdir="target/classes"/>
<javac srcdir="src/test/java"
includes="**/*.java"
classpathref="test.classpath"
destdir="target/testclasses"/>
<jar destfile="${jar.file}"
basedir="target/classes"/>
</target>
<target name="test" depends="build">
<mkdir dir="target/tests"/>
<junit printsummary="yes" haltonfailure="yes" >
<classpath>
<fileset dir="/usr/share/java">
<include name="jna.jar"/>
<include name="junit.jar"/>
<include name="junit4.jar"/>
</fileset>
<pathelement location="target/classes"/>
<pathelement location="target/testclasses"/>
</classpath>
<formatter type="plain"/>
<batchtest fork="yes" todir="target/tests">
<fileset dir="src/test/java">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="docs" depends="build" description="builds the javadoc">
<mkdir dir="target/javadoc"/>
<javadoc sourcepath="src/main/java"
classpathref="compile.classpath"
destdir="target/javadoc"/>
</target>
<target name="src" depends="init" description="creates a src tarball">
<mkdir dir="target/java-augeas-${version}"/>
<copy todir="target/java-augeas-${version}">
<fileset dir="." excludes="target/**,.gitignore,.git/**,.*,.*/**"/>
</copy>
<tar basedir="target"
includes="java-augeas-${version}/**"
compression="gzip"
destfile="${src.file}"/>
</target>
<target name="spec" depends="init" description="generates the spec file">
<copy file="java-augeas.spec.in"
tofile="${spec.file}"
overwrite="true"
filtering="true">
<filterset filtersfile="build.properties"/>
</copy>
</target>
<target name="package" depends="src,build,docs,spec" description="builds the rpms">
<copy file="${src.file}" todir="${rpm.topdir}/SOURCES"/>
<copy file="${spec.file}" todir="${rpm.topdir}/SPECS"/>
<rpm specfile="${spec}"
command="-ba"
topdir="${rpm.topdir}"/>
</target>
<target name="maven" depends="build">
<mkdir dir="target/repo"/>
<get src="http://apache.multihomed.net/maven/binaries/maven-ant-tasks-2.0.10.jar"
dest="target/maven-ant-tasks-2.0.10.jar"/>
<copy file="pom.xml.in"
tofile="target/pom.xml"
overwrite="true"
filtering="true">
<filterset filtersfile="build.properties"/>
</copy>
<path id="maven-ant-tasks.classpath" path="target/maven-ant-tasks-2.0.10.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant"
classpathref="maven-ant-tasks.classpath" />
<artifact:pom id="mypom" file="target/pom.xml" />
<artifact:install file="${jar.file}">
<localRepository path="target/repo"/>
<pom refid="mypom"/>
</artifact:install>
<checksum algorithm="md5">
<fileset dir="target/repo">
</fileset>
</checksum>
<checksum algorithm="sha1">
<fileset dir="target/repo">
<exclude name="**/*.md5"/>
</fileset>
</checksum>
</target>
</project>