@@ -1243,7 +1243,7 @@ object Build {
1243
1243
libraryDependencies += (" org.scala-js" %%% " scalajs-dom" % " 1.1.0" ).cross(CrossVersion .for3Use2_13)
1244
1244
)
1245
1245
1246
- def generateDocumentation (targets : Seq [String ], name : String , outDir : String , ref : String , params : Seq [String ] = Nil , addBootclasspath : Boolean = false ) =
1246
+ def generateDocumentation (targets : Seq [String ], name : String , outDir : String , ref : String , params : Seq [String ] = Nil , usingScript : Boolean = true ) =
1247
1247
Def .taskDyn {
1248
1248
val distLocation = (dist / pack).value
1249
1249
val projectVersion = version.value
@@ -1255,13 +1255,6 @@ object Build {
1255
1255
def srcManaged (v : String , s : String ) = s " out/bootstrap/stdlib-bootstrapped/scala- $v/src_managed/main/ $s-library-src "
1256
1256
def scalaSrcLink (v : String , s : String ) = s " -source-links: $s=github://scala/scala/v $v#src/library "
1257
1257
def dottySrcLink (v : String , s : String ) = s " -source-links: $s=github://lampepfl/dotty/ $v#library/src "
1258
- def bootclasspath : Seq [String ] = if (addBootclasspath) Seq (
1259
- " -bootclasspath" ,
1260
- Seq (
1261
- scalaLib,
1262
- dottyLib
1263
- ).mkString(System .getProperty(" path.separator" ))
1264
- ) else Nil
1265
1258
1266
1259
val revision = Seq (" -revision" , ref, " -project-version" , projectVersion)
1267
1260
val cmd = Seq (
@@ -1272,9 +1265,22 @@ object Build {
1272
1265
scalaSrcLink(stdLibVersion, srcManaged(dottyNonBootstrappedVersion, " scala" )),
1273
1266
dottySrcLink(referenceVersion, srcManaged(dottyNonBootstrappedVersion, " dotty" )),
1274
1267
s " -source-links:github://lampepfl/dotty/ $referenceVersion" ,
1275
- ) ++ scalacOptionsDocSettings ++ revision ++ params ++ targets ++ bootclasspath
1268
+ ) ++ scalacOptionsDocSettings ++ revision ++ params ++ targets
1276
1269
import _root_ .scala .sys .process ._
1277
- Def .task((s " $distLocation/bin/scaladoc " +: cmd).! )
1270
+ if (usingScript)
1271
+ Def .task((s " $distLocation/bin/scaladoc " +: cmd).! )
1272
+ else {
1273
+ val escapedCmd = cmd.map(arg => if (arg.contains(" " )) s """ " $arg" """ else arg)
1274
+ Def .task {
1275
+ try {
1276
+ (Compile / run).toTask(escapedCmd.mkString(" " , " " , " " )).value
1277
+ 0
1278
+ } catch {
1279
+ case _ : Throwable => 1
1280
+ }
1281
+ }
1282
+ }
1283
+
1278
1284
}
1279
1285
1280
1286
val SourceLinksIntegrationTest = config(" sourceLinksIntegrationTest" ) extend Test
@@ -1321,8 +1327,7 @@ object Build {
1321
1327
generateSelfDocumentation := Def .taskDyn {
1322
1328
generateDocumentation(
1323
1329
(Compile / classDirectory).value.getAbsolutePath :: Nil ,
1324
- " scaladoc" , " scaladoc/output/self" , VersionUtil .gitHash,
1325
- addBootclasspath = true
1330
+ " scaladoc" , " scaladoc/output/self" , VersionUtil .gitHash
1326
1331
)
1327
1332
}.value,
1328
1333
generateScalaDocumentation := Def .inputTaskDyn {
@@ -1363,7 +1368,7 @@ object Build {
1363
1368
s " -source-links:docs=github://lampepfl/dotty/master#docs " ,
1364
1369
" -doc-root-content" , docRootFile.toString,
1365
1370
" -Ydocument-synthetic-types"
1366
- )
1371
+ ), usingScript = false
1367
1372
))
1368
1373
}.evaluated,
1369
1374
@@ -1372,8 +1377,8 @@ object Build {
1372
1377
(Test / Build .testcasesOutputDir).value,
1373
1378
" scaladoc testcases" ,
1374
1379
" scaladoc/output/testcases" ,
1375
- " master" ,
1376
- addBootclasspath = true )
1380
+ " master"
1381
+ )
1377
1382
}.value,
1378
1383
1379
1384
Test / buildInfoKeys := Seq [BuildInfoKey ](
0 commit comments