forked from buntata/buntata-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
137 lines (117 loc) · 4.47 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
<!--
~ Copyright 2016 Information & Computational Sciences, The James Hutton Institute
~
~ Licensed 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.
-->
<project name="Buntata" default="compile8" basedir=".">
<property file="build-wildcat.properties"/>
<property name="src" location="src"/>
<property name="lib" location="lib"/>
<property name="cls" location="web/WEB-INF/classes"/>
<property name="web" location="web"/>
<property name="path" value="${deploy.name}/v${api.version}"/>
<property name="jar" value="buntata-server.jar"/>
<property name="war" value="${project.name}.war"/>
<!-- Development classpath -->
<path id="project.classpath">
<fileset dir="${lib}"/>
</path>
<!-- Runtime classpath (manifest formatted) -->
<manifestclasspath property="jar.classpath" jarfile="${jar}">
<classpath>
<fileset dir="${lib}">
<exclude name="**/lib-devel/**"/>
</fileset>
</classpath>
</manifestclasspath>
<target name="compile7" depends="clean">
<javac destdir="${cls}" source="7" target="7" debug="true" includeantruntime="false">
<src path="${src}"/>
<include name="jhi/buntata/resource/**" />
<classpath refid="project.classpath"/>
</javac>
</target>
<target name="compile8" depends="clean">
<javac srcdir="${src}" destdir="${cls}" source="8" target="8" debug="true" includeantruntime="false">
<src path="${src}"/>
<classpath refid="project.classpath"/>
</javac>
</target>
<target name="clean">
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${cls}" includes="**/*"/>
<fileset file="${jar}"/>
</delete>
</target>
<target name="jar" depends="compile8">
<jar jarfile="${jar}">
<fileset dir="${cls}"/>
<manifest>
<attribute name="Main-Class" value="jhi.buntata.server.Buntata"/>
<attribute name="Class-Path" value="${jar.classpath}"/>
</manifest>
</jar>
</target>
<target name="jar-sqlite" depends="compile8">
<jar jarfile="${web}/WEB-INF/sqlite/sqlite-client.jar">
<fileset dir="${cls}">
<exclude name="**/server/**"/>
</fileset>
</jar>
</target>
<target name="jar-client" depends="compile7">
<jar jarfile="buntata-client.jar">
<fileset dir="${cls}">
<exclude name="**/server/**"/>
<exclude name="**/data/**"/>
<exclude name="**/sqlite/**"/>
</fileset>
</jar>
</target>
<target name="war" depends="jar, jar-sqlite">
<copy
file="web/context.xml.template"
tofile="web/context.xml"
overwrite="true">
<filterset>
<filter token="datasource" value="${datasource}"/>
<filter token="database.username" value="${database.username}"/>
<filter token="database.password" value="${database.password}"/>
<filter token="master.username" value="${master.username}"/>
<filter token="master.password" value="${master.password}"/>
<filter token="database.url" value="${database.url}"/>
<filter token="data.dir" value="${data.dir}"/>
<filter token="api.version" value="${api.version}"/>
<filter token="ga.tracking.id" value="${ga.tracking.id}"/>
</filterset>
</copy>
<war destfile="${war}" update="false">
<webinf dir="web/WEB-INF"/>
<lib dir="${lib}" excludes="**/lib-devel/**"/>
<lib file="${jar}"/>
<zipfileset dir="res" includes="*.*" prefix="WEB-INF"/>
<zipfileset dir="." includes="logging.properties" prefix="WEB-INF/classes"/>
<metainf file="web/context.xml"/>
</war>
</target>
<target name="undeploy">
<taskdef name="undeploy" classpathref="project.classpath" classname="org.apache.catalina.ant.UndeployTask"/>
<undeploy url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}"
path="/${path}" failOnError="false"/>
</target>
<target name="deploy" depends="war, undeploy">
<taskdef name="deploy" classpathref="project.classpath" classname="org.apache.catalina.ant.DeployTask"/>
<deploy url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}"
path="/${path}" war="${project.name}.war"/>
</target>
</project>