-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.xml
170 lines (153 loc) · 7.29 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
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="VJdbc-Sf" basedir="." default="generateJars">
<property file="versioninfo.properties"/>
<property name="tmpdir" value="builddir"/>
<!-- Compiler switches -->
<property name="release" value="on"/>
<condition property="distribution_allowed">
<istrue value="${release}"/>
</condition>
<condition property="debug" value="on">
<istrue value="${release}"/>
</condition>
<condition property="optimize" value="off">
<istrue value="${release}"/>
</condition>
<target name="init">
<mkdir dir="${tmpdir}/class"/>
<mkdir dir="${tmpdir}/ear"/>
<mkdir dir="${tmpdir}/war"/>
<mkdir dir="${tmpdir}/applet"/>
<mkdir dir="${tmpdir}/website"/>
</target>
<target name="clean">
<delete verbose="true" includeemptydirs="true">
<fileset dir="${tmpdir}" includes="**/*"/>
</delete>
</target>
<target name="compile" depends="init">
<javac srcdir="src" destdir="${tmpdir}/class" debug="${debug}" optimize="${optimize}">
<classpath>
<fileset dir="lib" includes="*.jar"/>
<fileset dir="test" includes="*.jar"/>
</classpath>
</javac>
<!-- Compile RMI-Stubs -->
<rmic includes="**/*RmiImpl.class" base="${tmpdir}/class">
<classpath>
<pathelement location="lib/commons-logging.jar"/>
</classpath>
</rmic>
</target>
<!-- Generate normal JARs (this is NOT an EJB-JAR) -->
<target name="generateJars" depends="compile">
<!-- Condition for exclusion of test classes -->
<condition property="exclude_tests" value="de/simplicit/vjdbc/test/**">
<istrue value="${release}"/>
</condition>
<!-- Delete old files -->
<delete file="lib/vjdbc.jar" failonerror="false"/>
<delete file="lib/vjdbc_server.jar" failonerror="false"/>
<copy todir="${tmpdir}/class/de/simplicit/vjdbc" file="conf/log4j.properties"/>
<!-- First bundle the client JAR -->
<jar destfile="lib/vjdbc.jar">
<fileset dir="${tmpdir}/class">
<include name="de/simplicit/vjdbc/**"/>
<exclude name="de/simplicit/vjdbc/server/**"/>
<exclude name="${exclude_tests}"/>
</fileset>
<!-- The RMI stubs must be included explicitly -->
<fileset dir="${tmpdir}/class">
<include name="de/simplicit/vjdbc/server/rmi/*_Stub.class"/>
</fileset>
</jar>
<!-- ... now the server JAR -->
<jar basedir="${tmpdir}/class" destfile="lib/vjdbc_server.jar"
includes="de/simplicit/vjdbc/server/**"
excludes="${exclude_tests}"/>
</target>
<!-- Generate EJB-JAR which depends on the previously created JAR -->
<target name="generateEjbJar" depends="generateJars">
<delete file="deploy/vjdbc_ejb.jar"/>
<copy todir="${tmpdir}/class/META-INF">
<fileset dir="conf/ejb" excludesfile="conf/ejb/MANIFEST.MF"/>
</copy>
<jar basedir="${tmpdir}/class" destfile="deploy/vjdbc_ejb.jar"
includes="de/simplicit/vjdbc/server/ejb/*.class,META-INF/*"
manifest="conf/ejb/MANIFEST.MF"/>
</target>
<!-- Generate Web-Archive which depends on the previously created JAR -->
<target name="generateWar" depends="generateJars">
<delete file="deploy/vjdbc_servlet.war"/>
<war destfile="deploy/vjdbc_servlet.war" webxml="conf/servlet/web.xml">
<fileset dir="conf/servlet" includes="*.html">
<exclude name="applet.html"/>
</fileset>
<lib dir="lib" excludes="j2ee_api.jar,junit.jar"/>
</war>
</target>
<!-- Generate EAR-File which contains only the EJB-Module -->
<target name="generateEar" depends="generateJars,generateEjbJar">
<delete file="deploy/vjdbc.ear"/>
<copy file="deploy/vjdbc_ejb.jar" todir="${tmpdir}/ear"/>
<copy todir="${tmpdir}/ear/lib">
<fileset dir="lib" excludes="j2ee_api.jar,junit.jar"/>
</copy>
<ear basedir="${tmpdir}/ear" destfile="deploy/vjdbc.ear" appxml="conf/ear/application.xml"/>
</target>
<target name="generateAppletArchive" depends="generateJars">
<delete file="deploy/vjdbc_applet.jar"/>
<copy todir="${tmpdir}/applet">
<fileset dir="${tmpdir}/class" includes="de/**/QuizApplet*"/>
</copy>
<unjar src="lib/vjdbc.jar" dest="${tmpdir}/applet"/>
<unjar src="lib/commons-logging.jar" dest="${tmpdir}/applet"/>
<jar basedir="${tmpdir}/applet" destfile="deploy/vjdbc_applet.jar"/>
</target>
<!-- Package the VJDBC-distribution -->
<target name="distribution" depends="generateJars">
<fail message="This build is still marked as 'in development', set 'release' property to 'true' if you want to build a distribution !" unless="distribution_allowed"/>
<property name="distdirname" value="vjdbc_${version.major}_${version.minor}_${version.build}"/>
<property name="distfilename" value="${distdirname}.zip"/>
<property name="distdir" value="${tmpdir}/${distdirname}"/>
<delete dir="${distdir}"/>
<mkdir dir="${distdir}"/>
<copy todir="${distdir}" >
<fileset dir="." includes="conf/**" excludes="conf/lgpl.txt" />
<fileset dir="conf" includes="lgpl.txt"/>
<fileset dir="." includes="build.xml,readme.txt,changelog.txt"/>
<fileset dir="." includes="lib/**"
excludes="lib/log4j-1.2.8.jar" />
<fileset dir="." includes="docs/**" excludes="docs/ppt/**,**/Thumbs.db" />
<fileset dir="." includes="src/**" excludes="src/**/test/*" />
<fileset dir="." includes="deploy/readme.txt"/>
<fileset dir="." includes="test/readme.txt"/>
<fileset dir="test" includes="vjdbc.dtd"/>
</copy>
<copy todir="${distdir}/docs/sample" >
<fileset dir="src" includes="de/**/QuizApplet.java"/>
</copy>
<copy todir="${distdir}/docs" overwrite="true" >
<fileset dir="." includes="changelog.txt"/>
</copy>
<zip zipfile="deploy/${distfilename}">
<fileset dir="${tmpdir}" includes="${distdirname}/**"/>
</zip>
</target>
<!-- Packs the contents of the website -->
<target name="packWebsite" depends="init" >
<delete dir="${tmpdir}/website"/>
<copy todir="${tmpdir}/website">
<fileset dir="docs" excludes="ppt/**"/>
</copy>
<copy todir="${tmpdir}/website">
<fileset file="changelog.txt"/>
</copy>
<copy todir="${tmpdir}/website/sample">
<fileset dir="src" includes="de/**/QuizApplet.java" />
</copy>
<delete file="deploy/website.zip"/>
<zip basedir="${tmpdir}/website" zipfile="deploy/website.zip"/>
</target>
<target name="all" depends="clean,compile,generateJars,distribution,packWebsite"/>
</project>