-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildcnvt.xml
158 lines (141 loc) · 5.98 KB
/
buildcnvt.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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2009-2012 Institute of Meteorology and Water Management, IMGW
This file is part of the OdimH5 software.
OdimH5 is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OdimH5 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the OdimH5 software. If not, see http://www.gnu.org/licenses.
-->
<project name="OdimH5" default="install" basedir=".">
<property name="app.name" value="odimH5" />
<property name="version.src" value="src/pl/imgw/odimH5/AplicationConstans.java" />
<property name="version" value="src/pl/imgw/odimH5/AplicationConstans" />
<property name="main.class" value="pl.imgw.odimH5.Main" />
<property name="src.dir" value="src" />
<property name="lib.dir" value="lib" />
<property name="lib.hdf5.dir" value="${lib.dir}/hdf5"/>
<property name="build.dir" value="build" />
<property name="dist.dir" value="dist" />
<property name="share.dir" value="share"/>
<property name="bin.dir" value="bin"/>
<property name="doc.dir" value="doc" />
<property name="javadocs.dir" value="javadocs"/>
<property name="javadocs.src.dir" value="${src.dir}/pl/imgw/odimH5"/>
<property name="script.dir" value="script"/>
<property name="conf.dir" value="conf"/>
<property name="util.pkg" value="pl/imgw/odimH5/util"/>
<property name="log.dir" value="log"/>
<property name="etc.dir" value="etc"/>
<property name="tmp.dir" value="tmp"/>
<property name="options.file" value="options.xml"/>
<property name="properties.file" value="odim.properties"/>
<!-- Hudson environment property -->
<property environment="env"/>
<!-- Library path -->
<path id="lib.path">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<!-- Deletes the existing build, doc and dist directory-->
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
<delete dir="${javadocs.dir}"/>
</target>
<!-- Create directories -->
<target name="init">
<fail unless="prefix">Please specify installation prefix, e.g -Dprefix=/opt</fail>
<fail unless="system">Please specify system type: -Dsystem=linux|win</fail>
<fail unless="arch">Please specify system architecture: -Darch=32|64</fail>
<!-- System dependent library path -->
<property name="lib.version.dir" value="${lib.hdf5.dir}/${system}/${arch}"/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${doc.dir}"/>
</target>
<!-- Compiles the java code (including the usage of library for JUnit -->
<target name="compile" depends="clean,init">
<tstamp>
<format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss" />
</tstamp>
<copy file="${version}" toFile="${version.src}" overwrite="true">
<filterset>
<filter token="DATE" value="${TODAY}" />
<filter token="LOG" value="${prefix}/${app.name}/${log.dir}" />
<filter token="CONF" value="${prefix}/${app.name}/${conf.dir}" />
<filter token="TMP" value="${prefix}/${app.name}/${tmp.dir}" />
</filterset>
</copy>
<javac encoding="UTF-8" deprecation="on" srcdir="${src.dir}" destdir="${build.dir}" includeantruntime="false">
<include name="**/*.java" />
<classpath refid="lib.path" />
</javac>
</target>
<!--Creates the deployable jar file -->
<target name="jar" depends="compile">
<jar destfile="${dist.dir}/${app.name}.jar" basedir="${build.dir}">
<zipgroupfileset dir="${lib.dir}" includes="**/*.jar"/>
<zipgroupfileset dir="${lib.version.dir}" includes="**/*.jar"/>
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
<!-- Include properties file to be used via classloader -->
<fileset dir="${src.dir}">
<include name="**/*.properties"/>
</fileset>
</jar>
</target>
<!-- Installs OdimH5 -->
<target name="install" depends="jar">
<mkdir dir="${prefix}/${app.name}"/>
<mkdir dir="${prefix}/${app.name}/${lib.dir}"/>
<mkdir dir="${prefix}/${app.name}/${bin.dir}"/>
<mkdir dir="${prefix}/${app.name}/${share.dir}"/>
<mkdir dir="${prefix}/${app.name}/${conf.dir}"/>
<mkdir dir="${prefix}/${app.name}/${log.dir}"/>
<mkdir dir="${prefix}/${app.name}/${tmp.dir}"/>
<copy todir="${prefix}/${app.name}/${share.dir}" flatten="true">
<fileset dir="${dist.dir}">
<include name="**/*.jar" />
</fileset>
</copy>
<copy todir="${prefix}/${app.name}/lib" flatten="true">
<fileset dir="${lib.version.dir}/native">
<include name="**/*"/>
</fileset>
</copy>
<copy todir="${prefix}/${app.name}/${conf.dir}" file="${etc.dir}/${options.file}"/>
<!-- Copy wrapper scripts -->
<copy todir="${prefix}/${app.name}/${bin.dir}" file="${script.dir}/odimh5">
<filterset>
<filter token="LIBDIR" value="${prefix}/${app.name}/${lib.dir}" />
<filter token="JARDIR" value="${prefix}/${app.name}/${share.dir}/${app.name}.jar" />
</filterset>
</copy>
<chmod file="${prefix}/${app.name}/${bin.dir}/odimh5" perm="755"/>
<chmod file="${prefix}/${app.name}/${share.dir}/${app.name}.jar" perm="755"/>
<echo message="=========================="/>
<echo message="Installation completed"/>
<echo message="Run program using script located in ${bin.dir} directory" />
</target>
<!-- To be executed on Hudson -->
<target name="hudson" depends="init,jar" />
<!-- Generate source code documentation -->
<target name="javadocs">
<mkdir dir="${javadocs.dir}" />
<javadoc sourcepath="${src.dir}" destdir="${javadocs.dir}"
classpath="${src.dir}" author="true" version="true"
use="true" windowtitle="${app.name} API"
doctitle="<h1>${app.name}</h1>">
<fileset dir="${javadocs.src.dir}">
<include name="**/*.java"/>
</fileset>
</javadoc>
</target>
</project>