-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
80 lines (66 loc) · 2.37 KB
/
build.xml
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="jarJava" name="DNA">
<!-- The following two properties need to be changed -->
<property name="jUnitJar" location="./junit.jar" />
<property name="aspectJDir" location="../aspectj-1.7.4" />
<property name="src" location="src" />
<property name="bin" location="bin" />
<property name="mainClass" value="DNA.test" />
<path id="class.path">
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
<pathelement location="${jUnitJar}" />
</path>
<taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
<classpath>
<pathelement location="${aspectJDir}/lib/aspectjtools.jar" />
</classpath>
</taskdef>
<target name="init">
<mkdir dir="${bin}" />
</target>
<target name="clean">
<input message="Delete everything from ${bin} (neccessary if you switch from AspectJ to Java or the other way around)" addproperty="confirmDeleteBin" validargs="y,n" defaultvalue="n" />
<condition property="executeDeleteBin">
<and>
<isset property="confirmDeleteBin" />
<equals arg1="${confirmDeleteBin}" arg2="y" />
</and>
</condition>
<antcall target="deleteBin" />
</target>
<target name="deleteBin" if="executeDeleteBin">
<echo>Deleting ${bin}</echo>
<delete dir="${bin}" />
</target>
<target name="compileJava" depends="clean, init">
<javac srcdir="${src}" destdir="${bin}" classpathref="class.path" />
</target>
<target name="compileAspectJ" depends="clean, init">
<iajc source="1.7" target="1.7" sourceroots="${src}" destDir="${bin}">
<classpath>
<path refid="class.path" />
<pathelement location="${aspectJDir}/lib/aspectjrt.jar" />
</classpath>
</iajc>
</target>
<target name="jarAspectJ" depends="compileAspectJ">
<jar destfile="DNA-aspectJ.jar" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Main-Class" value="${mainClass}" />
<attribute name="Class-Path" value=".../" />
</manifest>
<fileset dir="${bin}" />
</jar>
</target>
<target name="jarJava" depends="compileJava">
<jar destfile="DNA.jar" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Main-Class" value="${mainClass}" />
<attribute name="Class-Path" value=".../" />
</manifest>
<fileset dir="${bin}" />
</jar>
</target>
</project>