build.xml 26.5 KB
Newer Older
1
<!--
ebruneton's avatar
ebruneton committed
2
 ! ASM: a very small and fast Java bytecode manipulation framework
ebruneton's avatar
ebruneton committed
3
 ! Copyright (c) 2000-2005 INRIA, France Telecom
ebruneton's avatar
ebruneton committed
4
 ! All rights reserved.
5
 !
ebruneton's avatar
ebruneton committed
6
7
8
9
10
11
12
13
14
15
16
 ! Redistribution and use in source and binary forms, with or without
 ! modification, are permitted provided that the following conditions
 ! are met:
 ! 1. Redistributions of source code must retain the above copyright
 !    notice, this list of conditions and the following disclaimer.
 ! 2. Redistributions in binary form must reproduce the above copyright
 !    notice, this list of conditions and the following disclaimer in the
 !    documentation and/or other materials provided with the distribution.
 ! 3. Neither the name of the copyright holders nor the names of its
 !    contributors may be used to endorse or promote products derived from
 !    this software without specific prior written permission.
17
 !
ebruneton's avatar
ebruneton committed
18
19
20
21
22
23
24
25
26
27
28
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 ! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 ! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 ! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 ! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 ! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 ! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 ! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 ! THE POSSIBILITY OF SUCH DAMAGE.
29
30
-->

ekuleshov's avatar
ekuleshov committed
31
<project name="ASM" default="compile">
32
33
34
35
36

  <!-- ==================================== -->
  <!-- ======== PROPERTY DEFINITION ======= -->
  <!-- ==================================== -->

37
  <property file="${user.home}/asm-build.properties"/>
38
39
40
  <property file="build.config"/>
  <property file="build.properties"/>

ebruneton's avatar
ebruneton committed
41
42
43
44
45
46
47
48
49
  <property name="src"                value="${basedir}/src"/>
  <property name="test"               value="${basedir}/test"/>
  <property name="doc"                value="${basedir}/doc"/>
  <property name="jdoc"               value="${basedir}/jdoc"/>
  <property name="web"                value="${basedir}/web"/>
  <property name="examples"           value="${basedir}/examples"/>
  <property name="examples.common"    value="${examples}/common"/>
  <property name="config"             value="${basedir}/config"/>
  <property name="archive"            value="${basedir}/archive"/>
ebruneton's avatar
ebruneton committed
50
  
ebruneton's avatar
ebruneton committed
51
52
  <property name="out"                value="${basedir}/output"/>
  <property name="out.build"          value="${out}/build"/>
ebruneton's avatar
ebruneton committed
53
  <property name="out.instr"          value="${out}/instr"/>
ebruneton's avatar
ebruneton committed
54
55
56
57
58
59
60
  <property name="out.dist"           value="${out}/dist"/>
  <property name="out.dist.lib"       value="${out.dist}/lib"/>
  <property name="out.dist.doc"       value="${out.dist}/doc"/>
  <property name="out.dist.jdoc"      value="${out.dist.doc}/javadoc"/>
  <property name="out.dist.examples"  value="${out.dist}/examples"/>
  <property name="out.dist.externals" value="${out.dist}/externals"/>
  <property name="out.test"           value="${out}/test"/>
ebruneton's avatar
ebruneton committed
61
  <property name="out.tmp"            value="${out}/tmp"/>
ebruneton's avatar
ebruneton committed
62
  <property name="out.zip"            value="${out}/zip"/>
ebruneton's avatar
ebruneton committed
63

64
65
66
67
  <target name="properties">
    <condition property="examples.exist">
      <available file="${examples}"/>
    </condition>
ebruneton's avatar
ebruneton committed
68

69
70
71
    <condition property="web.exist">
      <available file="${web}/build.xml"/>
    </condition>
ebruneton's avatar
ebruneton committed
72

73
74
75
76
77
    <condition property="paths.configured">
      <and>
        <isset property="objectweb.ant.tasks.path"/>
      </and>
    </condition>
