-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·175 lines (158 loc) · 5.51 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
<project name="model_RainfallRunoffZhang" default="help" basedir=".">
<!--
================================================================================
Ant build file for openda java code
install ant and type
"ant help"
for a list of options
================================================================================
-->
<target name="help">
<echo>
ant help --> print this help
ant build --> compile, make jar and copy resources
ant build-test --> compile test classes
ant clean --> remove output
ant javadoc --> build javadoc
</echo>
</target>
<property file="module.properties"/>
<target name="debug">
<echo>
module=${module}
srcdir=${srcdir}
jarname=${jarname}
builddir=${builddir}
bindir=${bindir}
</echo>
</target>
<!--
===========================================================================
Compilation
===========================================================================
-->
<target name="build" depends="jarfile">
</target>
<target name="build-test" depends="init">
<javac srcdir="${testdir}" destdir="${buildtestdir}" debug="${debug}" source="${source}" encoding="UTF-8" failonerror="${failonerror}" listfiles="${listfiles}" fork="yes" memoryInitialSize="${minmemory}" memoryMaximumSize="${maxmemory}" includeantruntime="false">
<classpath>
<fileset dir="${projectdir}">
<include name="${projectlib}/*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<target name="jarfile" depends="moduleclasses,manifest">
<jar jarfile="${modulelibdir}/${jarname}" manifest="MANIFEST.MF">
<fileset dir="${builddir}">
<include name="**/*.class"/>
<include name="**/*.gif"/>
</fileset>
</jar>
</target>
<target name="moduleclasses" depends="init,copy-module-resources">
<javac srcdir="${srcdir}" destdir="${builddir}" debug="${debug}" source="${source}" encoding="UTF-8" failonerror="${failonerror}" listfiles="${listfiles}" fork="yes" memoryInitialSize="${minmemory}" memoryMaximumSize="${maxmemory}" includeantruntime="false">
<classpath>
<fileset dir=".">
<include name="${modulelibdir}/*.jar"/>
</fileset>
<fileset dir="${projectdir}">
<include name="${projectlib}/*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<target name="javadoc" depends="init">
<javadoc destdir="${javadocdir}/${module}" verbose="yes" windowtitle="openDA.Module: ${module} Version: ${version}" source="${source}">
<fileset dir="${srcdir}">
<include name="**/*.java"/>
</fileset>
<classpath>
<fileset dir="${srcdir}">
</fileset>
<fileset dir="${resourcesdir}">
<include name="openda_core.jar"/>
<include name="observers.jar"/>
</fileset>
</classpath>
</javadoc>
</target>
<!--
===========================================================================
Tools: init, clean, etc.
===========================================================================
-->
<target name="init" depends="clean">
<tstamp/>
<mkdir dir="${builddir}"/>
<mkdir dir="${buildtestdir}"/>
<mkdir dir="${modulebindir}"/>
<mkdir dir="${modulelibdir}"/>
<mkdir dir="${javadocdir}"/>
</target>
<target name="clean">
<delete dir="${modulebindir}"/>
<delete dir="${modulelibdir}"/>
<delete dir="${builddir}"/>
<delete dir="${buildtestdir}"/>
<delete dir="${javadocdir}"/>
<delete file="MANIFEST.MF"/>
</target>
<taskdef resource="org/tigris/subversion/svnant/svnantlib.xml">
<classpath>
<fileset dir="../core/java/resources/svnant-1.3.0/lib" includes="**/*.jar" />
</classpath>
</taskdef>
<target name="svn-revision" >
<svn>
<status path="." revisionProperty="svn.revision" />
</svn>
<echo>Subversion Revision: ${svn.revision}</echo>
</target>
<target name="manifest" depends="svn-revision">
<tstamp/>
<manifest file="MANIFEST.MF">
<attribute name="Title" value="${projectname}"/>
<attribute name="Version" value="${version}.${svn.revision} ${TODAY}"/>
<attribute name="Vendor" value="${vendor}"/>
</manifest>
</target>
<target name="copy-module-resources">
<!-- copy openda resources and additional binaries -->
<copy todir="${modulelibdir}" flatten="yes">
<!-- copy resources -->
<fileset dir="${resourcesdir}">
<include name="**/*.jar"/>
<include name="**/*.dll"/>
<include name="**/*.DLL"/>
<include name="**/*.so"/>
<include name="**/*.lic"/>
<include name="**/*.LIC"/>
<include name="**/*.xsd"/>
<include name="**/*.exe"/>
<include name="**/*.EXE"/>
<include name="**/*.bat"/>
<include name="**/*.BAT"/>
<include name="**/*.test"/>
<include name="**/openDA_castor_schemas.zip"/>
</fileset>
</copy>
<copy todir="${modulebindir}" flatten="yes">
<fileset dir="${external}">
<include name="**/*.sh"/>
<include name="**/*.bat"/>
<include name="**/*.exe"/>
<include name="**/*.pl"/>
<include name="**/*.dll"/>
</fileset>
</copy>
<copy todir="${modulebindir}" flatten="no">
<fileset dir="${native_bin}">
<include name="**/*"/>
<exclude name="**/*.exp"/>
</fileset>
</copy>
<chmod dir="${modulebindir}" perm="ugo+rx" includes="**/*.sh"/>
<chmod dir="${modulebindir}" perm="ugo+rx" includes="**/*.pl"/>
</target>
</project>