-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
164 lines (133 loc) · 5.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
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="rims" basedir=".">
<property environment="env"/>
<!--do not change the order in which the properties gets loaded-->
<property file="tomcatTasks.properties"/>
<property file="user.software.properties"/>
<property file="tomcat.properties"/>
<property name="name" value="rims"/>
<property name="src.dir" value="main/src"/>
<property name="web.dir" value="web"/>
<property name="web.inf" value="${web.dir}/WEB-INF/"/>
<property name="web.inf.lib" value="${web.inf}/lib/"/>
<property name="build.dir" value="${web.inf}/classes/"/>
<property name="dist" value="dist"/>
<property name="dist.war.file" value="${dist}/${name}.war"/>
<path id="master-classpath">
<fileset dir="${web.inf.lib}">
<include name="*.jar"/>
</fileset>
<fileset dir="${appserver.lib}">
<include name="servlet*.jar"/>
</fileset>
<pathelement path="${build.dir}"/>
</path>
<target name="usage">
<echo message=""/>
<echo message="${name} build file"/>
<echo message="-------------------"/>
<echo message="available targets are"/>
<echo message="build --> Build the application"/>
<echo message="deploy --> Deploy application as directory"/>
<echo message="deploywar --> Deploy application as a WAR file"/>
<echo message="install --> Install application in Tomcat"/>
<echo message="reload --> Reload application in Tomcat"/>
<echo message="start --> Start Tomcat application"/>
<echo message="stop --> Stop Tomcat application"/>
<echo message="list --> List Tomcat applications"/>
<echo message=""/>
</target>
<target name="-create.context.symlink">
<property name="-meta.inf.file" value="${user.dir}\web\meta-inf\context.xml"/>
<exec executable="cmd">
<arg value="/c"/>
<arg value="mklink ${tomcat.context.dir}\rims.xml ${-meta.inf.file}"/>
</exec>
</target>
<target name="-create.rims.webapp.symlink">
<property name="-web.app.dir" value="${user.dir}\rims.root\web"/>
<exec executable="cmd">
<arg value="/c"/>
<arg value="mklink /d ${tomcat.webapps.dir}\rims ${-web.app.dir}"/>
</exec>
</target>
<target name="create.symlinks">
<antcall target="-create.context.symlink"/>
<antcall target="-create.rims.webapp.symlink"/>
</target>
<target name="build">
<mkdir dir="${build.dir}"/>
<javac destdir="${build.dir}" source="1.5" target="1.5" debug="true">
<src path="${src.dir}">
</src>
<classpath refid="master-classpath">
</classpath>
</javac>
</target>
<target name="deploy" depends="build">
<copy todir="${deploy.path}/${name}" preservelastmodified="true">
<fileset dir="${web.dir}">
<include name="**/*.*"/>
</fileset>
</copy>
</target>
<target name="redeploy" depends="build, undeploy, deploy"/>
<path id="catalina-ant-classpath">
<fileset dir="${appserver.lib}">
<include name="catalina-ant.jar"/>
</fileset>
</path>
<taskdef name="install" classname="${install}">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="reload" classname="${reload}">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="list" classname="${list}">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="start" classname="${start}">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="deploy" classname="${deploy}">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="undeploy" classname="${undeploy}">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="stop" classname="${stop}">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<target name="reload" description="Reload application in Tomcat">
<reload url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}"
path="/${name}"/>
</target>
<target name="start" description="Start Tomcat application">
<start url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}"
path="/${name}"/>
</target>
<target name="stop" description="Stop Tomcat application">
<stop url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}"
path="/${name}"/>
</target>
<target name="list" description="List Tomcat applications">
<list url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}"/>
</target>
<target name="make.war" depends="build">
<mkdir dir="${dist}"/>
<war destfile="${dist}/${name}.war" webxml="${web.inf}/web.xml">
<fileset dir="${web.dir}">
<include name="**/*.*"/>
</fileset>
</war>
</target>
<target name="deploy.war" depends="make.war">
<deploy url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}"
path="/${name}" war="${dist.war.file}"/>
</target>
<target name="redeploy.war" depends="make.war, undeploy, deploy.war"/>
<target name="undeploy">
<undeploy url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}"
path="/${name}" />
</target>
</project>