summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/ant/Scalac.scala
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2006-05-03 07:18:56 +0000
committermihaylov <mihaylov@epfl.ch>2006-05-03 07:18:56 +0000
commitc0f698a7c04ae2f3be2d32c809aa90add033d277 (patch)
tree5f57e8c9bd7cdefab14ace16755d6a8259c99c41 /src/compiler/scala/tools/ant/Scalac.scala
parent274d395e6b96f9487d21411ea5576e4cdb5d795e (diff)
downloadscala-c0f698a7c04ae2f3be2d32c809aa90add033d277.tar.gz
scala-c0f698a7c04ae2f3be2d32c809aa90add033d277.tar.bz2
scala-c0f698a7c04ae2f3be2d32c809aa90add033d277.zip
Added a 'target' option
Diffstat (limited to 'src/compiler/scala/tools/ant/Scalac.scala')
-rw-r--r--src/compiler/scala/tools/ant/Scalac.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/ant/Scalac.scala b/src/compiler/scala/tools/ant/Scalac.scala
index aabf19f5e8..9632094102 100644
--- a/src/compiler/scala/tools/ant/Scalac.scala
+++ b/src/compiler/scala/tools/ant/Scalac.scala
@@ -38,6 +38,7 @@ package scala.tools.ant {
* <li>extdirs,</li>
* <li>extdirsref,</li>
* <li>encoding,</li>
+ * <li>target,</li>
* <li>force,</li>
* <li>logging,</li>
* <li>logphase,</li>
@@ -87,6 +88,10 @@ package scala.tools.ant {
"terminal")
}
+ object Target extends PermissibleValue {
+ val values = List("jvm", "msil", "cldc")
+ }
+
/** The directories that contain source files to compile. */
private var origin: Option[Path] = None
/** The directory to put the compiled files in. */
@@ -104,6 +109,9 @@ package scala.tools.ant {
/** The character encoding of the files to compile. */
private var encoding: Option[String] = None
+ // the targetted backend
+ private var backend: Option[String] = None
+
/** Whether to force compilation of all files or not. */
private var force: Boolean = false
/** How much logging output to print. Either none (default),
@@ -229,6 +237,10 @@ package scala.tools.ant {
def setEncoding(input: String): Unit =
encoding = Some(input)
+ def setTarget(input: String): Unit =
+ if (Target.isPermissible(input)) backend = Some(input)
+ else error("Unknown target '" + input + "'")
+
/** Sets the force attribute. Used by Ant.
* @param input The value for <code>force</code>. */
def setForce(input: Boolean): Unit =
@@ -439,6 +451,7 @@ package scala.tools.ant {
settings.bootclasspath.value = asString(getBootclasspath)
if (!extdirs.isEmpty) settings.extdirs.value = asString(getExtdirs)
if (!encoding.isEmpty) settings.encoding.value = encoding.get
+ if (!backend.isEmpty) settings.target.value = backend.get
if (!logging.isEmpty && logging.get == "verbose")
settings.verbose.value = true
else if (!logging.isEmpty && logging.get == "debug") {