build.xml 5.81 KB
Newer Older
1
<project name="disl" default="prepare-all" basedir=".">
Lukáš Marek's avatar
Lukáš Marek committed
2

3 4
	<property file="build.properties" />
	<property file="disl.version" />
Lukáš Marek's avatar
Lukáš Marek committed
5 6

	<path id="buildpath">
7 8
		<pathelement location="${asm.path}" />
		<pathelement location="${bin}" />
Lukáš Marek's avatar
Lukáš Marek committed
9 10
	</path>

11 12
	<!-- it automatically compiles all other necessary stuff :) -->
	<target name="compile-tlvinserter">
13
		<mkdir dir="${bin}" />
14
		<javac srcdir="${src.disl}" includes="ch/usi/dag/disl/utilinstr/tlvinserter/" destdir="${bin}" debug="true" includeAntRuntime="false">
15
			<classpath refid="buildpath" />
Lukáš Marek's avatar
Lukáš Marek committed
16
		</javac>
Lukáš Marek's avatar
Lukáš Marek committed
17 18
	</target>

19
	<target name="prepare-extendedthread" depends="compile-tlvinserter">
20
		<mkdir dir="bin-thread/java/lang" />
21
		<java fork="true" classname="ch.usi.dag.disl.utilinstr.tlvinserter.ExtendThread">
22
			<classpath refid="buildpath" />
23
		</java>
24 25 26
		<mkdir dir="${build}" />
		<jar basedir="bin-thread" destfile="${extendedthread.path}" />
		<delete dir="bin-thread" />
Lukáš Marek's avatar
Lukáš Marek committed
27 28
	</target>

29
	<target name="compile-dynamicbypass" depends="prepare-extendedthread">
30
		<mkdir dir="${bin}" />
31
		<javac srcdir="${src.dynbypass}" destdir="${bin}" debug="true" includeAntRuntime="false">
32
			<classpath refid="buildpath" />
33
			<compilerarg value="-Xbootclasspath/p:${extendedthread.path}" />
Lukáš Marek's avatar
Lukáš Marek committed
34
		</javac>
35
		<delete file="${extendedthread.path}" />
Lukáš Marek's avatar
Lukáš Marek committed
36 37
	</target>

38 39
	<target name="compile-disl" depends="compile-dynamicbypass">
		<javac srcdir="${src.disl}" destdir="${bin}" debug="true" includeAntRuntime="false">
40
			<classpath refid="buildpath" />
Lukáš Marek's avatar
Lukáš Marek committed
41 42
		</javac>
	</target>
Lukáš Marek's avatar
Lukáš Marek committed
43

44 45 46 47
	<target name="compile-agent">
		<exec executable="make" dir="${src.agent}">
			<arg value="whole" />
		</exec>
48 49 50 51
	</target>

	<target name="compile-reserver">
		<javac srcdir="${src.reserver}" destdir="${bin}" debug="true" includeAntRuntime="false">
52 53 54 55
			<classpath refid="buildpath" />
		</javac>
	</target>

56 57
	<target name="compile-redispatch">
		<javac srcdir="${src.redispatch}" destdir="${bin}" debug="true" includeAntRuntime="false">
58 59 60 61
			<classpath refid="buildpath" />
		</javac>
	</target>

62 63 64 65 66
	<target name="compile-reagent">
		<exec executable="make" dir="${src.reagent}" />
	</target>

	<target name="compile-test" depends="compile-disl,compile-reserver,compile-redispatch">
67
		<javac srcdir="${src.test}" destdir="bin" debug="true" includeAntRuntime="false">
68
			<classpath refid="buildpath" />
69 70 71
		</javac>
	</target>

72
	<target name="compile" depends="compile-disl,compile-agent,compile-test,compile-reserver,compile-reagent,compile-redispatch" />
Lukáš Marek's avatar
Lukáš Marek committed
73

74
	<target name="package-dislserver" depends="compile-disl">
75
		<jar basedir="${bin}" destfile="${build}/disl-server.jar"
76 77
			includes="ch/usi/dag/disl/**,ch/usi/dag/dislserver/**"
			excludes="ch/usi/dag/disl/test/**,ch/usi/dag/disl/testtools/**">
78

79
			<manifest>
