-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.xml
More file actions
209 lines (177 loc) · 7.62 KB
/
Copy pathbuild.xml
File metadata and controls
209 lines (177 loc) · 7.62 KB
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
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="h3270" default="all" basedir=".">
<property file="${basedir}/build.properties" />
<property name="dir.lib" value="${basedir}/webapp/WEB-INF/lib" />
<property name="file.war" value="h3270.war" />
<property name="dir.webapp" value="${basedir}/webapp" />
<property name="dir.classes" value="${dir.webapp}/WEB-INF/classes" />
<property name="dir.test" value="${basedir}/test" />
<target name="init">
<mkdir dir="${dir.classes}" />
<mkdir dir="${dir.webapp}/WEB-INF/bin" />
<path id="cp.base">
<pathelement location="${dir.classes}" />
<fileset dir="${dir.lib}" includes="*.jar" />
<pathelement location="${servlet.jar}" />
<pathelement location="${portlet-api.jar}" />
</path>
<condition property="portlet.available">
<available classname="javax.portlet.Portlet">
<classpath refid="cp.base"/>
</available>
</condition>
<condition property="test.skip">
<not>
<isset property="dir.j2ee"/>
</not>
</condition>
</target>
<target name="all" depends="compile" />
<target name="compile" depends="init">
<javac srcdir="${basedir}/src" destdir="${dir.classes}" debug="true">
<classpath refid="cp.base" />
<exclude name="org/h3270/web/Portlet.java" />
</javac>
<copy description="copy properties files" todir="${dir.classes}">
<fileset dir="${basedir}/src" includes="**/*.properties"/>
</copy>
<antcall target="compile-portlet" />
</target>
<target name="test.compile" depends="test.init" unless="test.skip">
<javac srcdir="${basedir}/test/src" destdir="${dir.classes}">
<classpath refid="cp.test" />
</javac>
</target>
<target name="test.copy-resources" >
<copy todir="${dir.classes}">
<fileset dir="${basedir}/test/src">
<include name="**/*.dump" />
<include name="**/*.txt" />
</fileset>
</copy>
</target>
<target name="compile-portlet" if="portlet.available">
<javac srcdir="${basedir}/src" destdir="${dir.classes}"
extdirs="${dir.lib}">
<classpath refid="cp.base"/>
<include name="org/h3270/web/Portlet.java"/>
</javac>
</target>
<target name="war" depends="compile" description="Build the WAR">
<war destfile="${file.war}" basedir="${dir.webapp}" webxml="${dir.webapp}/WEB-INF/web.xml">
<exclude name="WEB-INF/web.xml" />
<exclude name="WEB-INF/classes/**/test/**" />
<exclude name="WEB-INF/classes/com/**" />
<exclude name="WEB-INF/bin/**"/>
<exclude name="WEB-INF/bin-win/**"/>
</war>
</target>
<target name="deploy" depends="war" description="Deploy the Application (by copying)">
<copy file="${file.war}" todir="${dir.deploy}" />
</target>
<target name="undeploy" description="Undeploy the Application (by deleting the WAR)">
<delete>
<fileset dir="${dir.deploy}" includes="${file.war}" />
</delete>
</target>
<target name="clean" description="Delete all generated artifacts">
<delete dir="${dir.classes}" />
<delete file="${file.war}" />
</target>
<target name="test.init" depends="init" unless="test.skip">
<path id="cp.test">
<path refid="cp.base" />
<fileset dir="${dir.test}/lib" includes="*.jar" />
<fileset dir="${dir.j2ee}" includes="*.jar" />
</path>
<!-- add test sources so resources can be found -->
<path id="cp.run-test">
<path refid="cp.test" />
<pathelement location="${dir.test}/src" />
</path>
</target>
<target name="test.run" depends="test.init">
<property name="dir" value="${basedir}" />
<junit showoutput="true" printsummary="true" fork="true" dir="${dir}">
<classpath refid="cp.run-test" />
<test name="${testname}" />
<formatter type="plain" usefile="false" />
<!-- <sysproperty key="org.apache.commons.logging.Log" value="org.apache.commons.logging.impl.SimpleLog"/>
<sysproperty key="org.apache.commons.logging.simplelog.defaultlog" value="debug" /> -->
</junit>
</target>
<target name="test.check" if="test.skip" >
<echo>
The JUnit Tests were skipped. This may have 2 reasons:
1) The property dir.j2ee was not set. Some of the Tests depend on the J2EE libs. This
property should point to the lib subdir of the J2EE installation.
2) You set the property test.skip manually.
</echo>
</target>
<target name="test" description="Run All h3270 Unit Tests" depends="test.check, test.compile" unless="test.skip">
<antcall target="test.run">
<param name="testname" value="org.h3270.test.AllTest" />
</antcall>
<antcall target="test.run">
<param name="testname" value="org.h3270.test.PreferencesTest" />
<param name="dir" value="${dir.webapp}" />
</antcall>
</target>
<target name="release" depends="">
<property name="version" value="1.2.1" />
<property name="name.release" value="h3270-${version}" />
<property name="dir.release" value="release" />
<mkdir dir="${dir.release}" />
<mkdir dir="${dir.release}/${name.release}" />
<copy todir="${dir.release}/${name.release}">
<fileset dir="${basedir}">
<include name="ChangeLog" />
<include name="LICENSE" />
<include name="README" />
<include name="h3270.war" />
<include name="doc/**" />
<include name="webapp/**" />
<exclude name="**/CVS/* " />
<exclude name="**/test/**" />
<exclude name="**/classes/com/**" />
</fileset>
</copy>
<tar destfile="h3270-${version}.tar.gz" compression="gzip">
<tarfileset dir="${dir.release}">
<include name="${name.release}/**" />
</tarfileset>
</tar>
<zip destfile="h3270-${version}.zip">
<zipfileset dir="${dir.release}">
<include name="${name.release}/**" />
</zipfileset>
</zip>
<delete dir="${dir.release}/${name.release}" />
<mkdir dir="${dir.release}/${name.release}" />
<copy todir="${dir.release}/${name.release}" >
<fileset dir="${basedir}">
<include name="ChangeLog" />
<include name="LICENSE" />
<include name="README" />
<include name="build.xml" />
<include name="build.properties.example" />
<include name="doc/**" />
<include name="webapp/**" />
<include name="src/**" />
<include name="test/**" />
<exclude name="**/CVS/* " />
<exclude name="**/classes/**" />
</fileset>
</copy>
<tar destfile="h3270-${version}-src.tar.gz" compression="gzip">
<tarfileset dir="${dir.release}">
<include name="${name.release}/**" />
</tarfileset>
</tar>
<zip destfile="h3270-${version}-src.zip">
<zipfileset dir="${dir.release}">
<include name="${name.release}/**" />
</zipfileset>
</zip>
</target>
</project>