ebruneton's avatar
ebruneton committed
78
79
80

    <condition property="product.shrink">
      <not><isset property="product.noshrink"/></not>
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
    </condition>

	<condition property="SIGV" value="false" else="true">
      <isset property="nosignatures"/>
    </condition>
	<condition property="SIG" value="-signatures" else="">
      <isset property="nosignatures"/>
    </condition>
	<condition property="ANNV" value="false" else="true">
      <isset property="noannotations"/>
    </condition>
	<condition property="ANN" value="-annotations" else="">
      <isset property="noannotations"/>
    </condition>
	<condition property="FRAMESV" value="false" else="true">
      <isset property="noframes"/>
    </condition>
	<condition property="FRAMES" value="-frames" else="">
      <isset property="noframes"/>
    </condition>
	<condition property="WRITERV" value="false" else="true">
      <isset property="nowriter"/>
    </condition>
	<condition property="WRITER" value="-writer" else="">
      <isset property="nowriter"/>
    </condition>
	<condition property="RESIZEV" value="false" else="true">
      <isset property="noresize"/>
    </condition>
	<condition property="RESIZE" value="-resize" else="">
      <isset property="noresize"/>
ebruneton's avatar
ebruneton committed
112
    </condition>
113
  </target>
ebruneton's avatar
ebruneton committed
114

115
  <!-- ================================== -->
116
  <!-- ========  INITIALIZATION   ======= -->
117
118
  <!-- ================================== -->

119
  <target name="check" unless="paths.configured">
120
    <echo message="The 'build.properties' file must be configured"/>
121
    <fail/>
122
123
  </target>

ebruneton's avatar
ebruneton committed
124
  <target name="init" depends="properties,check">
125

ebruneton's avatar
ebruneton committed
126
    <path id="classpath">
127
128
129
130
      <pathelement location="${out.build}"/>
    </path>

    <path id="cobertura.classpath">
ebruneton's avatar
ebruneton committed
131
       <pathelement path="${cobertura.path}"/> 
132
133
    </path>

ebruneton's avatar
ebruneton committed
134
    <taskdef name="multipleAnt"
ebruneton's avatar
ebruneton committed
135
136
137
             classname="org.objectweb.util.ant.MultipleAnt"
             classpath="${objectweb.ant.tasks.path}"/>

138
    <taskdef name="javadocMultipleLink"
ebruneton's avatar
ebruneton committed
139
140
141
             classname="org.objectweb.util.ant.JavadocMultipleLink"
             classpath="${objectweb.ant.tasks.path}"/>

142
    <taskdef name="multipleCopy"
ebruneton's avatar
ebruneton committed
143
144
             classname="org.objectweb.util.ant.MultipleCopy"
             classpath="${objectweb.ant.tasks.path}"/>
145

146
    <taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
147
148
149
150
151
152
153

    <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant">
      <classpath>
        <pathelement location="test/lib/maven-ant-tasks-2.0.7.jar"/>
      </classpath>
    </typedef>

154
  </target>
ebruneton's avatar
ebruneton committed
155

156
157
158
159
  <!-- =================================== -->
  <!-- ==========    COMPILE    ========== -->
  <!-- =================================== -->

160
  <target name="compile-init">
ebruneton's avatar
ebruneton committed
161
    <mkdir dir="${out.build}/tmp"/>
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
    <condition property="config.uptodate">
      <uptodate srcfile="${src}/org/objectweb/asm/ClassReader.java" 
        targetfile="${out.build}/tmp/org/objectweb/asm/ClassReader.java"/>
    </condition>
    <copy todir="${out.build}/tmp">
      <fileset dir="${src}">
        <include name="**/*"/>
      </fileset>
    </copy>
  </target>

  <target name="compile-config" unless="config.uptodate">
  	<replace dir="${out.build}/tmp">
  	  <include name="**/ClassReader.java"/>
	  <replacefilter token="SIGNATURES = true" value="SIGNATURES = ${SIGV}"/>
      <replacefilter token="ANNOTATIONS = true" value="ANNOTATIONS = ${ANNV}"/>
      <replacefilter token="FRAMES = true" value="FRAMES = ${FRAMESV}"/>
      <replacefilter token="WRITER = true" value="WRITER = ${SIGV}"/>
      <replacefilter token="RESIZE = true" value="RESIZE = ${RESIZEV}"/>
  	</replace>
  </target>

  <target name="compile-debug" depends="init,compile-init,compile-config">
  	<javac destdir="${out.build}/tmp" debug="on" source="1.3" target="1.2">