80
				<attribute name="Class-Path" value="${asm.lib}" />
81
				<attribute name="Main-Class" value="ch.usi.dag.dislserver.DiSLServer" />
82
				<attribute name="DiSL-Version" value="${disl.version}" />
83 84 85 86
			</manifest>
		</jar>
	</target>

87 88
	<target name="package-reserver" depends="compile-reserver">
		<jar basedir="${bin}" destfile="${build}/dislre-server.jar"
89 90
			includes="ch/usi/dag/dislreserver/**">
			<manifest>
91
				<attribute name="Class-Path" value="${asm.lib}" />
92
				<attribute name="Main-Class" value="ch.usi.dag.dislreserver.DiSLREServer" />
93
				<attribute name="DiSL-Version" value="${disl.version}" />
94 95 96 97
			</manifest>
		</jar>
	</target>

98 99
	<target name="package-redispatch" depends="compile-redispatch">
		<jar basedir="${bin}" destfile="${build}/dislre-dispatch.jar"
100 101 102 103
			includes="ch/usi/dag/dislre/**">
		</jar>
	</target>

104 105 106 107 108 109 110 111 112
	<target name="package-dynamicbypass" depends="compile-dynamicbypass">
		<jar basedir="${bin}" destfile="${build}/disl-bypass.jar" includes="ch/usi/dag/disl/dynamicbypass/**">
			<manifest>
				<attribute name="DiSL-Version" value="${disl.version}" />
			</manifest>
		</jar>
	</target>

	<target name="package" depends="package-dislserver,package-dynamicbypass,package-reserver,package-redispatch,compile-agent,compile-reagent" />
113 114 115

	<target name="eclipse-agent" description="creates simple agent jar file for eclipse">
		<mkdir dir="build" />
116 117
		<jar jarfile="build/eclipse-agent.jar">
			<manifest>
118
				<attribute name="Premain-Class" value="ch.usi.dag.disl.testtools.agent.Agent" />
119 120 121
			</manifest>
		</jar>
	</target>
122 123 124

	<target name="eclipse-dynamicbypass" depends="compile-dynamicbypass"
		description="creates support library for DiSL development under eclipse">
125

126 127
		<jar basedir="${bin}" destfile="${build}/eclipse-dynamicbypass.jar"
			includes="ch/usi/dag/disl/dynamicbypass/" />
128
	</target>
129 130

	<target name="eclipse" depends="eclipse-dynamicbypass,eclipse-agent" />
Lukáš Marek's avatar
Lukáš Marek committed
131

132 133 134 135 136 137
	<target name="copy-asm">
		<copy file="${asm.path}" tofile="${build}/${asm.lib}" />
	</target>

	<target name="prepare-all" depends="package,eclipse,compile-test,copy-asm" />

Lukáš Marek's avatar
Lukáš Marek committed
138
	<target name="clean">
139 140 141
		<delete dir="${bin}" />
		<delete dir="${build}" />
		<delete dir="${build.thread}" />
142
		<exec executable="make" dir="${src.agent}">
143 144 145 146 147 148 149
			<arg value="clean" />
		</exec>
		<exec executable="make" dir="${src.reagent}">
			<arg value="clean" />
		</exec>
		

Lukáš Marek's avatar
Lukáš Marek committed
150 151
	</target>

152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
	<!-- *** test instrumentaion package *** -->

	<target name="check-test-property">
		<condition property="test.set">
			<isset property="test.name"/>
		</condition>
	</target>

	<target name="report-missing-property" depends="check-test-property" unless="test.set">
		<fail message="Property test.name is not set. Set it using -Dtest.name=value" />
	</target>

	<property name="test.path" value="ch/usi/dag/disl/test/${test.name}"/>

	<target name="package-test" depends="report-missing-property,prepare-all" description="create instrumentation package for specified test">
		<mkdir dir="${build}"/>
		<jar jarfile="${build}/${instr.jar.name}"
		     basedir="${bin}"
170
		     includes="${test.path}/**"
171 172 173 174 175
		     excludes="${test.path}/TargetClass*.class ${test.path}/MANIFEST.MF"
		     manifest="${src.test}/${test.path}/MANIFEST.MF">
		</jar>
	</target>

Lukáš Marek's avatar
Lukáš Marek committed
176
</project>