forked from OpenMap-java/openmap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
225 lines (186 loc) · 9.85 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<?xml version="1.0"?>
<project name="OpenMap" default="all" basedir=".">
<!-- ############################
Set up the different builds.
############################ -->
<target name="init" description="Sets properties needed by the other targets.">
<property name="openmap.home" value="." />
<property name="general.excludes" value="**/*.in, **/Makefile, **/*.bat,
**/ChangeLog, **/*.html, **/*.txt,
**/*.*.txt, **/*.dat,
**/*.pl, **/unimplemented/**, **/build.xml" />
<property name="javac.excludes" value="${general.excludes},
**/*.gif, **/*.png, **/IntersectionTest.java" />
<property name="mac.app" value="OpenMap.app" />
<property name="jar.excludes" value="${general.excludes}, **/*.java" />
<property name="openmap_version" value="5.1.15" />
<property name="openmap.ext" value="${openmap.home}/src/ext" />
<property name="openmap.src" value="${openmap.home}/src/openmap" />
<property name="svg.src" value="${openmap.home}/src/svg" />
<property name="j3d.src" value="${openmap.home}/src/j3d" />
<property name="corba.src" value="${openmap.home}/src/corba" />
<property name="openmap_package.dir" value="${openmap.home}/package" />
<property name="openmap_mac_package.dir" value="${openmap_package.dir}/OpenMap_${openmap_version}" />
<property name="openmap_release.dir" value="${openmap_mac_package.dir}/openmap-${openmap_version}" />
<property name="openmap.zip" value="${openmap_package.dir}/openmap-${openmap_version}.zip" />
<property name="macJavaStub" value="/System/Library/Frameworks/JavaVM.framework/Resources/MacOS/JavaApplicationStub" />
<!-- Whatever you put in value will be passed to compiler.-->
<!-- <property name="compiler.args" value="-Xlint:deprecation,unchecked"/>-->
<property name="compiler.args" value="-nowarn" />
<available file="${macJavaStub}" property="do.copyMacJavaStub" />
<!-- ################################
You can add path to external jars here, comma separated in the includes list. This covers
the jars in the external libraries available from svn
######################### -->
<path id="ext_tools_classpath">
<fileset dir="." includes="ext/**/*.jar" />
</path>
</target>
<!-- ############################
Main targets
############################ -->
<target name="classes" depends="init" description="Compiles standard OpenMap classes.">
<ant antfile="${openmap.src}/build.xml" target="classes" inheritRefs="true" />
<antcall target="svg" inheritRefs="true" />
<antcall target="j3d" inheritRefs="true" />
<antcall target="corba" inheritRefs="true" />
</target>
<target name="svg" depends="init" description="Compiles SVG OpenMap classes.">
<ant antfile="${svg.src}/build.xml" target="classes.svg" inheritRefs="true" />
</target>
<target name="j3d" depends="init" description="Compiles J3D OpenMap classes.">
<ant antfile="${j3d.src}/build.xml" target="classes.j3d" inheritRefs="true" />
</target>
<target name="corba" depends="init" description="Compiles CORBA OpenMap classes.">
<ant antfile="${corba.src}/build.xml" target="classes.corba" inheritRefs="true" />
</target>
<target name="jars" depends="classes" description="Compiles OpenMap and alternative classes.">
<ant antfile="${openmap.src}/build.xml" target="jar.openmap" inheritRefs="true" />
<ant antfile="${svg.src}/build.xml" target="jar.svg" inheritRefs="true" />
<ant antfile="${j3d.src}/build.xml" target="jar.j3d" inheritRefs="true" />
<ant antfile="${corba.src}/build.xml" target="jar.corba" inheritRefs="true" />
</target>
<target name="geo" depends="init" description="Compiles Geo package and creates omgeo.jar.">
<ant antfile="${openmap.src}/build.xml" target="jar.geo" inheritRefs="true" />
</target>
<target name="all" depends="init" description="Compiles OpenMap classes and creates the jar files.">
<ant antfile="${openmap.src}/build.xml" target="all.openmap" inheritRefs="true" />
<ant antfile="${svg.src}/build.xml" target="all.svg" inheritRefs="true" />
<ant antfile="${j3d.src}/build.xml" target="all.j3d" inheritRefs="true" />
<ant antfile="${corba.src}/build.xml" target="all.corba" inheritRefs="true" />
</target>
<target name="docs" depends="init" description="Creates OpenMap API documentation.">
<ant antfile="${openmap.src}/build.xml" target="docs.openmap" inheritRefs="true" />
</target>
<!-- ############################
Cleanup targets
############################ -->
<target name="clean_all" depends="clean" description="Delete jar files, class files, and generated documentation.">
<delete dir="${mac.app}" />
<delete dir="${openmap_package.dir}" />
</target>
<target name="clean" depends="init" description="Delete jar files and all class files.">
<ant antfile="${openmap.src}/build.xml" target="clean.openmap" inheritRefs="true" />
<ant antfile="${svg.src}/build.xml" target="clean.svg" inheritRefs="true" />
<ant antfile="${j3d.src}/build.xml" target="clean.j3d" inheritRefs="true" />
<ant antfile="${corba.src}/build.xml" target="clean.corba" inheritRefs="true" />
</target>
<target name="distclean" depends="init" description="Delete class files, but not the jar files.">
<ant antfile="${openmap.src}/build.xml" target="distclean.openmap" inheritRefs="true" />
<ant antfile="${svg.src}/build.xml" target="distclean.svg" inheritRefs="true" />
<ant antfile="${j3d.src}/build.xml" target="distclean.j3d" inheritRefs="true" />
<ant antfile="${corba.src}/build.xml" target="distclean.corba" inheritRefs="true" />
</target>
<target name="clean_jars" depends="init" description="Delete only the jar files from the lib directory.">
<ant antfile="${openmap.src}/build.xml" target="clean_jars.openmap" inheritRefs="true" />
<ant antfile="${svg.src}/build.xml" target="clean_jars.svg" inheritRefs="true" />
<ant antfile="${j3d.src}/build.xml" target="clean_jars.j3d" inheritRefs="true" />
<ant antfile="${corba.src}/build.xml" target="clean_jars.corba" inheritRefs="true" />
</target>
<target name="clean_docs" depends="init" description="Delete only the generated API documentation.">
<ant antfile="${openmap.src}/build.xml" target="clean_docs.openmap" inheritRefs="true" />
</target>
<!-- ############################
End of cleanup targets.
############################ -->
<!-- depends="jar" -->
<target name="run" depends="init" description="Run the OpenMap application.">
<java classname="com.bbn.openmap.app.OpenMap" classpath="lib/openmap.jar;lib/milStd2525_png.jar;lib/omcorba.jar;lib/omsvg.jar;lib/omj3d;share" fork="yes">
<classpath>
<path refid="ext_tools_classpath" />
<pathelement path="${openmap.home}/lib/openmap.jar" />
<pathelement path="${openmap.home}/lib/milStd2525_png.jar" />
<pathelement path="${openmap.home}/lib/omsvg.jar" />
<pathelement path="${openmap.home}/lib/omj3d.jar" />
<pathelement path="${openmap.home}/lib/omcorba.jar" />
<pathelement path="${openmap.home}/share" />
</classpath>
</java>
</target>
<target name="mac" depends="all" description="Create MacOS X application.">
<delete dir="${mac.app}" />
<copy todir="${mac.app}">
<fileset dir="${openmap.home}/src/mac/OpenMap.app" />
</copy>
<copy todir="${mac.app}/Contents/Resources">
<fileset dir="${openmap.home}/share" includes="**/data/**" />
</copy>
<copy todir="${mac.app}/Contents/Resources" file="${openmap.home}/openmap.properties" />
<copy todir="${mac.app}/Contents/Resources/Java">
<fileset dir="${openmap.home}/lib" includes="**/*.jar" />
</copy>
<antcall target="copyMacJavaStub" />
<replace file="${mac.app}/Contents/Info.plist" token="@version@" value="${openmap_version}" />
<chmod file="${mac.app}/Contents/MacOS/JavaApplicationStub" perm="ugo+rx" />
<chmod dir="${mac.app}" perm="ugo+rx" />
</target>
<target name="copyMacJavaStub" if="${do.copyMacJavaStub}">
<copy file="${macJavaStub}" todir="${mac.app}/contents/MacOS" />
</target>
<target name="package" description="Create a directory containing the OpenMap release package." depends="clean_all, all, jars, mac">
<delete dir="${openmap_package.dir}" />
<property name="install_excludes" value="**/CVS, **/.svn, **/.DS_Store, **/*~" />
<copy file="${openmap.home}/bin/openmap.bat" tofile="${openmap_release.dir}/openmap.bat" />
<copy file="${openmap.home}/bin/openmap" tofile="${openmap_release.dir}/openmap" />
<copy file="${openmap.home}/openmap.properties" tofile="${openmap_release.dir}/openmap.properties" />
<copy todir="${openmap_release.dir}">
<fileset dir="${openmap.home}">
<include name="openmap.properties" />
<include name="README" />
<include name="AUTHORS" />
<include name="CHANGELOG" />
<include name="INSTALL*" />
<include name="LICENSE" />
<include name="build.xml" />
<include name="version.txt" />
</fileset>
</copy>
<copy todir="${openmap_release.dir}/src">
<fileset dir="${openmap.home}/src">
<exclude name="${install_excludes}" />
</fileset>
</copy>
<copy todir="${openmap_release.dir}/lib">
<fileset dir="${openmap.home}/lib">
<exclude name="${install_excludes}" />
</fileset>
</copy>
<copy todir="${openmap_release.dir}/share">
<fileset dir="${openmap.home}/share">
<exclude name="${install_excludes}" />
</fileset>
</copy>
<ant target="zip" />
<copy todir="${openmap_mac_package.dir}/${mac.app}">
<fileset dir="${mac.app}" />
</copy>
<copy file="openmap.properties" todir="${openmap_mac_package.dir}" />
<chmod file="${openmap_mac_package.dir}/${mac.app}/Contents/MacOS/JavaApplicationStub" perm="ugo+rx" />
<chmod dir="${openmap_mac_package.dir}/${mac.app}" perm="ugo+rx" />
<!-- Remove top level mac app, the one to use for the release is in the package directory -->
<delete dir="${mac.app}" />
</target>
<target name="zip" description="Create a OpenMap package zip file." depends="init">
<zip destfile="${openmap.zip}" basedir="${openmap_mac_package.dir}" includes="**" />
</target>
</project>