ebruneton's avatar
ebruneton committed
186
187
      <classpath>
        <pathelement location="${out.build}/tmp"/>
andrei's avatar
andrei committed
188
      </classpath>
189
      <src path="${out.build}/tmp"/>
190
191
      <include name="**/*.java"/>
    </javac>
192
193
  </target>

ebruneton's avatar
ebruneton committed
194
  <target name="shrink" depends="compile-debug" if="product.shrink">
195
    <echo message="Shrinking"/>
ebruneton's avatar
ebruneton committed
196
197
198
    <java classname="org.objectweb.asm.optimizer.Shrinker">
      <classpath>
        <pathelement location="${out.build}/tmp"/>
andrei's avatar
andrei committed
199
      </classpath>
ebruneton's avatar
ebruneton committed
200
      <arg value="${src}/org/objectweb/asm/optimizer/shrink.properties"/>
201
202
203
204
205
      <arg value="${src}/org/objectweb/asm/optimizer/shrink${SIG}.properties"/>
      <arg value="${src}/org/objectweb/asm/optimizer/shrink${ANN}.properties"/>
      <arg value="${src}/org/objectweb/asm/optimizer/shrink${FRAMES}.properties"/>
      <arg value="${src}/org/objectweb/asm/optimizer/shrink${WRITER}.properties"/>
      <arg value="${src}/org/objectweb/asm/optimizer/shrink${RESIZE}.properties"/>
andrei's avatar
andrei committed
206
207
      <arg value="${out.build}/tmp"/>
      <arg value="${out.build}"/>
ebruneton's avatar
ebruneton committed
208
    </java>
209
  </target>
ebruneton's avatar
ebruneton committed
210

211
212
213
  <target name="noshrink" depends="compile-debug" if="product.noshrink">
    <copy todir="${out.build}">
      <fileset dir="${out.build}/tmp"/>
andrei's avatar
andrei committed
214
215
216
    </copy>
  </target>

217
  <target name="compile" depends="compile-debug,shrink,noshrink"/>
andrei's avatar
andrei committed
218

ebruneton's avatar
ebruneton committed
219
220
221
  <!-- =================================== -->
  <!-- ==========      TEST     ========== -->
  <!-- =================================== -->
222

223
  <target name="test" depends="compile">
224
225
226
227
228
229
    <condition property="classes" value="${out.build}">
      <not><isset property="debug"/></not>
    </condition>
    <condition property="classes" value="${out.build}/tmp">
      <isset property="debug"/>
    </condition>
ebruneton's avatar
ebruneton committed
230
231
232
    <condition property="asm.test" value="${java.home}/lib/rt.jar,${out.test}/cases">
      <not><isset property="asm.test"/></not>
    </condition>
ebruneton's avatar
ebruneton committed
233
    <ant antfile="${test}/build.xml" target="test" inheritRefs="true"/>
234
235
  </target>

ebruneton's avatar
ebruneton committed
236
237
238
239
240
241
242
243
244
  <target name="test.report">
    <junitreport todir="${out.test}/reports">
      <fileset dir="${out.test}/reports">
        <include name="TEST-*.xml"/>
      </fileset>
      <report todir="${out.test}/reports"/>
    </junitreport>
  </target>

245
  <target name="coverage" depends="compile">
ebruneton's avatar
ebruneton committed
246
247
    <delete file="cobertura.ser"/>
    <delete dir="${out.instr}"/>
ebruneton's avatar
ebruneton committed
248
    <cobertura-instrument todir="${out.instr}">
ebruneton's avatar
ebruneton committed
249
      <ignore regex="java.lang.Error"/>
250
251
      <fileset dir="${out.build}/tmp">
        <include name="**/*.class"/>
ebruneton's avatar
ebruneton committed
252
253
        <exclude name="**/optimizer/*.class"/>
        <exclude name="**/xml/Processor*.class"/>
ebruneton's avatar
ebruneton committed
254
255
256
        <exclude name="**/*Test*.class" />
      </fileset>
    </cobertura-instrument>
