From 9e1ed625367326b0afbac2235ce08bf6c98d0a43 Mon Sep 17 00:00:00 2001 From: Gilles Dubochet Date: Tue, 18 Oct 2005 11:54:14 +0000 Subject: Added the log option. --- build.xml | 6 +++--- config/build.default.properties | 3 +++ sources/scala/tools/nsc/ant/NSC.scala | 16 ++++++++++++++++ 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 @@ @@ -199,7 +199,7 @@ @@ -219,7 +219,7 @@ 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 { *
  • force,
  • *
  • stop,
  • *
  • skip,
  • + *
  • log,
  • *
  • check.
  • * * It also takes the following parameters as nested elements:
      @@ -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; @@ -402,6 +405,18 @@ package scala.tools.nsc.ant { }); } + /** + * Sets the log attribute. Used by Ant. + * @param input The value for logPhase. + */ + 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 force. @@ -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 -- cgit v1.2.3