summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Dubochet <gilles.dubochet@epfl.ch>2005-10-18 11:54:14 +0000
committerGilles Dubochet <gilles.dubochet@epfl.ch>2005-10-18 11:54:14 +0000
commit9e1ed625367326b0afbac2235ce08bf6c98d0a43 (patch)
treeced67d3aea04ffb2e1c8d3fb4fbdda1bddbc1ba4
parent0b87051d35bbf9ca3e75fdab4c13819b6a09493b (diff)
downloadscala-9e1ed625367326b0afbac2235ce08bf6c98d0a43.tar.gz
scala-9e1ed625367326b0afbac2235ce08bf6c98d0a43.tar.bz2
scala-9e1ed625367326b0afbac2235ce08bf6c98d0a43.zip
Added the log option.
-rw-r--r--build.xml6
-rw-r--r--config/build.default.properties3
-rw-r--r--sources/scala/tools/nsc/ant/NSC.scala16
3 files changed, 22 insertions, 3 deletions
diff --git a/build.xml b/build.xml
index 99e1a4e24e..d835db90a5 100644
--- a/build.xml
+++ b/build.xml
@@ -186,7 +186,7 @@
<mkdir dir="${build.nslib.dir}"/>
<nsc srcdir="${sources.dir}" destdir="${build.nslib.dir}"
usepredefs="false"
- stop="${nsc.stop}" skip="${nsc.skip}" check="${nsc.check}"
+ stop="${nsc.stop}" skip="${nsc.skip}" check="${nsc.check}" log="${nsc.log}"
logging="${nsc.logging}">
<classpath>
<pathelement location="${build.nslib.dir}"/>
@@ -199,7 +199,7 @@
</nsc>
<nsc srcdir="${sources.dir}" destdir="${build.nslib.dir}"
excludesfile="${nsc.nslib.excludes}"
- stop="${nsc.stop}" skip="${nsc.skip}" check="${nsc.check}"
+ stop="${nsc.stop}" skip="${nsc.skip}" check="${nsc.check}" log="${nsc.log}"
logging="${nsc.logging}">
<classpath>
<pathelement location="${build.nslib.dir}"/>
@@ -219,7 +219,7 @@
<mkdir dir="${build.nstools.dir}"/>
<nsc srcdir="${sources.dir}" destdir="${build.nstools.dir}"
excludesfile="${nsc.nstools.excludes}"
- stop="${nsc.stop}" skip="${nsc.skip}" check="${nsc.check}"
+ stop="${nsc.stop}" skip="${nsc.skip}" check="${nsc.check}" log="${nsc.log}"
logging="${nsc.logging}">
<classpath>
<pathelement location="${build.nslib.dir}"/>
diff --git a/config/build.default.properties b/config/build.default.properties
index 7c7b83b0e5..ab821b042e 100644
--- a/config/build.default.properties
+++ b/config/build.default.properties
@@ -21,6 +21,9 @@ nsc.stop=
# A comma-separated list of compile phases that NSC should skip.
nsc.skip=
+# A comma-separated list of compile phases that NSC should log.
+nsc.log=
+
# A comma-separated list of compile phases which result should be checked for
# consistency.
nsc.check=
diff --git a/sources/scala/tools/nsc/ant/NSC.scala b/sources/scala/tools/nsc/ant/NSC.scala
index 1fdaa249b7..2616d41322 100644
--- a/sources/scala/tools/nsc/ant/NSC.scala
+++ b/sources/scala/tools/nsc/ant/NSC.scala
@@ -51,6 +51,7 @@ package scala.tools.nsc.ant {
* <li>force,</li>
* <li>stop,</li>
* <li>skip,</li>
+ * <li>log,</li>
* <li>check.</li>
* </ul>
* It also takes the following parameters as nested elements:<ul>
@@ -126,6 +127,8 @@ package scala.tools.nsc.ant {
private var stop: Option[String] = None;
/** Which compilation phases should be skipped during compilation. */
private var skip: List[String] = Nil;
+ /** Which compilation phases should be logged during compilation. */
+ private var logPhase: List[String] = Nil;
/** Which compilation phases results should be checked for consistency. */
private var check: List[String] = Nil;
@@ -403,6 +406,18 @@ package scala.tools.nsc.ant {
}
/**
+ * Sets the log attribute. Used by Ant.
+ * @param input The value for <code>logPhase</code>.
+ */
+ def setLog (input: String) = {
+ logPhase = List.fromArray(input.split(",")).flatMap(s: String => {
+ val st = s.trim();
+ if (CompilerPhase.isPermissible(st)) (if (input != "") List(st) else Nil)
+ else {error("Phase " + st + " in log does not exist."); Nil}
+ });
+ }
+
+ /**
* Sets the force attribute. Used by Ant.
* @param input The value for <code>force</code>.
*/
@@ -566,6 +581,7 @@ package scala.tools.nsc.ant {
if (!stop.isEmpty) settings.stop.value = List(stop.get);
if (!skip.isEmpty) settings.skip.value = skip;
if (!check.isEmpty) settings.check.value = check;
+ if (!logPhase.isEmpty) settings.log.value = logPhase;
// Sets path properties to prevent ClassPath from being corrupted.
// It this isn't done, classpath will contain more than