summaryrefslogtreecommitdiffstats
path: root/taskdefs/testdata/incTest/incTest.xml
blob: 5e050302c1547c48b4dbb14ae9daf65e0a4b09de (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
<!-- to test incremental task, run setup then test -->
<project default="test" basedir=".">

  <path id="aspectjrt.path">
    <pathelement location="${basedir}/../../../lib/test/aspectjrt.jar"/>
  </path>
  <path id="aspects.path">
    <pathelement location="${basedir}/output/aspects.jar"/>
  </path>

	<target name="init">
		<property name="td"
			location="${basedir}/../.."/>
		<property name="test.dir"
			location="${td}/testdata/incTest"/>
      <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
          <classpath> 
            <pathelement path="${td}/bin"/> 
            <pathelement path="${td}/src"/> 
            <pathelement path="${td}/../asm/bin"/> 
            <pathelement path="${td}/../bridge/bin"/> 
            <pathelement path="${td}/../org.aspectj.ajdt.core/bin"/> 
            <pathelement path="${td}/../org.eclipse.jdt.core/bin"/> 
            <pathelement path="${td}/../util/bin"/> 
            <pathelement path="${td}/../weaver/bin"/> 
            <pathelement path="${td}/../lib/eclipse2.0/jdtDepends.jar"/> 
            <pathelement path="${td}/../lib/bcel/bcel.jar"/> 
          </classpath>
      </taskdef>
	</target>
	
	<target name="clean" depends="init">
		<delete quiet="on">
			<fileset dir="${test.dir}/classes"/>
			<fileset dir="${test.dir}/injars"/>
		</delete>
	</target>

	<target name="test-both" depends="init">
		<mkdir dir="${test.dir}/injars"/>
		<iajc outjar="${test.dir}/injars/both.jar"
			failonerror="true">
			<sourceroots>
				<pathelement path="${test.dir}/injarSrc/one"/>
				<pathelement path="${test.dir}/injarSrc/two"/>
			</sourceroots>
			<classpath>
				<pathelement path="${td}/../lib/test/aspectjrt.jar"/>
			</classpath>
		</iajc>
	</target>
	
	<target name="test-all" depends="init">
		<mkdir dir="${test.dir}/injars"/>
		<mkdir dir="${test.dir}/output"/>
		<iajc outjar="${test.dir}/injars/all-one.jar"
			classpath="${td}/../lib/test/aspectjrt.jar"
			sourceroots="${test.dir}/injarSrc/one"
			failonerror="true"/>
		<iajc outjar="${test.dir}/output/aspect.jar"
			failonerror="true"
			classpathref="aspectjrt.path"
			srcdir="${test.dir}/src">
			<include name="TraceMains.java"/>
		</iajc>
		<iajc outjar="${test.dir}/output/all.jar"
			sourcerootcopyfilter="**/*.java"
			copyinjars="true"
			failonerror="true">
			<classpath>
				<pathelement path="${td}/../lib/test/aspectjrt.jar"/>
			</classpath>
			<aspectpath refid="aspects.path"/>
			<sourceroots>
				<pathelement path="${test.dir}/injarSrc/two"/>
				<pathelement path="${test.dir}/src"/>
			</sourceroots>
			<injars>
				<pathelement path="${test.dir}/injars/all-one.jar"/>
			</injars>
		</iajc>
	</target>
	
	<target name="setup" depends="init"
		description="create input jars">
		<mkdir dir="${test.dir}/injars"/>
		<iajc outjar="${test.dir}/injars/both.jar"
			classpath="${td}/../lib/test/aspectjrt.jar"
			sourceroots="${test.dir}/injarSrc/one,${test.dir}/injarSrc/two"
			failonerror="true"/>
		<iajc outjar="${test.dir}/injars/oneClasses.jar"
			classpath="${td}/../lib/test/aspectjrt.jar"
			sourceroots="${test.dir}/injarSrc/one"
			failonerror="true"/>
		<iajc outjar="${test.dir}/injars/twoClasses.jar"
			classpath="${td}/../lib/test/aspectjrt.jar"
			sourceroots="${test.dir}/injarSrc/two"
			failonerror="true"/>		
		<zip zipfile="${test.dir}/injars/one.jar">
			<zipfileset src="${test.dir}/injars/oneClasses.jar"/>
			<fileset dir="${test.dir}/injarSrc/one"
				includes="**/*"
				excludes="**/*.java"/>
		</zip>
		<zip zipfile="${test.dir}/injars/two.jar">
			<zipfileset src="${test.dir}/injars/twoClasses.jar"/>
			<fileset dir="${test.dir}/injarSrc/two"
				includes="**/*"
				excludes="**/*.java"/>
		</zip>
		<delete>
			<fileset dir="${test.dir}/injars"
				includes="*Classes.jar"/>
		</delete>
	</target>

	<target name="test" depends="init">
		<mkdir dir="${test.dir}/output/classes"/>
		<property name="tag.file"
			location="${test.dir}/output/tagFile.txt"/>
	    <echo message="edit to recompile, delete to quit" 
	    	file="${tag.file}"/>
	    <echo message="update to recompile, delete to quit: ${tag.file}"/>
		<iajc classpath="${td}/../lib/test/aspectjrt.jar"			 
			outjar="${test.dir}/output/outjar.jar"
			injars="${test.dir}/injars/one.jar;${test.dir}/injars/two.jar"
			sourceroots="${test.dir}/src"
			copyInjars="true"
			sourceRootCopyFilter="**/*.java,**/CVS/*"
			tagFile="${tag.file}"
            verbose="on"/>      
            <!--
			destDir="${test.dir}/output/classes"
			incremental="true"
			-->
	</target>
</project>