-
Notifications
You must be signed in to change notification settings - Fork 0
/
examples.xml
157 lines (139 loc) · 6.17 KB
/
examples.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
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
This file contains all the jar download targets to build Velocity.
Its tasks are referenced from the build.xml file and should not be
called directly.
This is here so that the main build file is not cluttered any further.
-->
<project name="VelocityTools - Example Apps" basedir=".">
<target name="build-examples"
description="Build WAR files for all VelocityTools example applications">
<property name="target" value="war"/>
<antcall target="simple-example" />
<antcall target="showcase-example" />
<antcall target="struts-example" />
</target>
<target name="clean-examples"
description="Build WAR files for all VelocityTools example applications">
<property name="target" value="clean"/>
<antcall target="simple-example" />
<antcall target="showcase-example" />
<antcall target="struts-example" />
</target>
<target name="simple-example">
<property name="name" value="simple" />
<property name="base" value="${examples.home}/${name}" />
<property name="lib" value="${base}/WEB-INF/lib"/>
<antcall target="example-${target}"/>
</target>
<target name="simple-dependencies">
<copy todir="${lib}" file="${dist.dir}/${view.id}.jar"/>
<copy todir="${lib}" file="${commons-beanutils.jar}"/>
<copy todir="${lib}" file="${commons-collections.jar}"/>
<copy todir="${lib}" file="${commons-digester.jar}"/>
<copy todir="${lib}" file="${commons-lang.jar}"/>
<copy todir="${lib}" file="${commons-logging.jar}"/>
<copy todir="${lib}" file="${oro.jar}"/>
<copy todir="${lib}" file="${velocity.jar}"/>
</target>
<target name="showcase-example">
<property name="name" value="showcase" />
<property name="base" value="${examples.home}/${name}" />
<property name="lib" value="${base}/WEB-INF/lib"/>
<antcall target="example-${target}"/>
</target>
<target name="showcase-dependencies" depends="simple-dependencies">
<copy todir="${lib}" file="${dom4j.jar}"/>
<copy todir="${lib}" file="${servlet.jar}"/>
</target>
<target name="struts-example">
<property name="name" value="struts" />
<property name="base" value="${examples.home}/${name}" />
<property name="lib" value="${base}/WEB-INF/lib"/>
<antcall target="example-${target}"/>
</target>
<target name="struts-dependencies">
<copy todir="${lib}" file="${dist.dir}/${struts.id}.jar"/>
<copy todir="${lib}" file="${commons-beanutils.jar}"/>
<copy todir="${lib}" file="${commons-chain.jar}"/>
<copy todir="${lib}" file="${commons-collections.jar}"/>
<copy todir="${lib}" file="${commons-digester.jar}"/>
<copy todir="${lib}" file="${commons-lang.jar}"/>
<copy todir="${lib}" file="${commons-logging.jar}"/>
<copy todir="${lib}" file="${commons-validator.jar}"/>
<copy todir="${lib}" file="${servlet.jar}"/>
<copy todir="${lib}" file="${sslext.jar}"/>
<copy todir="${lib}" file="${struts-core.jar}"/>
<copy todir="${lib}" file="${struts-taglib.jar}"/>
<copy todir="${lib}" file="${struts-tiles.jar}"/>
<copy todir="${lib}" file="${oro.jar}"/>
<copy todir="${lib}" file="${velocity.jar}"/>
</target>
<target name="example-compile">
<!-- run the dependencies target -->
<mkdir dir="${lib}"/>
<antcall target="${name}-dependencies"/>
<!-- compile the classes -->
<mkdir dir="${base}/WEB-INF/classes"/>
<javac srcdir="${base}/WEB-INF/src"
includes="*/**"
debug="${compile.debug}"
optimize="${compile.optimize}"
source="${compile.source}"
target="${compile.target}"
deprecation="${compile.deprecation}"
encoding="${compile.encoding}"
destdir="${base}/WEB-INF/classes">
<classpath>
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
</classpath>
</javac>
<!-- copy non-java resources -->
<copy todir="${base}/WEB-INF/classes">
<fileset dir="${base}/WEB-INF/src" excludes="**/*.java"/>
</copy>
</target>
<target name="example-war" depends="example-compile">
<jar jarfile="${examples.home}/${name}.war"
basedir="${base}"
excludes="**/MANIFEST.MF,**/servletapi-${jar.servletapi.version}.jar"/>
<echo> </echo>
<echo> A WAR file (Web ARchive) was created for you at </echo>
<echo> </echo>
<echo> ${examples.home}/${name}.war </echo>
<echo> </echo>
<echo> To use it with Tomcat, copy the ${name}.war file</echo>
<echo> to the webapps directory in the Tomcat tree </echo>
<echo> (assuming a standard Tomcat installation) and </echo>
<echo> then restart Tomcat. To access the page </echo>
<echo> point your browser to </echo>
<echo> </echo>
<echo> http://localhost:8080/${name}/index.vm </echo>
<echo> </echo>
<echo> If you have any questions, don't hesitate to </echo>
<echo> ask on the Velocity user list. </echo>
</target>
<target name="example-clean">
<delete file="${examples.home}/${name}.war"/>
<delete dir="${lib}" />
<delete dir="${base}/WEB-INF/classes"/>
</target>
</project>