File plexus-io-build.xml of Package plexus-io (Revision cc8ed3d57b8b6ef1d771fb3ebe88497e)
Currently displaying revision cc8ed3d57b8b6ef1d771fb3ebe88497e , Show latest
xxxxxxxxxx
1
2
3
<project name="plexus-io" default="package" basedir=".">
4
5
<!-- ====================================================================== -->
6
<!-- Build environment properties -->
7
<!-- ====================================================================== -->
8
9
<property file="build.properties"/>
10
11
<property name="project.artifactId" value="plexus-io"/>
12
<property name="project.groupId" value="org.codehaus.plexus"/>
13
<property name="project.version" value="3.2.0"/>
14
15
<property name="compiler.source" value="1.7"/>
16
<property name="compiler.target" value="${compiler.source}"/>
17
18
<property name="build.finalName" value="${project.artifactId}-${project.version}"/>
19
<property name="build.dir" value="target"/>
20
<property name="build.outputDir" value="${build.dir}/classes"/>
21
<property name="build.srcDir" value="src/main/java"/>
22
<property name="build.resourceDir" value="src/main/resources"/>
23
<property name="build.testOutputDir" value="${build.dir}/test-classes"/>
24
<property name="build.testDir" value="src/test/java"/>
25
<property name="build.testResourceDir" value="src/test/resources"/>
26
<property name="test.reports" value="${build.dir}/test-reports"/>
27
<property name="reporting.outputDirectory" value="${build.dir}/site"/>
28
29
<!-- ====================================================================== -->
30
<!-- Defining classpaths -->
31
<!-- ====================================================================== -->
32
33
<path id="build.classpath">
34
<fileset dir="lib">
35
<!-- plexus-utils-3.0.24 commons-io-2.5.jar -->
36
<include name="**/*"/>
37
</fileset>
38
</path>
39
<path id="build.test.classpath">
40
<fileset dir="lib">
41
<!-- plexus-utils-3.0.24 plexus-container-default-1.0-alpha-30
42
plexus-classworlds-1.2-alpha-9.jar jsr305-3.0.2.jar
43
commons-io-2.5.jar -->
44
<include name="**/*"/>
45
</fileset>
46
</path>
47
48
<!-- ====================================================================== -->
49
<!-- Cleaning up target -->
50
<!-- ====================================================================== -->
51
52
<target name="clean" description="Clean the output directory">
53
<delete dir="${build.dir}"/>
54
</target>
55
56
<!-- ====================================================================== -->
57
<!-- Compilation target -->
58
<!-- ====================================================================== -->
59
60
<target name="compile" description="Compile the code">
61
<mkdir dir="${build.outputDir}"/>
62
<javac destdir="${build.outputDir}"
63
nowarn="false"
64
debug="true"
65
optimize="false"
66
deprecation="true"
67
target="${compiler.target}"
68
verbose="false"
69
fork="false"
70
source="${compiler.source}">
71
<src>
72
<pathelement location="${build.srcDir}"/>
73
</src>
74
<classpath refid="build.classpath"/>
75
</javac>
76
<copy todir="${build.outputDir}">
77
<fileset dir="${build.resourceDir}"/>
78
</copy>
79
</target>
80
81
<!-- ====================================================================== -->
82
<!-- Test-compilation target -->
83
<!-- ====================================================================== -->
84
85
<target name="compile-tests"
86
depends="compile"
87
description="Compile the test code"
88
unless="test.skip">
89
<mkdir dir="${build.testOutputDir}"/>
90
<javac destdir="${build.testOutputDir}"
91
nowarn="false"
92
debug="true"
93
optimize="false"
94
deprecation="true"
95
target="${compiler.target}"
96
verbose="false"
97
fork="false"
98
source="${compiler.source}">
99
<src>
100
<pathelement location="${build.testDir}"/>
101
</src>
102
<classpath>
103
<path refid="build.test.classpath"/>
104
<pathelement location="${build.outputDir}"/>
105
</classpath>
106
</javac>
107
<copy todir="${build.testOutputDir}">
108
<fileset dir="${build.testResourceDir}"/>
109
</copy>
110
</target>
111
112
<!-- ====================================================================== -->
113
<!-- Run all tests -->
114
<!-- ====================================================================== -->
115
116
<target name="test"
117
depends="compile-tests, junit-missing"
118
unless="junit.skipped"
119
description="Run the test cases">
120
<mkdir dir="${test.reports}"/>
121
<junit printSummary="yes" haltonerror="true" haltonfailure="true" fork="true" dir=".">
122
<sysproperty key="basedir" value="."/>
123
<formatter type="xml"/>
124
<formatter type="plain" usefile="false"/>
125
<classpath>
126
<path refid="build.test.classpath"/>
127
<pathelement location="${build.outputDir}"/>
128
<pathelement location="${build.testOutputDir}"/>
129
</classpath>
130
<batchtest todir="${test.reports}" unless="test">
131
<fileset dir="${build.testDir}">
132
<include name="**/Test*.java"/>
133
<include name="**/*Test.java"/>
134
<include name="**/*TestCase.java"/>
135
<exclude name="**/*Abstract*Test.java"/>
136
</fileset>
137
</batchtest>
138
<batchtest todir="${test.reports}" if="test">
139
<fileset dir="${build.testDir}">
140
<include name="**/${test}.java"/>
141
<exclude name="**/*Abstract*Test.java"/>
142
</fileset>
143
</batchtest>
144
</junit>
145
</target>
146
147
<target name="test-junit-present">
148
<available classname="junit.framework.Test" property="junit.present" classpathref="build.test.classpath"/>
149
</target>
150
151
<target name="test-junit-status"
152
depends="test-junit-present">
153
<condition property="junit.missing">
154
<and>
155
<isfalse value="${junit.present}"/>
156
<isfalse value="${test.skip}"/>
157
</and>
158
</condition>
159
<condition property="junit.skipped">
160
<or>
161
<isfalse value="${junit.present}"/>
162
<istrue value="${test.skip}"/>
163
</or>
164
</condition>
165
</target>
166
167
<target name="junit-missing"
168
depends="test-junit-status"
169
if="junit.missing">
170
<echo>=================================== WARNING ===================================</echo>
171
<echo> JUnit is not present in the test classpath or your $ANT_HOME/lib directory. Tests not executed.</echo>
172
<echo>===============================================================================</echo>
173
</target>
174
175
<!-- ====================================================================== -->
176
<!-- Javadoc target -->
177
<!-- ====================================================================== -->
178
179
<target name="javadoc" description="Generates the Javadoc of the application">
180
<javadoc sourcepath="${build.srcDir}"
181
packagenames="*"
182
destdir="${reporting.outputDirectory}/apidocs"
183
access="protected"
184
source="${compiler.source}"
185
verbose="false"
186
version="true"
187
use="true"
188
author="true"
189
splitindex="false"
190
nodeprecated="false"
191
nodeprecatedlist="false"
192
notree="false"
193
noindex="false"
194
nohelp="false"
195
nonavbar="false"
196
serialwarn="false"
197
charset="ISO-8859-1"
198
linksource="false"
199
breakiterator="false">
200
<classpath refid="build.classpath"/>
201
</javadoc>
202
</target>
203
204
<!-- ====================================================================== -->
205
<!-- Package target -->
206
<!-- ====================================================================== -->
207
208
<target name="package" depends="compile,test" description="Package the application">
209
<jar jarfile="${build.dir}/${build.finalName}.jar"
210
compress="true"
211
index="false"
212
basedir="${build.outputDir}"
213
excludes="**/package.html">
214
<manifest>
215
<attribute name="JavaPackages-ArtifactId" value="${project.artifactId}"/>
216
<attribute name="JavaPackages-GroupId" value="${project.groupId}"/>
217
<attribute name="JavaPackages-Version" value="${project.version}"/>
218
</manifest>
219
</jar>
220
</target>
221
222
<!-- ====================================================================== -->
223
<!-- A dummy target for the package named after the type it creates -->
224
<!-- ====================================================================== -->
225
226
<target name="jar" depends="package" description="Builds the jar for the application"/>
227
228
</project>
229