Skip to content

Commit 94db9d9

Browse files
VladUrechexeno-by
authored andcommitted
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.
1 parent 0c153ee commit 94db9d9

22 files changed

+94
-142
lines changed

build.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,7 +1938,7 @@ DOCUMENTATION
19381938
docfooter="epfl"
19391939
docsourceurl="${scaladoc.url}€{FILE_PATH}.scala#L1"
19401940
docUncompilable="${src.dir}/library-aux"
1941-
docSourcePath="${src.dir}"
1941+
sourcepath="${src.dir}"
19421942
classpathref="pack.classpath"
19431943
addparams="${scalac.args.all}"
19441944
docRootContent="${src.dir}/library/rootdoc.txt"
@@ -2020,7 +2020,7 @@ DOCUMENTATION
20202020
doctitle="Scala Compiler"
20212021
docversion="${version.number}"
20222022
docsourceurl="${scaladoc.url}€{FILE_PATH}.scala#L1"
2023-
docSourcePath="${src.dir}"
2023+
sourcepath="${src.dir}"
20242024
classpathref="pack.classpath"
20252025
srcdir="${src.dir}/compiler"
20262026
docRootContent="${src.dir}/compiler/rootdoc.txt"
@@ -2043,7 +2043,7 @@ DOCUMENTATION
20432043
destdir="${build-docs.dir}/jline"
20442044
doctitle="Scala JLine"
20452045
docversion="${version.number}"
2046-
docSourcePath="${src.dir}"
2046+
sourcepath="${src.dir}"
20472047
classpathref="pack.classpath"
20482048
srcdir="${src.dir}/jline/src/main/java"
20492049
addparams="${scalac.args.all}"
@@ -2067,7 +2067,7 @@ DOCUMENTATION
20672067
doctitle="Scalap"
20682068
docversion="${version.number}"
20692069
docsourceurl="${scaladoc.url}€{FILE_PATH}.scala#L1"
2070-
docSourcePath="${src.dir}"
2070+
sourcepath="${src.dir}"
20712071
classpathref="pack.classpath"
20722072
srcdir="${src.dir}/scalap"
20732073
addparams="${scalac.args.all}"
@@ -2089,7 +2089,7 @@ DOCUMENTATION
20892089
destdir="${build-docs.dir}/scala-partest"
20902090
doctitle="Scala Parallel Testing Framework"
20912091
docversion="${version.number}"
2092-
docSourcePath="${src.dir}"
2092+
sourcepath="${src.dir}"
20932093
classpathref="pack.classpath"
20942094
srcdir="${src.dir}/partest"
20952095
addparams="${scalac.args.all}"
@@ -2111,7 +2111,7 @@ DOCUMENTATION
21112111
destdir="${build-docs.dir}/continuations-plugin"
21122112
doctitle="Delimited Continuations Compiler Plugin"
21132113
docversion="${version.number}"
2114-
docSourcePath="${src.dir}"
2114+
sourcepath="${src.dir}"
21152115
classpathref="pack.classpath"
21162116
srcdir="${src.dir}/continuations/plugin"
21172117
addparams="${scalac.args.all}"
@@ -2133,7 +2133,7 @@ DOCUMENTATION
21332133
destdir="${build-docs.dir}/actors-migration"
21342134
doctitle="Actors Migration Kit"
21352135
docversion="${version.number}"
2136-
docSourcePath="${src.dir}"
2136+
sourcepath="${src.dir}"
21372137
classpathref="pack.classpath"
21382138
srcdir="${src.dir}/actors-migration"
21392139
addparams="${scalac.args.all}"

lib/scala-compiler.jar.desired.sha1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
78aea1d6d86525ce869139f66bfb98505dab6c76 ?scala-compiler.jar
1+
043cf67f1a3769fb40d058693572058c5a7bf831 ?scala-compiler.jar

lib/scala-library.jar.desired.sha1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
935553e8d1dfb5d71652c195ce25314c3af2442c ?scala-library.jar
1+
410e7a0afc217532efe48c1c71684e08428bc211 ?scala-library.jar

lib/scala-reflect.jar.desired.sha1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d3a859a035f849d334732b12518715e7c9f4a475 ?scala-reflect.jar
1+
c4d6c4bd4c1a2d7b34a940ab935673a73dfb8630 ?scala-reflect.jar

project/Build.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ object ScalaBuild extends Build with Layers {
359359
},
360360
compile := inc.Analysis.Empty,
361361
// scaladocOptions in Compile <++= (baseDirectory) map (bd =>
362-
// Seq("-doc-source-path", (bd / "src" / "library").getAbsolutePath,
362+
// Seq("-sourcepath", (bd / "src" / "library").getAbsolutePath,
363363
// "-doc-no-compile", (bd / "src" / "library-aux").getAbsolutePath,
364364
// "-doc-source-url", """https://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/€{FILE_PATH}.scala#L1""",
365365
// "-doc-root-content", (bd / "compiler/scala/tools/nsc/doc/html/resource/lib/rootdoc.txt").getAbsolutePath

