Permalink
Browse files

Reverting 22c8dec and preventing bootstapping in scaladoc

Review by @dragos, @jsuereth. Required bootstrapping because the starr was
ant tasks were invoking locker with -Ysourcepath instead of -sourcepath.
  • Loading branch information...
VladUreche authored and xeno-by committed Jun 7, 2012
1 parent 0c153ee commit 94db9d983cdd28c053e568b6185fe2494bd7ffec
View
@@ -1938,7 +1938,7 @@ DOCUMENTATION
docfooter="epfl"
docsourceurl="${scaladoc.url}€{FILE_PATH}.scala#L1"
docUncompilable="${src.dir}/library-aux"
docSourcePath="${src.dir}"
sourcepath="${src.dir}"
classpathref="pack.classpath"
addparams="${scalac.args.all}"
docRootContent="${src.dir}/library/rootdoc.txt"
@@ -2020,7 +2020,7 @@ DOCUMENTATION
doctitle="Scala Compiler"
docversion="${version.number}"
docsourceurl="${scaladoc.url}€{FILE_PATH}.scala#L1"
docSourcePath="${src.dir}"
sourcepath="${src.dir}"
classpathref="pack.classpath"
srcdir="${src.dir}/compiler"
docRootContent="${src.dir}/compiler/rootdoc.txt"
@@ -2043,7 +2043,7 @@ DOCUMENTATION
destdir="${build-docs.dir}/jline"
doctitle="Scala JLine"
docversion="${version.number}"
docSourcePath="${src.dir}"
sourcepath="${src.dir}"
classpathref="pack.classpath"
srcdir="${src.dir}/jline/src/main/java"
addparams="${scalac.args.all}"
@@ -2067,7 +2067,7 @@ DOCUMENTATION
doctitle="Scalap"
docversion="${version.number}"
docsourceurl="${scaladoc.url}€{FILE_PATH}.scala#L1"
docSourcePath="${src.dir}"
sourcepath="${src.dir}"
classpathref="pack.classpath"
srcdir="${src.dir}/scalap"
addparams="${scalac.args.all}"
@@ -2089,7 +2089,7 @@ DOCUMENTATION
destdir="${build-docs.dir}/scala-partest"
doctitle="Scala Parallel Testing Framework"
docversion="${version.number}"
docSourcePath="${src.dir}"
sourcepath="${src.dir}"
classpathref="pack.classpath"
srcdir="${src.dir}/partest"
addparams="${scalac.args.all}"
@@ -2111,7 +2111,7 @@ DOCUMENTATION
destdir="${build-docs.dir}/continuations-plugin"
doctitle="Delimited Continuations Compiler Plugin"
docversion="${version.number}"
docSourcePath="${src.dir}"
sourcepath="${src.dir}"
classpathref="pack.classpath"
srcdir="${src.dir}/continuations/plugin"
addparams="${scalac.args.all}"
@@ -2133,7 +2133,7 @@ DOCUMENTATION
destdir="${build-docs.dir}/actors-migration"
doctitle="Actors Migration Kit"
docversion="${version.number}"
docSourcePath="${src.dir}"
sourcepath="${src.dir}"
classpathref="pack.classpath"
srcdir="${src.dir}/actors-migration"
addparams="${scalac.args.all}"
@@ -1 +1 @@
78aea1d6d86525ce869139f66bfb98505dab6c76 ?scala-compiler.jar
043cf67f1a3769fb40d058693572058c5a7bf831 ?scala-compiler.jar
@@ -1 +1 @@
935553e8d1dfb5d71652c195ce25314c3af2442c ?scala-library.jar
410e7a0afc217532efe48c1c71684e08428bc211 ?scala-library.jar
@@ -1 +1 @@
d3a859a035f849d334732b12518715e7c9f4a475 ?scala-reflect.jar
c4d6c4bd4c1a2d7b34a940ab935673a73dfb8630 ?scala-reflect.jar
View
@@ -359,7 +359,7 @@ object ScalaBuild extends Build with Layers {
},
compile := inc.Analysis.Empty,
// scaladocOptions in Compile <++= (baseDirectory) map (bd =>
// Seq("-doc-source-path", (bd / "src" / "library").getAbsolutePath,
// Seq("-sourcepath", (bd / "src" / "library").getAbsolutePath,
// "-doc-no-compile", (bd / "src" / "library-aux").getAbsolutePath,
// "-doc-source-url", """https://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/€{FILE_PATH}.scala#L1""",
// "-doc-root-content", (bd / "compiler/scala/tools/nsc/doc/html/resource/lib/rootdoc.txt").getAbsolutePath
View
@@ -71,7 +71,7 @@ trait Layers extends Build {
resourceDirectory in Compile <<= baseDirectory apply (_ / "src" / "library"),
defaultExcludes in unmanagedResources := ("*.scala" | "*.java" | "*.disabled"),
// TODO - Allow other scalac option settings.
scalacOptions in Compile <++= (scalaSource in Compile) map (src => Seq("-Ysourcepath", src.getAbsolutePath)),
scalacOptions in Compile <++= (scalaSource in Compile) map (src => Seq("-sourcepath", src.getAbsolutePath)),
resourceGenerators in Compile <+= (resourceManaged, Versions.scalaVersions, skip in Compile, streams) map Versions.generateVersionPropertiesFile("library.properties"),
referenceScala
)
@@ -100,7 +100,7 @@ class FastScalac extends Scalac {
List(
/*scalac*/
s.bootclasspath, s.classpath, s.extdirs, s.dependencyfile, s.encoding,
s.outdir, s.Ysourcepath,
s.outdir, s.sourcepath,
/*fsc*/
s.server
) filter (_.value != "") flatMap (x => List(x.name, x.value))
@@ -10,20 +10,13 @@ package scala.tools.ant
import java.io.{ File, InputStream, FileWriter }
import org.apache.tools.ant.{ Task, BuildException, Project }
import org.apache.tools.ant.{ Task, BuildException }
import org.apache.tools.ant.taskdefs.MatchingTask
import org.apache.tools.ant.types.{ Path, Reference }
trait ScalaTask {
self: Task =>
/** Logs a warning message from the ant task (such as deprecated warnings) */
protected def buildWarning(message: String): Unit = {
log("warning:", Project.MSG_WARN)
log(" " + message, Project.MSG_WARN)
log("", Project.MSG_WARN)
}
/** Generates a build error. Error location will be the
* current task in the ant file.
*
@@ -30,8 +30,8 @@ import scala.tools.nsc.reporters.{Reporter, ConsoleReporter}
* - `destdir`,
* - `classpath`,
* - `classpathref`,
* - `Ysourcepath`,
* - `Ysourcepathref`,
* - `sourcepath`,
* - `sourcepathref`,
* - `bootclasspath`,
* - `bootclasspathref`,
* - `extdirs`,
@@ -61,7 +61,7 @@ import scala.tools.nsc.reporters.{Reporter, ConsoleReporter}
* It also takes the following parameters as nested elements:
* - `src` (for `srcdir`),
* - `classpath`,
* - `Ysourcepath`,
* - `sourcepath`,
* - `bootclasspath`,
* - `extdirs`,
* - `compilerarg`.
@@ -119,7 +119,7 @@ class Scalac extends ScalaMatchingTask with ScalacShared {
/** The class path to use for this compilation. */
protected var classpath: Option[Path] = None
/** The source path to use for this compilation. */
protected var Ysourcepath: Option[Path] = None
protected var sourcepath: Option[Path] = None
/** The boot class path to use for this compilation. */
protected var bootclasspath: Option[Path] = None
/** The path to use when finding scalac - *only used for forking!* */
@@ -253,32 +253,19 @@ class Scalac extends ScalaMatchingTask with ScalacShared {
createClasspath().setRefid(input)
}
// bridge to setYsourcepath
@deprecated("The scalac sourcepath attribute is deprecated. Please use ySourcePath instead!")
def setSourcepath(input: Path) = {
buildWarning("The scalac sourcepath attribute is deprecated. Please use ySourcePath instead!")
setYSourcepath(input)
}
@deprecated("The scalac sourcepath attribute is deprecated. Please use ySourcePath instead!")
def setSourcepathref(input: Reference) = {
buildWarning("The scalac sourcepath attribute is deprecated. Please use ySourcePath instead!")
setYSourcepathref(input)
}
/** Sets the `Ysourcepath` attribute. Used by [[http://ant.apache.org Ant]].
/** Sets the `sourcepath` attribute. Used by [[http://ant.apache.org Ant]].
* @param input The value of `sourcepath`. */
def setYSourcepath(input: Path) {
Ysourcepath = setOrAppend(Ysourcepath, input)
def setSourcepath(input: Path) {
sourcepath = setOrAppend(sourcepath, input)
}
/** Sets the `sourcepath` as a nested sourcepath Ant parameter.
* @return A source path to be configured. */
def createSourcepath(): Path = createNewPath(Ysourcepath _, p => Ysourcepath = p)
def createSourcepath(): Path = createNewPath(sourcepath _, p => sourcepath = p)
/** Sets the `docSourcePath` as an external reference Ant parameter.
/** Sets the `sourcepath` as an external reference Ant parameter.
* @param input A reference to a source path. */
def setYSourcepathref(input: Reference) {
def setSourcepathref(input: Reference) {
createSourcepath().setRefid(input)
}
@@ -465,10 +452,10 @@ class Scalac extends ScalaMatchingTask with ScalacShared {
if (destination.isEmpty) buildError("Member 'destination' is empty.")
else existing(getProject resolveFile destination.get.toString)
/** Gets the value of the `ySourcepath` attribute in a
/** Gets the value of the `sourcepath` attribute in a
* Scala-friendly form.
* @return The source path as a list of files. */
protected def getSourcepath: List[File] = pathAsList(Ysourcepath, "sourcepath")
protected def getSourcepath: List[File] = pathAsList(sourcepath, "sourcepath")
/** Gets the value of the `bootclasspath` attribute in a
* Scala-friendly form.
@@ -598,10 +585,10 @@ class Scalac extends ScalaMatchingTask with ScalacShared {
settings.outdir.value = asString(destination.get)
if (!classpath.isEmpty)
settings.classpath.value = asString(getClasspath)
if (!Ysourcepath.isEmpty)
settings.Ysourcepath.value = asString(getSourcepath)
if (!sourcepath.isEmpty)
settings.sourcepath.value = asString(getSourcepath)
else if (origin.get.size() > 0)
settings.Ysourcepath.value = origin.get.list()(0)
settings.sourcepath.value = origin.get.list()(0)
if (!bootclasspath.isEmpty)
settings.bootclasspath.value = asString(getBootclasspath)
if (!extdirs.isEmpty) settings.extdirs.value = asString(getExtdirs)
@@ -27,8 +27,8 @@ import scala.tools.nsc.reporters.{Reporter, ConsoleReporter}
* - `destdir`,
* - `classpath`,
* - `classpathref`,
* - `docSourcePath`,
* - `docSourcePathref`,
* - `sourcepath`,
* - `sourcepathref`,
* - `bootclasspath`,
* - `bootclasspathref`,
* - `extdirs`,
@@ -44,12 +44,12 @@ import scala.tools.nsc.reporters.{Reporter, ConsoleReporter}
* - `docgenerator`,
* - `docrootcontent`,
* - `unchecked`,
* - `nofail` and others :)
* - `nofail`.
*
* It also takes the following parameters as nested elements:
* - `src` (for srcdir),
* - `classpath`,
* - `docSourcePath`,
* - `sourcepath`,
* - `bootclasspath`,
* - `extdirs`.
*
@@ -90,7 +90,7 @@ class Scaladoc extends ScalaMatchingTask {
/** The class path to use for this compilation. */
private var classpath: Option[Path] = None
/** The source path to use for this compilation. */
private var docSourcePath: Option[Path] = None
private var sourcepath: Option[Path] = None
/** The boot class path to use for this compilation. */
private var bootclasspath: Option[Path] = None
/** The external extensions path to use for this compilation. */
@@ -214,33 +214,29 @@ class Scaladoc extends ScalaMatchingTask {
def setClasspathref(input: Reference) =
createClasspath().setRefid(input)
// Bridge the gap between sourcepath and docSourcePath
@deprecated("The scaladoc sourcepath attribute is deprecated. Please use docSourcePath instead.")
def setSourcepath(input: Path) = {
buildWarning("The scaladoc sourcepath attribute is deprecated. Please use docSourcePath instead.")
setDocSourcePath(input)
}
@deprecated("The scaladoc sourcepath attribute is deprecated. Please use docSourcePath instead.")
def setSourcepathref(input: Reference) = {
buildWarning("The scaladoc sourcepath attribute is deprecated. Please use docSourcePath instead.")
setDocSourcePathRef(input)
}
/** Sets the `docSourcePath` attribute. */
def setDocSourcePath(input: Path) =
if (docSourcePath.isEmpty) docSourcePath = Some(input)
else docSourcePath.get.append(input)
/** Sets the `sourcepath` attribute. Used by [[http://ant.apache.org Ant]].
*
* @param input The value of `sourcepath`.
*/
def setSourcepath(input: Path) =
if (sourcepath.isEmpty) sourcepath = Some(input)
else sourcepath.get.append(input)
/** Sets the `docSourcePath` as a nested docSourcePath Ant parameter. */
def createSourcePath(): Path = {
if (docSourcePath.isEmpty) docSourcePath = Some(new Path(getProject))
docSourcePath.get.createPath()
/** 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))
sourcepath.get.createPath()
}
/** Sets the `docSourcePath` as an external reference Ant parameter. */
def setDocSourcePathRef(input: Reference) =
createSourcePath().setRefid(input)
/** 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 `bootclasspath` attribute. Used by [[http://ant.apache.org Ant]].
*
@@ -250,7 +246,7 @@ class Scaladoc extends ScalaMatchingTask {
if (bootclasspath.isEmpty) bootclasspath = Some(input)
else bootclasspath.get.append(input)
/** Sets the `bootclasspath` as a nested `docSourcePath` Ant parameter.
/** Sets the `bootclasspath` as a nested `sourcepath` Ant parameter.
*
* @return A source path to be configured.
*/
@@ -276,7 +272,7 @@ class Scaladoc extends ScalaMatchingTask {
else extdirs.get.append(input)
}
/** Sets the `extdirs` as a nested docSourcePath Ant parameter.
/** Sets the `extdirs` as a nested sourcepath Ant parameter.
*
* @return An extensions path to be configured.
*/
@@ -460,8 +456,8 @@ class Scaladoc extends ScalaMatchingTask {
* @return The source path as a list of files.
*/
private def getSourcepath: List[File] =
if (docSourcePath.isEmpty) buildError("Member 'sourcepath' is empty.")
else docSourcePath.get.list().toList map nameToFile
if (sourcepath.isEmpty) buildError("Member 'sourcepath' is empty.")
else sourcepath.get.list().toList map nameToFile
/** Gets the value of the `bootclasspath` attribute in a
* Scala-friendly form.
@@ -599,11 +595,12 @@ class Scaladoc extends ScalaMatchingTask {
docSettings.outdir.value = asString(destination.get)
if (!classpath.isEmpty)
docSettings.classpath.value = asString(getClasspath)
if (!docSourcePath.isEmpty)
docSettings.docSourcePath.value = asString(getSourcepath)
if (!sourcepath.isEmpty)
docSettings.sourcepath.value = asString(getSourcepath)
/*else if (origin.get.size() > 0)
settings.sourcepath.value = origin.get.list()(0)*/
if (!bootclasspath.isEmpty)
docSettings.bootclasspath.value = asString(getBootclasspath)
if (!extdirs.isEmpty) docSettings.extdirs.value = asString(getExtdirs)
if (!encoding.isEmpty) docSettings.encoding.value = encoding.get
if (!doctitle.isEmpty) docSettings.doctitle.value = decodeEscapes(doctitle.get)
@@ -20,7 +20,7 @@ class Make extends Task with TaskArgs {
if (!destinationDir.isEmpty) settings.d = destinationDir.get
if (!compTarget.isEmpty) settings.target = compTarget.get
if (!compilationPath.isEmpty) settings.classpath = compilationPath.get
if (!sourcePath.isEmpty) settings.Ysourcepath = sourcePath.get
if (!sourcePath.isEmpty) settings.sourcepath = sourcePath.get
settings.extraParams = extraArgsFlat
Compilers.make(id.get, (compilerPath.get.list.map{ path => new File(path).toURI.toURL }), settings)
}
@@ -101,7 +101,7 @@ class ScalacFork extends ScalaMatchingTask with ScalacShared with TaskArgs {
compTarget foreach (settings.target = _)
compilationPath foreach (settings.classpath = _)
sourcePath foreach (settings.Ysourcepath = _)
sourcePath foreach (settings.sourcepath = _)
settings.extraParams = extraArgsFlat
if (isMSIL)
@@ -27,8 +27,8 @@ class Settings {
def classpath_=(p: Path): this.type = { classpathBf = Some(p); this }
private var sourcepathBf: Option[Path] = None
def Ysourcepath = sourcepathBf.get
def Ysourcepath_=(p: Path): this.type = { sourcepathBf = Some(p); this }
def sourcepath = sourcepathBf.get
def sourcepath_=(p: Path): this.type = { sourcepathBf = Some(p); this }
private var sourcedirBf: Option[File] = None
def sourcedir = sourcedirBf.get
@@ -66,7 +66,7 @@ class Settings {
(if (!gBf.isEmpty) "-g:"+g :: Nil else Nil) :::
(if (uncheckedBf) "-unchecked" :: Nil else Nil) :::
(if (!classpathBf.isEmpty) "-classpath" :: classpath.toString :: Nil else Nil) :::
(if (!sourcepathBf.isEmpty) "-Ysourcepath" :: Ysourcepath.toString :: Nil else Nil) :::
(if (!sourcepathBf.isEmpty) "-sourcepath" :: sourcepath.toString :: Nil else Nil) :::
(if (!sourcedirBf.isEmpty) "-Xsourcedir" :: sourcedir.toString :: Nil else Nil) :::
(if (!bootclasspathBf.isEmpty) "-bootclasspath" :: bootclasspath.toString :: Nil else Nil) :::
(if (!extdirsBf.isEmpty) "-extdirs" :: extdirs.toString :: Nil else Nil) :::
Oops, something went wrong.

0 comments on commit 94db9d9

Please sign in to comment.