-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
143 lines (128 loc) · 4.55 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
<?xml version="1.0"?>
<!-- ant build file for video project
Copyright (C) 2007-2011 Minnesota Department of Transportation
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. -->
<project name="video" default="war" basedir=".">
<property file="project.properties"/>
<property file="${user.home}/.ant.properties"/>
<property name="src.dir" value="src" />
<property name="etc.dir" value="etc" />
<property name="web.dir" value="web" />
<property name="lib.dir" value="lib" />
<property name="bin.dir" value="bin" />
<property name="build.dir" value="build" />
<property name="build.war.dir" value="${build.dir}/war" />
<property name="build.src.dir" value="${build.dir}/src" />
<property name="build.etc.dir" value="${build.dir}/etc" />
<property name="build.web.dir" value="${build.dir}/web" />
<property name="build.lib.dir" value="${build.dir}/lib" />
<property name="build.dist.dir" value="${build.dir}/dist" />
<property name="build.classes.dir" value="${build.dir}/classes" />
<property name="build.javadocs.dir" value="${build.dir}/javadocs" />
<property name="webxml" value="${web.dir}/web-inf/web.xml"/>
<property name="userdocs.dir" value="${name}" />
<property name="build.compiler.pedantic" value="true"/>
<path id="classpath">
<fileset dir = "${lib.dir}" includes="**/*.jar"/>
</path>
<!-- Check for dependancies -->
<target name="check-deps">
<antcall target="check-jar">
<param name="file.jar" value="postgresql-8.4-702.jdbc3.jar"/>
</antcall>
<antcall target="check-jar">
<param name="file.jar" value="servlet-api.jar"/>
</antcall>
</target>
<!-- Check for one jar dependancy -->
<target name="check-jar">
<available property="jar.exists"
file="${lib.dir}/${file.jar}"/>
<echo message="Checking for ${lib.dir}/${file.jar}"/>
<fail unless="jar.exists"
message="Missing dependency: ${lib.dir}/${file.jar}"/>
</target>
<!-- Prepares the directory structure -->
<target name="prepare"
description="Prepare the build directory">
<mkdir dir="${build.src.dir}" />
<mkdir dir="${build.classes.dir}" />
<mkdir dir="${build.lib.dir}" />
<copy todir="${build.src.dir}">
<fileset dir="${src.dir}"/>
</copy>
<copy todir="${build.web.dir}">
<fileset dir="${web.dir}" />
</copy>
<copy todir="${build.etc.dir}">
<fileset dir="${etc.dir}" />
</copy>
<chmod dir="${build.etc.dir}" perm="ugo+rx"
includes="**/*.sh"/>
</target>
<!-- Compile the source cod -->
<target name="compile"
depends="check-deps, prepare"
description="Compiles all of the source files for the project.">
<javac destdir="${build.classes.dir}"
excludes="us/mn/state/dot/video/dev/**"
debug="on"
deprecation="on"
optimize="on"
target="1.5">
<src path="${build.src.dir}"/>
<classpath refid="classpath" />
</javac>
</target>
<!-- Create the war -->
<target name="war"
depends="clean, compile"
description="Creates the war file. Can be used as backend or repeater">
<copy todir="${build.war.dir}/WEB-INF/lib">
<fileset dir="${lib.dir}" >
<exclude name="servlet*" />
</fileset>
</copy>
<copy todir="${build.war.dir}/WEB-INF/classes">
<fileset dir="${build.classes.dir}">
<include name="us/mn/state/dot/video/*.*"/>
<include name="us/mn/state/dot/video/server/*.*"/>
</fileset>
<fileset dir="${etc.dir}">
<include name="logging.properties"/>
</fileset>
</copy>
<war
destfile="${build.lib.dir}/${name}.war-${version}"
webxml="${webxml}"
basedir="${build.war.dir}">
</war>
</target>
<!-- Create the API documentation -->
<target name="javadocs"
depends="prepare"
description="Creates the javadocs for the project.">
<javadoc packagenames="${packages}"
classpathref="classpath"
sourcepath="${basedir}/${src.dir}"
destdir="${build.javadocs}"
author="true"
version="true"
windowtitle="${name} API"
doctitle="${name}-${version}"
bottom="Copyright © Minnesota Department of
Transportation. All Rights Reserved."/>
</target>
<!-- Clean up generated stuff -->
<target name="clean"
description="deletes build directory.">
<delete dir="${build.dir}"/>
</target>
</project>