-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·75 lines (65 loc) · 2.87 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
<?xml version="1.0"?>
<project name="blabberone" default="all">
<!--=======================================================================-->
<property name="source.root" value="."/>
<property name="source.java" value="${source.root}/java"/>
<property name="source.jar" value="${source.root}/jar"/>
<property name="source.web" value="${source.root}/web"/>
<property name="target.root" value="${source.root}/target/ant"/>
<property name="target.classes" value="${source.web}/WEB-INF/classes"/>
<!--=======================================================================-->
<patternset id="java.non.compile">
<include name="**/*.properties"/>
<include name="**/*.gif"/>
<include name="**/*.jpg"/>
<include name="**/*.png"/>
<include name="**/*.ser"/>
</patternset>
<property name="java.non.compile" value="**/*.properties,**/*.gif,**/*.jpg,**/*.png,**/*.ser"/>
<!--=======================================================================-->
<target name="prepare">
<echo message="Building on ${os.name}"/>
<tstamp/>
</target>
<!--=======================================================================-->
<target name="war" depends="prepare" description="Create a WAR directory">
<mkdir dir="${target.classes}"/>
<javac debug="on" includes="**/*.java" destdir="${target.classes}">
<src path="${source.java}"/>
<classpath>
<dirset dir="${target.classes}"/>
<fileset dir="${source.jar}" includes="**/*.jar"/>
<fileset dir="${source.web}/WEB-INF/lib" includes="**/*.jar"/>
</classpath>
</javac>
<copy todir="${target.classes}">
<fileset dir="${source.java}">
<patternset refid="java.non.compile"/>
</fileset>
</copy>
</target>
<!--=======================================================================-->
<target name="targetwar" depends="war" description="Copy war to target/ant/war-new">
<mkdir dir="${target.root}/war"/>
<mkdir dir="${target.root}/war-new"/>
<copy todir="${target.root}/war-new">
<fileset dir="${source.web}"/>
</copy>
</target>
<!--=======================================================================-->
<target name="live" depends="targetwar" description="Copy war-new to war">
<!-- we want these 2 commands to happen quickly so tomcat doesn't notice -->
<tstamp>
<format property="date" pattern="yyyy.MM.dd.HH.mm"/>
</tstamp>
<move file="${target.root}/war" tofile="${target.root}/war-${date}"/>
<move file="${target.root}/war-new" tofile="${target.root}/war"/>
</target>
<!--=======================================================================-->
<target name="all" depends="war">
</target>
<!--=======================================================================-->
<target name="clean" description="Wipe away the ./target">
<delete dir="${target.root}"/>
</target>
</project>