-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
110 lines (101 loc) · 3.57 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
<?xml version="1.0" ?>
<project name="lou" default="deploy-war">
<!-- maak env variabele-->
<property environment="env" />
<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>
<property name="war.dir" value="dist"/>
<property name="doc.dir" value="doc"/>
<property name="lib.dir" value="WebContent/WEB-INF/lib"/>
<property name="classes.dir" value="bin"/>
<property name="web.dir" value="WebContent"/>
<property name="local.dir" value="/Applications/apache-tomcat-5.5.27/webapps/lou"/>
<!-- create the classpath -->
<path id="classpath">
<fileset dir="${lib.dir}" includes="*.jar"/>
</path>
<target name="init">
<mkdir dir="${build.dir}" />
<mkdir dir="${war.dir}" />
<mkdir dir="${classes.dir}" />
</target>
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${war.dir}"/>
<delete dir="${classes.dir}" />
<delete dir="${tomcat.dir}"/>
</target>
<target name="compile" depends="init">
<javac srcdir="${src.dir}" destdir="${classes.dir}" debug="on">
<classpath>
<path refid="classpath"/>
</classpath>
</javac>
</target>
<target name="javadoc" depends="init">
<javadoc packagenames=".*" sourcepath="${src.dir}" destdir="${doc.dir}/api"
author="true"
version="true"
use="true"
>
<classpath>
<path refid="classpath"/>
</classpath>
</javadoc>
</target>
<target name="build" depends="clean,compile,buildtime">
<loadfile property="time" srcFile="${web.dir}/build.txt"/>
<delete file="${build.dir}/lou.jar"/>
<jar jarfile="${build.dir}/lou.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Built-By" value="Noterik B.V."/>
<attribute name="Main-Class" value="org.springfield.lou.LouApplication"/>
<attribute name="Build" value="${time}"/>
</manifest>
</jar>
</target>
<target name="deploy-war" depends="build">
<loadfile property="time" srcFile="${web.dir}/build.txt"/>
<war destfile="${war.dir}/lou.war" webxml="${web.dir}/WEB-INF/web.xml">
<lib dir="${build.dir}" />
<fileset dir="${web.dir}">
<exclude name="WEB-INF/web.xml"/>
<exclude name="WEB-INF/lib/servlet.jar"/>
<exclude name="WEB-INF/lib/servlet-api.jar"/>
<exclude name="WEB-INF/lib/jsp-api.jar"/>
<exclude name="WEB-INF/lib/mojo.jar"/>
<exclude name="WEB-INF/lib/dom4j-1.6.1.jar"/>
<exclude name="WEB-INF/lib/log4j-1.2.15.jar"/>
<exclude name="WEB-INF/lib/org.apache.commons.codec.jar"/>
<exclude name="WEB-INF/lib/org.apache.commons.httpclient.jar"/>
<exclude name="WEB-INF/lib/org.apache.commons.logging.jar"/>
<exclude name="WEB-INF/lib/jaxen-1.1.1.jar"/>
<exclude name="WEB-INF/lib/org.restlet.jar" />
<exclude name="WEB-INF/lib/com.noelios.restlet.jar"/>
<exclude name="WEB-INF/lib/com.noelios.restlet.ext.servlet_2.4.jar"/>
<exclude name="WEB-INF/lib/javax.servlet.jar"/>
</fileset>
<manifest>
<attribute name="Built-By" value="Noterik B.V."/>
<attribute name="Build" value="${time}"/>
</manifest>
</war>
</target>
<target name="deploy-local" depends="build">
<copy file="${build.dir}/lou.jar" todir="${local.dir}/WEB-INF/lib" />
<copy todir="${local.dir}/WEB-INF/lib/">
<fileset dir="${lib.dir}" includes="**/*.jar">
<exclude name="jsp-api.jar"/>
<exclude name="mojo.jar"/>
<exclude name="servlet.jar"/>
<exclude name="servlet-api.jar"/>
</fileset>
</copy>
</target>
<target name="buildtime">
<tstamp>
<format property="time" pattern="yyyy/MM/dd HH:mm:ss" unit="hour"/>
</tstamp>
<echo file="${web.dir}/build.txt">${time}</echo>
</target>
</project>