-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.xml
174 lines (154 loc) · 6.59 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Ant build file for the documentation tutorial code
Writer of a chapter with an example have to include a foroward
to their build file. This latest build file suppose arguments
sets here :
src.dir : Directory where the source are : ./src
build.dir : Base directory where to store generated files
classpath : Classpath used to make any compilation
-->
<project name="jweather" default="all" basedir=".">
<!-- Load user property definition overrides -->
<property file="build.properties"/>
<property file="${user.home}/build.properties"/>
<property environment="env" />
<property name="src.dir" value="${basedir}/src"/>
<property name="src.resources" value="${basedir}/resources"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="dist.dir" value="${basedir}/dist"/>
<property name="properties.dir" value="${basedir}/properties"/>
<property name="lib.dir" value="${basedir}/lib"/>
<!-- ==================== Compilation Control Options ==================== -->
<!--
These properties control option settings on the Javac compiler when it
is invoked using the <javac> task.
compile.debug Should compilation include the debug option?
compile.deprecation Should compilation include the deprecation option?
compile.optimize Should compilation include the optimize option?
-->
<property name="compile.debug" value="true"/>
<property name="compile.deprecation" value="false"/>
<property name="compile.optimize" value="true"/>
<!-- ==================== External Dependencies =========================== -->
<!--<property name="some.jar" value="(set this in build.properties!)"/>-->
<property name="log4j.properties" value="(set this in build.properties!)"/>
<!-- ==================== Compilation Classpath =========================== -->
<!--
Rather than relying on the CLASSPATH environment variable, Ant includes
features that makes it easy to dynamically construct the classpath you
need for each compilation. The example below constructs the compile
classpath to include the servlet.jar file, as well as the other
components that Tomcat makes available to web applications automatically,
plus anything that you explicitly added.
-->
<path id="jweather.classpath">
<!--<pathelement location="${some.jar}"/>-->
<pathelement path="${log4j.properties}"/>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<!-- Clean build and dist -->
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<!-- No default Target -->
<target name="all" depends="jar">
</target>
<!-- Target to create files to store on the Web site -->
<target name="dist" depends="compile">
<mkdir dir="${dist.dir}"/>
<!-- Bundle all the sources and build script in one file -->
<zip zipfile="${dist.dir}/jweather.zip" basedir="${src.dir}" includes="net/**">
<fileset dir="${basedir}" includes="LICENSE"/>
<fileset dir="${basedir}" includes="LICENSE_log4j"/>
<fileset dir="${basedir}" includes="LICENSE_oro"/>
<fileset dir="${basedir}" includes="README"/>
<fileset dir="${basedir}" includes="build.xml"/>
<fileset dir="${basedir}" includes="build.properties"/>
<fileset dir="${basedir}" includes="stations.txt"/>
<fileset dir="${basedir}" includes="**/lib/**"/>
<fileset dir="${basedir}" includes="**/properties/**"/>
</zip>
<!--<tar tarfile="${dist.dir}/jweather.tar" basedir="${src.dir}" includes="net/**" />-->
<!--<gzip src="${dist.dir}/jweather.tar" zipfile="${dist.dir}/jweather.tar.gz" />-->
</target>
<!-- Target to create channel archive -->
<target name="jar" depends="compile">
<mkdir dir="${dist.dir}"/>
<jar destfile="${dist.dir}/${app.name}-${app.version}.jar">
<fileset dir="${build.dir}/classes"/>
<fileset dir="${basedir}" includes="LICENSE"/>
<fileset dir="${basedir}" includes="README"/>
<manifest>
<attribute name="Built-By" value="David Castro (arimus), Azusa Pacific University"/>
<attribute name="Main-Class" value="net.sf.jweather.Test"/>
</manifest>
</jar>
</target>
<target name="compile">
<mkdir dir="${build.dir}/classes"/>
<javac srcdir="${src.dir}"
destdir="${build.dir}/classes"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}">
<classpath refid="jweather.classpath"/>
</javac>
</target>
<target name="test" depends="jar">
<echo message="Invoking test"/>
<java fork="true" dir="${basedir}" classname="net.sf.jweather.Test">
<classpath>
<pathelement path="${dist.dir}/${app.name}-${app.version}.jar"/>
<pathelement path="${log4j.properties}"/>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</classpath>
</java>
</target>
<target name="metar-tests" depends="jar">
<echo message="Invoking junit METAR tests"/>
<java fork="true" dir="${basedir}" classname="net.sf.jweather.tests.MetarTest">
<classpath>
<pathelement path="${dist.dir}/${app.name}-${app.version}.jar"/>
<pathelement path="${log4j.properties}"/>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</classpath>
</java>
</target>
<target name="run" depends="jar">
<echo message="Running ${class} ${args}"/>
<java fork="true" dir="${basedir}" classname="${class}">
<arg line="${args}"/>
<classpath>
<pathelement path="${dist.dir}/${app.name}-${app.version}.jar"/>
<pathelement path="${log4j.properties}"/>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</classpath>
</java>
</target>
<target name="javadoc" depends="compile"
description="Create Javadoc API documentation">
<mkdir dir="${dist.dir}/docs/api"/>
<javadoc sourcepath="src"
classpathref="jweather.classpath"
destdir="${dist.dir}/docs/api"
packagenames="net.sf.jweather.*"
access="public"
author="true"
version="true"
windowtitle="${app.name} ${app.version} API Documentation">
<doctitle><![CDATA[${app.name} ${app.version}<br/>API Documentation]]></doctitle>
<header><![CDATA[${app.name} ${app.version}<br/>API Documentation]]></header>
</javadoc>
</target>
<!-- Add a new target here -->
</project>