257
258
    <copy todir="${out.instr}" preservelastmodified="yes">
      <fileset dir="${out.build}/tmp"/>
ebruneton's avatar
ebruneton committed
259
    </copy>
ebruneton's avatar
ebruneton committed
260
261
262
263
264
265
266
267
268
    <property name="coverage" value="yes"/>
    <property name="classes" value="${out.instr}"/>
    <property name="asm.test.class" value="pkg"/>
    <condition property="asm.test" value="${out.test}/cases">
      <not><isset property="asm.test"/></not>
    </condition>
    <condition property="test.type" value="conform">
      <not><isset property="test.type"/></not>
    </condition>
ekuleshov's avatar
ekuleshov committed
269
    <ant antfile="${test}/build.xml" target="test" inheritRefs="true"/>         
ebruneton's avatar
ebruneton committed
270
271
  </target>

ebruneton's avatar
ebruneton committed
272
273
274
275
276
  <target name="coverage.check" depends="init">
    <cobertura-check branchrate="100" linerate="100">
    </cobertura-check>
  </target>

277
  <target name="coverage.report" depends="init">
ebruneton's avatar
ebruneton committed
278
279
280
281
    <cobertura-report destdir="${out}/coverage" srcdir="${src}" format="xml"/>
    <cobertura-report destdir="${out}/coverage">
      <fileset dir="${src}">
        <include name="**/*.java"/>
ekuleshov's avatar
ekuleshov committed
282
        <exclude name="**/asm/optimizer/**/*.java"/>
ebruneton's avatar
ebruneton committed
283
284
285
286
      </fileset>
    </cobertura-report>
  </target>

287
288
289
290
  <!-- =================================== -->
  <!-- ==========      DIST     ========== -->
  <!-- =================================== -->

291
  <target name="dist.init">
ebruneton's avatar
ebruneton committed
292
293
    <mkdir dir="${out.dist}"/>
    <mkdir dir="${out.dist.doc}"/>
294
295
    <mkdir dir="${out.dist.jdoc}"/>
    <mkdir dir="${out.dist.lib}"/>
296
297
  </target>

298
  <target name="dist.version">
299
300
301
    <tstamp>
      <format property="product.build.time" pattern="yyyyMMdd.HHmmss"/>
    </tstamp>
302

303
304
305
306
307
308
309
    <condition property="product.artifact" value="${product.version}">
      <not><isset property="product.snapshot"/></not>
    </condition>
    <condition property="product.artifact" value="${product.build.time}">
      <isset property="product.snapshot"/>
    </condition>

310
311
312
313
314
315
316
317
318
    <condition property="plugin.artifact" value="${plugin.version}">
      <not><isset property="product.snapshot"/></not>
    </condition>
    <condition property="plugin.artifact" value="${plugin.version}.${product.build.time}">
      <isset property="product.snapshot"/>
    </condition>
  </target>
    
  <target name="jar" depends="dist.init,dist.version,compile,shrink">
ebruneton's avatar
ebruneton committed
319
    <multipleAnt dir="${archive}"/>
ebruneton's avatar
ebruneton committed
320
    <java classname="org.objectweb.asm.optimizer.JarOptimizer">
321
322
323
      <classpath>
        <pathelement location="${out.build}/tmp"/>
      </classpath>
324
325
      <!--arg value="${src}/org/objectweb/asm/optimizer/jdk1.2.2_017.txt.gz"/-->
      <arg value="${src}/org/objectweb/asm/optimizer/jdk1.3.1_19.txt.gz"/>
andrei's avatar
andrei committed
326
327
      <arg value="${out.dist.lib}"/>
    </java>
328
  </target>
329

330
  <target name="jdoc" depends="init,dist.init">
ebruneton's avatar
ebruneton committed
331
332
333
334
335
336
337
338
339
    <copy todir="${out.dist.doc}"
          preservelastmodified="yes"
          includeEmptyDirs="false">
      <fileset dir="${doc}">
        <include name="**/*"/>
        <exclude name="**/*.fig"/>
      </fileset>
    </copy>
    <multipleAnt dir="${jdoc}"/>
