File: build.xml

package info (click to toggle)
libjaudiotagger-java 2.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 5,368 kB
  • ctags: 8,676
  • sloc: java: 62,686; xml: 422; sh: 12; makefile: 12
file content (311 lines) | stat: -rw-r--r-- 10,219 bytes parent folder | download | duplicates (3)
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="jaudiotagger" default="dist" basedir=".">
  
  	<!--property file, values in this file are used first -->
  	<property file="./build.properties"/>
  	
  	<!-- Compiler options -->
	<property name="compiler.debug" value="on"/>
	<property name="compiler.generate.no.warnings" value="off"/>
	<property name="compiler.args" value=""/>
	<property name="compiler.max.memory" value="128m"/>
	<property name="compiler.verbose" value="true"/>
	
	<!-- Ignore these always -->
	<patternset id="ignored.files">
	<exclude name="**/CVS/**"/>
	<exclude name="**/SCCS/**"/>
	<exclude name="**/RCS/**"/>
	<exclude name="**/rcs/**"/>
	<exclude name="**/.DS_Store/**"/>
	<exclude name="**/.svn/**"/>
	</patternset>
	
	<!-- Any non java files that we need to deploy -->
	<patternset id="compiler.resources">
	<include name="**/?*.properties"/>
	<include name="**/?*.xml"/>
	<include name="**/?*.html"/>
	<include name="**/?*.dtd"/>
	<include name="**/?*.tld"/>
	<include name="**/?*.gif"/>
	<include name="**/?*.png"/>
	<include name="**/?*.jpeg"/>
	<include name="**/?*.jpg"/>
	</patternset>
	

	<!-- Have been using this version of java for compilation,could use to force javac compilation -->
		
	<!-- Output dirs -->
	<property name="output.dir"         value="classes"/>
	<property name="instrumented.dir"  value="instrumentedclasses"/>
	<property name="testoutput.dir"     value="testclasses"/>
	<property name="dist.dir"           value="dist"/>
	<property name="web.dir"            value="www"/>
	<property name="userjavadoc.dir"    value="www/javadoc"/>
	<property name="devjavadoc.dir"     value="www/devjavadoc"/>	
	<property name="lib.dir"            value="lib"/>
	
	<property name="jar.file"    value="${dist.dir}/jaudiotagger.jar"/>
	<property name="jarsrc.file" value="${dist.dir}/jaudiotaggersrc.jar"/>
	
	<property name="junit.file"       value="${lib.dir}/junit.jar"/>
	<property name="junitreport.dir"  value="junitreport"/>
	<property name="coveragereport.dir"  value="coveragereport"/>
	<property name="junitreport.testdata.dir"     value="testdata"/>
	<property name="junitreport.testdatatmp.dir"  value="testdatatmp"/>
	
	<property name="src.dir"         value="src"/>
	<property name="srctest.dir"     value="srctest"/>
	
	<property name="zip.file"                  value="jaudiotagger.zip"/>
	<property name="release.zipprefix.file"    value="jaudiotagger${build.release}"/>	
	<property name="release.file"              value="${release.zipprefix.file}.zip"/>
	
	<!-- Paths to be included in compilation bootclasspath -->	
	<path id="bootclasspath">
	</path>
	
	<!-- Additional classpath required in compilation  -->		
	<path id="classpath">		
	</path>	
	
	<!-- Ignore these in all compilations -->
	<patternset id="excluded.from.compilation">
		<patternset refid="ignored.files"/>
	</patternset>	
	
	<!-- src directory relative to base -->
	<path id="sourcepath">
		<dirset dir="${basedir}">
 			<include name="src"/>			
		</dirset>
	</path>
	
	<!-- Additional classpath required in compilation  -->		
	<path id="testclasspath">	
		<dirset dir="${output.dir}">			
		</dirset>		
		<pathelement location="${junit.file}"/>		
	</path>	
	
	<!-- Additional classpath required in compilation  -->		
	<path id="runtestclasspath">	
		<dirset dir="${testoutput.dir}">			
		</dirset>
		<dirset dir="${output.dir}">			
		</dirset>			
	</path>	
	
	<!-- src directory relative to base -->
	<path id="testsourcepath">
		<dirset dir="${basedir}">
 			<include name="srctest"/>			
		</dirset>
	</path>
	
	<property name="cobertura.dir" value="../cobertura" />
	<path id="cobertura.classpath">
	    <fileset dir="${cobertura.dir}">
	        <include name="*.jar" />	        
	    </fileset>
	</path>

