-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
90 lines (82 loc) · 3.74 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
<?xml version="1.0"?>
<project name="testdwr" default="package">
<!-- ===================================================================== -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<fileset dir="${basedir}/etc/ant" includes="**/*"/>
</classpath>
</taskdef>
<property name="dwr.home" value="${basedir}/../../dwr"/>
<property name="downloads" value="${basedir}/downloads"/>
<property name="servers" value="${basedir}/servers"/>
<property name="target" value="${basedir}/target/ant"/>
<!-- ===================================================================== -->
<target name="prepare" description="">
<tstamp/>
</target>
<!-- ===================================================================== -->
<target name="compile" depends="prepare" description="">
<ant dir="${dwr.home}" target="test" inheritall="false" inheritrefs="false"/>
<copy file="${dwr.home}/target/ant/dwr.jar" todir="${basedir}/main/web/WEB-INF/lib"/>
<copy file="${dwr.home}/target/ant/junitdwr.jar" todir="${basedir}/main/web/WEB-INF/lib"/>
<mkdir dir="${basedir}/main/web/WEB-INF/classes"/>
<javac debug="on" destdir="${basedir}/main/web/WEB-INF/classes" srcdir="${basedir}/main/java" includes="**/*.java" includeantruntime="false" excludes="**/package-info.java">
<classpath>
<fileset dir="${basedir}/main/lib" includes="**/*.jar"/>
<fileset dir="${basedir}/main/web/WEB-INF/lib" includes="**/*.jar"/>
</classpath>
</javac>
</target>
<!--=======================================================================-->
<target name="package" depends="compile" description="Create packaged outputs: testdwr.war">
<!-- Rezip the demo war file if it's contents have changed -->
<mkdir dir="${target}"/>
<copy file="${basedir}/main/java/org/testdwr/custom/index.html" tofile="${basedir}/main/web/WEB-INF/classes/org/testdwr/custom/index.html"/>
<if-not-uptodate destfile="${target}/testdwr.war" sourcedir="${basedir}/main/web">
<action>
<zip destfile="${target}/testdwr.war" basedir="${basedir}/main/web"/>
</action>
</if-not-uptodate>
</target>
<!-- ===================================================================== -->
<target name="clean" depends="prepare" description="Set the state of the filesystem back to that of a clean checkout">
<delete dir="${target}"/>
</target>
<!--=======================================================================-->
<macrodef name="if-not-uptodate">
<!-- If you change this, remember the copy in dwr/build.xml -->
<attribute name="destfile"/>
<attribute name="sourcedir"/>
<element name="action"/>
<sequential>
<if>
<or>
<not>
<available file="@{destfile}"/>
</not>
<not>
<uptodate targetfile="@{destfile}">
<srcfiles dir="@{sourcedir}" includes="**/*"/>
</uptodate>
</not>
</or>
<then>
<action/>
</then>
</if>
</sequential>
</macrodef>
<!-- ===================================================================== -->
<target name="start-jetty" depends="compile" description="Start testdwr in the embedded Jetty">
<java classname="org.testdwr.launch.JettyTestLauncher">
<classpath>
<pathelement location="${basedir}/main/lib/jetty-6.1.10.jar"/>
<pathelement location="${basedir}/main/lib/jetty-util-6.1.10.jar"/>
<pathelement location="${basedir}/main/lib/servlet-api-2.4.jar"/>
<pathelement location="${basedir}/main/lib/jsp-2.1.jar"/>
<pathelement location="${basedir}/main/lib/jsp-api-2.1.jar"/>
<pathelement location="${target}/launch"/>
</classpath>
</java>
</target>
</project>