340
  </target>
341

342
  <target name="examples" depends="init,dist.init" if="examples.exist">
ebruneton's avatar
ebruneton committed
343
344
    <mkdir dir="${out.dist.examples}"/>
    <copy todir="${out.dist.examples}"
ebruneton's avatar
ebruneton committed
345
346
          preservelastmodified="yes"
          includeEmptyDirs="yes">
347
348
349
350
351
352
353
      <fileset dir="${examples}">
        <exclude name="common"/>
        <exclude name="common/**/*"/>
      </fileset>
    </copy>

    <multipleCopy file="${examples}/common/build.xml"
ebruneton's avatar
ebruneton committed
354
355
356
                  toDir="${out.dist.examples}"
                  notReplace="yes"
                  preservelastmodified="yes">
357
358
359
360
361
      <include name="*"/>
      <exclude name="etc"/>
      <exclude name="lib"/>
    </multipleCopy>

ebruneton's avatar
ebruneton committed
362
    <copy toDir="${out.dist.examples}" preservelastmodified="yes">
363
364
365
366
367
      <fileset dir="${examples.common}">
        <include name="**/*"/>
        <exclude name="build.xml"/>
      </fileset>
    </copy>
ebruneton's avatar
ebruneton committed
368
    <replace dir="${out.dist.examples}/etc" token="@product.version@" value="${product.version}"/>
369

ebruneton's avatar
ebruneton committed
370
371
372
373
374
    <copy todir="${out.dist}">
      <fileset dir=".">
        <include name="externals/*.jar"/>
      </fileset>
    </copy>
375
376
  </target>

ebruneton's avatar
ebruneton committed
377
378
  <!--
  <target name="eclipse.generate" depends="dist.version">  	
379
  </target>
ebruneton's avatar
ebruneton committed
380

381
  <target name="eclipse.plugin" depends="jar,eclipse.generate">
ebruneton's avatar
ebruneton committed
382
    <jar zipfile="${out}/org.objectweb.asm_${plugin.artifact}.jar">
383
384
      <zipfileset dir="${basedir}">
        <include name="plugin.xml"/>
ebruneton's avatar
ebruneton committed
385
        <include name="META-INF/MANIFEST.MF"/>      	
386
387
388
389
390
391
392
        <include name="**/asm-${product.artifact}.jar"/>
        <include name="**/asm-tree-${product.artifact}.jar"/>
        <include name="**/asm-analysis-${product.artifact}.jar"/>
        <include name="**/asm-util-${product.artifact}.jar"/>
        <include name="**/asm-commons-${product.artifact}.jar"/>
        <include name="**/asm-attrs-${product.artifact}.jar"/>
      </zipfileset>
ebruneton's avatar
ebruneton committed
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
      <manifest>
        <attribute name="Bundle-ManifestVersion" value="2"/>
        <attribute name="Bundle-Name" value="ASM Framework"/>
        <attribute name="Bundle-SymbolicName" value="org.objectweb.asm;singleton:=true"/>
        <attribute name="Bundle-Version" value="${plugin.artifact}"/>
        <attribute name="Bundle-ClassPath" value="output/dist/lib/asm-${product.artifact}.jar,
output/dist/lib/asm-tree-${product.artifact}.jar,
output/dist/lib/asm-analysis-${product.artifact}.jar,
output/dist/lib/asm-commons-${product.artifact}.jar,
output/dist/lib/asm-attrs-${product.artifact}.jar,
output/dist/lib/asm-util-${product.artifact}.jar"/>
        <attribute name="Bundle-Vendor" value="ObjectWeb.org"/>
        <attribute name="Bundle-Localization" value="plugin"/>
        <attribute name="Export-Package" value="org.objectweb.asm,
org.objectweb.asm.attrs,
org.objectweb.asm.commons,
org.objectweb.asm.signature,
org.objectweb.asm.tree,
org.objectweb.asm.tree.analysis,
org.objectweb.asm.util,
org.objectweb.asm.xml"/>
        <attribute name="Eclipse-AutoStart" value="true"/>
      </manifest>
    </jar>
