-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.xml
144 lines (117 loc) · 4.42 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
<project name="SimpleGatewayServer" default="deploywar" xmlns:ivy="antlib:org.apache.ivy.ant">
<property file="build.properties" />
<property name="name" value="SimpleGatewayServer" />
<property name="lib.dir" value="lib" />
<property name="java.dir" value="src" />
<property name="resource.dir" value="src/main/resources" />
<property name="webapp.dir" value="src/main/webapp" />
<property name="target.dir" value="target" />
<property name="build.dir" value="target/classes" />
<!-- ivy properties used -->
<property name="ivy.settings.dir" value="${user.home}/.ivy2/settings" />
<path id="lib.path.id">
<fileset dir="${lib.dir}" />
</path>
<pathconvert property="class-path" dirsep="/" pathsep=" "
refid="lib.path.id">
<map from="${basedir}${file.separator}lib${file.separator}"
to="" />
</pathconvert>
<ivy:settings file="${ivy.settings.dir}/settings.xml" />
<target name="init">
<!-- Create the time stamp -->
<tstamp>
<format property="build.date" pattern="dd-MM-yyyy HH:mm:ss" />
</tstamp>
<echo message="Build at ${build.date}" />
</target>
<target name="usage" depends="init">
<echo message="" />
<echo message="${name} build file" />
<echo message="-----------------------------------" />
<echo message="" />
<echo message="Available targets are:" />
<echo message="" />
<echo message="build --> Build the application" />
<echo message="deploy --> Deploy application as directory" />
<echo message="deploywar --> Deploy application as a WAR file" />
<echo message="" />
</target>
<!-- =================================
target: resolve
================================= -->
<target name="resolve" depends="init" description="--> retrieve dependencies with ivy">
<ivy:retrieve />
</target>
<target name="build" depends="resolve" description="Compile main source tree java files">
<mkdir dir="${build.dir}" />
<javac srcdir="${java.dir}" destdir="${build.dir}" classpathref="lib.path.id" debug="true" deprecation="true" optimize="true" failonerror="true"/>
<copy file="${java.dir}/XmlRPC.properties" todir="${target.dir}/${name}/WEB-INF/classes" />
<!--
<copy todir="${build.dir}">
<fileset dir="${resource.dir}" includes="*.properties" />
</copy>
<copy todir="${build.dir}/config">
<fileset dir="${resource.dir}/config"/>
</copy>
<copy todir="${build.dir}/templates">
<fileset dir="${resource.dir}/templates"/>
</copy>
-->
</target>
<target name="deploy" depends="build" description="Deploy application">
<mkdir dir="${build.dir}/${name}" />
<mkdir dir="${target.dir}/${name}/WEB-INF/lib" />
<!-- classes etc. -->
<copy todir="${target.dir}/${name}/WEB-INF/classes">
<fileset dir="${build.dir}">
<include name="**/*" />
</fileset>
</copy>
<!-- libraries -->
<copy todir="${target.dir}/${name}/WEB-INF/lib">
<fileset dir="${lib.dir}">
<include name="*.jar" />
<exclude name="weblogic*" />
<exclude name="*dbcp*" />
<exclude name="ojdbc*" />
<exclude name="mail*" />
<exclude name="activation*" />
<exclude name="servlet-api*" />
</fileset>
</copy>
</target>
<target name="deploywar" depends="build, deploy" description="Deploy application as a WAR file">
<mkdir dir="${target.dir}" />
<!--war destfile="${build.dir}/dist/${name}_${app.version}.war" webxml="${build.dir}/exploded/${name}/WEB-INF/web.xml"-->
<war destfile="${target.dir}/${name}.war" webxml="web.xml">
<fileset dir="${target.dir}/${name}">
<include name="**/*.*" />
<exclude name="banner/**" />
<exclude name="e/**" />
<exclude name="i/**" />
<exclude name="images/**" />
</fileset>
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Built-Date" value="${build.date}" />
<attribute name="Class-path" value="${class-path}"/>
</manifest>
</war>
<!--
<copy todir="${deploy.path}" preservelastmodified="true">
<fileset dir="${target.dir}">
<include name="${name}.war" />
</fileset>
</copy>
-->
</target>
<target name="clean" depends="init" description="Clean output directories">
<delete dir="${target.dir}/"/>
<delete>
<fileset dir="${lib.dir}" includes="**/*.*"/>
</delete>
<delete file="${deploy.path}/${name}.war"/>
<!-- ivy:cleancache / -->
</target>
</project>