diff options
author | Burak Emir <emir@epfl.ch> | 2005-07-30 23:18:59 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2005-07-30 23:18:59 +0000 |
commit | 526917486633c5f69aab6fe64021b2c0998b74c6 (patch) | |
tree | 7235b51e6842ee8e39fdd39b8ab8c4358ab9e1cf | |
parent | 7df39b24cf872a65203769cb76a9f0cd90d979b5 (diff) | |
download | scala-526917486633c5f69aab6fe64021b2c0998b74c6.tar.gz scala-526917486633c5f69aab6fe64021b2c0998b74c6.tar.bz2 scala-526917486633c5f69aab6fe64021b2c0998b74c6.zip |
userExclude feature for build and test infrastr...
userExclude feature for build and test infrastructure
-rw-r--r-- | .cvsignore | 2 | ||||
-rwxr-xr-x | ant-build-nsc.sh | 8 | ||||
-rwxr-xr-x | ant-common.sh | 19 | ||||
-rwxr-xr-x | ant-test-nsc.sh | 9 | ||||
-rw-r--r-- | test-nsc.xml | 86 |
5 files changed, 122 insertions, 2 deletions
diff --git a/.cvsignore b/.cvsignore index 182cf49d52..e4e7dba551 100644 --- a/.cvsignore +++ b/.cvsignore @@ -11,3 +11,5 @@ objects tmp build-nsc.properties env.sh +concrete-build-nsc.xml +concrete-test-nsc.xml diff --git a/ant-build-nsc.sh b/ant-build-nsc.sh index 6b15ce300e..0769f443b8 100755 --- a/ant-build-nsc.sh +++ b/ant-build-nsc.sh @@ -14,5 +14,11 @@ export CLASSPATH # for debugging your classpath #echo $CLASSPATH +if [ -f developer/${USER}/build-nsc-excludes.xml ]; then + sed -e "s/userExcludes\ \"\"/userExcludes\ SYSTEM\ \"developer\/${USER}\/build-nsc-excludes.xml\"/" < build-nsc.xml > concrete-build-nsc.xml; + else + ln -s build-nsc.xml concrete-build-nsc.xml; +fi -ant -f build-nsc.xml $* +ant -f concrete-build-nsc.xml $* +rm -f concrete-build-nsc.xml diff --git a/ant-common.sh b/ant-common.sh new file mode 100755 index 0000000000..7da266bd54 --- /dev/null +++ b/ant-common.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +export ANT_OPTS=-Xmx256m + +awk '/^$/ {next;} /^#/ {next;} {print "export " $1 $2 $3}' build-nsc.properties > env.sh + +. env.sh + +# ------- don't change these, change build-nsc.properties instead + +function addJar() { # string -> void + if [ -f $1 ]; then + CLASSPATH=$1:$CLASSPATH; + return 0; + else + echo you supplied $1 for $2, but it does not exists; + return -1; + fi +} diff --git a/ant-test-nsc.sh b/ant-test-nsc.sh index 556d75bf00..93f130ef63 100755 --- a/ant-test-nsc.sh +++ b/ant-test-nsc.sh @@ -15,5 +15,12 @@ export CLASSPATH # for debugging your classpath #echo $CLASSPATH +if [ -f developer/${USER}/test-nsc-excludes.xml ]; then + sed -e "s/userExcludes\ \"\"/userExcludes\ SYSTEM\ \"developer\/${USER}\/test-nsc-excludes.xml\"/" < test-nsc.xml > concrete-test-nsc.xml; + else + ln -s test-nsc.xml concrete-test-nsc.xml; +fi + +ant -f concrete-test-nsc.xml $* +rm -f concrete-test-ncs.xml -ant -f test-nsc.xml $* diff --git a/test-nsc.xml b/test-nsc.xml new file mode 100644 index 0000000000..5fbe1eec2b --- /dev/null +++ b/test-nsc.xml @@ -0,0 +1,86 @@ +<!DOCTYPE project [ + <!ENTITY userExcludes ""> +]> +<project name="scala.nsc" default="test"> + + <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + nsc + + new scala compiler + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%% + %%% Preliminaries + %%% + + 1) working nsc compiler (see build-nsc.xml) + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --> + + <!-- %%% properties and taskdefs %%%--> + + <property file="build-nsc.properties"/> + + <!-- taskdefs to call compilers --> + + <taskdef name="nsc" classname="scala.tools.scala4ant.NscTask$class"/> + + <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + test test nsc compiler + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --> + + <property file="developer/${user.name}/custom.properties"/> + + <target name="init.args" if="nscArgs"> + <property name="moreNscArgs" value="${nscArgs}"/> + </target> + + <target name="init.noargs"> + <property name="moreNscArgs" value=""/> + </target> + + <target name="init" depends="init.args, init.noargs"> + <echo> Hi, I am your helpful test script. Passing options to nsc?</echo> + <echo> Either, add a line to developer/${user.name}/custom.properties</echo> + <echo> nscArgs = -check:term;-debug </echo> + <echo> or set a property nscArgs on the cmd line</echo> + <echo> sh ant-test-nsc.sh -DnscArgs="-check:term;-debug" </echo> + <echo/> + <echo> Note the hyphens, the quotes on the cmd line, no spaces between options, the ';' separator</echo> + </target> + + <target name="test" depends="init"> + + <mkdir dir="${nsc_output_dir}"/> + + <echo>==== running nsc on predef and runtime</echo> + <nsc srcdir="sources" destdir="${nsc_output_dir}" + classpath="sources:newsources:${tools_util_runtime_dir}" + nscArgs="-nopredefs;${moreNscArgs}"> + + <include name="scala/Predef.scala"/> + <include name="scala/runtime/ScalaRunTime.scala"/> + </nsc> + + <echo>===== running nsc on the rest</echo> + <nsc srcdir="sources" destdir="${nsc_output_dir}" + classpath="sources:newsources:${tools_util_runtime_dir}:${nsc_output_dir}" + nscArgs="${moreNscArgs}" force="true"> + + <include name="scala/**/*.scala"/> + <include name="../newsources/**.scala"/> + + <exclude name="scala/Predef.scala"/> + <exclude name="scala/runtime/ScalaRunTime.scala"/> + + <exclude name="scala/tools/**"/> + &userExcludes; + </nsc> + + </target> + +</project> |