summaryrefslogtreecommitdiff
path: root/test/files/ant/imported.xml
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2011-11-27 11:41:16 +0000
committermichelou <michelou@epfl.ch>2011-11-27 11:41:16 +0000
commit172563dfbbc674789fad1f8d8cd6567e06e52c99 (patch)
treece66093b871f42b84aee64456f3def25878a2a5e /test/files/ant/imported.xml
parent37201dd3cd6da6ca47f651a5b346a7706ae1e561 (diff)
downloadscala-172563dfbbc674789fad1f8d8cd6567e06e52c99.tar.gz
scala-172563dfbbc674789fad1f8d8cd6567e06e52c99.tar.bz2
scala-172563dfbbc674789fad1f8d8cd6567e06e52c99.zip
updated test cases for Scala Ant tasks
Diffstat (limited to 'test/files/ant/imported.xml')
-rw-r--r--test/files/ant/imported.xml111
1 files changed, 62 insertions, 49 deletions
diff --git a/test/files/ant/imported.xml b/test/files/ant/imported.xml
index 9e2a3ffa1f..5a4dfc319b 100644
--- a/test/files/ant/imported.xml
+++ b/test/files/ant/imported.xml
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project name="imported" default="run" basedir=".">
+<project name="imported">
+
+ <!-- This file is imported by the main Ant script. -->
<!-- Prevents system classpath from being used -->
<property name="build.sysclasspath" value="ignore"/>
@@ -11,11 +13,19 @@ PROPERTIES
<property name="source.dir" value="${basedir}"/>
- <property file="./build.properties"/>
+ <property file="${basedir}/build.properties"/>
+
+ <property name="build.dir" location="${source.dir}/${ant.project.name}-ant.obj"/>
+ <property name="log.dir" location="${source.dir}"/>
+ <property name="log.file" value="${log.dir}/${ant.project.name}-build-ant.log"/>
+ <property name="project.dir" value="../../.."/>
<condition property="quick.binary">
<equals arg1="${binary}" arg2="quick"/>
</condition>
+ <condition property="pack.binary">
+ <equals arg1="${binary}" arg2="pack"/>
+ </condition>
<condition property="latest.binary">
<equals arg1="${binary}" arg2="latest"/>
</condition>
@@ -23,16 +33,15 @@ PROPERTIES
<equals arg1="${binary}" arg2="installed"/>
</condition>
- <fail message="Property 'binary' must be set to either 'quick', 'lastest' or 'installed'.">
+ <fail message="Property 'binary' must be set to either 'quick', 'pack', 'latest' or 'installed'.">
<condition><not><or>
<isset property="quick.binary"/>
+ <isset property="pack.binary"/>
<isset property="latest.binary"/>
<isset property="installed.binary"/>
</or></not></condition>
</fail>
<echo level="verbose" message="binary=${binary}"/>
-
- <property name="build.dir" value="${java.io.tmpdir}/classes-${user.name}"/>
<echo level="verbose" message="build.dir=${build.dir}"/>
<!-- ===========================================================================
@@ -40,25 +49,32 @@ INITIALISATION
============================================================================ -->
<target name="quick.init" if="quick.binary">
- <property name="quick.dir" value="../../../build/quick"/>
- <available file="${quick.dir}" property="quick.present"/>
- <fail
- message="Quick build could not be found."
- unless="quick.present"
- />
+ <property name="quick.dir" value="${project.dir}/build/quick"/>
+ <fail message="Quick build could not be found.">
+ <condition><not><available file="${quick.dir}"/></not></condition>
+ </fail>
<property name="scala.dir" value="${quick.dir}"/>
- <property name="scala-library.lib" value="${scala.dir}/lib/library/"/>
- <property name="scala-compiler.lib" value="${scala.dir}/lib/compiler/"/>
- <property name="fjbg.lib" value="${scala.dir}/lib/fjbg.jar"/>
+ <property name="scala-library.lib" value="${scala.dir}/classes/library/"/>
+ <property name="scala-compiler.lib" value="${scala.dir}/classes/compiler/"/>
+ <property name="fjbg.lib" value="${project.dir}/lib/fjbg.jar"/>
+ </target>
+
+ <target name="pack.init" if="pack.binary">
+ <property name="pack.dir" value="${project.dir}/build/pack"/>
+ <fail message="Pack build could not be found.">
+ <condition><not><available file="${pack.dir}"/></not></condition>
+ </fail>
+ <property name="scala.dir" value="${pack.dir}"/>
+ <property name="scala-library.lib" value="${scala.dir}/lib/scala-library.jar"/>
+ <property name="scala-compiler.lib" value="${scala.dir}/lib/scala-compiler.jar"/>
+ <property name="fjbg.lib" value=""/>
</target>
<target name="latest.init" if="latest.binary">
- <property name="latest.dir" value="../../../dists/latest"/>
- <available file="${latest.dir}" property="latest.present"/>
- <fail
- message="Latest build could not be found."
- unless="latest.present"
- />
+ <property name="latest.dir" value="${project.dir}/dists/latest"/>
+ <fail message="Latest build could not be found.">
+ <condition><not><available file="${latest.dir}"/></not></condition>
+ </fail>
<property name="scala.dir" value="${latest.dir}"/>
<property name="scala-library.lib" value="${scala.dir}/lib/scala-library.jar"/>
<property name="scala-compiler.lib" value="${scala.dir}/lib/scala-compiler.jar"/>
@@ -66,55 +82,52 @@ INITIALISATION
</target>
<target name="installed.init" if="installed.binary">
- <property name="installed.dir" value="/home/linuxsoft/apps/scala/share/scala"/>
- <available file="${installed.dir}" property="installed.present"/>
- <fail
- message="Installed distribution could not be found."
- unless="installed.present"
- />
+ <property name="installed.dir" value="/opt/scala"/>
+ <fail message="Installed distribution could not be found.">
+ <condition><not><available file="${installed.dir}"/></not></condition>
+ </fail>
<property name="scala.dir" value="${installed.dir}"/>
<property name="scala-library.lib" value="${scala.dir}/lib/scala-library.jar"/>
<property name="scala-compiler.lib" value="${scala.dir}/lib/scala-compiler.jar"/>
<property name="fjbg.lib" value=""/>
</target>
- <target name="init" depends="quick.init, latest.init, installed.init">
+ <target name="init" depends="quick.init, pack.init, latest.init, installed.init">
<echo level="verbose" message="scala.dir=${scala.dir}"/>
- <fail message="Scala library '${scala-library.lib}' is not available">
+
+ <path id="scala.classpath">
+ <pathelement location="${scala-library.lib}"/>
+ <pathelement location="${scala-compiler.lib}"/>
+ <pathelement location="${fjbg.lib}"/> <!-- only present for 'quick' -->
+ </path>
+
+ <fail message="Scala library '${scala-library.lib}' or '${scala-compiler.lib}' is missing/broken">
<condition><not><and>
<available classname="scala.Predef"
- classpath="${scala-library.lib}"/>
- <available classname="scala.List"
- classpath="${scala-library.lib}"/>
+ classpathref="scala.classpath"/>
+ <available classname="scala.Option"
+ classpathref="scala.classpath"/>
<available classname="scala.runtime.ObjectRef"
- classpath="${scala-library.lib}"/>
- </and></not></condition>
- </fail>
- <fail message="Scala library '${scala-compiler.lib}' is not available">
- <condition><not><and>
+ classpathref="scala.classpath"/>
<available classname="scala.tools.ant.Scalac"
- classpath="${scala-compiler.lib}"/>
+ classpathref="scala.classpath"/>
<available classname="scala.tools.nsc.Main"
- classpath="${scala-compiler.lib}"/>
+ classpathref="scala.classpath"/>
<available classname="scala.tools.util.StringOps"
- classpath="${scala-compiler.lib}"/>
+ classpathref="scala.classpath"/>
</and></not></condition>
</fail>
- <path id="scala.classpath">
- <pathelement location="${scala-library.lib}"/>
- <pathelement location="${scala-compiler.lib}"/>
- <pathelement location="${fjbg.lib}"/> <!-- only present for 'quick' -->
- </path>
- <taskdef resource="scala/tools/ant/antlib.xml">
- <classpath>
- <path refid="scala.classpath"/>
- </classpath>
- </taskdef>
+ <taskdef resource="scala/tools/ant/antlib.xml" classpathref="scala.classpath"/>
+
<path id="build.classpath">
<!--<pathelement location="${scala-actors.lib}"/>-->
<pathelement location="${scala-library.lib}"/>
<pathelement location="${build.dir}"/>
</path>
+
+ <!-- make sure the log file exists when the Ant build scripts -->
+ <!-- are run manually from the command prompt -->
+ <touch file="${log.file}"/>
</target>
<!-- ===========================================================================