-
Notifications
You must be signed in to change notification settings - Fork 2
/
build-example.xml
73 lines (61 loc) · 2.92 KB
/
build-example.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
<project name="warp-example">
<description>A rudimentary deployable example webapp built on warp</description>
<import file="build.xml"/>
<property file="build-example.properties"/>
<path id="core.classpath">
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- this class path is only needed if you're running the demo webapp with jetty from this script-->
<path id="jetty.plugin.classpath">
<fileset dir="${jetty.lib}" includes="**/*.jar"/>
</path>
<target name="build.demo" depends="assemble.jar" description="Builds demo artifacts for making a deployable war">
<antcall target="clean"/>
<antcall target="init"/>
<javac srcdir="${src}" destdir="${build}">
<classpath>
<path refid="core.classpath"/>
<fileset dir="${dir.distribute}">
<include name="*.jar"/>
</fileset>
<pathelement location="${build}"/>
</classpath>
</javac>
<!-- copy non binary resources to output classpath -->
<copy todir="${build}">
<fileset dir="${src}">
<include name="com/wideplay/warp/example/**/*.xml"/>
<include name="com/wideplay/warp/example/**/*.properties"/>
<include name="com/wideplay/warp/example/**/*.js"/>
</fileset>
</copy>
</target>
<target name="assemble.war" depends="build.demo" description="Assembles a deployable war of Warp and the standard demo webapp (contained in .example)">
<war basedir="${demo.resources}" destfile="${dir.distribute}/${demo.artifact}" webxml="${demo.webxml}">
<lib dir="${dir.distribute}">
<include name="${core.artifact}"/>
</lib>
<lib dir="${lib}">
<exclude name="javaee.jar"/>
<include name="**/*.jar"/>
</lib>
<classes dir="${build}">
<include name="com/wideplay/warp/example/**"/>
</classes>
</war>
</target>
<!-- targets to deploy the demo webapp in jetty -->
<!-- Enable if you have jetty only...
<target name="jetty.run" description="Runs the demo webapp (expects it is published to dist) using the Jetty web server">
<taskdef classpathref="jetty.plugin.classpath" resource="tasks.properties" loaderref="jetty.loader" />
<jetty>
<webapp name="${demo.webapp}" contextPath="${demo.context-path}" warfile="${dir.distribute}/${demo.artifact}"/>
</jetty>
</target>-->
<target name="deploy.tomcat.root" depends="clean,assemble.war">
<fail unless="tomcat.home">Please set tomcat.home value.</fail>
<copy tofile="${tomcat.home}/webapps/ROOT.war" file="${dir.distribute}/${demo.artifact}"/>
</target>
</project>