diff options
-rw-r--r-- | build.xml | 6 | ||||
-rw-r--r-- | config/build.default.properties | 3 | ||||
-rw-r--r-- | sources/scala/tools/nsc/ant/NSC.scala | 16 |
3 files changed, 22 insertions, 3 deletions
@@ -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 |