-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
196 lines (157 loc) · 7.32 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?xml version="1.0"?>
<!--
Run "ant -projecthelp" to view all the possible targets and descriptions.
-->
<project name="HippoTest" basedir=".">
<property file="build.properties" />
<path id="lib.include">
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
</path>
<!-- all Third Party jars and tool jars this module needs to compile -->
<path id="lib.jars">
<path refid="lib.include" />
<fileset dir="${libexclude}">
<include name="**/*.jar" />
</fileset>
</path>
<!-- must keep junit jars separate for ease of creating classpath in manifest -->
<path id="tool.and.lib">
<path refid="lib.jars" />
</path>
<path id="gwt">
<fileset dir="tools/gwt">
<include name="**/*.jar" />
</fileset>
</path>
<path id="classes.classpath">
<pathelement location="${build}" />
</path>
<target name="compile" >
<mkdir dir="${build}" />
<pathconvert property="compile.classpath" pathsep=";">
<path refid="tool.and.lib" />
</pathconvert>
<echo message="Compiling files in ${javacode}" />
<echo message="Putting the class files in ${build}" />
<echo message="classpath=${compile.classpath}" />
<!-- Compile the java code from ${javacode} into ${build} -->
<javac srcdir="${javacode}" destdir="${build}" deprecation="yes" debug="on">
<classpath>
<path refid="tool.and.lib" />
<path refid="gwt" />
</classpath>
</javac>
<pathconvert property="gwt.classpath" pathsep=";">
<path refid="gwt" />
</pathconvert>
<echo message="gwt classpath=${gwt.classpath}"/>
<!-- compile java to javascript here -->
<java maxmemory="512M" failonerror="true" classname="com.google.gwt.dev.GWTCompiler" fork="true">
<classpath>
<pathelement path="${javacode}" />
<path refid="tool.and.lib" />
<path refid="gwt" />
</classpath>
<arg value="-out" />
<arg value="${gwt.out}" />
<!-- <arg value="-style"/>
<arg value="pretty"/>-->
<arg value="${gwt.module}" />
</java>
<java maxmemory="512M" failonerror="true" classname="com.google.gwt.dev.GWTCompiler" fork="true">
<classpath>
<pathelement path="${javacode}" />
<path refid="tool.and.lib" />
<path refid="gwt" />
</classpath>
<arg value="-out" />
<arg value="${gwt.out}" />
<arg value="${gwt.module2}" />
</java>
</target>
<target name="copyForJar" depends="compile">
<echo message="webapp.enabled=${webapp.enabled}" />
<property name="run.war.target" value="true" />
<!-- Also, copy over all needed jars from ${lib} to ${jardist} -->
<!-- <copy todir="${jardist}">
<fileset dir="${lib}" includes="**" />
</copy>
-->
</target>
<!--
***********************************************************************
JAR TARGET
***********************************************************************
-->
<target name="jar" depends="copyForJar" description="Builds a jar file">
<!-- Create the distribution directory -->
<mkdir dir="${jardist}" />
<!-- Put all implementation classes from ${build} into the jar file -->
<jar jarfile="${jardist}/${jar.name}" basedir="${build}" />
</target>
<!--
***********************************************************************
WAR TARGET
***********************************************************************
-->
<target name="war" depends="jar" if="run.war.target" description="Builds a war file">
<mkdir dir="${wardist}" />
<!-- <war destfile="${wardist}/${name}.war" webxml="${webroot}/WEB-INF/web.xml" >-->
<war destfile="${wardist}/${name}.war" webxml="${specialWebIncludes}/web.xml" >
<lib dir="${lib}">
<include name="**/*.jar" />
</lib>
<classes dir="${classes}" />
<!-- <manifest context.xml??-->
<fileset dir="${webroot}" />
<fileset dir="${gwt.out}"/>
</war>
</target>
<target name="tomcatTasks">
<fail unless="tomcat.home" message="PLEASE make sure you have a ${user.home}/ant.properties file with the property tomcat.home set" />
<fail unless="tomcat.username" message="PLEASE make sure you have a ${user.home}/ant.properties file with the property tomcat.username set" />
<fail unless="tomcat.password" message="PLEASE make sure you have a ${user.home}/ant.properties file with the property tomcat.password set" />
<fail unless="tomcat.url" message="PLEASE make sure you have a ${user.home}/ant.properties file with the property tomcat.url set" />
<taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"/>
<taskdef name="list" classname="org.apache.catalina.ant.ListTask"/>
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"/>
<taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"/>
<taskdef name="roles" classname="org.apache.catalina.ant.RolesTask"/>
<taskdef name="start" classname="org.apache.catalina.ant.StartTask"/>
<taskdef name="stop" classname="org.apache.catalina.ant.StopTask"/>
<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"/>
<echo message="foo"></echo>
<property name="tomcat.manager.url" value="${tomcat.url}/manager" />
<path id="tomcat.classpath">
<fileset dir="${tomcat.home}/server/lib/">
<include name="catalina-ant.jar" />
</fileset>
</path>
<!--Just a convenient pathconvert to debug paths above by converting to string and printing -->
<pathconvert dirsep="/" pathsep=" " property="temp.tomcat" refid="tomcat.classpath" setonempty="true" />
<echo message="tomcat ant task jars=${temp.tomcat}" />
<!-- <taskdef resource="org/apache/catalina/ant/antlib.xml" classpathref="tomcat.classpath" />-->
</target>
<target name="deploy" description="Install application in Tomcat" depends="tomcatTasks, war">
<deploy url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" path="/" war="${wardist}/${name}.war" />
</target>
<target name="undeploy" description="Remove application in Tomcat" depends="tomcatTasks">
<undeploy url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" path="/" />
</target>
<target name="redeploy" description="Reload application in Tomcat" depends="war, undeploy, deploy">
</target>
<target name="start" description="Start Tomcat application" depends="tomcatTasks">
<start url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" path="/${name}" />
</target>
<target name="stop" description="Stop Tomcat application" depends="tomcatTasks">
<stop url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" path="/${name}" />
</target>
<target name="tomcatInfo" description="List Tomcat applications" depends="tomcatTasks">
<list url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" />
<roles url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" />
<resources url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" />
<sessions url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" path="/${name}" />
</target>
</project>