1 <project name="DBus-java" default="jars" basedir=".">
3 <description>Java binding for D-Bus</description>
5 <property file="local.properties"/>
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"/>
20 <path id="deps.classpath">
21 <pathelement path="${debug.jar}"/>
22 <pathelement path="${hexdump.jar}"/>
23 <pathelement path="${unix.jar}"/>
25 <path id="build.classpath">
26 <pathelement path="${debug.jar}"/>
27 <pathelement path="${hexdump.jar}"/>
28 <pathelement path="${unix.jar}"/>
32 <tstamp prefix="touch.time"/>
33 <condition property="java.6.available">
35 <contains string="${java.version}" substring="1.6"/>
36 <contains string="${java.version}" substring="1.7"/>
39 <fail message="This package requires Java 6 or 7." unless="java.6.available"/>
40 <condition property="ant.1.7.available">
42 <contains string="${ant.version}" substring="1.7"/>
43 <contains string="${ant.version}" substring="1.8"/>
46 <fail message="This package requires Ant 1.7." unless="ant.1.7.available"/>
47 <condition property="libmatthew-java.available">
49 <available file="${debug.jar}"/>
50 <available file="${hexdump.jar}"/>
51 <available file="${unix.jar}"/>
54 <fail message="This package requires libmatthew-java." unless="libmatthew-java.available"/>
55 <mkdir dir="${build.output}"/>
58 <target name="clean" description="Clean the output directories">
59 <delete dir="${build}"/>
60 <delete dir="${dist}"/>
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"/>
70 <target name="dbus.jar" depends="compile" description="Create the JAR">
71 <mkdir dir="${dist}"/>
72 <jar jarfile="${dist}/dbus-${ant.project.version}.jar">
74 <attribute name="Class-Path" value="${unix.jar} ${debug.jar}"/>
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"/>
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">
90 <attribute name="Class-Path" value="${dbus.java.home}/dbus-${ant.project.version}.jar"/>
92 <fileset dir="${build.output}">
93 <include name="org/freedesktop/dbus/test/*.class"/>
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">
102 <attribute name="Class-Path" value="${dbus.java.home}/dbus-${ant.project.version}.jar"/>
104 <fileset dir="${build.output}">
105 <include name="org/freedesktop/dbus/viewer/*.class"/>
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">
114 <attribute name="Class-Path" value="${dbus.java.home}/dbus-${ant.project.version}.jar"/>
116 <fileset dir="${build.output}">
117 <include name="org/freedesktop/dbus/bin/*.class"/>
122 <target name="jars" depends="dbus.jar,dbus-test.jar,dbus-viewer.jar,dbus-bin.jar"/>
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"/>