-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.xml
executable file
·228 lines (185 loc) · 7.56 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
225
226
227
228
<project name="Laverca" basedir="." default="dist">
<description>
Laverca project build file
</description>
<!-- Make sure the Java runtime system classpath does not mess compilation -->
<property name="build.sysclasspath" value="last" />
<property name="project-version" value="2.2.0" />
<property name="project-name" value="laverca" />
<property name="build" location="build" />
<property name="dist" location="dist" />
<property name="apidocs" location="apidocs" />
<property name="core-src" location="src/core" />
<property name="datatypes-src" location="src/jaxb-datatypes" />
<property name="examples-src" location="src/examples"/>
<property name="xmlschemas" location="etc/xmlschemas"/>
<property name="buildproperties" location="etc/buildproperties"/>
<property name="libs" location="libs"/>
<property name="jlibs" location="libs/jaxb-ri-240-b180830" />
<property name="docs" location="docs"/>
<property name="examples" location="examples"/>
<property name="conf" value="${examples}/conf"/>
<property name="etc" value="${examples}/etc"/>
<property name="bin" value="${examples}/bin" />
<property name="example-libs" location="${examples}/libs"/>
<property name="core-lib" location="${build}/laverca-core-${project-version}.jar" />
<property name="datatypes-lib" location="${build}/laverca-datatypes.jar" />
<property name="examples-lib" location="${build}/laverca-examples.jar" />
<path id="laverca-libs">
<fileset dir="${libs}">
<include name="*.jar" />
<exclude name="axis-1.4.patched.jar" />
</fileset>
<pathelement location="${jlibs}/jaxb-api.jar" />
<pathelement location="${jlibs}/jaxb-runtime.jar" />
<pathelement location="${jlibs}/istack-commons-runtime.jar" />
<pathelement location="${libs}/axis-1.4.patched.jar" />
</path>
<path id="anttasks.classpath">
<fileset dir="${libs}">
<include name="*.jar" />
</fileset>
</path>
<path id="xjc.classpath">
<fileset dir="${libs}/jaxb-ri-240-b180830">
<include name="*.jar" />
</fileset>
<pathelement location="${libs}/xml-apis-2.11.0-20110622.jar" />
</path>
<!-- Run JAXB XJC tool on WSDL source file -->
<macrodef name="jaxb-wsdl2src-gen">
<attribute name="todir" />
<attribute name="file" />
<sequential>
<echo>XJC @{file}</echo>
<java classname="com.sun.tools.xjc.XJCFacade"
failonerror="true"
classpathref="xjc.classpath">
<arg line="-verbose -npa -no-header " />
<arg line="-d @{todir}"/>
<arg line="-extension -b ${buildproperties}/xjc-bindings.xml" />
<arg line="-wsdl @{file}" />
</java>
</sequential>
</macrodef>
<!-- Run JAXB XJC tool on XSD source file -->
<macrodef name="jaxb-xsd2src-gen">
<attribute name="todir" />
<attribute name="file" />
<sequential>
<echo>Generating JAXB datatypes with XJC</echo>
<java classname="com.sun.tools.xjc.XJCFacade"
failonerror="true"
classpathref="xjc.classpath">
<arg line="-npa -no-header -nv" />
<arg line="-d @{todir}"/>
<arg line="-extension"/>
<!-- <arg line="-verbose"/> -->
<!-- <arg line="-quiet"/> -->
<arg line="-encoding UTF-8"/>
<arg line="-XexplicitAnnotation"/>
<!-- <arg line="-XautoNameResolution"/> -->
<arg line="-Xlocator"/>
<!-- customized namespace-to-package mappings -->
<arg line="-b ${buildproperties}/xjc-bindings.xml" />
<arg line="-xmlschema @{file}" />
</java>
</sequential>
</macrodef>
<target name="clean">
<delete dir="${build}" failonerror="false" />
<delete dir="${dist}" failonerror="false" />
<delete dir="${apidocs}" failonerror="false" />
<delete dir="${datatypes-src}" failonerror="false" />
</target>
<target name="generate-datatypes" >
<mkdir dir="${datatypes-src}" />
<jaxb-xsd2src-gen file="${xmlschemas}/MSS-plus.xsd"
todir="${datatypes-src}" />
</target>
<target name="build" depends="build-core" />
<target name="build-core"
depends="generate-datatypes">
<mkdir dir="${build}/core" />
<javac debug="true"
optimize="true"
deprecation="true"
destdir="${build}/core"
encoding="UTF-8"
includeantruntime="false">
<src path="${core-src}"/>
<src path="${datatypes-src}"/>
<classpath>
<path refid="laverca-libs" />
</classpath>
<include name="**/**.java"/>
</javac>
<jar jarfile="${core-lib}">
<fileset dir="${build}/core">
<include name="**" />
</fileset>
<fileset dir="${core-src}">
<include name="laverca-client-config.wsdd" />
</fileset>
</jar>
<copy todir="${dist}/libs" file="${jlibs}/jaxb-runtime.jar" />
<copy todir="${dist}/libs" file="${jlibs}/jaxb-api.jar" />
<copy todir="${dist}/libs" file="${jlibs}/istack-commons-runtime.jar" />
</target>
<target name="build-examples">
<ant antfile="./build-examples.xml" target="build" />
</target>
<!-- DIST -->
<target name="dist" depends="build, apidocs">
<copy tofile="${dist}/examples/build.xml" file="build-examples.xml" />
<copy todir="${dist}/examples/conf"> <fileset dir="${conf}"/> </copy>
<copy todir="${dist}/examples/etc"> <fileset dir="${etc}"/> </copy>
<copy todir="${dist}/examples/src"> <fileset dir="${examples-src}"/> </copy>
<copy todir="${dist}/examples/bin"> <fileset dir="${bin}"/> </copy>
<copy todir="${dist}/examples/libs"> <fileset dir="${example-libs}"/> </copy>
<chmod dir="${dist}/examples/bin" perm="755"/>
<copy todir="${dist}/docs"><fileset dir="${docs}"/></copy>
<copy todir="${dist}/apidocs"><fileset dir="${apidocs}"/></copy>
<copy todir="${dist}/libs"><fileset dir="${libs}"/></copy>
<copy todir="${dist}/libs" file="${jlibs}/jaxb-runtime.jar" />
<copy todir="${dist}/libs" file="${jlibs}/jaxb-api.jar" />
<copy todir="${dist}/libs" file="${jlibs}/istack-commons-runtime.jar" />
<copy todir="${dist}" file="${core-lib}" />
<copy todir="${dist}" file="README.md" />
<copy todir="${dist}" file="CHANGELOG" />
<copy todir="${dist}" file="LICENSE" />
<copy todir="${dist}" file="NOTICE" />
</target>
<!-- MISC -->
<target name="zip" depends="dist">
<zip destfile="${project-name}-${project-version}.zip" basedir="${dist}"/>
</target>
<target name="gzip" depends="dist">
<tar compression="gzip" longfile="gnu" destfile="${project-name}-${project-version}.tar.gz" basedir="${dist}"/>
</target>
<target name="test" depends="build"/>
<target name="apidocs"
description="Generates Laverca documentation.">
<mkdir dir="apidocs"/>
<javadoc packagenames="fi.laverca,fi.laverca.*"
defaultexcludes="yes"
destdir="${apidocs}"
author="false"
version="false"
verbose="false"
private="false"
encoding="UTF-8"
use="true"
useexternalfile="true"
windowtitle="Laverca">
<classpath>
<path refid="laverca-libs"/>
<pathelement location="${datatypes-src}"/>
</classpath>
<fileset dir="${core-src}" casesensitive="yes">
<include name="**/*.java" />
</fileset>
<doctitle><![CDATA[<h1>Laverca ${project-version}</h1>]]></doctitle>
</javadoc>
</target>
</project>