417
418
419
420
421
  </target>

  <target name="eclipse.feature" depends="eclipse.plugin">
    <echo file="${out}/feature.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<feature id="org.objectweb.asm.feature" label="ASM Framework"
ekuleshov's avatar
ekuleshov committed
422
      version="${plugin.artifact}" provider-name="ObjectWeb.org">
423

424
   <description url="http://asm.objectweb.org/eclipse/asm/index.html">
425
426
427
428
Feature contains ASM Java bytecode manipulation framework runtime.
   </description>

   <copyright>
ebruneton's avatar
ebruneton committed
429
Copyright (c) 2000-2005 INRIA, France Telecom.
430
431
432
433
All rights reserved.
   </copyright>

   <license>
ebruneton's avatar
ebruneton committed
434
Copyright (c) 2000-2005 INRIA, France Telecom
435
436
437
438
439
440
441
442
443
444
445
446
447
448
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   </license>

   <url>
ebruneton's avatar
ebruneton committed
449
      <update label="ASM Framework" url="http://download.forge.objectweb.org/eclipse-update/site.xml"/>
450
451
452
453
454
455
456
457
458
459
460
461
462
463
   </url>

   <plugin id="org.objectweb.asm" download-size="0" install-size="0" version="${plugin.artifact}"/>

</feature>]]></echo>

    <jar jarfile="${out}/org.objectweb.asm.feature_${plugin.artifact}.jar">
      <fileset file="${out}/feature.xml"/>
    </jar>
  </target>
  
  <target name="eclipse.site" depends="eclipse.feature">
    <echo file="${out}/site.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<site>
464
   <description url="http://asm.objectweb.org/eclipse/asm/index.html">
465
466
467
468
469
470
471
472
      ASM Framework
   </description>
   
   <feature url="features/org.objectweb.asm.feature_${plugin.artifact}.jar" id="org.objectweb.asm.feature" version="${plugin.artifact}">
      <category name="asm"/>
   </feature>

   <category-def name="asm" label="ASM Framework"/>
473
474
      
   <archive path="plugins/org.objectweb.asm_${plugin.artifact}.jar" url="http://download.forge.objectweb.org/asm/org.objectweb.asm_${plugin.artifact}.jar"/>
475
476
477
478
479
480
481
482
</site>]]></echo>
    
    <zip zipfile="${out}/org.objectweb.asm.update_${plugin.artifact}.zip">
      <zipfileset dir="${out}" includes="site.xml"/>
      <zipfileset dir="${out}" includes="org.objectweb.asm.feature_${plugin.artifact}.jar" prefix="features"/>
      <zipfileset dir="${out}" includes="org.objectweb.asm_${plugin.artifact}.jar"  prefix="plugins"/>
    </zip>
  </target>
ebruneton's avatar
ebruneton committed
483
  -->
484
  
485
  <target name="dist" depends="jar,jdoc,examples">
ebruneton's avatar
ebruneton committed
486
    <zip zipFile="${out.dist}/src.zip" basedir="${src}" excludes="**/optimizer/**/*"/>
487
488
  </target>

489
490
491
  <!-- =================================== -->
  <!-- ==========    EXAMPLES   ========== -->
  <!-- =================================== -->
492

493
  <target name="example" depends="jar,examples">
ebruneton's avatar
ebruneton committed
494
495
496
    <ant inheritAll="false"
         dir="${out.dist.examples}/${example.name}"
         target="execute"/>
497
498
499
500
501
502
503
504
505
  </target>

  <!-- =================================== -->
  <!-- ==========     ZIP       ========== -->
  <!-- =================================== -->

  <!-- creates zip files of the different distribution (source, binaries) -->

  <target name="zip" depends="dist">
ebruneton's avatar
ebruneton committed
506
    <mkdir dir="${out.zip}"/>
507
508
509
510
511
512
513
514
515
516
    <tar destfile="${out.zip}/${product.name}-${product.version}.tar.gz"
         compression="gzip">
      <tarfileset dir="${basedir}" prefix="${product.name}-${product.version}">
        <exclude name="build.config"/>
        <exclude name="config/**"/>
        <exclude name="config"/>
        <exclude name="**/externals/**"/>
        <exclude name="**/externals"/>
        <exclude name="**/lib/**"/>
        <exclude name="**/lib"/>
