-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
199 lines (160 loc) · 7.17 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
<?xml version="1.0" encoding="US-ASCII"?>
<project name="wsdl2rest" default="dist" basedir=".">
<description>
build file for WSDL2REST
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="lib" location="lib"/>
<property name="target" value="target/classes"/>
<property name="dist" value="dist"/>
<property name="testdir" location="test"/>
<property name="samples" location="samples"/>
<property name="debug" value="on"/> <!-- this need to be off for the releases -->
<property name="release-version" value="1.0"/>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${target}"/>
</target>
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac destdir="${target}" debug="${debug}" debuglevel="lines,vars,source">
<compilerarg value="-Xlint"/>
<src path="${src}/api"/>
<src path="${src}/impl"/>
<classpath>
<fileset dir="${lib}" id="allLibs">
<exclude name="wsdl4j.jar"/>
<include name="*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<target name="test" depends="compile" description="compile test source " >
<!-- Compile test java code from ${test} into target/test/classes -->
<mkdir dir="target/test/classes"/>
<javac destdir="target/test/classes" debug="${debug}" debuglevel="lines,vars,source">
<compilerarg value="-Xlint"/>
<src path="${testdir}"/>
<src path="${samples}/src/api"/>
<src path="${samples}/src/impl"/>
<classpath>
<pathelement location="${target}"/>
<pathelement location="target/test/classes"/>
<fileset refid="allLibs"/>
</classpath>
</javac>
<junit printsummary="yes" haltonfailure="yes" fork="yes">
<classpath>
<pathelement location="${target}"/>
<pathelement location="target/test/classes"/>
<fileset refid="allLibs"/>
</classpath>
<formatter type="plain"/>
<jvmarg value="-Dorg.slosc.wsdl2rest.wsdl.wsdlLocations=${basedir}/samples/wsdl"/>
<jvmarg value="-Dorg.slosc.wsdl2rest.wsdl.targetLocation=${basedir}/target/generated"/>
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"/>
<test if="test" name="${test}"/>
<batchtest unless="test" fork="yes" todir="target/test">
<fileset dir="${testdir}"/>
</batchtest>
</junit>
</target>
<target name="wsdl2rest" depends="compile" description="compile and run UI" >
<java classname="org.slosc.wsdl2rest.ui.Wsdl2RestForm" fork="yes">
<classpath>
<pathelement location="${target}"/>
<fileset refid="allLibs"/>
</classpath>
</java>
</target>
<target name="dist" depends="compile" description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the jar file -->
<jar jarfile="${dist}/lib/wsdl2rest-${release-version}.jar">
<metainf dir="config/META-INF"/>
<fileset dir="${target}"/>
</jar>
</target>
<target name="restapp" depends="dist" description="create web app">
<!-- Create the distribution directory -->
<mkdir dir="${dist}/restapp/WEB-INF/lib"/>
<copy todir="${dist}/restapp/WEB-INF" overwrite="true">
<fileset dir="config/WEB-INF"/>
</copy>
<copy todir="${dist}/restapp/WEB-INF/lib" overwrite="true">
<fileset dir="lib">
<include name="asm-*.jar"/>
<include name="commons-logging.jar"/>
<include name="log4j-*.jar"/>
</fileset>
<fileset dir="${dist}/lib">
<include name="wsdl2rest-${release-version}.jar"/>
</fileset>
</copy>
<!-- Put everything in ${build} into the jar file -->
<!--<jar jarfile="${dist}/restapp/WEB-INF/lib/wsdl2rest-${release-version}.jar" basedir="${target}"/>-->
</target>
<property environment="env"/>
<target name="test-svr" depends="restapp">
<fail message="Please set CATALINA_HOME to your tomcat install directory." unless="env.CATALINA_HOME"/>
<copy todir="${env.CATALINA_HOME}/webapps" overwrite="true">
<fileset dir="${dist}">
<include name="restapp/**"/>
</fileset>
</copy>
<exec executable="${env.CATALINA_HOME}/bin/startup.sh" os="${os.name}" osfamily="unix"/>
<exec executable="${env.CATALINA_HOME}/bin/catalina.bat" spawn="true" osfamily="windows">
<arg value="jpda"/>
<arg value="start"/>
<env key="JPDA_SUSPEND" value="y"/>
</exec>
<echo message="App server started"/>
</target>
<target name="src-dist" description="generate the src distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/src"/>
<!-- Put everything in ${build} into the *.tar.gz file -->
<tar destfile="${dist}/src/wsdl2rest-src-${release-version}.tar.gz" compression="gzip" basedir="."
excludes=".svn/**,**/.svn,**/.svn/**,dist,dist/**,target,target/**,wsdl2rest.iml,wsdl2rest.ipr,wsdl2rest.iws,config/**,docs/discussions.txt,docs/todo.txt,site/**,samples/src/api/**,samples/test/**,samples/src/webapp/**,tools/**,**/*.bak,.classpath,.project"/>
<zip destfile="${dist}/src/wsdl2rest-src-${release-version}.zip" basedir="."
excludes=".svn/**,**/.svn,**/.svn/**,dist,dist/**,target,target/**,wsdl2rest.iml,wsdl2rest.ipr,wsdl2rest.iws,config/**,docs/discussions.txt,docs/todo.txt,site/**,samples/src/api/**,samples/test/**,samples/src/webapp/**,tools/**,**/*.bak,.classpath,.project"/>
</target>
<target name="bin-dist" depends="dist" description="generate the binary distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/bin"/>
<mkdir dir="${dist}/docs"/>
<copy todir="${dist}/docs" overwrite="true">
<fileset dir="./docs">
<exclude name="building.txt"/>
<exclude name="discussions.txt"/>
<exclude name="todo.txt"/>
</fileset>
</copy>
<tar destfile="${dist}/bin/wsdl2rest-bin-${release-version}.tar.gz" compression="gzip">
<fileset dir=".">
<include name="README.TXT"/>
<include name="LICENSE"/>
<include name="NOTICE"/>
<include name="lib/**"/>
</fileset >
<fileset dir="${dist}/lib">
<include name="wsdl2rest-${release-version}.jar"/>
</fileset>
<fileset dir="${dist}">
<include name="docs/**"/>
</fileset>
</tar>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="target" includeemptydirs="true"/>
<delete dir="${dist}"/>
</target>
</project>