Merge branch 'release-0.6.6'
[olsrd.git] / lib / pud / wireformat-java / resources / build.xml
1 <?xml version="1.0" standalone="yes" ?>
2 <project name="PROJECT" basedir="." default="build">
3         <description>
4                 Build file for distribution of Olsrd Pud Plugin Wireformat Library Java Bindings
5     </description>
6
7
8         <!-- Properties -->
9         <property name="fullname" value="Olsrd Pud Plugin Wireformat Library Java Bindings" />
10
11         <property name="name" value="PROJECT" />
12         <property name="version" value="PLUGIN_VER" />
13
14         <property name="debug" value="DEBUG" />
15         <property name="debug.flags" value="lines,vars,source" />
16         <property name="source.version" value="JAVAVERSIONSRC" />
17         <property name="target.version" value="JAVAVERSIONDST" />
18
19         <property name="build.dir" location="${basedir}/BUILD_DIR/classes" />
20         <property name="src.dir" location="${basedir}/JAVASRC" />
21         <property name="lib.dir" location="${basedir}/LIBDIR_BUILD" />
22
23         <property name="jar.file" value="${lib.dir}/${name}.jar" />
24
25         <property name="javadoc.dir" location="${basedir}/doc/javadoc" />
26         <property name="javac.bootclasspath" location="${basedir}/resources/ee.j2se/${source.version}/ee.j2se.jar" />
27
28         <!--
29
30          Targets
31
32         -->
33
34         <target name="getgitcommit" description="Retrieve the Git Commit SHA1">
35                 <exec dir="${basedir}" executable="git" outputproperty="git.commit.descriptor" failonerror="false" error="/dev/null">
36                         <arg value="describe" />
37                         <arg value="--dirty" />
38                         <arg value="--always" />
39                 </exec>
40                 <exec dir="${basedir}" executable="git" outputproperty="git.commit.sha" failonerror="false" error="/dev/null">
41                         <arg value="rev-parse" />
42                         <arg value="HEAD" />
43                 </exec>
44         </target>
45
46         <target name="init" description="initialisation build environment for ${name}">
47                 <mkdir dir="${build.dir}" />
48         </target>
49
50         <target name="clean" description="clean build environment">
51                 <delete dir="${build.dir}" />
52                 <delete dir="${javadoc.dir}" />
53         </target>
54
55         <target name="build" description="Build plugin jar file" depends="clean,init,getgitcommit">
56                 <echo message="Compiling Plugin classes. (debug: ${debug})" />
57                 <javac bootclasspath="${javac.bootclasspath}" srcdir="${src.dir}" destdir="${build.dir}" source="${source.version}" target="${target.version}" debug="${debug}" debuglevel="${debug.flags}" includeantruntime="false" />
58
59                 <delete file="${jar.file}" />
60                 <jar destfile="${jar.file}">
61                         <fileset dir="${build.dir}">
62                                 <include name="**/*.class" />
63                         </fileset>
64                         <manifest>
65                                 <attribute name="Class-Path" value="." />
66                                 <attribute name="Version" value="${version}" />
67                                 <attribute name="Git-Descriptor" value="${git.commit.descriptor}" />
68                                 <attribute name="Git-SHA" value="${git.commit.sha}" />
69                         </manifest>
70                 </jar>
71         </target>
72
73         <target name="src-zip" depends="init">
74                 <!-- make the zip file -->
75                 <zip zipfile="${lib.dir}/${name}-src.zip">
76                         <zipfileset dir="${src.dir}" />
77                 </zip>
78         </target>
79
80         <target name="release" description="Build plugin jar file" depends="clean, init, build, src-zip, javadoc-zip">
81         </target>
82
83         <!-- Generate JavaDoc -->
84         <target name="javadoc">
85                 <delete dir="${javadoc.dir}" />
86                 <mkdir dir="${javadoc.dir}" />
87                 <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">
88                         <packageset dir="${src.dir}" defaultexcludes="yes">
89                                 <include name="org/olsr/**" />
90                         </packageset>
91                 </javadoc>
92         </target>
93
94         <!-- Create zip file containing the API HTML pages. -->
95         <target name="javadoc-zip" depends="init,javadoc">
96                 <!-- make the zip file -->
97                 <zip zipfile="${lib.dir}/${name}-doc.zip">
98                         <zipfileset dir="${javadoc.dir}" />
99                 </zip>
100         </target>
101
102 </project>