<taskdef classpathref="cobertura.classpath" resource="tasks.properties" />

	<!-- Clean -->
	<target name="clean" description="Cleanup module">
		<delete dir="${output.dir}"/>
		<delete dir="${testoutput.dir}"/>
		<delete dir="${junitreport.testdatatmp.dir}"/>
		<delete dir="${junitreport.dir}"/>
	</target>
	
	<target name="share" depends="dist" description="Copy the distribution to be used by another project">
		<echo message="Copying to share dir" />
		<copy file="${jar.file}" todir="${release.dir}"/>	
		<copy file="${jarsrc.file}" todir="${release.dir}"/>	 	 
	</target>
	
	<target name="build.release" depends="build.zip" description="Build new official release of the JAudiotagger Project">
	  <zip destfile="../${release.file}">    
	       <zipfileset src="../${zip.file}"  prefix="${release.zipprefix.file}"/>  
	  </zip>		
	</target>
	
	<target name="build.zip" description="Create simple zipfile of the JAudiotagger Project">	  
		<zip destfile="../${zip.file}">
    <zipfileset dir="${basedir}" excludes="${junitreport.testdata.dir}/**,releases/**,${output.dir}/**,${testoutput.dir}/**,${junitreport.testdatatmp.dir}/**,${junitreport.dir}/**"/>    
  </zip>
	</target>	
	
	


	  
	<target name="dist" depends="build.jar,build.jarsrc" description="Create distribution for use in another project"/>
		

	<target name="build.jar" depends="compile" description="Jar up the compiled production code jaudiotagger">
		<echo message="Creating jaudiotagger.jar" />
		<mkdir dir="${dist.dir}"/>
		<jar jarfile="${jar.file}" update="false" basedir="${output.dir}">
			<manifest>
				<attribute name="Version" value="${build.release}" />
			</manifest>
		</jar>      	  
	</target>

	<target name="build.jarsrc" depends="compile" description="Jar up the jaudiotagger source code">
		<echo message="Creating jaudiotaggersrc.jar" />
		<jar jarfile="${jarsrc.file}" update="false" basedir="${basedir}/src" includes="org/jaudiotagger/**/*.java">
			<manifest>
				<attribute name="Version" value="${build.release}" />
			</manifest>
		</jar>
	</target>
	
	<target name="compile" depends="compile.production,compile.tests,run.tests" description="Compile all jaudiotagger code"/>

	<target name="compile.production" description="Compile production classes">
	  
		<!-- Recreate destination dir if missing -->
		<mkdir dir="${output.dir}"/>
		
		<!-- Compile the source to be as 1.5-->
		<javac destdir="${output.dir}"
			verbose="${compiler.verbose}"
			debug="${compiler.debug}"
			nowarn="${compiler.generate.no.warnings}"
			memoryMaximumSize="${compiler.max.memory}"
			source="1.5"
			encoding="UTF-8"
			fork="true">
			<compilerarg line="${compiler.args}"/>
			<bootclasspath refid="bootclasspath"/>
			<classpath refid="classpath"/>			
			<src refid="sourcepath"/>
		</javac>
	
		<!-- Copy over any non java resources -->
		<copy todir="${output.dir}">
			<fileset dir="${src.dir}">
			<patternset refid="compiler.resources"/>
			<type type="file"/>
			</fileset>
		</copy>
		
		<!--Delete old file -->
		<delete file="cobertura.ser" />
		
		<!--Instrument the classes for code coverage -->
		<cobertura-instrument todir="${instrumented.dir}">
	    <ignore regex="org.apache.log4j.*" />
	    <fileset dir="${output.dir}">
	        <include name="**/*.class" />	        
	    </fileset>	    
    </cobertura-instrument>
		
		
	</target>
	
	

 

	<!-- Junit tests:for when we write some !-->
	<target name="compile.tests" depends="compile.production" description="Compile test classes" unless="skip.tests">
	
	
		<!-- Recreate destination dir if missing -->
		<mkdir dir="${testoutput.dir}"/>
		
		<!-- Compile the source as 1.5 -->
		<javac destdir="${testoutput.dir}"
			verbose="${compiler.verbose}"
			debug="${compiler.debug}"
			nowarn="${compiler.generate.no.warnings}"
			memoryMaximumSize="${compiler.max.memory}"
			source="1.5"
			encoding="UTF-8"
			fork="true">
			<compilerarg line="${compiler.args}"/>
			<bootclasspath refid="bootclasspath"/>
			<classpath refid="testclasspath"/>
			<src refid="testsourcepath"/>
		</javac>
	
		<!-- Copy over any non java resources -->
		<copy todir="${testoutput.dir}">
			<fileset dir="${srctest.dir}">
			<patternset refid="compiler.resources"/>
			<type type="file"/>
			</fileset>
		</copy>
	</target>
	
	<target name="run.tests" depends="compile.tests" description="Run test cases" unless="skip.tests">
		<mkdir dir="${junitreport.dir}"/>
		<mkdir dir="${junitreport.testdatatmp.dir}"/>
		<!-- forkmode="once" -->
		<junit fork="yes" printsummary="true" showoutput="true">		
			<classpath location="${instrumented.dir}" />	
			<classpath refid="runtestclasspath"/>		
			<classpath refid="cobertura.classpath" />
			<batchtest  todir="${junitreport.dir}">
				<formatter type="xml"/>				
    				<fileset dir="${testoutput.dir}">
    					<include name="**/*Test.class"/>      			
    				</fileset>
  			</batchtest>
		</junit>
		
		<junitreport todir="${junitreport.dir}">
  			<fileset dir="${junitreport.dir}">
    				<include name="TEST-*.xml"/>
			</fileset>
  			<report format="frames" todir="${junitreport.dir}"/>
		</junitreport>
		
		<cobertura-report format="html" destdir="${coveragereport.dir}" srcdir="${src.dir}" />
	</target>
	

	
	<!-- Build User Javadoc, public only -->
	<target name="build.user.javadoc" description="Build Java User API Documentation, only public members are shown">  
		<javadoc 
		WindowTitle="Jaudiotagger User API ${build.release}"
		Public="true"
		packagenames="org.jaudiotagger.*"
		maxmemory="128m" 
		classpath="${classpath}" 		
		sourcepath="${basedir}/src" 
		destdir="${userjavadoc.dir}" 
		use="true" 	 
		Version="true">
		<doctitle><![CDATA[<h1>Jaudiotagger User API ${build.release}</h1>]]></doctitle>
		</javadoc>	
	</target>
	
	<!-- Build complete Javadoc -->
	<target name="build.dev.javadoc" description="Build Java Dev API Documentation, includes private package and protected members">  
		<javadoc 
		WindowTitle="Jaudiotagger Developer API ${build.release}"
		Private="true"
		packagenames="org.jaudiotagger.*"
		maxmemory="128m" 
		classpath="${classpath}" 		
		sourcepath="${basedir}/src" 
		destdir="${devjavadoc.dir}" 
		use="true" 	 
		Version="true">
		<doctitle><![CDATA[<h1>Jaudiotagger Developer API ${build.release}</h1>]]></doctitle>
		</javadoc>	
	</target>
	
	<!-- Build all Javadoc -->
	<target name="build.javadoc" depends="build.user.javadoc,build.dev.javadoc" description="Build user and Developer javaDoc">
	</target>
</project>