aboutsummaryrefslogtreecommitdiffstats
path: root/tests/ltw/ant.xml
blob: db38cb16a195d4a6df40e92127d87889b647c0eb (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
<!-- ajc-ant script, not to be used from Ant commant line - see AntSpec -->
<project name="ltw">

    <!-- using this we can debug the forked VM -->
    <property
        name="jdwp"
        value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"/>

    <target name="JDK14 LTW with XML">
        <java fork="yes" classname="HelloWorld" failonerror="yes">
            <classpath refid="aj.path"/>
<!--        	
            <classpath>
                <pathelement path="${aj.sandbox}/hello.jar"/>
            </classpath>
-->            
            <jvmarg value="-Djava.system.class.loader=org.aspectj.weaver.loadtime.WeavingURLClassLoader"/>
        	<sysproperty key="aj.class.path" path="${aj.sandbox}/hello.jar:${aj.sandbox}/handler.jar"/>
            <jvmarg value="-Daj.weaving.verbose=true"/>
            <jvmarg value="-Dorg.aspectj.weaver.showWeaveInfo=true"/>
            <jvmarg value="-Dorg.aspectj.tracing.debug=true"/>
            <!-- use META-INF/aop.xml style -->
<!--            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>-->
<!--            <jvmarg line="${jdwp}"/>-->
        </java>
    </target>

    <target name="JDK14 LTW with ASPECTPATH">
        <java fork="yes" classname="HelloWorld" failonerror="yes">
            <classpath refid="aj.path"/>
        	<!--        	
            <classpath>
                <pathelement path="${aj.sandbox}/hello.jar"/>
            </classpath>
-->            
            <jvmarg value="-Djava.system.class.loader=org.aspectj.weaver.loadtime.WeavingURLClassLoader"/>
        	<sysproperty key="aj.class.path" path="${aj.sandbox}/hello.jar:${aj.sandbox}/handler.jar"/>
        	<sysproperty key="aj.aspect.path" path="${aj.sandbox}/handler.jar"/>
            <jvmarg value="-Daj.weaving.verbose=true"/>
            <jvmarg value="-Dorg.aspectj.weaver.showWeaveInfo=true"/>
            <jvmarg value="-Dorg.aspectj.tracing.debug=true"/>
            <!-- use META-INF/aop.xml style -->
<!--            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>-->
<!--            <jvmarg line="${jdwp}"/>-->
        </java>
    </target>

	<!-- We have three JARs files, two containing aspects (ExceptionHandler and Tracing)
	     for which aop-ajc.xml files have been generate. However we supply our own
	     aop.xml which declares only ExceptionHandler. We then override the 
	     configuration search path -->
    <target name="override default path using -Dorg.aspectj.weaver.loadtime.configuration">
        <copy file="${aj.root}/tests/ltw/aop-orgaspectjweaverloadtimeconfiguration.xml"
              tofile="${aj.sandbox}/META-INF/aop-random.xml"/>
        <java fork="yes" classname="HelloWorld" failonerror="yes">
            <classpath refid="aj.path"/>
            <classpath>
                <pathelement path="${aj.sandbox}/hello.jar:${aj.sandbox}/handler.jar:${aj.sandbox}/tracing.jar"/>
            </classpath>
            <jvmarg value="-Dorg.aspectj.weaver.loadtime.configuration=META-INF/aop-random.xml"/>
            <jvmarg value="-Dorg.aspectj.tracing.enabled=true"/>
            <jvmarg value="-Dorg.aspectj.tracing.factory=default"/>
            <jvmarg value="-Dorg.aspectj.tracing.messages=true"/>
            <!-- use META-INF/aop.xml style -->
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
<!--            <jvmarg line="${jdwp}"/>-->
        </java>
    </target>

</project>