ebruneton's avatar
ebruneton committed
517
518
        <exclude name="eclipse/**"/>
        <exclude name="eclipse"/>
519
520
        <exclude name="web/**"/>
        <exclude name="web"/>
ebruneton's avatar
ebruneton committed
521
522
        <exclude name="**/output/**"/>
        <exclude name="**/output"/>
523
        <exclude name="CVSROOT/**"/>
ebruneton's avatar
ebruneton committed
524
        <exclude name="CVSROOT"/>
525
526
527
528
      </tarfileset>
    </tar>
    <zip zipFile="${out.zip}/${product.name}-${product.version}-bin.zip">
      <zipfileset dir="${out.dist}" prefix="${product.name}-${product.version}"/>
529
530
    </zip>
  </target>
andrei's avatar
andrei committed
531

532
533
534
535
536
537
  <!-- =================================== -->
  <!-- ==========     CLEAN     ========== -->
  <!-- =================================== -->

  <!-- remove all directories -->

538
539
540
541
542
  <target name="clean.web" if="web.exist">
    <ant dir="${web}" target="clean"/>
  </target>

  <target name="clean" depends="properties,clean.web">
ebruneton's avatar
ebruneton committed
543
544
    <delete dir="${out.build}"/>
    <delete dir="${out.dist}"/>
ebruneton's avatar
ebruneton committed
545
    <delete dir="${out.tmp}"/>
ebruneton's avatar
ebruneton committed
546
547
    <delete dir="${out.zip}"/>
    <delete dir="${out.test}"/>
ebruneton's avatar
ebruneton committed
548
    <delete dir="${out.instr}"/>
ebruneton's avatar
ebruneton committed
549
550
  </target>

551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
  <!-- ==================================== -->
  <!-- ==========     HELP       ========== -->
  <!-- ==================================== -->

  <target name="help">
    <echo message="The available targets are the following:"/>
    <echo message="  compile: compiles the product into ${out.build}"/>
    <echo message="  dist: creates the product's distributions into ${out.dist}"/>
    <echo message="  zip: creates the product's distributions zip files into ${out.zip}"/>
    <echo message="  clean: removes all generated files."/>
    <echo message="  jar: creates all jars in ${out.dist.lib}"/>
    <echo message="  test: run all tests"/>
    <echo message=""/>
    <echo message="There are some options to run tests:"/>
    <echo message="  -Dtest.group=&lt;group name&gt;  Only a group of test: The default target of"/>
    <echo message="    the xml file is called the test.group contains the xml file name with"/>
    <echo message="    directory ex: ant -Dtest.group=conform/toto test =&gt; calls the default"/>
    <echo message="    target of the file ${test}/conform/toto.xml"/>
    <echo message="  -Dtest.type=&lt;type name&gt;  Only a type of test: conform, deviance, stress,"/>
    <echo message="    thread or perf. The test.type properties contains the directory name of"/>
    <echo message="    the test type ex: ant -Dtest.type=conform test"/>
    <echo message="  -Dtest.name=&lt;test name&gt;  Only a single test. The target &lt;test name&gt; is called"/>
573
574
  </target>

575
  <target name="maven.install" xmlns:artifact="urn:maven-artifact-ant" depends="init">
576

577
578
    <artifact:install file="${out.dist.lib}/asm-parent-${product.artifact}.pom">
      <artifact:pom file="${out.dist.lib}/asm-parent-${product.artifact}.pom"/>
579
580
    </artifact:install>

581
582
    <artifact:install file="${out.dist.lib}/asm-${product.artifact}.jar">
      <artifact:pom file="${out.dist.lib}/asm-${product.artifact}.pom"/>
583
584
    </artifact:install>

585
586
    <artifact:install file="${out.dist.lib}/asm-analysis-${product.artifact}.jar">
      <artifact:pom file="${out.dist.lib}/asm-analysis-${product.artifact}.pom"/>
587
588
    </artifact:install>

589
590
    <artifact:install file="${out.dist.lib}/asm-commons-${product.artifact}.jar">
      <artifact:pom file="${out.dist.lib}/asm-commons-${product.artifact}.pom"/>
