forked from citygml4j/citygml4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
184 lines (156 loc) · 8.03 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
<?xml version="1.0" standalone="yes"?>
<!--
* citygml4j - The Open Source Java API for CityGML
* https://github.com/citygml4j
*
* Copyright 2013-2017 Claus Nagel <[email protected]>
*
* 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="citygml4j" default="dist" basedir=".">
<!-- load external property sets -->
<property file="default.properties" />
<!-- classpath -->
<path id="classpath">
<fileset dir="${dir.lib}" includes="*.jar" />
</path>
<!-- JAXB XJC compiler -->
<taskdef name="xjc" classname="com.sun.tools.xjc.XJC2Task">
<classpath>
<fileset dir="${dir.resources.jaxb.xjc}" includes="*.jar" />
</classpath>
</taskdef>
<tstamp>
<format property="date" pattern="yyyy-MM-dd" />
<format property="time" pattern="HH:mm:ss" />
</tstamp>
<target name="clean" description="clean up">
<!-- delete the ${dir.build} and ${jar} directory trees -->
<delete dir="${dir.build}" />
<delete dir="${dir.dist.lib}" />
<delete dir="${dir.dist.javadoc}" />
<delete dir="${dir.dist.samples}" />
<delete dir="${dir.dist}" />
</target>
<target name="clean_samples" description="clean sample dir">
<subant target="clean">
<fileset dir="${dir.samples}" includes="**/build.xml" />
</subant>
</target>
<target name="generate_jaxb_binding" description="compile JAXB classes from CityGML schemas">
<mkdir dir="${dir.src-gen}/org/citygml4j/jaxb" />
<!-- create JAXB classes from CityGML schemas -->
<xjc destdir="${dir.src-gen}" extension="true" removeOldOutput="yes" description="generate CityGML schema derived classess">
<arg line="
-Xnamespace-prefix
-Xsetters
-Xsetters-mode=direct" />
<schema dir="${dir.resources.jaxb.schemas}/CityGML" includes="citygml4j_profile.xsd" />
<binding dir="${dir.resources.jaxb.schemas}/CityGML" includes="binding.xjb" />
<produces dir="${dir.src-gen}" includes="**/*" />
<depends dir="${dir.resources.jaxb.schemas}" includes="**/*.xsd" />
<classpath>
<fileset dir="${dir.resources.jaxb.xjc-plugins}">
<include name="**/*.jar" />
</fileset>
</classpath>
</xjc>
<delete dir="${dir.src-gen}/org/citygml4j" />
</target>
<target name="generate_javadoc" depends="generate_jaxb_binding" description="generate API javadoc">
<delete dir="${dir.dist.javadoc}" />
<mkdir dir="${dir.dist.javadoc}" />
<!-- copy overview.html and replace token -->
<copy file="${dir.resources.javadoc}/overview.html" tofile="${dir.resources.javadoc}/overview_adapted.html" />
<replace file="${dir.resources.javadoc}/overview_adapted.html" token="!citygml4j.name!" value="${citygml4j.name}" />
<replace file="${dir.resources.javadoc}/overview_adapted.html" token="!citygml4j.version!" value="${citygml4j.version}" />
<replace file="${dir.resources.javadoc}/overview_adapted.html" token="!citygml4j.git!" value="${citygml4j.git}" />
<replace file="${dir.resources.javadoc}/overview_adapted.html" token="!copyright.year!" value="${copyright.year}" />
<replace file="${dir.resources.javadoc}/overview_adapted.html" token="!copyright.owner!" value="${copyright.owner}" />
<replace file="${dir.resources.javadoc}/overview_adapted.html" token="!copyright.owner.email!" value="${copyright.owner.email}" />
<!-- create javadoc from source files -->
<javadoc access="public" author="true" classpathref="classpath" destdir="${dir.dist.javadoc}" doctitle="${citygml4j.name} - ${citygml4j.description}" encoding="UTF-8" charset="UTF-8" maxmemory="256m" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" overview="${dir.resources.javadoc}/overview_adapted.html" packagenames="org.citygml4j.*" sourcepath="${dir.src};${dir.src-gen}" splitindex="true" use="true" version="true" />
<delete file="${dir.resources.javadoc}/overview_adapted.html" />
</target>
<target name="compile_src" depends="generate_jaxb_binding" description="compile the source">
<delete dir="${dir.build}" />
<mkdir dir="${dir.build.classes}" />
<!-- compile the java code from ${dir.src} and ${dir.src-gen} into ${build} -->
<javac includeantruntime="false" classpathref="classpath" srcdir="${dir.src-gen}" destdir="${dir.build.classes}" debug="on" />
<javac includeantruntime="false" classpathref="classpath" srcdir="${dir.src}" destdir="${dir.build.classes}" debug="on" />
</target>
<target name="generate_jar" depends="compile_src" description="generate the citygml4j library file">
<!-- create the distribution directory -->
<delete dir="${dir.dist.lib}" />
<mkdir dir="${dir.dist.lib}" />
<!-- copy README and LICENSE files to tmp folder -->
<copy todir="${dir.dist.tmp}">
<fileset dir="${dir.resources.doc}" includes="**/*" />
<fileset dir="${dir.resources.license}" includes="**/*" />
</copy>
<!-- replace tokens in README file -->
<replace file="${dir.dist.tmp}/README" token="!citygml4j.name!" value="${citygml4j.name}" />
<replace file="${dir.dist.tmp}/README" token="!citygml4j.version!" value="${citygml4j.version}" />
<replace file="${dir.dist.tmp}/README" token="!citygml4j.description!" value="${citygml4j.description}" />
<replace file="${dir.dist.tmp}/README" token="!citygml4j.git!" value="${citygml4j.git}" />
<replace file="${dir.dist.tmp}/README" token="!build.date!" value="${date}" />
<replace file="${dir.dist.tmp}/README" token="!copyright.year!" value="${copyright.year}" />
<replace file="${dir.dist.tmp}/README" token="!copyright.owner!" value="${copyright.owner}" />
<replace file="${dir.dist.tmp}/README" token="!copyright.owner.email!" value="${copyright.owner.email}" />
<replace file="${dir.dist.tmp}/README" token="!developer.main.name!" value="${developer.main.name}" />
<replace file="${dir.dist.tmp}/README" token="!developer.main.email!" value="${developer.main.email}" />
<!-- copy README template to dir.dist folder -->
<copy todir="${dir.dist}">
<fileset dir="${dir.dist.tmp}" includes="README" />
</copy>
<!-- copy LICENSE file to license folder -->
<copy todir="${dir.dist.license}">
<fileset dir="${dir.resources.license}" includes="**/*" />
</copy>
<!-- copy schema files -->
<copy todir="${dir.build.schemas}">
<fileset dir="${dir.resources.schemas}" includes="**/*" />
</copy>
<!-- set package variables -->
<pathconvert property="manifest.classpath" dirsep="/" pathsep=" " refid="classpath">
<map from="${basedir}${file.separator}lib${file.separator}" to="" />
</pathconvert>
<buildnumber file="build.num" />
<!-- put everything in ${build} into .jar file -->
<jar jarfile="${dir.dist.lib}/${citygml4j.jar}" basedir="${dir.build.classes}">
<fileset dir="${dir.dist.tmp}" includes="**/*" />
<manifest>
<attribute name="Build-Id" value="${citygml4j.name}-${citygml4j.version}" />
<attribute name="Build-Date" value="${date} ${time}" />
<attribute name="Implementation-Title" value="${citygml4j.name}" />
<attribute name="Implementation-Version" value="${citygml4j.version}+${build.number}" />
<attribute name="Class-Path" value="${manifest.classpath}" />
</manifest>
</jar>
<!-- copy mandatory dependencies -->
<copy toDir="${dir.dist.lib}">
<fileset dir="${dir.lib}" includes="*.jar" />
</copy>
<!-- clean up -->
<delete dir="${dir.build}" />
<delete dir="${dir.dist.tmp}" />
</target>
<target name="dist" depends="clean_samples, generate_javadoc, generate_jar" description="generate and pack the citygml4j distribution">
<delete dir="${dir.dist.samples}" />
<mkdir dir="${dir.dist.samples}" />
<!-- copy sample files -->
<copy toDir="${dir.dist.samples}">
<fileset dir="${dir.samples}" includes="**/*" />
</copy>
</target>
</project>