aboutsummaryrefslogtreecommitdiffstats
path: root/build/build.xml
blob: d0ff7998148d4ce174cdf488bc8845ec2bd1def3 (plain)
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
<!-- -*- Mode: SGML; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -->

<!-- ========================================================================= -->
<!-- Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC),        -->
<!-- 2003-2005 Contributors                                                         -->
<!-- All rights reserved.                                                      -->
<!-- This program and the accompanying materials are made available            -->
<!-- under the terms of the Eclipse Public License v1.0                         -->
<!-- which accompanies this distribution and is available at                   -->
<!-- http://www.eclipse.org/legal/epl-v10.html                                 -->
<!--                                                                           -->
<!-- Contributors: (See CVS checkin's)                                         -->
<!--     Xerox/PARC     initial implementation                                 -->
<!--     Adrian Colyer / George Harley eclipse plugin targets                  -->
<!-- ========================================================================= -->

<project name="build" default="all" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:maven="antlib:org.apache.maven.artifact.ant">

    <target name="all"     depends="aspectj">
        <antcall target="eclipse.plugins"/>
    </target>
    <target name="clean"   depends="clean-directories"/>
		    
    <target name="compile" depends="build-module"
    	description="compile module ${module.name} (without tests, by default)"/>

    <target name="compile-tests" depends="init"
        description="compile module ${module.name} tests">
		<assemble-module-test module="${module.name}"/>
    </target>

    <target name="test" depends="compile-tests">
        <antcall target="do-test-junit"/>
    </target>

    <!-- ===================================================================== -->
    <!-- Init                                                                  -->
    <!-- ===================================================================== -->
    <property name="modules.dir" location="${basedir}/.."/>
    <property name="module.name" value="${ant.project.name}"/>
    
    <import file="${modules.dir}/build/build-properties.xml"/>
	
    <target name="init" depends="init-properties,init-directories">
      <property name="build.config" value=""/> 
      <property name="trim.testing.default" value="true"/>
      <property name="aj.installer.jar" location="${aj.dist.dir}/aspectj-${build.version.long}.jar"/>

      <available property="ant.lib.aspectjtools"
         file="${ant.home}/lib/aspectjtools.jar"
         value="Expect classpath errors from ${ant.home}/lib/aspectjtools.jar"/>

      <available property="ant.lib.aspectjrt"
         file="${ant.home}/lib/aspectjrt.jar"
         value="Expect classpath errors from ${ant.home}/lib/aspectjrt.jar"/>

      <available property="testing.drivers.all.available"
         file="${aj.jar.dir}/testing-drivers-all.jar"
         value="${aj.jar.dir}/testing-drivers-all.jar"/>
    </target>

    <target name="version-uptodate" depends="init,init-taskdefs"
         unless="version-uptodate.done">
         <!-- XXX change task to pre-check & avoid scan if dates uptodate -->
		 <versionuptodate
			version="${build.version}"
			versionSourceFile="${aspectj.modules.dir}/bridge/src/org/aspectj/bridge/Version.java"
			versionTagFile="${aj.temp.dir}/versionUptodate"/>
		 
		 <available file="${aj.temp.dir}/versionUptodate"
		       property="version.uptodate"/>
         <property name="version-uptodate.done" value="done"/>
    </target>

    <target name="init-version" depends="init,init-filters,version-uptodate" >
      <antcall target="init-filters"/>
      <copy file="${aspectj.modules.dir}/build/lib/BridgeVersion.java.txt"
          tofile="${aspectj.modules.dir}/bridge/src/org/aspectj/bridge/Version.java"
          overwrite="yes" filtering="yes"/>
      <property name="init.version.done" value="done"/>
      <!-- consider checking this in? -->
    </target>


    <!-- ===================================================================== -->
    <!-- Misc setup and warnings                                               -->
    <!-- ===================================================================== -->

    <target name="warn.ant.lib.aspectjrt" if="ant.lib.aspectjrt">
      <echo message="----- WARNING: ${ant.lib.aspectjrt}" /> 
    </target>

    <target name="warn.ant.lib.aspectjtools" if="ant.lib.aspectjtools">
      <echo message="----- WARNING: ${ant.lib.aspectjtools}" /> 
    </target>

	<target name="fail-unless-boot-libraries-uptodate" depends="init"
	 description="fail unless all boot libraries are up-to-date">
		
		<antcall target="verify-boot-lib">
			<param name="boot.lib"        value="test/aspectjrt.jar"/>
			<param name="vbl.module.name" value="runtime"/>
		</antcall>
		
		<antcall target="verify-boot-lib">
			<param name="boot.lib"        value="build/build.jar"/>
			<param name="vbl.module.name" value="build"/>
		</antcall>

		<antcall target="verify-boot-lib">
			<param name="boot.lib"        value="test/testing-client.jar"/>
			<param name="vbl.module.name" value="testing-client"/>
		</antcall>

		<echo message="fyi, bridge/util changes rarely mean client is invalid"/>
		<antcall target="verify-boot-lib">
			<param name="boot.lib"        value="test/testing-client.jar"/>
			<param name="vbl.module.name" value="util"/>
		</antcall>
		
		<antcall target="verify-boot-lib">
			<param name="boot.lib"        value="test/testing-client.jar"/>
			<param name="vbl.module.name" value="bridge"/>
		</antcall>

		<echo message="all boot libraries verified"/>		
	</target>

	<target name="update-tree" depends="init"
     description="update tree">
      <fail unless="CVSROOT" 
           message="required: {ant} -DCVSROOT=... ..."/>
      <cvs cvsRoot="${CVSROOT}"
              dest="${aspectj.modules.dir}"
             quiet="on" 
       failonerror="on" 
           command="update -dP" />
    </target>
		
    <!-- ===================================================================== -->
    <!-- antcall targets                                                       -->
    <!-- ===================================================================== -->	
	
	<target name="build-product" depends="init,init-taskdefs,init-version" description="build $${product.name}">
      <ajbuild jarDir="${aj.jar.dir}"
              baseDir="${aspectj.modules.dir}"
              distDir="${aj.dist.dir}"
           productDir="${aspectj.modules.dir}/build/products/${product.name}"
          trimTesting="true"
          buildConfig="${build.config}" 
              version="${build.version.long}"
              verbose="${build.verbose}"
          failonerror="true"/>		
	</target>

	<target name="build-module" depends="init,init-taskdefs,init-version">
      <ajbuild module="${module.name}"
              baseDir="${aspectj.modules.dir}"
              distDir="${aj.dist.dir}"
               jarDir="${aj.jar.dir}"
          trimTesting="${trim.testing}"
          buildConfig="${build.config}" 
              version="${build.version.long}"
              verbose="${build.verbose}"
          assembleall="${assemble}"
          failonerror="true"/>		
	</target>

    <macrodef name="build-module-all">
		<attribute name="module"/>
		<attribute name="trimTesting" default="${trim.testing.default}"/>
		<sequential>
			<antcall target="build-module">
				<param name="module.name" value="@{module}"/>
				<param name="trim.testing" value="@{trimTesting}"/>
				<param name="assemble" value="true"/>
			</antcall>
		</sequential>
	</macrodef>
    <macrodef name="build-module">
		<attribute name="module"/>
		<attribute name="trimTesting" default="${trim.testing.default}"/>
		<attribute name="assemble" default="false"/>
		<sequential>
			<antcall target="build-module">
				<param name="module.name" value="@{module}"/>
				<param name="trim.testing" value="@{trimTesting}"/>
				<param name="assemble" value="@{assemble}"/>
			</antcall>
		</sequential>
	</macrodef>
    
    <macrodef name="assemble-module-test">
		<attribute name="module"/>
		<sequential>
    		<build-module module="@{module}" assemble="true" trimTesting="false"/>
		</sequential>
	</macrodef>

    
	<target name="create-installer" depends="init,init-taskdefs,init-filters"
	 description="create ${installer.file} from ${staging.dir} using ${htmlSrc.dir} and ${simpleClassName}">
        <!-- init-filters: filter on copy used by ajinstaller taskdef -->
        
        <delete quiet="on" file="${installer.file}"/>
        <ajinstaller zipfile="${installer.file}"
           installerclassjar="${aspectj.build.jar}"
                     basedir="${staging.dir}"
                   mainclass="$$installer$$.org.aspectj.${simpleClassName}"
                     htmlSrc="${htmlSrc.dir}"
                resourcesSrc="${aspectj.modules.build.dir}/installer-resources"/>
	</target>

	<target name="verify-boot-lib" depends="init"
	 description="fail if ${boot.lib} is out of date wrt ${vbl.module.name}">
      <uptodate property="lib-warning-${vbl.module.name}"
              targetfile="${aspectj.modules.dir}/lib/${boot.lib}">
      	<srcfiles dir="${aspectj.modules.dir}/${vbl.module.name}/src"
              includes="**/*.java"/>
      </uptodate>
      
      <fail unless="lib-warning-${vbl.module.name}"
        message="${boot.lib} out of date wrt module ${vbl.module.name}"/>

    </target>

    <!-- ===================================================================== -->
    <!-- test targets                                                          -->
    <!-- ===================================================================== -->	
    <target name="test-run-all-junit-tests" 
		depends="init"
        description="run unit tests via run-all-junit-tests module">
	    <antcall target="test">
	        <param name="module.name" value="run-all-junit-tests"/>
	    </antcall>
    </target>
    
    <target name="test-compiler-tests" 
		depends="init"
        description="run compiler tests via tests module">
	    <antcall target="test">
	        <param name="module.name" value="tests"/>
	    </antcall>
    </target>

    <target name="test-each-module" 
		depends="init"
	    description="run JUnit tests for each module">
	    <subant target="test">
	        <filelist dir="${aspectj.modules.dir}"
	        	files="${aspectj.tools.modules},${aspectj.test.modules}"/>
	    </subant>
	</target>

<!--
<target name="ivy.init" unless="ivy.initialized">
  <property name="ivy.lib.dir" value="n:/apache-ivy-2.1.0/lib"/>
  <property name="ivy.settings.file" value="n:/workspaces/aspectj16_1/build/ivysettings.xml"/>
                <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant">
               <classpath>
                       <path location="${ivy.lib.dir}/ivy.jar"/>
	                                <path location="${ivy.lib.dir}/org.springframework.build.aws.ivy.jar"/>
	                                <path location="${ivy.lib.dir}/commons-codec.jar"/>
                       <path location="${ivy.lib.dir}/commons-httpclient.jar"/>
                       <path location="${ivy.lib.dir}/commons-logging.jar"/>
                       <path location="${ivy.lib.dir}/jets3t.jar"/>
	                                <path location="${ivy.lib.dir}"/>
	                        </classpath>
       </taskdef>

	                <ivy:settings file="${ivy.settings.file}"/>
	                <property name="ivy.initialized" value="true"/>
	        </target>
-->

  <target name="maven.init" >
    <property name="org.apache.maven.ant.version" value="2.0.10"/>
<property name="org.springframework.build.aws.maven.version" value="2.0.0.RELEASE"/>
<!--
    <ivy:cachepath resolveId="maven.ant.tasks.classpath" pathid="maven.ant.tasks.classpath"
       organisation="org.apache.maven" module="com.springsource.org.apache.maven.ant"
       revision="${org.apache.maven.ant.version}" conf="runtime" type="jar" inline="true" log="download-only"/>
-->
<!--
         <taskdef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant"
                           classpathref="maven.ant.tasks.classpath"/>
-->
          <maven:install-provider groupId="org.springframework.build.aws" artifactId="org.springframework.build.aws.maven"
                           version="${org.springframework.build.aws.maven.version}"/>
  </target>


	                	    
    <target name="junitreport" depends="init,init-taskdefs"
        if="junitreport.available">
	    <clean-dir dir="${aj.junit.dir}/html"/>
	    <junitreport todir="${aj.junit.dir}/html">
	      <fileset dir="${aj.junit.dir}">
	        <include name="**/TEST-*.xml"/>
	      </fileset>
	      <report format="frames" todir="${aj.junit.dir}/html"/>
	    </junitreport>
        <pathconvert property="jur.url" targetos="unix">
        	<path location="${aj.junit.dir}/html/index.html"/>
        </pathconvert>
        <echo message="see file:${jur.url}"/>
	</target>
    
	<target name="do-test-junit" 
	    depends="init-taskdefs" 
		description="run junit tests for a module using module root or leaves">
		<property name="dtj.dir"
	    	location="${aj.junit.dir}/${module.name}"/>
	    <mkdir dir="${dtj.dir}"/>

	    <condition property="dtj.includes"
	        value="${junit.includes}"
	        else="${junit.rootSuites}">
	        <istrue value="${junit.leaves}"/>
	    </condition>
	    <condition property="dtj.excludes"
	        value="${junit.excludes}"
	        else="">
	        <istrue value="${junit.leaves}"/>
	    </condition>
      	
	    <junit 
	    	dir="${aspectj.modules.build.dir}"
      	    failureproperty="test-junit-${module.name}.failed"
      	    fork="on" 
      	    forkmode="perTest"
      	    maxmemory="400m"
      		includeAntRuntime="off" 
           	printsummary="yes" 
           	haltonfailure="${haltOnTestFailure}" >
           	<classpath>
           	    <pathelement location="${aj.jar.dir}/${module.name}-test-all.jar"/>
				<!-- see skipped libraries in Builder.properties -->
           	    <pathelement location="${jdk.tools.jar}"/>
            	<pathelement location="${aspectj.modules.lib.dir}/junit/junit.jar"/> 
           		<fileset dir="${aspectj.modules.lib.dir}/commons" includes="commons.jar"/>
           		<!-- XML api's used by loadtime, also needed when running under 1.3 per Ant FAQ -->
           	    <fileset dir="${aspectj.modules.lib.dir}/ant/lib" 
                	includes="ant.jar,ant-junit.jar,xml-apis.jar,xercesImpl.jar"/>
           	</classpath>
    		<jvmarg value="-Daspectjrtpath=${lib.test.aspectjrt.jar}" />
	        <formatter type="xml"/>
	        <batchtest todir="${dtj.dir}">
	            <fileset dir="${modules.dir}/${module.name}/testsrc"
	                includes="${dtj.includes}"
	                excludes="${dtj.excludes}"/>
            </batchtest>        
	    </junit>
	    <report-if-failed text="JUnit tests for ${module.name} failed"
	        property="test-junit-${module.name}.failed"/>
    </target>

    	
    <!-- ===================================================================== -->
    <!-- custom targets                                                        -->
    <!-- ===================================================================== -->

    <target name="build-harness-jar" depends="init"
		description="build harness jar from scratch">
        <antcall target="clean-jars"/>
		<assemble-module-test module="testing-drivers"/>
	</target>
	
    <target name="build-testing-jars" depends="init"
		description="build testing jars from scratch">
        <antcall target="build-harness-jar"/>
	</target>

    <target name="build-testing-client" depends="init-taskdefs,init">
		<build-module module="testing-client" assemble="true"/>
		<assemble-module-test module="testing-client"/>
	  <echo>
To use testing client jar in tests, 
  mv ../aj-build/jars/testing-client-all.jar ../lib/tests/testing-client.jar
</echo>
	</target>

    <target name="aspectj" depends="init,aspectjtools-dist,docs-dist" description="create installer from local distributions">
	  <property name="installer.staging.dir" location="${aj.temp.dir}/installer-staging"/>
	  <clean-dir dir="${installer.staging.dir}"/>
	  <copy todir="${installer.staging.dir}">
	    <fileset dir="${aj.dist.dir}/tools"/>
	    <fileset dir="${aj.dist.dir}/docs"/>
	  </copy>
	  
	  <antcall target="create-installer">
	    <param name="installer.file" location="${aj.installer.jar}"/>
	    <param name="staging.dir" location="${installer.staging.dir}"/>
	    <param name="htmlSrc.dir" location="${aspectj.modules.build.dir}/products/aspectj/install"/>
	    <param name="simpleClassName" value="ToolsInstaller"/>
	  </antcall>
	  <delete dir="${installer.staging.dir}"/> 
	</target>
	
	<target name="docs-dist" depends="init">
	   <ant dir="${aspectj.modules.dir}/docs"
	    antfile="build.xml"
	    target="local-dist"
	    inheritAll="false"/>
	</target>
	
	<target name="aspectjrt" depends="init"
	 description="build aspectjrt.jar (differently than release)">
		<build-module-all module="aspectj5rt"/>
	  <copy file="${aj.jar.dir}/aspectj5rt-all.jar"
	      tofile="${aj.jar.dir}/aspectjrt.jar"/>
	</target>

    <target name="compile-runtime-11" depends="init-properties"
        description="compile runtime under 1.1 - fails, but by how much?">
        <condition property="cr1.in13">
            <equals arg1="1.3" arg2="${ant.java.version}"/>
        </condition>
		<antcall target="compile-runtime-11-flag-unless13"/>
		<antcall target="compile-runtime-11-do-if13"/>
    </target>
    
    <target name="compile-runtime-11-flag-unless13" depends="init-properties"
    	unless="cr1.in13">
        <echo message="Skipping compile-runtime-11 unless 1.3"/>
    </target>
    
    <target name="compile-runtime-11-do-if13" depends="init-properties"
        if="cr1.in13">
        <mkdir dir="${aj.build.dir}/classes-1.1"/>
        <property name="java11.classes.zip"
            location="${java11.home}/lib/classes.zip"/>
        <available property="classes.zip.available"
        	file="${java11.classes.zip}"/>
        <fail unless="classes.zip.available" message="no 1.1 bootclasspath"/>
        <javac
            compiler="javac1.1"
            bootclasspath="${java11.classes.zip}"
            source="1.3"
            includejavaruntime="no"
            includeantruntime="no"
            destdir="${aj.build.dir}/classes-1.1"
            srcdir="${aspectj.modules.dir}/runtime/src"
            target="1.1"
            verbose="false"
            failonerror="true"
            />
       <delete dir="${aj.build.dir}/classes-1.1"/>
    </target>
    
    <!-- ===================================================================== -->
    <!-- boilerplate antcalls                                                  -->
    <!-- ===================================================================== -->

	<!-- for any-[module|product], define [module|product].name -->
	<target name="any-module" depends="init">
		<fail unless="module.name" message="use -Dmodule.name=... to define"/>
		<build-module module="${module.name}"/>
	</target>

	<target name="any-module-all" depends="init">
		<fail unless="module.name" message="use -Dmodule.name=... to define"/>
		<build-module-all module="${module.name}"/>
	</target>

	<target name="any-product" depends="init">
	  <fail unless="product.name" message="use -Dproduct.name=... to define"/>
	  <antcall target="build-product">
	    <param name="product.name" value="${product.name}"/>
	  </antcall>
	</target>

	<target name="ajbrowser-all" >
    	<build-module-all module="ajbrowser"/>
    </target>

	<target name="ajdoc-all">
    	<build-module-all module="ajdoc"/>
    </target>

	<target name="build">
		<build-module-all module="build"/>
    </target>

	<target name="aspectjtools-dist" depends="init" description="build local distribution">
	  <antcall target="build-product">
	    <param name="product.name" value="tools"/>
	  </antcall>
    </target>

    <!-- ===================================================================== -->
    <!-- eclipse plugins                                                       -->
    <!-- ===================================================================== -->

	<target name="eclipse.plugins" depends="init"
     	    description="create the Eclipse distribution plugins">	  
	   <ant dir="${aspectj.modules.dir}/eclipse.plugin" inheritAll="false"/>
    </target>
	
	<target name="src" depends="init" description="build src modules">
		
		<mkdir dir="${aj.src.dir}"/>
		<jar destfile="${aj.src.dir}/aspectjrt${build.version}-src.jar">
			<fileset dir="${aspectj.modules.dir}/aspectj5rt/java5-src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/runtime/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
		</jar>

		<unzip dest="${aj.src.dir}/bcelsrc" src="${aspectj.modules.dir}/lib/bcel/bcel-src.zip"/>
	    <!-- loadtime5/asm/bridge/loadtime/weaver/weaver5 -->
		<jar destfile="${aj.src.dir}/aspectjweaver${build.version}-src.jar">
			<fileset dir="${aspectj.modules.dir}/aspectj5rt/java5-src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/runtime/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
				<exclude name="**/*.html"/>
			</fileset>
			<fileset dir="${aj.src.dir}/bcelsrc">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/loadtime5/java5-src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/asm/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/bridge/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/loadtime/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/org.aspectj.matcher/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/weaver/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/weaver5/java5-src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/util/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
		</jar>
		
        <!-- missing from this are the jdtDepends.jar src files -->
		<unzip dest="${aj.src.dir}/jdtsrc" src="${aspectj.modules.dir}/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip"/>
        <!-- ajde/ajde.core/ajdoc/asm/bridge/loadtime/org.aspectj.ajdt.core/taskdefs/util/weaver5 -->
		<jar destfile="${aj.src.dir}/aspectjtools${build.version}-src.jar">
			<fileset dir="${aj.src.dir}/jdtsrc">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aj.src.dir}/bcelsrc">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/loadtime5/java5-src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/loadtime/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/ajde/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/ajde.core/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/runtime/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/aspectj5rt/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/ajdoc/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/asm/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/bridge/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/loadtime/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/org.aspectj.ajdt.core/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/taskdefs/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/util/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/weaver/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/org.aspectj.matcher/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<fileset dir="${aspectj.modules.dir}/weaver5/java5-src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
		</jar>
		<delete dir="${aj.src.dir}/bcelsrc" failonerror="false"/>
		<delete dir="${aj.src.dir}/jdtsrc" failonerror="false"/>
		
		<jar destfile="${aj.src.dir}/org.aspectj.matcher-${build.version}-src.jar">
					<fileset dir="${aspectj.modules.dir}/bridge/src">
						<exclude name="CVS"/>
						<exclude name="**/.cvsignore"/>
					</fileset>
					<fileset dir="${aspectj.modules.dir}/util/src">
						<exclude name="CVS"/>
						<exclude name="**/.cvsignore"/>
					</fileset>
			<fileset dir="${aspectj.modules.dir}/org.aspectj.matcher/src">
				<exclude name="CVS"/>
				<exclude name="**/.cvsignore"/>
			</fileset>
			<!--
					<fileset dir="${aj.src.dir}/jdtsrc">
						<exclude name="CVS"/>
						<exclude name="**/.cvsignore"/>
					</fileset>
					<fileset dir="${aj.src.dir}/bcelsrc">
						<exclude name="CVS"/>
						<exclude name="**/.cvsignore"/>
					</fileset>
					<fileset dir="${aspectj.modules.dir}/loadtime5/java5-src">
						<exclude name="CVS"/>
						<exclude name="**/.cvsignore"/>
					</fileset>
					<fileset dir="${aspectj.modules.dir}/loadtime/src">
						<exclude name="CVS"/>
						<exclude name="**/.cvsignore"/>
					</fileset>
					<fileset dir="${aspectj.modules.dir}/ajde/src">
						<exclude name="CVS"/>
						<exclude name="**/.cvsignore"/>
					</fileset>
					<fileset dir="${aspectj.modules.dir}/ajde.core/src">
						<exclude name="CVS"/>
						<exclude name="**/.cvsignore"/>
					</fileset>
					<fileset dir="${aspectj.modules.dir}/runtime/src">
						<exclude name="CVS"/>
						<exclude name="**/.cvsignore"/>
					</fileset>
					<fileset dir="${aspectj.modules.dir}/aspectj5rt/src">
						<exclude name="CVS"/>
						<exclude name="**/.cvsignore"/>
					</fileset>
					<fileset dir="${aspectj.modules.dir}/ajdoc/src">
						<exclude name="CVS"/>
						<exclude name="**/.cvsignore"/>
					</fileset>
					<fileset dir="${aspectj.modules.dir}/asm/src">
						<exclude name="CVS"/>
						<exclude name="**/.cvsignore"/>
					</fileset>
					<fileset dir="${aspectj.modules.dir}/loadtime/src">
						<exclude name="CVS"/>
						<exclude name="**/.cvsignore"/>
					</fileset>
					<fileset dir="${aspectj.modules.dir}/org.aspectj.ajdt.core/src">
						<exclude name="CVS"/>
						<exclude name="**/.cvsignore"/>
					</fileset>
					<fileset dir="${aspectj.modules.dir}/taskdefs/src">
						<exclude name="CVS"/>
						<exclude name="**/.cvsignore"/>
					</fileset>
					<fileset dir="${aspectj.modules.dir}/weaver/src">
						<exclude name="CVS"/>
						<exclude name="**/.cvsignore"/>
					</fileset>
					<fileset dir="${aspectj.modules.dir}/weaver5/java5-src">
						<exclude name="CVS"/>
						<exclude name="**/.cvsignore"/>
					</fileset>
					-->
				</jar>
		
		<jar destfile="${aj.src.dir}/org.aspectj-${build.version}-src.jar">
			<fileset dir="${aj.src.dir}">
				<include name="aspectjrt${build.version}-src.jar"/> 
				<include name="aspectjweaver${build.version}-src.jar"/> 
				<include name="aspectjtools${build.version}-src.jar"/>
				<include name="org.aspectj.matcher-${build.version}-src.jar"/>
			</fileset>
		</jar>
		
		<delete file="{aj.src.dir}/aspectjrt${build.version}-src.jar"/> 
		<delete file="{aj.src.dir}/aspectjweaver${build.version}-src.jar"/> 
		<delete file="{aj.src.dir}/aspectjtools${build.version}-src.jar"/> 
		<delete file="{aj.src.dir}/org.aspectj.matcher${build.version}-src.jar"/> 
    </target>
	


	<target name="repo" depends="init" description="deploy maven repo">
		<property name="repo.url" value="scp://simonegianni.it/home/mavenrsync/repo"/>
		<property name="repo.id" value="simonegianni-rsync"/>
		
		<mkdir dir="${modules.dir}/aj-build/repo"/>
		<copy toDir="${modules.dir}/aj-build/repo" file="aspectjtools.pom"/>
		<copy toDir="${modules.dir}/aj-build/repo" file="aspectjweaver.pom"/>
		<copy toDir="${modules.dir}/aj-build/repo" file="aspectjrt.pom"/>
		<replaceregexp byline="true" flags="g">
			<regexp pattern="ASPECTJVERSION"/>
			<substitution expression="${repo.version}"/>
			<fileset dir="${modules.dir}/aj-build/repo">
				<include name="*.pom"/>
			</fileset>			
		</replaceregexp>
		
		
		<!-- Invoke maven to deploy the jars to the rsynced repo -->
		<antcall target="mavenDeployJar">
			<param name="file" value="${modules.dir}/aj-build/dist/tools/lib/aspectjtools.jar"/>
			<param name="artifact" value="aspectjtools"/>
			<param name="desc" value="AspectJ Tools"/>
		</antcall>		
		<antcall target="mavenDeployJar">
			<param name="file" value="${modules.dir}/aj-build/dist/tools/lib/aspectjweaver.jar"/>
			<param name="artifact" value="aspectjweaver"/>
			<param name="desc" value="AspectJ Weaver"/>
		</antcall>		
		<antcall target="mavenDeployJar">
			<param name="file" value="${modules.dir}/aj-build/dist/tools/lib/aspectjrt.jar"/>
			<param name="artifact" value="aspectjrt"/>
			<param name="desc" value="AspectJ Runtime"/>
		</antcall>		
		
		<antcall target="mavenDeploySource">
			<param name="file" value="${modules.dir}/aj-build/src/aspectjtools${build.version}-src.jar"/>
			<param name="artifact" value="aspectjtools"/>
			<param name="desc" value="AspectJ Tools"/>
		</antcall>		
		<antcall target="mavenDeploySource">
			<param name="file" value="${modules.dir}/aj-build/src/aspectjweaver${build.version}-src.jar"/>
			<param name="artifact" value="aspectjweaver"/>
			<param name="desc" value="AspectJ Weaver"/>
		</antcall>		
		<antcall target="mavenDeploySource">
			<param name="file" value="${modules.dir}/aj-build/src/aspectjrt${build.version}-src.jar"/>
			<param name="artifact" value="aspectjrt"/>
			<param name="desc" value="AspectJ Runtime"/>
		</antcall>		
		
		
		
	</target>

