summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/build/pack.xml58
-rw-r--r--src/compiler/scala/tools/ant/Scaladoc.scala202
-rw-r--r--src/compiler/scala/tools/ant/sabbus/ScalacFork.scala33
-rw-r--r--src/compiler/scala/tools/ant/sabbus/Settings.scala3
-rw-r--r--src/compiler/scala/tools/nsc/CompileServer.scala13
-rw-r--r--src/compiler/scala/tools/nsc/Properties.scala20
-rw-r--r--src/compiler/scala/tools/nsc/plugins/Plugin.scala34
7 files changed, 190 insertions, 173 deletions
diff --git a/src/build/pack.xml b/src/build/pack.xml
index 86c4cf68f8..05e49e5e81 100644
--- a/src/build/pack.xml
+++ b/src/build/pack.xml
@@ -21,53 +21,53 @@ MAIN DISTRIBUTION PACKAGING
</target>
<target name="pack-archives.tar" depends="pack-archives.start">
- <tar destfile="${dists.dir}/archives/scala-${version.number}.tar"
+ <tar destfile="${dists.dir}/archives/${dist.name}.tar"
compression="none" longfile="gnu">
- <tarfileset dir="${dist.dir}" prefix="scala-${version.number}" includes="bin/**" mode="755"/>
- <tarfileset dir="${dist.dir}" prefix="scala-${version.number}" excludes="bin/**"/>
+ <tarfileset dir="${dist.dir}" prefix="${dist.name}" includes="bin/**" mode="755"/>
+ <tarfileset dir="${dist.dir}" prefix="${dist.name}" excludes="bin/**"/>
</tar>
- <gzip src="${dists.dir}/archives/scala-${version.number}.tar" destfile="${dists.dir}/archives/scala-${version.number}.tgz"/>
+ <gzip src="${dists.dir}/archives/${dist.name}.tar" destfile="${dists.dir}/archives/${dist.name}.tgz"/>
<exec executable="xz" failifexecutionfails="false">
- <arg line="-k -9e -S .xz ${dists.dir}/archives/scala-${version.number}.tar"/>
+ <arg line="-k -9e -S .xz ${dists.dir}/archives/${dist.name}.tar"/>
</exec>
- <move file="${dists.dir}/archives/scala-${version.number}.tar.xz" tofile="${dists.dir}/archives/scala-${version.number}.txz" failonerror="false"/>
- <delete file="${dists.dir}/archives/scala-${version.number}.tar" />
+ <move file="${dists.dir}/archives/${dist.name}.tar.xz" tofile="${dists.dir}/archives/${dist.name}.txz" failonerror="false"/>
+ <delete file="${dists.dir}/archives/${dist.name}.tar" />
<checksum fileext=".md5">
<fileset dir="${dists.dir}/archives">
- <include name="scala-${version.number}.t?z"/>
+ <include name="${dist.name}.t?z"/>
</fileset>
</checksum>
</target>
<target name="pack-archives.zip" depends="pack-archives.tar">
- <zip destfile="${dists.dir}/archives/scala-${version.number}.zip">
- <zipfileset prefix="scala-${version.number}" dir="${dist.dir}"/>
+ <zip destfile="${dists.dir}/archives/${dist.name}.zip">
+ <zipfileset prefix="${dist.name}" dir="${dist.dir}"/>
</zip>
- <checksum file="${dists.dir}/archives/scala-${version.number}.zip" fileext=".md5"/>
+ <checksum file="${dists.dir}/archives/${dist.name}.zip" fileext=".md5"/>
</target>
<target name="pack-devel-docs.tar" depends="pack-archives.zip">
- <tar destfile="${dists.dir}/archives/scala-${version.number}-devel-docs.tar"
+ <tar destfile="${dists.dir}/archives/${dist.name}-devel-docs.tar"
compression="none" longfile="gnu">
- <tarfileset dir="${dist.dir}/doc/scala-devel-docs" prefix="scala-${version.number}-devel-docs"/>
+ <tarfileset dir="${dist.dir}/doc/scala-devel-docs" prefix="${dist.name}-devel-docs"/>
</tar>
- <gzip src="${dists.dir}/archives/scala-${version.number}-devel-docs.tar" destfile="${dists.dir}/archives/scala-${version.number}-devel-docs.tgz"/>
+ <gzip src="${dists.dir}/archives/${dist.name}-devel-docs.tar" destfile="${dists.dir}/archives/${dist.name}-devel-docs.tgz"/>
<exec executable="xz" failifexecutionfails="false">
- <arg line="-k -9e -S .xz ${dists.dir}/archives/scala-${version.number}-devel-docs.tar"/>
+ <arg line="-k -9e -S .xz ${dists.dir}/archives/${dist.name}-devel-docs.tar"/>
</exec>
- <move file="${dists.dir}/archives/scala-${version.number}-devel-docs.tar.xz" tofile="${dists.dir}/archives/scala-${version.number}-devel-docs.txz" failonerror="false"/>
- <delete file="${dists.dir}/archives/scala-${version.number}-devel-docs.tar" />
+ <move file="${dists.dir}/archives/${dist.name}-devel-docs.tar.xz" tofile="${dists.dir}/archives/${dist.name}-devel-docs.txz" failonerror="false"/>
+ <delete file="${dists.dir}/archives/${dist.name}-devel-docs.tar" />
<checksum fileext=".md5">
<fileset dir="${dists.dir}/archives">
- <include name="scala-${version.number}-devel-docs.t?z"/>
+ <include name="${dist.name}-devel-docs.t?z"/>
</fileset>
</checksum>
</target>
<target name="pack-archives.src" depends="pack-devel-docs.tar">
- <tar destfile="${dists.dir}/archives/scala-${version.number}-sources.tar"
+ <tar destfile="${dists.dir}/archives/${dist.name}-sources.tar"
compression="none" longfile="gnu">
- <tarfileset dir="${basedir}" prefix="scala-${version.number}-sources">
+ <tarfileset dir="${basedir}" prefix="${dist.name}-sources">
<exclude name="bin/**"/>
<exclude name="build/**"/>
<exclude name="debian/**"/>
@@ -76,19 +76,19 @@ MAIN DISTRIBUTION PACKAGING
<exclude name="sandbox/**"/>
<exclude name="test/partest"/>
</tarfileset>
- <tarfileset dir="${basedir}" prefix="scala-${version.number}-sources" filemode="755">
+ <tarfileset dir="${basedir}" prefix="${dist.name}-sources" filemode="755">
<include name="test/partest"/>
</tarfileset>
</tar>
- <gzip src="${dists.dir}/archives/scala-${version.number}-sources.tar" destfile="${dists.dir}/archives/scala-${version.number}-sources.tgz"/>
+ <gzip src="${dists.dir}/archives/${dist.name}-sources.tar" destfile="${dists.dir}/archives/${dist.name}-sources.tgz"/>
<exec executable="xz" failifexecutionfails="false">
- <arg line="-k -9e -S .xz ${dists.dir}/archives/scala-${version.number}-sources.tar"/>
+ <arg line="-k -9e -S .xz ${dists.dir}/archives/${dist.name}-sources.tar"/>
</exec>
- <move file="${dists.dir}/archives/scala-${version.number}-sources.tar.xz" tofile="${dists.dir}/archives/scala-${version.number}-sources.txz" failonerror="false"/>
- <delete file="${dists.dir}/archives/scala-${version.number}-sources.tar" />
+ <move file="${dists.dir}/archives/${dist.name}-sources.tar.xz" tofile="${dists.dir}/archives/${dist.name}-sources.txz" failonerror="false"/>
+ <delete file="${dists.dir}/archives/${dist.name}-sources.tar" />
<checksum fileext=".md5">
<fileset dir="${dists.dir}/archives">
- <include name="scala-${version.number}-sources.t?z"/>
+ <include name="${dist.name}-sources.t?z"/>
</fileset>
</checksum>
</target>
@@ -186,13 +186,13 @@ MAIN DISTRIBUTION SBAZ
<target name="pack-sbaz.all" depends="pack-sbaz.doc">
<sbaz
- file="${dists.dir}/sbaz/scala-${version.number}.sbp"
- adfile="${dists.dir}/sbaz/scala-${version.number}.advert"
+ file="${dists.dir}/sbaz/${dist.name}.sbp"
+ adfile="${dists.dir}/sbaz/${dist.name}.advert"
name="scala"
version="${version.number}"
desc="The base Scala package that contains everything needed to start using Scala."
depends="scala-library,scala-devel"
- link="${sbaz.universe}/scala-${version.number}.sbp"/>
+ link="${sbaz.universe}/${dist.name}.sbp"/>
</target>
diff --git a/src/compiler/scala/tools/ant/Scaladoc.scala b/src/compiler/scala/tools/ant/Scaladoc.scala
index b233d3b585..a4593b8f88 100644
--- a/src/compiler/scala/tools/ant/Scaladoc.scala
+++ b/src/compiler/scala/tools/ant/Scaladoc.scala
@@ -11,7 +11,7 @@ package scala.tools.ant
import java.io.File
-import org.apache.tools.ant.{BuildException, Project}
+import org.apache.tools.ant.Project
import org.apache.tools.ant.types.{Path, Reference}
import org.apache.tools.ant.util.{FileUtils, GlobPatternMapper}
@@ -19,45 +19,37 @@ import scala.tools.nsc.Global
import scala.tools.nsc.doc.Settings
import scala.tools.nsc.reporters.{Reporter, ConsoleReporter}
-/** <p>
- * An Ant task to document Scala code.
- * </p>
- * <p>
- * This task can take the following parameters as attributes:
- * </p>
- * <ul>
- * <li>srcdir (mandatory),</li>
- * <li>srcref,</li>
- * <li>destdir,</li>
- * <li>classpath,</li>
- * <li>classpathref,</li>
- * <li>sourcepath,</li>
- * <li>sourcepathref,</li>
- * <li>bootclasspath,</li>
- * <li>bootclasspathref,</li>
- * <li>extdirs,</li>
- * <li>extdirsref,</li>
- * <li>encoding,</li>
- * <li>doctitle,</li>
- * <li>header,</li>
- * <li>footer,</li>
- * <li>top,</li>
- * <li>bottom,</li>
- * <li>addparams,</li>
- * <li>deprecation,</li>
- * <li>docgenerator,</li>
- * <li>unchecked.</li>
- * </ul>
- * <p>
- * It also takes the following parameters as nested elements:
- * </p>
- * <ul>
- * <li>src (for srcdir),</li>
- * <li>classpath,</li>
- * <li>sourcepath,</li>
- * <li>bootclasspath,</li>
- * <li>extdirs.</li>
- * </ul>
+/** An Ant task to document Scala code.
+ *
+ * This task can take the following parameters as attributes:
+ * - `srcdir` (mandatory),
+ * - `srcref`,
+ * - `destdir`,
+ * - `classpath`,
+ * - `classpathref`,
+ * - `sourcepath`,
+ * - `sourcepathref`,
+ * - `bootclasspath`,
+ * - `bootclasspathref`,
+ * - `extdirs`,
+ * - `extdirsref`,
+ * - `encoding`,
+ * - `doctitle`,
+ * - `header`,
+ * - `footer`,
+ * - `top`,
+ * - `bottom`,
+ * - `addparams`,
+ * - `deprecation`,
+ * - `docgenerator`,
+ * - `unchecked`.
+ *
+ * It also takes the following parameters as nested elements:
+ * - `src` (for srcdir),
+ * - `classpath`,
+ * - `sourcepath`,
+ * - `bootclasspath`,
+ * - `extdirs`.
*
* @author Gilles Dubochet, Stephane Micheloud
*/
@@ -76,8 +68,8 @@ class Scaladoc extends ScalaMatchingTask {
(value == "") || values.exists(_.startsWith(value))
}
- /** Defines valid values for the <code>deprecation</code> and
- * <code>unchecked</code> properties.
+ /** Defines valid values for the `deprecation` and
+ * `unchecked` properties.
*/
object Flag extends PermissibleValue {
val values = List("yes", "no", "on", "off")
@@ -131,25 +123,25 @@ class Scaladoc extends ScalaMatchingTask {
** Properties setters **
\*============================================================================*/
- /** Sets the <code>srcdir</code> attribute. Used by Ant.
+ /** Sets the `srcdir` attribute. Used by [[http://ant.apache.org Ant]].
*
- * @param input The value of <code>origin</code>.
+ * @param input The value of `origin`.
*/
def setSrcdir(input: Path) {
if (origin.isEmpty) origin = Some(input)
else origin.get.append(input)
}
- /** Sets the <code>origin</code> as a nested src Ant parameter.
+ /** Sets the `origin` as a nested src Ant parameter.
*
* @return An origin path to be configured.
*/
def createSrc(): Path = {
- if (origin.isEmpty) origin = Some(new Path(getProject()))
+ if (origin.isEmpty) origin = Some(new Path(getProject))
origin.get.createPath()
}
- /** Sets the <code>origin</code> as an external reference Ant parameter.
+ /** Sets the `origin` as an external reference Ant parameter.
*
* @param input A reference to an origin path.
*/
@@ -157,83 +149,81 @@ class Scaladoc extends ScalaMatchingTask {
createSrc().setRefid(input)
}
- /** Sets the <code>destdir</code> attribute. Used by Ant.
+ /** Sets the `destdir` attribute. Used by [[http://ant.apache.org Ant]].
*
- * @param input The value of <code>destination</code>.
+ * @param input The value of `destination`.
*/
def setDestdir(input: File) {
destination = Some(input)
}
- /** Sets the <code>classpath</code> attribute. Used by Ant.
+ /** Sets the `classpath` attribute. Used by [[http://ant.apache.org Ant]].
*
- * @param input The value of <code>classpath</code>.
+ * @param input The value of `classpath`.
*/
def setClasspath(input: Path) {
if (classpath.isEmpty) classpath = Some(input)
else classpath.get.append(input)
}
- /** Sets the <code>classpath</code> as a nested classpath Ant parameter.
+ /** Sets the `classpath` as a nested classpath Ant parameter.
*
* @return A class path to be configured.
*/
def createClasspath(): Path = {
- if (classpath.isEmpty) classpath = Some(new Path(getProject()))
+ if (classpath.isEmpty) classpath = Some(new Path(getProject))
classpath.get.createPath()
}
- /** Sets the <code>classpath</code> as an external reference Ant parameter.
+ /** Sets the `classpath` as an external reference Ant parameter.
*
* @param input A reference to a class path.
*/
def setClasspathref(input: Reference) =
createClasspath().setRefid(input)
- /** Sets the <code>sourcepath</code> attribute. Used by Ant.
+ /** Sets the `sourcepath` attribute. Used by [[http://ant.apache.org Ant]].
*
- * @param input The value of <code>sourcepath</code>.
+ * @param input The value of `sourcepath`.
*/
def setSourcepath(input: Path) =
if (sourcepath.isEmpty) sourcepath = Some(input)
else sourcepath.get.append(input)
- /** Sets the <code>sourcepath</code> as a nested sourcepath Ant parameter.
+ /** Sets the `sourcepath` as a nested sourcepath Ant parameter.
*
* @return A source path to be configured.
*/
def createSourcepath(): Path = {
- if (sourcepath.isEmpty) sourcepath = Some(new Path(getProject()))
+ if (sourcepath.isEmpty) sourcepath = Some(new Path(getProject))
sourcepath.get.createPath()
}
- /** Sets the <code>sourcepath</code> as an external reference Ant parameter.
+ /** Sets the `sourcepath` as an external reference Ant parameter.
*
* @param input A reference to a source path.
*/
def setSourcepathref(input: Reference) =
createSourcepath().setRefid(input)
- /** Sets the <code>bootclasspath</code> attribute. Used by Ant.
+ /** Sets the `bootclasspath` attribute. Used by [[http://ant.apache.org Ant]].
*
- * @param input The value of <code>bootclasspath</code>.
+ * @param input The value of `bootclasspath`.
*/
def setBootclasspath(input: Path) =
if (bootclasspath.isEmpty) bootclasspath = Some(input)
else bootclasspath.get.append(input)
- /** Sets the <code>bootclasspath</code> as a nested sourcepath Ant
- * parameter.
+ /** Sets the `bootclasspath` as a nested `sourcepath` Ant parameter.
*
* @return A source path to be configured.
*/
def createBootclasspath(): Path = {
- if (bootclasspath.isEmpty) bootclasspath = Some(new Path(getProject()))
+ if (bootclasspath.isEmpty) bootclasspath = Some(new Path(getProject))
bootclasspath.get.createPath()
}
- /** Sets the <code>bootclasspath</code> as an external reference Ant
- * parameter.
+ /** Sets the `bootclasspath` as an external reference Ant parameter.
*
* @param input A reference to a source path.
*/
@@ -241,25 +231,25 @@ class Scaladoc extends ScalaMatchingTask {
createBootclasspath().setRefid(input)
}
- /** Sets the external extensions path attribute. Used by Ant.
+ /** Sets the external extensions path attribute. Used by [[http://ant.apache.org Ant]].
*
- * @param input The value of <code>extdirs</code>.
+ * @param input The value of `extdirs`.
*/
def setExtdirs(input: Path) {
if (extdirs.isEmpty) extdirs = Some(input)
else extdirs.get.append(input)
}
- /** Sets the <code>extdirs</code> as a nested sourcepath Ant parameter.
+ /** Sets the `extdirs` as a nested sourcepath Ant parameter.
*
* @return An extensions path to be configured.
*/
def createExtdirs(): Path = {
- if (extdirs.isEmpty) extdirs = Some(new Path(getProject()))
+ if (extdirs.isEmpty) extdirs = Some(new Path(getProject))
extdirs.get.createPath()
}
- /** Sets the <code>extdirs</code> as an external reference Ant parameter.
+ /** Sets the `extdirs` as an external reference Ant parameter.
*
* @param input A reference to an extensions path.
*/
@@ -267,15 +257,15 @@ class Scaladoc extends ScalaMatchingTask {
createExtdirs().setRefid(input)
}
- /** Sets the <code>encoding</code> attribute. Used by Ant.
+ /** Sets the `encoding` attribute. Used by Ant.
*
- * @param input The value of <code>encoding</code>.
+ * @param input The value of `encoding`.
*/
def setEncoding(input: String) {
encoding = Some(input)
}
- /** Sets the <code>docgenerator</code> attribute.
+ /** Sets the `docgenerator` attribute.
*
* @param input A fully qualified class name of a doclet.
*/
@@ -283,49 +273,49 @@ class Scaladoc extends ScalaMatchingTask {
docgenerator = Some(input)
}
- /** Sets the <code>docversion</code> attribute.
+ /** Sets the `docversion` attribute.
*
- * @param input The value of <code>docversion</code>.
+ * @param input The value of `docversion`.
*/
def setDocversion(input: String) {
docversion = Some(input)
}
- /** Sets the <code>docsourceurl</code> attribute.
+ /** Sets the `docsourceurl` attribute.
*
- * @param input The value of <code>docsourceurl</code>.
+ * @param input The value of `docsourceurl`.
*/
def setDocsourceurl(input: String) {
docsourceurl = Some(input)
}
- /** Sets the <code>doctitle</code> attribute.
+ /** Sets the `doctitle` attribute.
*
- * @param input The value of <code>doctitle</code>.
+ * @param input The value of `doctitle`.
*/
def setDoctitle(input: String) {
doctitle = Some(input)
}
- /** Sets the <code>docfooter</code> attribute.
+ /** Sets the `docfooter` attribute.
*
- * @param input The value of <code>docfooter</code>.
+ * @param input The value of `docfooter`.
*/
def setDocfooter(input: String) {
docfooter = Some(input)
}
- /** Set the <code>addparams</code> info attribute.
+ /** Set the `addparams` info attribute.
*
- * @param input The value for <code>addparams</code>.
+ * @param input The value for `addparams`.
*/
def setAddparams(input: String) {
addParams = input
}
- /** Set the <code>deprecation</code> info attribute.
+ /** Set the `deprecation` info attribute.
*
- * @param input One of the flags <code>yes/no</code> or <code>on/off</code>.
+ * @param input One of the flags `yes/no` or `on/off`.
*/
def setDeprecation(input: String) {
if (Flag.isPermissible(input))
@@ -334,9 +324,9 @@ class Scaladoc extends ScalaMatchingTask {
buildError("Unknown deprecation flag '" + input + "'")
}
- /** Set the <code>unchecked</code> info attribute.
+ /** Set the `unchecked` info attribute.
*
- * @param input One of the flags <code>yes/no</code> or <code>on/off</code>.
+ * @param input One of the flags `yes/no` or `on/off`.
*/
def setUnchecked(input: String) {
if (Flag.isPermissible(input))
@@ -353,59 +343,59 @@ class Scaladoc extends ScalaMatchingTask {
** Properties getters **
\*============================================================================*/
- /** Gets the value of the <code>classpath</code> attribute in a
+ /** Gets the value of the `classpath` attribute in a
* Scala-friendly form.
*
* @return The class path as a list of files.
*/
private def getClasspath: List[File] =
if (classpath.isEmpty) buildError("Member 'classpath' is empty.")
- else classpath.get.list().toList.map(nameToFile)
+ else classpath.get.list().toList map nameToFile
- /** Gets the value of the <code>origin</code> attribute in a Scala-friendly
+ /** Gets the value of the `origin` attribute in a Scala-friendly
* form.
*
* @return The origin path as a list of files.
*/
private def getOrigin: List[File] =
if (origin.isEmpty) buildError("Member 'origin' is empty.")
- else origin.get.list().toList.map(nameToFile)
+ else origin.get.list().toList map nameToFile
- /** Gets the value of the <code>destination</code> attribute in a
+ /** Gets the value of the `destination` attribute in a
* Scala-friendly form.
*
* @return The destination as a file.
*/
private def getDestination: File =
if (destination.isEmpty) buildError("Member 'destination' is empty.")
- else existing(getProject().resolveFile(destination.get.toString))
+ else existing(getProject resolveFile destination.get.toString)
- /** Gets the value of the <code>sourcepath</code> attribute in a
+ /** Gets the value of the `sourcepath` attribute in a
* Scala-friendly form.
*
* @return The source path as a list of files.
*/
private def getSourcepath: List[File] =
if (sourcepath.isEmpty) buildError("Member 'sourcepath' is empty.")
- else sourcepath.get.list().toList.map(nameToFile)
+ else sourcepath.get.list().toList map nameToFile
- /** Gets the value of the <code>bootclasspath</code> attribute in a
+ /** Gets the value of the `bootclasspath` attribute in a
* Scala-friendly form.
*
* @return The boot class path as a list of files.
*/
private def getBootclasspath: List[File] =
if (bootclasspath.isEmpty) buildError("Member 'bootclasspath' is empty.")
- else bootclasspath.get.list().toList.map(nameToFile)
+ else bootclasspath.get.list().toList map nameToFile
- /** Gets the value of the <code>extdirs</code> attribute in a
+ /** Gets the value of the `extdirs` attribute in a
* Scala-friendly form.
*
* @return The extensions path as a list of files.
*/
private def getExtdirs: List[File] =
if (extdirs.isEmpty) buildError("Member 'extdirs' is empty.")
- else extdirs.get.list().toList.map(nameToFile)
+ else extdirs.get.list().toList map nameToFile
/*============================================================================*\
** Compilation and support methods **
@@ -435,7 +425,7 @@ class Scaladoc extends ScalaMatchingTask {
* @return A file created from the name.
*/
private def nameToFile(name: String): File =
- existing(getProject().resolveFile(name))
+ existing(getProject resolveFile name)
/** Tests if a file exists and prints a warning in case it doesn't. Always
* returns the file, even if it doesn't exist.
@@ -453,7 +443,7 @@ class Scaladoc extends ScalaMatchingTask {
/** Transforms a path into a Scalac-readable string.
*
* @param path A path to convert.
- * @return A string-representation of the path like <code>a.jar:b.jar</code>.
+ * @return A string-representation of the path like `a.jar:b.jar`.
*/
private def asString(path: List[File]): String =
path.map(asString).mkString("", File.pathSeparator, "")
@@ -461,7 +451,7 @@ class Scaladoc extends ScalaMatchingTask {
/** Transforms a file into a Scalac-readable string.
*
* @param path A file to convert.
- * @return A string-representation of the file like <code>/x/k/a.scala</code>.
+ * @return A string-representation of the file like `/x/k/a.scala`.
*/
private def asString(file: File): String =
file.getAbsolutePath()
@@ -480,8 +470,8 @@ class Scaladoc extends ScalaMatchingTask {
if (destination.isEmpty) destination = Some(getOrigin.head)
val mapper = new GlobPatternMapper()
- mapper.setTo("*.html")
- mapper.setFrom("*.scala")
+ mapper setTo "*.html"
+ mapper setFrom "*.scala"
// Scans source directories to build up a compile lists.
// If force is false, only files were the .class file in destination is
@@ -536,7 +526,7 @@ class Scaladoc extends ScalaMatchingTask {
if (!doctitle.isEmpty) docSettings.doctitle.value = decodeEscapes(doctitle.get)
if (!docfooter.isEmpty) docSettings.docfooter.value = decodeEscapes(docfooter.get)
if (!docversion.isEmpty) docSettings.docversion.value = decodeEscapes(docversion.get)
- if (!docsourceurl.isEmpty) docSettings.docsourceurl.value =decodeEscapes(docsourceurl.get)
+ if (!docsourceurl.isEmpty) docSettings.docsourceurl.value = decodeEscapes(docsourceurl.get)
if (!docUncompilable.isEmpty) docSettings.docUncompilable.value = decodeEscapes(docUncompilable.get)
docSettings.deprecation.value = deprecation
diff --git a/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala b/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala
index 1b66d504f9..5da531146b 100644
--- a/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala
+++ b/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala
@@ -6,38 +6,65 @@
** |/ **
\* */
-
package scala.tools.ant
package sabbus
-import java.io.File
-import java.io.FileWriter
+import java.io.{ File, FileWriter }
import org.apache.tools.ant.Project
import org.apache.tools.ant.taskdefs.Java
import org.apache.tools.ant.util.{ GlobPatternMapper, SourceFileScanner }
import scala.tools.nsc.io
import scala.tools.nsc.util.ScalaClassLoader
+/** An Ant task to compile with the new Scala compiler (NSC).
+ *
+ * This task can take the following parameters as attributes:
+ * - `srcdir` (mandatory),
+ * - `failonerror`,
+ * - `timeout`,
+ * - `jvmargs`,
+ * - `argfile`.
+ *
+ * It also takes the following parameters as nested elements:
+ * - `src` (for `srcdir`),
+ * - `classpath`,
+ * - `sourcepath`,
+ * - `bootclasspath`,
+ * - `extdirs`.
+ *
+ * @author Gilles Dubochet
+ */
class ScalacFork extends ScalaMatchingTask with ScalacShared with TaskArgs {
+
private def originOfThis: String =
ScalaClassLoader.originOfClass(classOf[ScalacFork]) map (_.toString) getOrElse "<unknown>"
+ /** Sets the `srcdir` attribute. Used by [[http://ant.apache.org Ant]].
+ * @param input The value of `sourceDir`. */
def setSrcdir(input: File) {
sourceDir = Some(input)
}
+ /** Sets the `failonerror` attribute. Used by [[http://ant.apache.org Ant]].
+ * @param input The value of `failOnError`. */
def setFailOnError(input: Boolean) {
failOnError = input
}
+ /** Sets the `timeout` attribute. Used by [[http://ant.apache.org Ant]].
+ * @param input The value of `timeout`. */
def setTimeout(input: Long) {
timeout = Some(input)
}
+ /** Sets the `jvmargs` attribute. Used by [[http://ant.apache.org Ant]].
+ * @param input The value of `jvmArgs`. */
def setJvmArgs(input: String) {
jvmArgs = Some(input)
}
+ /** Sets the `argfile` attribute. Used by [[http://ant.apache.org Ant]].
+ * @param input The value of `argfile`. */
def setArgfile(input: File) {
argfile = Some(input)
}
diff --git a/src/compiler/scala/tools/ant/sabbus/Settings.scala b/src/compiler/scala/tools/ant/sabbus/Settings.scala
index 543dcef1d4..3c02a86c55 100644
--- a/src/compiler/scala/tools/ant/sabbus/Settings.scala
+++ b/src/compiler/scala/tools/ant/sabbus/Settings.scala
@@ -6,7 +6,6 @@
** |/ **
\* */
-
package scala.tools.ant.sabbus
import java.io.File
@@ -57,7 +56,7 @@ class Settings {
private var optimiseBf: Boolean = false
def optimise = optimiseBf
- def optimise_=(b: Boolean): Unit = { optimiseBf = b }
+ def optimise_=(b: Boolean) { optimiseBf = b }
private var moreBf: Option[String] = None
def more = moreBf.get
diff --git a/src/compiler/scala/tools/nsc/CompileServer.scala b/src/compiler/scala/tools/nsc/CompileServer.scala
index c23a671ef8..b10ac78ac7 100644
--- a/src/compiler/scala/tools/nsc/CompileServer.scala
+++ b/src/compiler/scala/tools/nsc/CompileServer.scala
@@ -29,9 +29,7 @@ class StandardCompileServer extends SocketServer {
var shutdown = false
var verbose = false
- val versionMsg = "Fast Scala compiler " +
- Properties.versionString + " -- " +
- Properties.copyrightString
+ val versionMsg = "Fast " + Properties.versionMsg
val MaxCharge = 0.8
@@ -175,8 +173,9 @@ object CompileServer extends StandardCompileServer {
/** A directory holding redirected output */
private lazy val redirectDir = (compileSocket.tmpDir / "output-redirects").createDirectory()
- private def redirect(setter: PrintStream => Unit, filename: String): Unit =
+ private def redirect(setter: PrintStream => Unit, filename: String) {
setter(new PrintStream((redirectDir / filename).createFile().bufferedOutput()))
+ }
def main(args: Array[String]) {
val debug = args contains "-v"
@@ -190,10 +189,10 @@ object CompileServer extends StandardCompileServer {
redirect(System.setErr, "scala-compile-server-err.log")
System.err.println("...starting server on socket "+port+"...")
System.err.flush()
- compileSocket.setPort(port)
+ compileSocket setPort port
run()
- compileSocket.deletePort(port)
- sys.exit(0)
+ compileSocket deletePort port
+ sys exit 0
}
}
diff --git a/src/compiler/scala/tools/nsc/Properties.scala b/src/compiler/scala/tools/nsc/Properties.scala
index f88b7e82fc..c83ccfeef1 100644
--- a/src/compiler/scala/tools/nsc/Properties.scala
+++ b/src/compiler/scala/tools/nsc/Properties.scala
@@ -3,23 +3,23 @@
* @author Stephane Micheloud
*/
-
package scala.tools.nsc
-/** Loads compiler.properties from the jar. */
+/** Loads `compiler.properties` from the jar archive file.
+ */
object Properties extends scala.util.PropertiesTrait {
- protected def propCategory = "compiler"
- protected def pickJarBasedOn = classOf[Global]
+ protected def propCategory = "compiler"
+ protected def pickJarBasedOn = classOf[Global]
// settings based on jar properties
- def fileEndingString = scalaPropOrElse("file.ending", ".scala|.java")
- def residentPromptString = scalaPropOrElse("resident.prompt", "\nnsc> ")
- def shellPromptString = scalaPropOrElse("shell.prompt", "\nscala> ")
+ def fileEndingString = scalaPropOrElse("file.ending", ".scala|.java")
+ def residentPromptString = scalaPropOrElse("resident.prompt", "\nnsc> ")
+ def shellPromptString = scalaPropOrElse("shell.prompt", "\nscala> ")
// settings based on system properties
- def msilLibPath = propOrNone("msil.libpath")
+ def msilLibPath = propOrNone("msil.libpath")
// derived values
- def isEmacsShell = propOrEmpty("env.emacs") != ""
- def fileEndings = fileEndingString.split("""\|""").toList
+ def isEmacsShell = propOrEmpty("env.emacs") != ""
+ def fileEndings = fileEndingString.split("""\|""").toList
}
diff --git a/src/compiler/scala/tools/nsc/plugins/Plugin.scala b/src/compiler/scala/tools/nsc/plugins/Plugin.scala
index bfc1c2dbc2..99b4a3d6f3 100644
--- a/src/compiler/scala/tools/nsc/plugins/Plugin.scala
+++ b/src/compiler/scala/tools/nsc/plugins/Plugin.scala
@@ -13,17 +13,20 @@ import java.util.zip.ZipException
import scala.collection.mutable
import mutable.ListBuffer
+/*@XML*/
import scala.xml.XML
+/*XML@*/
+/*@NOXML
+import scala.tools.util.XML
+XMLNO@*/
-/** <p>
- * Information about a plugin loaded from a jar file.
- * </p>
- * <p>
- * The concrete subclass must have a one-argument constructor
- * that accepts an instance of <code>Global</code>.
- * </p><pre>
+/** Information about a plugin loaded from a jar file.
+ *
+ * The concrete subclass must have a one-argument constructor
+ * that accepts an instance of `global`.
+ * {{{
* (val global: Global)
- * </pre>
+ * }}}
*
* @author Lex Spoon
* @version 1.0, 2007-5-21
@@ -42,7 +45,7 @@ abstract class Plugin {
* to a constructor parameter in the concrete subclass. */
val global: Global
- /** Handle any plugin-specific options. The -P:plugname: part
+ /** Handle any plugin-specific options. The `-P:plugname:` part
* will not be present. */
def processOptions(options: List[String], error: String => Unit) {
if (!options.isEmpty)
@@ -50,9 +53,8 @@ abstract class Plugin {
}
/** A description of this plugin's options, suitable as a response
- * to the -help command-line option. Conventionally, the
- * options should be listed with the <code>-P:plugname:</code>
- * part included.
+ * to the -help command-line option. Conventionally, the options
+ * should be listed with the `-P:plugname:` part included.
*/
val optionsHelp: Option[String] = None
}
@@ -105,9 +107,9 @@ object Plugin {
type AnyClass = Class[_]
/** Loads a plugin class from the named jar file.
-
- * @return <code>None</code> if the jar file has no plugin in it or
- * if the plugin is badly formed.
+ *
+ * @return `None` if the jar file has no plugin in it or
+ * if the plugin is badly formed.
*/
def loadFrom(jarfile: Path, loader: ClassLoader): Option[AnyClass] =
loadDescription(jarfile) match {
@@ -124,7 +126,7 @@ object Plugin {
/** Load all plugins found in the argument list, both in the
* jar files explicitly listed, and in the jar files in the
- * directories specified. Skips all plugins in <code>ignoring</code>.
+ * directories specified. Skips all plugins in `ignoring`.
* A single classloader is created and used to load all of them.
*/
def loadAllFrom(