forked from visad/visad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
202 lines (176 loc) · 7.43 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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<?xml version="1.0"?>
<project name="VisAD Distribution">
<property name="type.lib.dir" location="${basedir}/lib"/>
<!-- overrides locations in sub-projects -->
<property name="visad.jarfile" location="${basedir}/visad.jar" />
<property name="examples.jarfile" location="${basedir}/visad_examples.jar" />
<property name="docs.jarfile" location="${basedir}/visad_doc.jar" />
<property name="source.jarfile" location="${basedir}/visad_src.jar" />
<property name="native.jarfile" location="${basedir}/visad_native.jar" />
<path id="build.classpath">
<fileset dir="${type.lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<target name="build" depends="build.visad, jar.visad, build.examples"
description="build and jar the core, and build the examples"/>
<target name="build.visad" description="build the core">
<ant dir="${basedir}/core" target="build"/>
</target>
<target name="jar.visad" description="jar the core">
<ant dir="${basedir}/core" target="jar"/>
</target>
<target name="build.examples" description="build the examples">
<ant dir="${basedir}/examples" target="build"/>
</target>
<target name="jar.examples" description="jar the examples">
<ant dir="${basedir}/examples" target="jar"/>
</target>
<target name="build.javadoc" description="build the javadoc">
<ant dir="${basedir}/core" target="javadoc"/>
</target>
<target name="jar.javadoc" description="jar the javadoc">
<ant dir="${basedir}/core" target="jar.javadoc"/>
</target>
<target name="jar.native" depends="dist.revision" description="jar the native code">
<jar basedir="${basedir}/native" destfile="${native.jarfile}">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Revision" value="${repository.version}"/>
</manifest>
</jar>
</target>
<available file=".git" type="dir" property="git.present"/>
<!-- requires git version 1.7.2 or higher -->
<target name="dist.revision" description="Store git revision in ${repository.version}" if="git.present">
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false" errorproperty="">
<arg value="rev-list"/>
<arg value="--count"/>
<arg value="HEAD"/>
</exec>
<condition property="repository.version" value="${git.revision}" else="unknown">
<and>
<isset property="git.revision"/>
<length string="${git.revision}" trim="yes" length="0" when="greater"/>
</and>
</condition>
<echo>git rev: ${repository.version}</echo>
</target>
<target name="dist" depends="clean,
build.visad,
jar.visad,
build.examples,
jar.examples,
clean,
build.javadoc,
jar.javadoc,
jar.source,
dist.revision"
description="make the VisAD distribution including project jar file with dependencies and jars for examples and docs">
<tstamp>
<format property="date.value" pattern="EEE MMM dd HH:mm:ss zzz yyyy" />
</tstamp>
<jar update="true" destfile="${basedir}/visad.jar">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="visad.ss.SpreadSheet"/>
<attribute name="Implementation-Title" value="VisAD" />
<attribute name="Implementation-Version" value="${date.value} ${repository.version}" />
<attribute name="Implementation-Vendor" value="UW/SSEC" />
</manifest>
</jar>
</target>
<target name="jar.source" description="jar source for all sub-projects">
<mkdir dir="${basedir}/build/examples"/>
<copy todir="${basedir}/build/examples">
<fileset dir="${basedir}/examples/src/" includes="**/*.java"/>
</copy>
<patternset id="deps.packages">
<include name="HTTPClient/**/*"/>
<include name="Jama/**/*"/>
<include name="ucar/multiarray/*"/>
<include name="ucar/util/*"/>
<include name="ucar/netcdf/*"/>
<include name="ucar/tests/*"/>
<include name="dods/dap/*"/>
<include name="dods/dap/parser/*"/>
<include name="dods/dap/Server/*"/>
<include name="dods/dap/functions/*"/>
<include name="dods/util/*"/>
<include name="gnu/regexp/*"/>
<include name="loci/formats/*"/>
<include name="loci/formats/codec/*"/>
<include name="loci/formats/gui/*"/>
<include name="loci/formats/in/*"/>
<include name="loci/formats/out/*"/>
<include name="nom/tam/fits/*"/>
<include name="nom/tam/util/*"/>
<include name="nom/tam/test/*"/>
<include name="ncsa/hdf/hdf5lib/exceptions/*"/>
<include name="ncsa/hdf/hdf5lib/*"/>
</patternset>
<echo file="${basedir}/build/build.xml">
<![CDATA[
<project name="VisAD Source" default="help">
<target name="build" description="compile VisAD, deps, and example files in place">
<javac srcdir="." memoryMaximumSize="512M" fork="true" debug="on"/>
<rmic classpath="." base=".">
<include name="visad/**/*Remote*Impl.class" />
</rmic>
<javac srcdir="./examples" classpath="." debug="on"/>
</target>
<target name="jar" description="create jar of core and dependencies">
<jar destfile="visad.jar">
<fileset dir=".">
<exclude name="examples/**/*"/>
<include name="**/*.class"/>
<include name="**/*.jhf"/>
<include name="**/*.gif"/>
<include name="loci/**/*.txt"/>
</fileset>
</jar>
</target>
<target name="clean" description="remove class files">
<delete>
<fileset dir=".">
<include name="**/*.class"/>
<include name="visad.jar"/>
</fileset>
</delete>
</target>
<target name="help" description="print help">
<echo>
Examples are in ./examples
Build and jar VisAD, VisAD RMI, and dependencies:
ant build jar
Run Examples:
java -cp visad.jar:examples DisplayTest
</echo>
</target>
</project>
]]>
</echo>
<jar destfile="${source.jarfile}">
<fileset dir="${basedir}/core/src">
<include name="edu/wisc/ssec/mcidas/*"/>
<include name="edu/wisc/ssec/mcidas/adde/*.java"/>
<include name="visad/**/*"/>
</fileset>
<fileset dir="${basedir}/deps/src">
<patternset refid="deps.packages"/>
</fileset>
<fileset dir="${basedir}/build" includes="examples/**,build.xml"/>
</jar>
<delete dir="${basedir}/build" />
</target>
<target name="clean" description="remove project jar files and contents of build dir">
<delete file="${visad.jarfile}"/>
<delete file="${examples.jarfile}"/>
<delete file="${docs.jarfile}"/>
<delete file="${source.jarfile}"/>
<delete file="${native.jarfile}"/>
<ant dir="${basedir}/core" target="clean"/>
<ant dir="${basedir}/examples" target="clean"/>
<ant dir="${basedir}/deps" target="clean"/>
</target>
</project>