Adding DBUS stuff to classpath &c. in run.sh
[stereo.git] / DAAPLib / build.xml
blob69a53fb08676a41d6357058275d65cf788ab9e1d
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project basedir="." default="build" name="DAAPLib" xmlns:ivy="antlib:org.apache.ivy.ant">
3   <property name="CLI.location" value="../CLI"/>
4   <property name="Asunder.location" value="../Asunder"/>
5   <property name="MemphisDJ.location" value="../MemphisDJ"/>
7   <property name="DAAPLib.java.library.path" value="/usr/local/lib/jni"/>
9   <property name="debuglevel" value="source,lines,vars"/>
11   <property name="target" value="1.5"/>
12   <property name="source" value="1.5"/>
14   <property name="ivy.install.version" value="2.0.0-beta2"/>
16   <available file="lib/ivy.jar" property="ivy.available" />
18   <target name="download-ivy" unless="ivy.available">
19     <!-- download Ivy from web site so that it can be used even without any special installation -->
20     <echo message="installing ivy..."/>
21     <mkdir dir="lib"/>
22     <get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
23          dest="lib/ivy.jar" usetimestamp="true"/>
24   </target>
26   <target name="install-ivy" depends="download-ivy">
27     <path id="ivy.lib.path">
28       <fileset dir="lib" includes="*.jar"/>
29     </path>
30     <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
31   </target>
33   <target name="resolve" depends="install-ivy">
34     <ivy:settings file="../ivysettings.xml" />
35     <ivy:retrieve />
36   </target>
38   <path id="MemphisDJ.classpath">
39     <pathelement location="${MemphisDJ.location}/bin"/>
40   </path>
41   <path id="Asunder.classpath">
42     <pathelement location="${Asunder.location}"/>
43   </path>
44   <path id="DAAPLib.classpath">
45     <pathelement location="bin"/>
46     <fileset dir="lib">
47       <include name="**/*.jar"/>
48     </fileset>
49     <path refid="MemphisDJ.classpath"/>
50     <path refid="Asunder.classpath"/>
51     <pathelement location="/usr/local/share/java/dbus.jar"/>
52     <pathelement location="/usr/local/share/java/unix.jar"/>
53     <pathelement location="/usr/local/share/java/debug-disable.jar"/>
54   </path>
56   <target name="init" depends="resolve">
57     <mkdir dir="bin"/>
58     <copy includeemptydirs="false" todir="bin">
59       <fileset dir="src" excludes="**/*.launch, **/*.java"/>
60     </copy>
61     <copy includeemptydirs="false" todir="bin">
62       <fileset dir="test" excludes="**/*.launch, **/*.java"/>
63     </copy>
64   </target>
65   <target name="clean">
66     <delete dir="bin"/>
67   </target>
68   <target depends="clean" name="cleanall">
69     <ant antfile="${MemphisDJ.location}/build.xml" inheritAll="false" target="clean"/>
70   </target>
71   <target depends="build-subprojects,build-project" name="build">
72     <echo file="run.sh" message="#!/bin/sh${line.separator}${line.separator}${java.home}/bin/java -cp ${toString:DAAPLib.classpath} -Djava.library.path=${DAAPLib.java.library.path} dacp.Main $* ${line.separator}" />
73     <exec executable="chmod">
74       <arg line="755 run.sh"/>
75     </exec>
76   </target>
78   <target name="build-subprojects">
79     <ant antfile="${MemphisDJ.location}/build.xml" inheritAll="false" target="build-project"/>
80         <ant antfile="${Asunder.location}/build.xml" inheritAll="false" target="build-project"/>
81   </target>
82   <target depends="init" name="build-project">
83     <echo message="${ant.project.name}: ${ant.file}"/>
84     <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
85       <src path="src"/>
86       <classpath refid="DAAPLib.classpath"/>
87     </javac>
88     <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
89       <src path="test"/>
90       <classpath refid="DAAPLib.classpath"/>
91     </javac>
92   </target>
93   <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects">
94     <ant antfile="${CLI.location}/build.xml" inheritAll="false" target="clean"/>
95     <ant antfile="${CLI.location}/build.xml" inheritAll="false" target="build"/>
96     <ant antfile="${Asunder.location}/build.xml" inheritAll="false" target="clean"/>
97     <ant antfile="${Asunder.location}/build.xml" inheritAll="false" target="build"/>
98   </target>
99   <target name="DAAPConstants">
100     <java classname="daap.DAAPConstants" failonerror="true" fork="yes">
101       <classpath refid="DAAPLib.classpath"/>
102     </java>
103   </target>
104   <target name="DACPConstants">
105     <java classname="util.DACPConstants" failonerror="true" fork="yes">
106       <classpath refid="DAAPLib.classpath"/>
107     </java>
108   </target>
109   <target name="Main">
110     <java classname="dacp.Main" failonerror="true" fork="yes">
111       <classpath refid="DAAPLib.classpath"/>
112     </java>
113   </target>
114   <target name="QueryParser">
115     <java classname="util.queryparser.QueryParser" failonerror="true" fork="yes">
116       <classpath refid="DAAPLib.classpath"/>
117     </java>
118   </target>
119 </project>