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