project/Layers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ trait Layers extends Build {
7171
resourceDirectory in Compile <<= baseDirectory apply (_ / "src" / "library"),
7272
defaultExcludes in unmanagedResources := ("*.scala" | "*.java" | "*.disabled"),
7373
// TODO - Allow other scalac option settings.
74-
scalacOptions in Compile <++= (scalaSource in Compile) map (src => Seq("-Ysourcepath", src.getAbsolutePath)),
74+
scalacOptions in Compile <++= (scalaSource in Compile) map (src => Seq("-sourcepath", src.getAbsolutePath)),
7575
resourceGenerators in Compile <+= (resourceManaged, Versions.scalaVersions, skip in Compile, streams) map Versions.generateVersionPropertiesFile("library.properties"),
7676
referenceScala
7777
)

src/compiler/scala/tools/ant/FastScalac.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class FastScalac extends Scalac {
100100
List(
101101
/*scalac*/
102102
s.bootclasspath, s.classpath, s.extdirs, s.dependencyfile, s.encoding,
103-
s.outdir, s.Ysourcepath,
103+
s.outdir, s.sourcepath,
104104
/*fsc*/
105105
s.server
106106
) filter (_.value != "") flatMap (x => List(x.name, x.value))

src/compiler/scala/tools/ant/ScalaMatchingTask.scala

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,13 @@ package scala.tools.ant
1010

1111
import java.io.{ File, InputStream, FileWriter }
1212

13-
import org.apache.tools.ant.{ Task, BuildException, Project }
13+
import org.apache.tools.ant.{ Task, BuildException }
1414
import org.apache.tools.ant.taskdefs.MatchingTask
1515
import org.apache.tools.ant.types.{ Path, Reference }
1616

1717
trait ScalaTask {
1818
self: Task =>
1919

20-
/** Logs a warning message from the ant task (such as deprecated warnings) */
21-
protected def buildWarning(message: String): Unit = {
22-
log("warning:", Project.MSG_WARN)
23-
log(" " + message, Project.MSG_WARN)
24-
log("", Project.MSG_WARN)
25-
}
26-
2720
/** Generates a build error. Error location will be the
2821
* current task in the ant file.
2922
*

src/compiler/scala/tools/ant/Scalac.scala

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ import scala.tools.nsc.reporters.{Reporter, ConsoleReporter}
3030
* - `destdir`,
3131
* - `classpath`,
3232
* - `classpathref`,
33-
* - `Ysourcepath`,
34-
* - `Ysourcepathref`,
33+
* - `sourcepath`,
34+
* - `sourcepathref`,
3535
* - `bootclasspath`,
3636
* - `bootclasspathref`,
3737
* - `extdirs`,
@@ -61,7 +61,7 @@ import scala.tools.nsc.reporters.{Reporter, ConsoleReporter}
6161
* It also takes the following parameters as nested elements:
6262
* - `src` (for `srcdir`),
6363
* - `classpath`,
64-
* - `Ysourcepath`,
64+
* - `sourcepath`,
6565
* - `bootclasspath`,
6666
* - `extdirs`,
6767
* - `compilerarg`.
@@ -119,7 +119,7 @@ class Scalac extends ScalaMatchingTask with ScalacShared {
119119
/** The class path to use for this compilation. */
120120
protected var classpath: Option[Path] = None
121121
/** The source path to use for this compilation. */
122-
protected var Ysourcepath: Option[Path] = None
122+
protected var sourcepath: Option[Path] = None
123123
/** The boot class path to use for this compilation. */
124124
protected var bootclasspath: Option[Path] = None
125125
/** The path to use when finding scalac - *only used for forking!* */
@@ -253,32 +253,19 @@ class Scalac extends ScalaMatchingTask with ScalacShared {
253253
createClasspath().setRefid(input)
254254
}
255255

256-
// bridge to setYsourcepath
257-
@deprecated("The scalac sourcepath attribute is deprecated. Please use ySourcePath instead!")
258-
def setSourcepath(input: Path) = {
259-
buildWarning("The scalac sourcepath attribute is deprecated. Please use ySourcePath instead!")
260-
setYSourcepath(input)
261-
}
262-
263-
@deprecated("The scalac sourcepath attribute is deprecated. Please use ySourcePath instead!")
264-
def setSourcepathref(input: Reference) = {
265-
buildWarning("The scalac sourcepath attribute is deprecated. Please use ySourcePath instead!")
266-
setYSourcepathref(input)
267-
}
268-
269-
/** Sets the `Ysourcepath` attribute. Used by [[http://ant.apache.org Ant]].
256+
/** Sets the `sourcepath` attribute. Used by [[http://ant.apache.org Ant]].
270257
* @param input The value of `sourcepath`. */
271-
def setYSourcepath(input: Path) {
272-
Ysourcepath = setOrAppend(Ysourcepath, input)
258+
def setSourcepath(input: Path) {
259+
sourcepath = setOrAppend(sourcepath, input)
273260
}
274261

275262
/** Sets the `sourcepath` as a nested sourcepath Ant parameter.
276263
* @return A source path to be configured. */
277-
def createSourcepath(): Path = createNewPath(Ysourcepath _, p => Ysourcepath = p)
264+
def createSourcepath(): Path = createNewPath(sourcepath _, p => sourcepath = p)
278265

279-
/** Sets the `docSourcePath` as an external reference Ant parameter.
266+
/** Sets the `sourcepath` as an external reference Ant parameter.
280267
* @param input A reference to a source path. */
281-
def setYSourcepathref(input: Reference) {
268+
def setSourcepathref(input: Reference) {
282269
createSourcepath().setRefid(input)
283270
}
284271

@@ -465,10 +452,10 @@ class Scalac extends ScalaMatchingTask with ScalacShared {
465452
if (destination.isEmpty) buildError("Member 'destination' is empty.")
466453
else existing(getProject resolveFile destination.get.toString)
467454

468-
/** Gets the value of the `ySourcepath` attribute in a
455+
/** Gets the value of the `sourcepath` attribute in a
469456
* Scala-friendly form.
470457
* @return The source path as a list of files. */
471-
protected def getSourcepath: List[File] = pathAsList(Ysourcepath, "sourcepath")
458+
protected def getSourcepath: List[File] = pathAsList(sourcepath, "sourcepath")
472459

473460
/** Gets the value of the `bootclasspath` attribute in a
474461
* Scala-friendly form.
@@ -598,10 +585,10 @@ class Scalac extends ScalaMatchingTask with ScalacShared {
598585
settings.outdir.value = asString(destination.get)
599586
if (!classpath.isEmpty)
600587
settings.classpath.value = asString(getClasspath)
601-
if (!Ysourcepath.isEmpty)
602-
settings.Ysourcepath.value = asString(getSourcepath)
588+
if (!sourcepath.isEmpty)
589+
settings.sourcepath.value = asString(getSourcepath)
603590
else if (origin.get.size() > 0)
604-
settings.Ysourcepath.value = origin.get.list()(0)
591+
settings.sourcepath.value = origin.get.list()(0)
605592
if (!bootclasspath.isEmpty)
606593
settings.bootclasspath.value = asString(getBootclasspath)
607594
if (!extdirs.isEmpty) settings.extdirs.value = asString(getExtdirs)

src/compiler/scala/tools/ant/Scaladoc.scala

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import scala.tools.nsc.reporters.{Reporter, ConsoleReporter}
2727
* - `destdir`,
2828
* - `classpath`,
2929
* - `classpathref`,
30-
* - `docSourcePath`,
31-
* - `docSourcePathref`,
30+
* - `sourcepath`,
31+
* - `sourcepathref`,
3232
* - `bootclasspath`,
3333
* - `bootclasspathref`,
3434
* - `extdirs`,
@@ -44,12 +44,12 @@ import scala.tools.nsc.reporters.{Reporter, ConsoleReporter}
4444
* - `docgenerator`,
4545
* - `docrootcontent`,
4646
* - `unchecked`,
47-
* - `nofail` and others :)
47+
* - `nofail`.
4848
*
4949
* It also takes the following parameters as nested elements:
5050
* - `src` (for srcdir),
5151
* - `classpath`,
52-
* - `docSourcePath`,
52+
* - `sourcepath`,
5353
* - `bootclasspath`,
5454
* - `extdirs`.
5555
*
@@ -90,7 +90,7 @@ class Scaladoc extends ScalaMatchingTask {
9090
/** The class path to use for this compilation. */
9191
private var classpath: Option[Path] = None
9292
/** The source path to use for this compilation. */
93-
private var docSourcePath: Option[Path] = None
93+
private var sourcepath: Option[Path] = None
9494
/** The boot class path to use for this compilation. */
9595
private var bootclasspath: Option[Path] = None
9696
/** The external extensions path to use for this compilation. */
@@ -214,33 +214,29 @@ class Scaladoc extends ScalaMatchingTask {
214214
def setClasspathref(input: Reference) =
215215
createClasspath().setRefid(input)
216216

217-
// Bridge the gap between sourcepath and docSourcePath
218-
@deprecated("The scaladoc sourcepath attribute is deprecated. Please use docSourcePath instead.")
219-
def setSourcepath(input: Path) = {
220-
buildWarning("The scaladoc sourcepath attribute is deprecated. Please use docSourcePath instead.")
221-
setDocSourcePath(input)
222-
}
223-
224-
@deprecated("The scaladoc sourcepath attribute is deprecated. Please use docSourcePath instead.")
225-
def setSourcepathref(input: Reference) = {
226-
buildWarning("The scaladoc sourcepath attribute is deprecated. Please use docSourcePath instead.")
227-
setDocSourcePathRef(input)
228-
}
229-
230-
/** Sets the `docSourcePath` attribute. */
231-
def setDocSourcePath(input: Path) =
232-
if (docSourcePath.isEmpty) docSourcePath = Some(input)
233-
else docSourcePath.get.append(input)
217+
/** Sets the `sourcepath` attribute. Used by [[http://ant.apache.org Ant]].
218+
*
219+
* @param input The value of `sourcepath`.
220+
*/
221+
def setSourcepath(input: Path) =
222+
if (sourcepath.isEmpty) sourcepath = Some(input)
223+
else sourcepath.get.append(input)
234224

235-
/** Sets the `docSourcePath` as a nested docSourcePath Ant parameter. */
236-
def createSourcePath(): Path = {
237-
if (docSourcePath.isEmpty) docSourcePath = Some(new Path(getProject))
238-
docSourcePath.get.createPath()
225+
/** Sets the `sourcepath` as a nested sourcepath Ant parameter.
226+
*
227+
* @return A source path to be configured.
228+
*/
229+
def createSourcepath(): Path = {
230+
if (sourcepath.isEmpty) sourcepath = Some(new Path(getProject))
231+
sourcepath.get.createPath()
239232
}
240233

241-
/** Sets the `docSourcePath` as an external reference Ant parameter. */
242-
def setDocSourcePathRef(input: Reference) =
243-
createSourcePath().setRefid(input)
234+
/** Sets the `sourcepath` as an external reference Ant parameter.
235+
*
236+
* @param input A reference to a source path.
237+
*/
238+
def setSourcepathref(input: Reference) =
239+
createSourcepath().setRefid(input)
244240

245241
/** Sets the `bootclasspath` attribute. Used by [[http://ant.apache.org Ant]].
246242
*
@@ -250,7 +246,7 @@ class Scaladoc extends ScalaMatchingTask {
250246
if (bootclasspath.isEmpty) bootclasspath = Some(input)
251247
else bootclasspath.get.append(input)
252248

253-
/** Sets the `bootclasspath` as a nested `docSourcePath` Ant parameter.
249+
/** Sets the `bootclasspath` as a nested `sourcepath` Ant parameter.
254250
*
255251
* @return A source path to be configured.
256252
*/
@@ -276,7 +272,7 @@ class Scaladoc extends ScalaMatchingTask {
276272
else extdirs.get.append(input)
277273
}
278274

279-
/** Sets the `extdirs` as a nested docSourcePath Ant parameter.
275+
/** Sets the `extdirs` as a nested sourcepath Ant parameter.
280276
*
281277
* @return An extensions path to be configured.
282278
*/
@@ -460,8 +456,8 @@ class Scaladoc extends ScalaMatchingTask {
460456
* @return The source path as a list of files.
461457
*/
462458
private def getSourcepath: List[File] =
463-
if (docSourcePath.isEmpty) buildError("Member 'sourcepath' is empty.")
464-
else docSourcePath.get.list().toList map nameToFile
459+
if (sourcepath.isEmpty) buildError("Member 'sourcepath' is empty.")
460+
else sourcepath.get.list().toList map nameToFile
465461

466462
/** Gets the value of the `bootclasspath` attribute in a
467463
* Scala-friendly form.
@@ -599,11 +595,12 @@ class Scaladoc extends ScalaMatchingTask {
599595
docSettings.outdir.value = asString(destination.get)
600596
if (!classpath.isEmpty)
601597
docSettings.classpath.value = asString(getClasspath)
602-
if (!docSourcePath.isEmpty)
603-
docSettings.docSourcePath.value = asString(getSourcepath)
598+
if (!sourcepath.isEmpty)
599+
docSettings.sourcepath.value = asString(getSourcepath)
600+
/*else if (origin.get.size() > 0)
601+
settings.sourcepath.value = origin.get.list()(0)*/
604602
if (!bootclasspath.isEmpty)
605603
docSettings.bootclasspath.value = asString(getBootclasspath)
606-
607604
if (!extdirs.isEmpty) docSettings.extdirs.value = asString(getExtdirs)
608605
if (!encoding.isEmpty) docSettings.encoding.value = encoding.get
609606
if (!doctitle.isEmpty) docSettings.doctitle.value = decodeEscapes(doctitle.get)

0 commit comments

Comments
 (0)