summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/ant/ScalaTool.scala
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2006-10-03 14:57:15 +0000
committermichelou <michelou@epfl.ch>2006-10-03 14:57:15 +0000
commit1450735f9747fe97afbbd882aaf7b8992d493189 (patch)
tree1a6b400785ec0ec54671eb1c9e399903ce33e397 /src/compiler/scala/tools/ant/ScalaTool.scala
parent6ce056f31e1fea835b33203dd864f1ee4edf587c (diff)
downloadscala-1450735f9747fe97afbbd882aaf7b8992d493189.tar.gz
scala-1450735f9747fe97afbbd882aaf7b8992d493189.tar.bz2
scala-1450735f9747fe97afbbd882aaf7b8992d493189.zip
rewrote handling of Scala comments in DocGenera...
rewrote handling of Scala comments in DocGenerator.scala improved Scala comments in library and compiler source files added test in method 'apply' of class collection.immutable.Queue
Diffstat (limited to 'src/compiler/scala/tools/ant/ScalaTool.scala')
-rw-r--r--src/compiler/scala/tools/ant/ScalaTool.scala127
1 files changed, 81 insertions, 46 deletions
diff --git a/src/compiler/scala/tools/ant/ScalaTool.scala b/src/compiler/scala/tools/ant/ScalaTool.scala
index a159d4fed8..01920985bb 100644
--- a/src/compiler/scala/tools/ant/ScalaTool.scala
+++ b/src/compiler/scala/tools/ant/ScalaTool.scala
@@ -23,30 +23,35 @@ package scala.tools.ant {
SourceFileScanner}
import org.apache.tools.ant.types.{EnumeratedAttribute, Reference}
- /** An Ant task that generates a SH or BAT script to execute a Scala program.
- * This task can take the following parameters as attributes:<ul>
- * <li>file (mandatory),</li>
- * <li>name,</li>
- * <li>class (mandatory),</li>
- * <li>platforms,</li>
- * <li>version,</li>
- * <li>copyright,</li>
- * <li>bootclasspath,</li>
- * <li>extclasspath,</li>
- * <li>properties,</li>
- * <li>javaflags,</li>
- * <li>toolflags,</li>
- * <li>genericfile.</li></ul>
- *
- * @author Gilles Dubochet */
+ /** <p>
+ * An Ant task that generates a shell or batch script to execute a
+ * <a href="http://scala.epfl.ch/" target="_top">Scala</a> program.
+ * This task can take the following parameters as attributes:
+ * </p><ul>
+ * <li>file (mandatory),</li>
+ * <li>name,</li>
+ * <li>class (mandatory),</li>
+ * <li>platforms,</li>
+ * <li>version,</li>
+ * <li>copyright,</li>
+ * <li>bootclasspath,</li>
+ * <li>extclasspath,</li>
+ * <li>properties,</li>
+ * <li>javaflags,</li>
+ * <li>toolflags,</li>
+ * <li>genericfile.</li></ul>
+ *
+ * @author Gilles Dubochet
+ * @version 1.0
+ */
class ScalaTool extends MatchingTask {
/** The unique Ant file utilities instance to use in this task. */
private val fileUtils = FileUtils.newFileUtils()
-/******************************************************************************\
+/*============================================================================*\
** Ant user-properties **
-\******************************************************************************/
+\*============================================================================*/
abstract class PermissibleValue {
val values: List[String]
@@ -93,22 +98,31 @@ package scala.tools.ant {
* be set when a main class is defined */
private var toolFlags: String = ""
-/******************************************************************************\
+/*============================================================================*\
** Properties setters **
-\******************************************************************************/
+\*============================================================================*/
- /** Sets the file attribute. Used by Ant.
- * @param input The value of <code>file</code>. */
+ /** Sets the file attribute.
+ * Used by <a href="http://ant.apache.org/" target="_top">Ant</a>.
+ *
+ * @param input The value of <code>file</code>.
+ */
def setFile(input: File) =
file = Some(input)
- /** Sets the file attribute. Used by Ant.
- * @param input The value of <code>file</code>. */
+ /** Sets the file attribute.
+ * Used by <a href="http://ant.apache.org/" target="_top">Ant</a>.
+ *
+ * @param input The value of <code>file</code>.
+ */
def setName(input: String) =
name = Some(input)
- /** Sets the main class attribute. Used by Ant.
- * @param input The value of <code>mainClass</code>. */
+ /** Sets the main class attribute.
+ * Used by <a href="http://ant.apache.org/" target="_top">Ant</a>.
+ *
+ * @param input The value of <code>mainClass</code>.
+ */
def setClass(input: String) =
mainClass = Some(input)
@@ -126,28 +140,43 @@ package scala.tools.ant {
}
}
- /** Sets the version attribute. Used by Ant.
- * @param input The value of <code>version</code>. */
+ /** Sets the version attribute.
+ * Used by <a href="http://ant.apache.org/" target="_top">Ant</a>.
+ *
+ * @param input The value of <code>version</code>.
+ */
def setVersion(input: String) =
version = input
- /** Sets the copyright attribute. Used by Ant.
- * @param input The value of <code>copyright</code>. */
+ /** Sets the copyright attribute.
+ * Used by <a href="http://ant.apache.org/" target="_top">Ant</a>.
+ *
+ * @param input The value of <code>copyright</code>.
+ */
def setCopyright(input: String) =
copyright = input
- /** Sets the boot classpath attribute. Used by Ant.
- * @param input The value of <code>bootclasspath</code>. */
+ /** Sets the boot classpath attribute.
+ * Used by <a href="http://ant.apache.org/" target="_top">Ant</a>.
+ *
+ * @param input The value of <code>bootclasspath</code>.
+ */
def setBootclasspath(input: String) =
bootclasspath = bootclasspath ::: List.fromArray(input.split(":"))
- /** Sets the extension classpath attribute. Used by Ant.
- * @param input The value of <code>extclasspath</code>. */
+ /** Sets the extension classpath attribute.
+ * Used by <a href="http://ant.apache.org/" target="_top">Ant</a>.
+ *
+ * @param input The value of <code>extclasspath</code>.
+ */
def setExtclasspath(input: String) =
extclasspath = extclasspath ::: List.fromArray(input.split(":"))
- /** Sets the properties attribute. Used by Ant.
- * @param input The value for <code>properties</code>. */
+ /** Sets the properties attribute.
+ * Used by <a href="http://ant.apache.org/" target="_top">Ant</a>.
+ *
+ * @param input The value for <code>properties</code>.
+ */
def setProperties(input: String) = {
properties = List.fromArray(input.split(",")).flatMap { s: String =>
val st = s.trim(); val stArray = st.split("=", 2)
@@ -157,19 +186,25 @@ package scala.tools.ant {
}
}
- /** Sets the version attribute. Used by Ant.
- * @param input The value of <code>version</code>. */
+ /** Sets the version attribute.
+ * Used by <a href="http://ant.apache.org/" target="_top">Ant</a>.
+ *
+ * @param input The value of <code>version</code>.
+ */
def setJavaflags(input: String) =
javaFlags = input
- /** Sets the version attribute. Used by Ant.
- * @param input The value of <code>version</code>. */
+ /** Sets the version attribute.
+ * Used by <a href="http://ant.apache.org/" target="_top">Ant</a>.
+ *
+ * @param input The value of <code>version</code>.
+ */
def setToolflags(input: String) =
toolFlags = input
-/******************************************************************************\
+/*============================================================================*\
** Properties getters **
-\******************************************************************************/
+\*============================================================================*/
/** Gets the value of the file attribute in a Scala-friendly form.
* @returns The file as a file. */
@@ -206,9 +241,9 @@ package scala.tools.ant {
case Pair(name,value) => "-D" + name + "=\"" + value + "\""
}).mkString("", " ", "")
-/******************************************************************************\
+/*============================================================================*\
** Compilation and support methods **
-\******************************************************************************/
+\*============================================================================*/
/** Generates a build error. Error location will be the current task in the
* ant file.
@@ -289,9 +324,9 @@ package scala.tools.ant {
}
-/******************************************************************************\
+/*============================================================================*\
** The big execute method **
-\******************************************************************************/
+\*============================================================================*/
/** Performs the compilation. */
override def execute() = {