591
592
    </artifact:install>

593
594
    <artifact:install file="${out.dist.lib}/asm-tree-${product.artifact}.jar">
      <artifact:pom file="${out.dist.lib}/asm-tree-${product.artifact}.pom"/>
595
596
    </artifact:install>
    
597
598
    <artifact:install file="${out.dist.lib}/asm-util-${product.artifact}.jar">
      <artifact:pom file="${out.dist.lib}/asm-util-${product.artifact}.pom"/>
599
600
    </artifact:install>
  
601
602
    <artifact:install file="${out.dist.lib}/asm-xml-${product.artifact}.jar">
      <artifact:pom file="${out.dist.lib}/asm-xml-${product.artifact}.pom"/>
603
604
    </artifact:install>

605
606
607
    <artifact:install file="${out.dist.lib}/all/asm-all-${product.artifact}.jar">
      <artifact:pom file="${out.dist.lib}/all/asm-all-${product.artifact}.pom"/>
      <artifact:attach file="${out.dist}/src.zip" type="jar" classifier="sources"/>
608
609
610
    </artifact:install>
  </target>

611
  <target name="maven.deploy" xmlns:artifact="urn:maven-artifact-ant" depends="init">
612

613
614
    <artifact:install-provider artifactId="wagon-file" version="1.0-alpha-7"/>
    <artifact:install-provider artifactId="wagon-webdav" version="1.0-alpha-6"/>
615

616
    <artifact:remoteRepository id="objectweb.repo" layout="default" url="file:${out}/maven"/>
617

618
619
620
    <artifact:deploy file="${out.dist.lib}/asm-parent-${product.artifact}.pom">
      <artifact:pom file="${out.dist.lib}/asm-parent-${product.artifact}.pom"/>
      <remoteRepository refid="objectweb.repo"/>
621
622
    </artifact:deploy>

623
624
625
    <artifact:deploy file="${out.dist.lib}/asm-${product.artifact}.jar">
      <artifact:pom file="${out.dist.lib}/asm-${product.artifact}.pom"/>
      <remoteRepository refid="objectweb.repo"/>
626
627
    </artifact:deploy>

628
629
630
    <artifact:deploy file="${out.dist.lib}/asm-analysis-${product.artifact}.jar">
      <artifact:pom file="${out.dist.lib}/asm-analysis-${product.artifact}.pom"/>
      <remoteRepository refid="objectweb.repo"/>
631
632
    </artifact:deploy>

633
634
635
    <artifact:deploy file="${out.dist.lib}/asm-commons-${product.artifact}.jar">
      <artifact:pom file="${out.dist.lib}/asm-commons-${product.artifact}.pom"/>
      <remoteRepository refid="objectweb.repo"/>
636
637
    </artifact:deploy>

638
639
640
    <artifact:deploy file="${out.dist.lib}/asm-tree-${product.artifact}.jar">
      <artifact:pom file="${out.dist.lib}/asm-tree-${product.artifact}.pom"/>
      <remoteRepository refid="objectweb.repo"/>
641
642
    </artifact:deploy>
    
643
644
645
    <artifact:deploy file="${out.dist.lib}/asm-util-${product.artifact}.jar">
      <artifact:pom file="${out.dist.lib}/asm-util-${product.artifact}.pom"/>
      <remoteRepository refid="objectweb.repo"/>
646
647
    </artifact:deploy>
  
648
649
650
    <artifact:deploy file="${out.dist.lib}/asm-xml-${product.artifact}.jar">
      <artifact:pom file="${out.dist.lib}/asm-xml-${product.artifact}.pom"/>
      <remoteRepository refid="objectweb.repo"/>
651
652
    </artifact:deploy>

653
654
655
656
    <artifact:deploy file="${out.dist.lib}/all/asm-all-${product.artifact}.jar">
      <artifact:pom file="${out.dist.lib}/all/asm-all-${product.artifact}.pom"/>
      <artifact:attach file="${out.dist}/src.zip" type="jar" classifier="sources"/>
      <remoteRepository refid="objectweb.repo"/>
657
    </artifact:deploy>
658

659
660
  </target>

661
</project>