This repository has been archived by the owner on Dec 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
123 lines (107 loc) · 3.7 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
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project>
<project default="info">
<loadfile property="version" srcfile="build.version"/>
<property file="build.properties"/>
<!--
Print usage information for this build file.
-->
<target name="info">
<loadfile property="info" srcfile="build.info"/>
<echo message="NativeInterceptor ${version}"/>
<echo message="${info}"/>
</target>
<path id="jarjar.cp">
<fileset dir="${lib}" includes="**/jarjar*.jar"/>
</path>
<path id="main.build.cp">
<fileset dir="${lib}" includes="**/asm*.jar"/>
</path>
<path id="test.build.cp">
<path refid="main.build.cp"/>
<pathelement location="${main-build}"/>
<pathelement location="${junit-jar}"/>
</path>
<!-- Classpath for tests that use ASM directly -->
<path id="unittest.run.cp">
<pathelement location="${test-build}"/>
<path refid="test.build.cp"/>
</path>
<!-- Classpath for tests that use ASM through native-intercept interfaces -->
<path id="integrationtest.run.cp">
<pathelement location="${dev-jar}"/>
<pathelement location="${test-build}"/>
<pathelement location="${junit-jar}"/>
</path>
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpathref="jarjar.cp"/>
<target name="build">
<mkdir dir="${main-build}"/>
<javac srcdir="${main-src}" destdir="${main-build}" classpathref="main.build.cp"
debug="${javac-debug}" optimize="${javac-optimize}"
source="${javac-source}" target="${javac-target}"/>
</target>
<target name="test-build" depends="build">
<mkdir dir="${test-build}"/>
<javac srcdir="${test-src}" destdir="${test-build}" classpathref="test.build.cp"
debug="${javac-debug}" optimize="${javac-optimize}"
source="${javac-source}" target="${javac-target}"/>
</target>
<target name="test-run" depends="jar,test-build">
<mkdir dir="${test-results}"/>
<delete>
<fileset dir="${test-results}" includes="**/*.xml"/>
</delete>
<junit printsummary="on" fork="on">
<classpath refid="unittest.run.cp"/>
<formatter type="xml"/>
<batchtest todir="${test-results}">
<fileset dir="${test-build}">
<include name="**/*Test.class"/>
<exclude name="**/integration/*Test.class"/>
<exclude name="**/Abstract*.class"/>
</fileset>
</batchtest>
</junit>
<junit printsummary="on" fork="on">
<classpath refid="integrationtest.run.cp"/>
<formatter type="xml"/>
<batchtest todir="${test-results}">
<fileset dir="${test-build}">
<include name="**/integration/*Test.class"/>
<exclude name="**/Abstract*.class"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="clean">
<delete dir="${main-build}"/>
<delete dir="${test-build}"/>
<delete dir="${test-results}"/>
</target>
<target name="dist-clean" depends="clean">
<delete dir="${dist}"/>
<delete dir="${target}"/>
</target>
<target name="jar" depends="build">
<mkdir dir="${dist}"/>
<jarjar destfile="${dev-jar}" basedir="${main-build}" manifest="${resources}/META-INF/MANIFEST.MF">
<zipfileset src="${lib}/asm-${asm-version}.jar"/>
<zipfileset src="${lib}/asm-commons-${asm-version}.jar"/>
<rule pattern="org.objectweb.**" result="org.synth.@1"/>
</jarjar>
</target>
<!--
Create the distribution jar files
-->
<target name="dist" depends="dist-clean,test-run">
<mkdir dir="${dist}"/>
<jarjar destfile="${jar}" basedir="${main-build}" manifest="${resources}/META-INF/MANIFEST.MF">
<fileset dir="${resources}">
<include name="META-INF/*LICENSE*"/>
</fileset>
<zipfileset src="${lib}/asm-${asm-version}.jar"/>
<zipfileset src="${lib}/asm-commons-${asm-version}.jar"/>
<rule pattern="org.objectweb.**" result="org.synth.@1"/>
</jarjar>
</target>
</project>