/
build.xml
216 lines (191 loc) · 9.79 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<!--
JBoss, Home of Professional Open Source
Copyright 2007, Red Hat Middleware LLC, and individual contributors
as indicated by the @author tags.
See the copyright.txt in the distribution for a full listing
of individual contributors.
This copyrighted material is made available to anyone wishing to use,
modify, copy, or redistribute it subject to the terms and conditions
of the GNU General Public License, v. 2.0.
This program is distributed in the hope that it will be useful, but WITHOUT A
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License,
v. 2.0 along with this distribution; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
(C) 2008
@author JBoss Inc.
-->
<project name="byteman" default="jar" basedir=".">
<!-- the directory in which your installed app server resides -->
<property environment="env"/>
<!-- pick up the asm.org code transform library -->
<property name="asm.home" value="${env.HOME}/Download/asm/asm-3.0/output/dist/lib/all"/>
<property name="asm.jar" value="asm-all-3.0.jar"/>
<condition property="jboss.home" value="${env.JBOSS_HOME}">
<isset property="env.JBOSS_HOME"/>
</condition>
<fail unless="jboss.home">
The JBoss installation directory must be specified with the JBOSS_HOME environment variable or the jboss.home property.
</fail>
<condition property="xts.home" value="${env.XTS_HOME}">
<isset property="env.XTS_HOME"/>
</condition>
<fail unless="xts.home">
The XTS installation directory must be specified with the XTS_HOME environment variable or the xts.home property.
</fail>
<property name="src.dir" value="src"/>
<property name="dd.dir" value="dd"/>
<property name="dd.grammar.dir" value="${dd.dir}/grammar"/>
<property name="ext.lib.dir" value="ext"/>
<property name="build.dir" value="build"/>
<property name="build.classes.dir" value="${build.dir}/classes"/>
<property name="build.lib.dir" value="${build.dir}/lib"/>
<property name="ext.jflex.jars" value="JFlex.jar"/>
<property name="ext.javacup.jars" value="javacup.jar"/>
<property name="ext.javacup.rt.jars" value="javacuprt.jar"/>
<!-- we need to add the XTS, TS and various jboss jars to the test code path so we can
load XTS code -->
<property name="xts.lib.dir" value="${xts.home}/lib"/>
<property name="xts.sar.dir" value="${xts.home}/sar"/>
<property name="jboss.lib.dir" value="${jboss.home}/lib"/>
<property name="jboss.client.dir" value="${jboss.home}/client"/>
<property name="jboss.common.lib.dir" value="${jboss.home}/common/lib"/>
<property name="jboss.server.deploy.dir" value="${jboss.home}/server/default/deploy"/>
<property name="xts.lib.jars" value="ws-c10.jar wscf10.jar wscf.jar ws-t10.jar ws-t.jar wstx11.jar wsas.jar ws-c11.jar wscf11.jar ws-c.jar ws-t11.jar wstx10.jar wstx.jar"/>
<property name="xts.sar.jars" value="jbossxts.sar"/>
<property name="jboss.lib.jars" value="stax-api.jar"/>
<property name="jboss.client.jars" value="jbossall-client.jar"/>
<property name="jboss.common.lib.jars" value="jbossjta.jar jbossws-common.jar jbossws-framework.jar jbossws-spi.jar jbossws-native-saaj.jar jbossws-native-jaxws.jar jbossws-native-jaxws-ext.jar jbossws-native-jaxrpc.jar jboss-javaee.jar"/>
<property name="jboss.server.deploy.jars" value="jbossws.sar"/>
<!-- enable debugging of XTS service code -->
<property name="javac.debug" value="on"/>
<target name="init">
<delete dir="${build.dir}"/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes.dir}"/>
<mkdir dir="${build.lib.dir}"/>
<mkdir dir="${build.classes.dir}/META-INF"/>
</target>
<!-- parser is not automatically remade -->
<target name="parser" depends="init">
<java classname="JFlex.Main">
<classpath>
<fileset dir="${ext.lib.dir}" includes="${ext.jflex.jars}"/>
</classpath>
<arg value="-q"/>
<arg value="${dd.grammar.dir}/flex/ECAToken.flex"/>
</java>
<!--
<java classname="java_cup.Main">
<classpath>
<fileset dir="${ext.lib.dir}" includes="${ext.javacup.jars}"/>
<fileset dir="${ext.lib.dir}" includes="${ext.javacup.rt.jars}"/>
</classpath>
<arg value="-parser" />
<arg value="ECAGrammarParser" />
<arg value="-nonterms"/>
<arg value="-dump_grammar"/>
<arg value="-dump_states"/>
<arg value="-dump_tables"/>
<arg value="-dump"/>
<arg value="${dd.grammar.dir}/cup/ECAGrammar.cup"/>
</java>
-->
<java classname="java_cup.Main">
<classpath>
<fileset dir="${ext.lib.dir}" includes="${ext.javacup.jars}"/>
<fileset dir="${ext.lib.dir}" includes="${ext.javacup.rt.jars}"/>
</classpath>
<arg value="-package"/>
<arg value="org.jboss.byteman.rule.grammar"/>
<arg value="-parser" />
<arg value="ECAGrammarParser" />
<arg value="-nonterms"/>
<arg value="${dd.grammar.dir}/cup/ECAGrammar.cup"/>
</java>
<delete file="${src.dir}/org/jboss/byteman/rule/grammar/ECATokenLexer.java"/>
<delete file="${src.dir}/org/jboss/byteman/rule/grammar/ECAGrammarParser.java"/>
<delete file="${src.dir}/org/jboss/byteman/rule/grammar/sym.java"/>
<move file="${dd.grammar.dir}/flex/ECATokenLexer.java"
tofile="${src.dir}/org/jboss/byteman/rule/grammar/ECATokenLexer.java"/>
<move file="ECAGrammarParser.java"
tofile="${src.dir}/org/jboss/byteman/rule/grammar/ECAGrammarParser.java"/>
<move file="sym.java"
tofile="${src.dir}/org/jboss/byteman/rule/grammar/sym.java"/>
</target>
<target name="compile" depends="init">
<javac srcdir="${src.dir}" destdir="${build.classes.dir}" debug="${javac.debug}">
<classpath>
<pathelement location="${asm.home}/${asm.jar}"/>
<fileset dir="${ext.lib.dir}" includes="${ext.javacup.jars}"/>
<fileset dir="${ext.lib.dir}" includes="${ext.javacup.rt.jars}"/>
</classpath>
</javac>
</target>
<target name="jar" depends="compile">
<!--
<unjar src="${ext.lib.dir}/junit.jar" dest="${build.classes.dir}"/>
-->
<unjar src="${ext.lib.dir}/javacuprt.jar" dest="${build.classes.dir}"/>
<unjar src="${ext.lib.dir}/asm-all-3.0.jar" dest="${build.classes.dir}"/>
<jar jarfile="${build.lib.dir}/byteman.jar" manifest="${dd.dir}/META-INF/MANIFEST.MF">
<fileset dir="${build.classes.dir}" includes="**/*"/>
</jar>
</target>
<target name="install" depends="jar">
<zip destfile="${build.dir}/byteman.zip">
<fileset dir="${build.dir}" includes="lib/byteman.jar"/>
<fileset dir="." includes="README"/>
<fileset dir="." includes="docs/ProgrammersGuide.pdf"/>
<fileset dir="." includes="bin/bytemancheck.sh"/>
<fileset dir="." includes="ext/asm-all-3.0.jar"/>
<fileset dir="." includes="ext/third_party_licenses.txt"/>
</zip>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${dd.grammar.dir}" includes="*.java *.tokens"/>
</target>
<target name="TestScript" depends="jar">
<java classname="org.jboss.byteman.test.TestScript" fork="true">
<classpath>
<fileset dir="${build.lib.dir}" includes="byteman.jar"/>
<pathelement location="${asm.home}/${asm.jar}"/>
<!-- xts, jta and jboss as jars-->
<fileset dir="${xts.lib.dir}" includes="${xts.lib.jars}"/>
<fileset dir="${xts.sar.dir}" includes="${xts.sar.jars}"/>
<fileset dir="${jboss.lib.dir}" includes="${jboss.lib.jars}"/>
<fileset dir="${jboss.client.dir}" includes="${jboss.client.jars}"/>
<fileset dir="${jboss.common.lib.dir}" includes="${jboss.common.lib.jars}"/>
<fileset dir="${jboss.server.deploy.dir}" includes="${jboss.server.deploy.jars}"/>
</classpath>
<!-- uncomment this to see parser debug output
<jvmarg value="-Dorg.jboss.jbossts.byteman.rule.debug=foo"/>
-->
<arg value="handler.txt"/>
</java>
</target>
<target name="TestScriptDebug" depends="jar">
<java classname="org.jboss.byteman.test.TestScript" fork="true">
<classpath>
<fileset dir="${build.lib.dir}" includes="byteman.jar"/>
<pathelement location="${asm.home}/${asm.jar}"/>
<!-- xts, jta and jboss as jars-->
<fileset dir="${xts.lib.dir}" includes="${xts.lib.jars}"/>
<fileset dir="${xts.sar.dir}" includes="${xts.sar.jars}"/>
<fileset dir="${jboss.lib.dir}" includes="${jboss.lib.jars}"/>
<fileset dir="${jboss.client.dir}" includes="${jboss.client.jars}"/>
<fileset dir="${jboss.common.lib.dir}" includes="${jboss.common.lib.jars}"/>
<fileset dir="${jboss.server.deploy.dir}" includes="${jboss.server.deploy.jars}"/>
</classpath>
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=n,address=5005,suspend=y"/>
<!-- uncomment this to see parser debug output
<jvmarg value="-Dorg.jboss.jbossts.byteman.rule.debug=foo"/>
-->
<arg value="handler.txt"/>
</java>
</target>
</project>