diff options
author | michelou <michelou@epfl.ch> | 2004-07-14 13:06:32 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2004-07-14 13:06:32 +0000 |
commit | 5a1117d93a2f2ca3d9f90661eb4e91d7b93bef06 (patch) | |
tree | b52223d1da74a3c2d4a0850b6dcd00d80e747a60 /sources | |
parent | cbf9e4a90190beabd78a04c1ca2f5b036fdc61c2 (diff) | |
download | scala-5a1117d93a2f2ca3d9f90661eb4e91d7b93bef06.tar.gz scala-5a1117d93a2f2ca3d9f90661eb4e91d7b93bef06.tar.bz2 scala-5a1117d93a2f2ca3d9f90661eb4e91d7b93bef06.zip |
- added Ant attribute 'debug'.
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scala/tools/scala4ant/ScalaTask.scala | 18 | ||||
-rw-r--r-- | sources/scala/tools/scala4ant/ScalapTask.scala | 7 |
2 files changed, 22 insertions, 3 deletions
diff --git a/sources/scala/tools/scala4ant/ScalaTask.scala b/sources/scala/tools/scala4ant/ScalaTask.scala index e42c192866..7b1a53984d 100644 --- a/sources/scala/tools/scala4ant/ScalaTask.scala +++ b/sources/scala/tools/scala4ant/ScalaTask.scala @@ -28,12 +28,24 @@ class ScalaTask extends Java { private val PRODUCT = "scala"; + private val classpath = ScalaRuntime.scalapath; + + private var debug = false; + override def getTaskName(): String = PRODUCT; override def setClasspath(s: Path): Unit = { - val cp = ScalaRuntime.classpath; - cp.append(s); - super.setClasspath(cp) + classpath.append(s); + super.setClasspath(classpath) + } + + def setDebug(debug: Boolean): Unit = this.debug = debug; + + override def execute() = { + if (debug) { + log("CLASSPATH=" + classpath.toString()); + } + super.execute() } } diff --git a/sources/scala/tools/scala4ant/ScalapTask.scala b/sources/scala/tools/scala4ant/ScalapTask.scala index 80dbb38e40..837453b82f 100644 --- a/sources/scala/tools/scala4ant/ScalapTask.scala +++ b/sources/scala/tools/scala4ant/ScalapTask.scala @@ -35,6 +35,7 @@ class ScalapTask extends Task { private var showPrivateDefs = false; private var isVerbose = false; + private var debug = false; override def getTaskName(): String = PRODUCT; @@ -48,6 +49,8 @@ class ScalapTask extends Task { def setVerbose(verbose: Boolean): Unit = isVerbose = verbose; + def setDebug(debug: Boolean): Unit = this.debug = debug; + override def execute() = try { System.setProperty("scala.home", ScalaRuntime.home.toString()); System.setProperty("scala.product", PRODUCT); @@ -55,6 +58,10 @@ class ScalapTask extends Task { System.setProperty("scala.class.path", "."); System.setProperty("scala.boot.class.path", ScalaRuntime.bootclasspath.toString()); + if (debug) { + for (val arg <- getArgs()) + System.out.println(arg); + } scala.tools.scalap.Main.main(getArgs()); } catch { |