<!--
ant -propertyfile XXX publishtomaven
-->
  <target name="publishtomaven_snapshot" depends="maven.init">
    <property name="build.root" value="/Users/aclement/workspaces/aspectj1/aj-build"/>

    <property name="adjusted.release.type" value="snapshot"/>
    <property name="maven.central.repository" value="s3://maven.springframework.org/${adjusted.release.type}"/>

    <property name="bin.jars.folder" value="${build.root}/dist/tools/lib"/>
    <property name="src.jars.folder" value="${build.root}/src"/>
    <property name="suffix" value="DEVELOPMENT"/>

    <!-- ASPECTJRT -->
    <maven:deploy file="${bin.jars.folder}/aspectjrt.jar">
      <remoteRepository url="${maven.central.repository}">
        <authentication username="${accessKey}" passphrase="${secretKey}"/>
      </remoteRepository>
      <pom file="usedForMavenUpload/aspectjrt.pom"/>
      <attach file="${src.jars.folder}/aspectjrt${suffix}-src.jar" classifier="sources"/>
    </maven:deploy>

    <!-- ASPECTJTOOLS -->
    <maven:deploy file="${bin.jars.folder}/aspectjtools.jar">
      <remoteRepository url="${maven.central.repository}">
        <authentication username="${accessKey}" passphrase="${secretKey}"/>
      </remoteRepository>
      <pom file="usedForMavenUpload/aspectjtools.pom"/>
      <attach file="${src.jars.folder}/aspectjtools${suffix}-src.jar" classifier="sources"/>
    </maven:deploy>

    <!-- ASPECTJWEAVER -->
    <maven:deploy file="${bin.jars.folder}/aspectjweaver.jar">
      <remoteRepository url="${maven.central.repository}">
        <authentication username="${accessKey}" passphrase="${secretKey}"/>
      </remoteRepository>
      <pom file="usedForMavenUpload/aspectjweaver.pom"/>
      <attach file="${src.jars.folder}/aspectjweaver${suffix}-src.jar" classifier="sources"/>
    </maven:deploy>

  </target>





  <target name="publishtomaven_milestone" depends="maven.init">
    <property name="suffix" value="1.6.12.M1"/>

    <property name="build.root" value="/Users/aclement/workspaces/aspectj1/aj-build"/>
    <property name="adjusted.release.type" value="milestone"/>
    <property name="maven.central.repository" value="s3://maven.springframework.org/${adjusted.release.type}"/>
    <property name="bin.jars.folder" value="${build.root}/dist/tools/lib"/>
    <property name="src.jars.folder" value="${build.root}/src"/>

    <!-- ASPECTJRT -->
    <maven:deploy file="${bin.jars.folder}/aspectjrt.jar">
      <remoteRepository url="${maven.central.repository}">
        <authentication username="${accessKey}" passphrase="${secretKey}"/>
      </remoteRepository>
      <pom file="usedForMavenUpload_milestone/aspectjrt.pom"/>
      <attach file="${src.jars.folder}/aspectjrt${suffix}-src.jar" classifier="sources"/>
    </maven:deploy>

    <!-- ASPECTJTOOLS -->
    <maven:deploy file="${bin.jars.folder}/aspectjtools.jar">
      <remoteRepository url="${maven.central.repository}">
        <authentication username="${accessKey}" passphrase="${secretKey}"/>
      </remoteRepository>
      <pom file="usedForMavenUpload_milestone/aspectjtools.pom"/>
      <attach file="${src.jars.folder}/aspectjtools${suffix}-src.jar" classifier="sources"/>
    </maven:deploy>

    <!-- ASPECTJWEAVER -->
    <maven:deploy file="${bin.jars.folder}/aspectjweaver.jar">
      <remoteRepository url="${maven.central.repository}">
        <authentication username="${accessKey}" passphrase="${secretKey}"/>
      </remoteRepository>
      <pom file="usedForMavenUpload_milestone/aspectjweaver.pom"/>
      <attach file="${src.jars.folder}/aspectjweaver${suffix}-src.jar" classifier="sources"/>
    </maven:deploy>
  </target>

  <target name="publishtomaven_release" depends="maven.init">
    <property name="suffix" value="1.6.11"/>

    <property name="build.root" value="/Users/aclement/workspaces/aspectj1/aj-build"/>
    <property name="adjusted.release.type" value="release"/>
    <property name="maven.central.repository" value="s3://maven.springframework.org/${adjusted.release.type}"/>
    <property name="bin.jars.folder" value="${build.root}/dist/tools/lib"/>
    <property name="src.jars.folder" value="${build.root}/src"/>

    <!-- ASPECTJRT -->
    <maven:deploy file="${bin.jars.folder}/aspectjrt.jar">
      <remoteRepository url="${maven.central.repository}">
        <authentication username="${accessKey}" passphrase="${secretKey}"/>
      </remoteRepository>
      <pom file="usedForMavenUpload_${adjusted.release.type}/aspectjrt.pom"/>
      <attach file="${src.jars.folder}/aspectjrt${suffix}-src.jar" classifier="sources"/>
    </maven:deploy>

    <!-- ASPECTJTOOLS -->
    <maven:deploy file="${bin.jars.folder}/aspectjtools.jar">
      <remoteRepository url="${maven.central.repository}">
        <authentication username="${accessKey}" passphrase="${secretKey}"/>
      </remoteRepository>
      <pom file="usedForMavenUpload_${adjusted.release.type}/aspectjtools.pom"/>
      <attach file="${src.jars.folder}/aspectjtools${suffix}-src.jar" classifier="sources"/>
    </maven:deploy>

    <!-- ASPECTJWEAVER -->
    <maven:deploy file="${bin.jars.folder}/aspectjweaver.jar">
      <remoteRepository url="${maven.central.repository}">
        <authentication username="${accessKey}" passphrase="${secretKey}"/>
      </remoteRepository>
      <pom file="usedForMavenUpload_${adjusted.release.type}/aspectjweaver.pom"/>
      <attach file="${src.jars.folder}/aspectjweaver${suffix}-src.jar" classifier="sources"/>
    </maven:deploy>
  </target>

	
  <target name="repo2" depends="maven.init">
  </target>

	<target name="mavenDeployJar">
		<!-- 
		  Currently only an exec is usable, see http://jira.codehaus.org/browse/MANTTASKS-71 
		  this mean you need to have maven installed on your system.
		-->
		<exec executable="n:/tools/apache-maven-2.0.9/bin/mvn.bat" failonerror="true">
			<arg line="--batch-mode"/>
			<arg line="deploy:deploy-file"/>
			<arg line="-Durl=${repo.url}"/>
			<arg line="-DrepositoryId=${repo.id}"/>
			<arg line="-Dfile=${file}"/>
			<arg line="-DgroupId=org.aspectj"/>
			<arg line="-DartifactId=${artifact}"/>
			<arg line="-Dpackaging=jar"/>
			<arg line="-Dversion=${repo.version}"/>
			<arg line="-DpomFile=${modules.dir}/aj-build/repo/${artifact}.pom"/>			
		</exec>	
	</target>
	
	<target name="mavenDeploySource">
		<!-- 
		     Currently only an exec is usable, see http://jira.codehaus.org/browse/MANTTASKS-71 
		     this mean you need to have maven installed on your system.
		     
		     failonerror is set to false because deploy:deploy-file goes NPE for some obscure reason
		     on recent versions, see http://jira.codehaus.org/browse/MDEPLOY-48
		     -->
		<exec executable="n:/tools/apache-maven-2.0.9/bin/mvn.bat" failonerror="false">
			<arg line="--batch-mode"/>
			<arg line="deploy:deploy-file"/>
			<arg line="-Durl=${repo.url}"/>
			<arg line="-DrepositoryId=${repo.id}"/>
			<arg line="-Dfile=${file}"/>
			<arg line="-DgroupId=org.aspectj"/>
			<arg line="-DartifactId=${artifact}"/>
			<arg line="-Dpackaging=java-source"/>
			<arg line="-Dversion=${repo.version}"/>
			<arg value="-DgeneratePom=false"/>			
		</exec>	
	</target>
	

</project>