blob: 6702c7a6c4835cc3af6a1150d29f95122930841c (
plain)
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
|
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant"
name="My Vaadin Hello World"
basedir="."
default="package-war">
<target name="configure">
<property file="${basedir}/Application.properties"/>
<property name="main.dir" value="${basedir}/src/main" />
<property name="build.dir" value="${basedir}/build"/>
<property name="dist.dir" value="${basedir}/dist"/>
<property name="src.dir" value="${main.dir}/java" />
<property name="web.dir" value="${main.dir}/WebContent"/>
<property name="classes.dir" value="${build.dir}/WEB-INF/classes"/>
<property name="lib.dir" value="${build.dir}/WEB-INF/lib"/>
<property name="war.name" value="${app.name}-${app.version}.war"/>
<property name="compile.debug" value="true"/>
<property name="compile.deprecation" value="false"/>
<property name="compile.optimize" value="true"/>
<property file="${basedir}/tomcat.properties"/>
<path id="cp.tomcat">
<fileset dir="${catalina.home}/bin">
<include name="*.jar"/>
</fileset>
<fileset dir="${catalina.home}/lib">
<include name="*.jar"/>
</fileset>
</path>
<taskdef classpathref="cp.tomcat" resource="org/apache/catalina/ant/catalina.tasks" />
</target>
<target name="resolve" description="retrieve dependencies with Ivy">
<ivy:resolve file="ivy.xml" log="download-only"/>
<ivy:cachepath pathid="ivy.deps.server-side" conf="server-side" />
<ivy:cachefileset setid="ivy.deps.server-side.fileset" conf="server-side"/>
</target>
<target name="ivy-report" depends="configure,resolve">
<ivy:report conf="default" organisation="ch.asynk" module="${app.name}"/>
</target>
<target name="clean" depends="configure" description="clean project">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
<delete file="build.log" />
<delete file="test.log" />
<delete file="ivy-report.css" />
<delete>
<fileset dir="${basedir}" includes="ch.asynk-${app.name}-*"/>
</delete>
</target>
<target name="ctags" depends="configure">
<exec executable="ctags" failonerror="false">
<arg value="-R"/>
<arg value="--language-force=java"/>
<arg value="-f.tags"/>
<arg value="${src.dir}"/>
</exec>
</target>
<target name="compile-server-side" depends="configure,resolve,ctags">
<record name="build.log" loglevel="verbose" action="start" />
<mkdir dir="${classes.dir}" />
<javac srcdir="${main.dir}"
destdir="${classes.dir}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}"
includeantruntime="false">
<classpath refid="ivy.deps.server-side"/>
<compilerarg value="-Xlint:all"/>
<compilerarg value="-Xlint:-path"/>
<compilerarg value="-Xlint:-processing"/>
<compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/>
</javac>
</target>
<target name="package-war" depends="compile-server-side">
<mkdir dir="${lib.dir}"/>
<copy todir="${lib.dir}" flatten="true">
<fileset refid="ivy.deps.server-side.fileset"/>
</copy>
<delete>
<fileset dir="${lib.dir}">
<include name="**/*-sources.jar"/>
<include name="**/*-javadoc.jar"/>
</fileset>
</delete>
<delete file="${dist.dir}/${war.name}"/>
<war destfile="${dist.dir}/${war.name}"
webxml="${web.dir}/WEB-INF/web.xml">
<classes dir="${classes.dir}" includes="**" />
<fileset dir="${web.dir}">
<patternset>
<include name="images/**/*" />
<include name="VAADIN/widgetsets/**/*" />
<include name="*.html" />
<include name="WEB-INF/lib/*" />
<include name="WEB-INF/*.xml" />
</patternset>
</fileset>
<fileset dir="${build.dir}">
<include name="WEB-INF/lib/*" />
<include name="VAADIN/themes/**/*" />
</fileset>
</war>
</target>
<!-- tomcat specific targets -->
<target name="remove" description="Remove application on servlet container">
<undeploy url="${manager.url}"
username="${manager.username}"
password="${manager.password}"
path="${app.path}"
failonerror="false"/>
</target>
<target name="install" depends="package-war,remove" description="Install application to servlet container">
<copy todir="/tmp" file="${dist.dir}/${war.name}"/>
<deploy url="${manager.url}"
username="${manager.username}"
password="${manager.password}"
path="${app.path}"
localWar="file://tmp/${war.name}"/>
<delete file="/tmp/${war.name}"/>
</target>
</project>
|