updated on Mon Jan 23 12:00:23 UTC 2012
[aur-mirror.git] / dbus-java / build.xml
blobcde8a1566444a3b08c48641fb29d254eba7a9e0b
1 <project name="DBus-java" default="jars" basedir=".">
2         
3         <description>Java binding for D-Bus</description>
4         
5         <property file="local.properties"/>
6         
7         <property name="ant.project.version" value="${pkgver}"/>
8         <property name="src" location="src"/>
9         <property name="build" location="build"/>
10         <property name="build.output" location="${build}"/>
11         <property name="libmatthew-java.path" location="${pkg.libmatthew-java.path}"/>
12         <property name="libmatthew-lib.path." location="${pkg.libmatthew-lib.path}"/>
13         <property name="debug-state" value="${pkg.debug}"/>
14         <property name="debug.jar" location="${libmatthew-java.path}/debug-${debug-state}.jar"/>
15         <property name="hexdump.jar" location="${libmatthew-java.path}/hexdump.jar"/>
16         <property name="unix.jar" location="${libmatthew-java.path}/unix.jar"/>
17         <property name="dbus.java.home" location="${pkg.jarpath}"/>
18         <property name="dist" location="dist"/>
19         
20         <path id="deps.classpath">
21                 <pathelement path="${debug.jar}"/>
22                 <pathelement path="${hexdump.jar}"/>
23                 <pathelement path="${unix.jar}"/>
24         </path>
25         <path id="build.classpath">
26                 <pathelement path="${debug.jar}"/>
27                 <pathelement path="${hexdump.jar}"/>
28                 <pathelement path="${unix.jar}"/>
29         </path>
30         
31         <target name="init">
32                 <tstamp prefix="touch.time"/>
33                 <condition property="java.6.available">
34                         <or>
35                                 <contains string="${java.version}" substring="1.6"/>
36                                 <contains string="${java.version}" substring="1.7"/>
37                         </or>
38                 </condition>
39                 <fail message="This package requires Java 6 or 7." unless="java.6.available"/>
40                 <condition property="ant.1.7.available">
41                         <or>
42                                 <contains string="${ant.version}" substring="1.7"/>
43                                 <contains string="${ant.version}" substring="1.8"/>
44                         </or>
45                 </condition>
46                 <fail message="This package requires Ant 1.7." unless="ant.1.7.available"/>
47                 <condition property="libmatthew-java.available">
48                         <and>
49                                 <available file="${debug.jar}"/>
50                                 <available file="${hexdump.jar}"/>
51                                 <available file="${unix.jar}"/>
52                         </and>
53                 </condition>
54                 <fail message="This package requires libmatthew-java." unless="libmatthew-java.available"/>
55                 <mkdir dir="${build.output}"/>
56         </target>
57         
58         <target name="clean" description="Clean the output directories">
59                 <delete dir="${build}"/>
60                 <delete dir="${dist}"/>
61         </target>
62         
63         <target name="compile" depends="init" description="Compile the code">
64                 <javac srcdir="${src}" excludes="org/freedesktop/dbus/test/**" destdir="${build.output}" encoding="UTF-8" optimize="true" target="1.6" source="1.6">
65                         <classpath refid="deps.classpath"/>
66                         <compilerarg value="-Xlint:unchecked"/>
67                 </javac>
68         </target>
69         
70         <target name="dbus.jar" depends="compile" description="Create the JAR">
71                 <mkdir dir="${dist}"/>
72                 <jar jarfile="${dist}/dbus-${ant.project.version}.jar">
73                         <manifest>
74                                 <attribute name="Class-Path" value="${unix.jar} ${debug.jar}"/>
75                         </manifest>
76                         <fileset dir="${build.output}">
77                                 <include name="org/freedesktop/*.class"/>
78                                 <include name="org/freedesktop/dbus/*.class"/>
79                                 <include name="org/freedesktop/dbus/types/*.class"/>
80                                 <include name="org/freedesktop/dbus/exceptions/*.class"/>
81                                 <include name="*localized*class"/>
82                         </fileset>
83                 </jar>
84         </target>
85         
86         <target name="dbus-test.jar" depends="compile" description="Create the JAR">
87                 <mkdir dir="${dist}"/>
88                 <jar jarfile="${dist}/dbus-test-${ant.project.version}.jar">
89                         <manifest>
90                                 <attribute name="Class-Path" value="${dbus.java.home}/dbus-${ant.project.version}.jar"/>
91                         </manifest>
92                         <fileset dir="${build.output}">
93                                 <include name="org/freedesktop/dbus/test/*.class"/>
94                         </fileset>
95                 </jar>
96         </target>
97         
98         <target name="dbus-viewer.jar" depends="compile" description="Create the JAR">
99                 <mkdir dir="${dist}"/>
100                 <jar jarfile="${dist}/dbus-viewer-${ant.project.version}.jar">
101                         <manifest>
102                                 <attribute name="Class-Path" value="${dbus.java.home}/dbus-${ant.project.version}.jar"/>
103                         </manifest>
104                         <fileset dir="${build.output}">
105                                 <include name="org/freedesktop/dbus/viewer/*.class"/>
106                         </fileset>
107                 </jar>
108         </target>
109         
110         <target name="dbus-bin.jar" depends="compile" description="Create the JAR">
111                 <mkdir dir="${dist}"/>
112                 <jar jarfile="${dist}/dbus-bin-${ant.project.version}.jar">
113                         <manifest>
114                                 <attribute name="Class-Path" value="${dbus.java.home}/dbus-${ant.project.version}.jar"/>
115                         </manifest>
116                         <fileset dir="${build.output}">
117                                 <include name="org/freedesktop/dbus/bin/*.class"/>
118                         </fileset>
119                 </jar>
120         </target>
121         
122         <target name="jars" depends="dbus.jar,dbus-test.jar,dbus-viewer.jar,dbus-bin.jar"/>
123         
124         <target name="source" depends="init" description="Pack project">
125                 <mkdir dir="${dist}"/>
126                 <tar destfile="${dist}/${ant.project.name}-src-${touch.time.DSTAMP}${touch.time.TSTAMP}.tar" basedir="${basedir}" includes="src/** *.c build.xml changelog COPYING INSTAL README Makefile"/>
127                 <gzip destfile="${dist}/${ant.project.name}-src-${touch.time.DSTAMP}${touch.time.TSTAMP}.tar.gz" src="${dist}/${ant.project.name}-src-${touch.time.DSTAMP}${touch.time.TSTAMP}.tar"/>
128                 <delete file="${dist}/${ant.project.name}-src-${touch.time.DSTAMP}${touch.time.TSTAMP}.tar"/>
129         </target>
131 </project>