info: java: update workspace
[olsrd.git] / lib / pud / wireformat-java / resources / build.xml
1 <?xml version="1.0" standalone="yes" ?>
2
3 <!--
4
5 The olsr.org Optimized Link-State Routing daemon (olsrd)
6
7 (c) by the OLSR project
8
9 See our Git repository to find out who worked on this file
10 and thus is a copyright holder on it.
11
12 All rights reserved.
13
14 Redistribution and use in source and binary forms, with or without
15 modification, are permitted provided that the following conditions
16 are met:
17
18 * Redistributions of source code must retain the above copyright
19   notice, this list of conditions and the following disclaimer.
20 * Redistributions in binary form must reproduce the above copyright
21   notice, this list of conditions and the following disclaimer in
22   the documentation and/or other materials provided with the
23   distribution.
24 * Neither the name of olsr.org, olsrd nor the names of its
25   contributors may be used to endorse or promote products derived
26   from this software without specific prior written permission.
27
28 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
31 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32 COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
33 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
34 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 POSSIBILITY OF SUCH DAMAGE.
40
41 Visit http://www.olsr.org for more information.
42
43 If you find this software useful feel free to make a donation
44 to the project. For more information see the website or contact
45 the copyright holders.
46
47 -->
48
49 <project name="PROJECT" basedir="." default="build">
50         <description>
51                 Build file for distribution of Olsrd Pud Plugin Wireformat Library Java Bindings
52     </description>
53
54
55         <!-- Properties -->
56         <property name="fullname" value="Olsrd Pud Plugin Wireformat Library Java Bindings" />
57
58         <property name="name" value="PROJECT" />
59         <property name="version" value="PLUGIN_VER" />
60
61         <property name="debug" value="DEBUG" />
62         <property name="debug.flags" value="lines,vars,source" />
63         <property name="source.version" value="JAVAVERSIONSRC" />
64         <property name="target.version" value="JAVAVERSIONDST" />
65
66         <property name="build.dir" location="${basedir}/BUILD_DIR/classes" />
67         <property name="src.dir" location="${basedir}/JAVASRC" />
68         <property name="lib.dir" location="${basedir}/LIBDIR_BUILD" />
69
70         <property name="jar.file" value="${lib.dir}/${name}.jar" />
71
72         <property name="javadoc.dir" location="${basedir}/doc/javadoc" />
73         <property name="javac.bootclasspath" location="${basedir}/resources/ee.j2se/${source.version}/ee.j2se.jar" />
74
75         <!--
76
77          Targets
78
79         -->
80
81         <target name="getgitcommit" description="Retrieve the Git Commit SHA1">
82                 <exec dir="${basedir}" executable="git" outputproperty="git.commit.descriptor" failonerror="false" error="/dev/null">
83                         <arg value="describe" />
84                         <arg value="--dirty" />
85                         <arg value="--always" />
86                 </exec>
87                 <exec dir="${basedir}" executable="git" outputproperty="git.commit.sha" failonerror="false" error="/dev/null">
88                         <arg value="rev-parse" />
89                         <arg value="HEAD" />
90                 </exec>
91         </target>
92
93         <target name="init" description="initialisation build environment for ${name}">
94                 <mkdir dir="${build.dir}" />
95         </target>
96
97         <target name="clean" description="clean build environment">
98                 <delete dir="${build.dir}" />
99                 <delete dir="${javadoc.dir}" />
100         </target>
101
102         <target name="build" description="Build plugin jar file" depends="clean,init,getgitcommit">
103                 <echo message="Compiling Plugin classes. (debug: ${debug})" />
104                 <javac bootclasspath="${javac.bootclasspath}" srcdir="${src.dir}" destdir="${build.dir}" source="${source.version}" target="${target.version}" debug="${debug}" debuglevel="${debug.flags}" includeantruntime="false" />
105
106                 <delete file="${jar.file}" />
107                 <jar destfile="${jar.file}">
108                         <fileset dir="${build.dir}">
109                                 <include name="**/*.class" />
110                         </fileset>
111                         <manifest>
112                                 <attribute name="Class-Path" value="." />
113                                 <attribute name="Version" value="${version}" />
114                                 <attribute name="Git-Descriptor" value="${git.commit.descriptor}" />
115                                 <attribute name="Git-SHA" value="${git.commit.sha}" />
116                         </manifest>
117                 </jar>
118         </target>
119
120         <target name="src-zip" depends="init">
121                 <!-- make the zip file -->
122                 <zip zipfile="${lib.dir}/${name}-src.zip">
123                         <zipfileset dir="${src.dir}" />
124                 </zip>
125         </target>
126
127         <target name="release" description="Build plugin jar file" depends="clean, init, build, src-zip, javadoc-zip">
128         </target>
129
130         <!-- Generate JavaDoc -->
131         <target name="javadoc">
132                 <delete dir="${javadoc.dir}" />
133                 <mkdir dir="${javadoc.dir}" />
134                 <javadoc bootclasspath="${javac.bootclasspath}" destdir="${javadoc.dir}" windowtitle="${fullname}" use="yes" linksource="yes" splitindex="yes" access="private" author="true" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" version="true" source="${source.version}" sourcepath="${src.dir}" maxmemory="256M">
135                         <packageset dir="${src.dir}" defaultexcludes="yes">
136                                 <include name="org/olsr/**" />
137                         </packageset>
138                 </javadoc>
139         </target>
140
141         <!-- Create zip file containing the API HTML pages. -->
142         <target name="javadoc-zip" depends="init,javadoc">
143                 <!-- make the zip file -->
144                 <zip zipfile="${lib.dir}/${name}-doc.zip">
145                         <zipfileset dir="${javadoc.dir}" />
146                 </zip>
147         </target>
148
149 </project>