@@ -1243,16 +1243,19 @@ 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 ) =
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
1250
1250
IO .createDirectory(file(outDir))
1251
1251
val stdLibVersion = stdlibVersion(Bootstrapped )
1252
+ val scalaLib = findArtifactPath(externalCompilerClasspathTask.value, " scala-library" )
1253
+ val dottyLib = (`scala3-library` / Compile / classDirectory).value
1252
1254
// TODO add versions etc.
1253
1255
def srcManaged (v : String , s : String ) = s " out/bootstrap/stdlib-bootstrapped/scala- $v/src_managed/main/ $s-library-src "
1254
1256
def scalaSrcLink (v : String , s : String ) = s " -source-links: $s=github://scala/scala/v $v#src/library "
1255
1257
def dottySrcLink (v : String , s : String ) = s " -source-links: $s=github://lampepfl/dotty/ $v#library/src "
1258
+
1256
1259
val revision = Seq (" -revision" , ref, " -project-version" , projectVersion)
1257
1260
val cmd = Seq (
1258
1261
" -d" ,
@@ -1264,7 +1267,20 @@ object Build {
1264
1267
s " -source-links:github://lampepfl/dotty/ $referenceVersion" ,
1265
1268
) ++ scalacOptionsDocSettings ++ revision ++ params ++ targets
1266
1269
import _root_ .scala .sys .process ._
1267
- 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
+
1268
1284
}
1269
1285
1270
1286
val SourceLinksIntegrationTest = config(" sourceLinksIntegrationTest" ) extend Test
@@ -1311,7 +1327,7 @@ object Build {
1311
1327
generateSelfDocumentation := Def .taskDyn {
1312
1328
generateDocumentation(
1313
1329
(Compile / classDirectory).value.getAbsolutePath :: Nil ,
1314
- " scaladoc" , " scaladoc/output/self" , VersionUtil .gitHash,
1330
+ " scaladoc" , " scaladoc/output/self" , VersionUtil .gitHash
1315
1331
)
1316
1332
}.value,
1317
1333
generateScalaDocumentation := Def .inputTaskDyn {
@@ -1352,7 +1368,7 @@ object Build {
1352
1368
s " -source-links:docs=github://lampepfl/dotty/master#docs " ,
1353
1369
" -doc-root-content" , docRootFile.toString,
1354
1370
" -Ydocument-synthetic-types"
1355
- )
1371
+ ), usingScript = false
1356
1372
))
1357
1373
}.evaluated,
1358
1374
@@ -1361,7 +1377,8 @@ object Build {
1361
1377
(Test / Build .testcasesOutputDir).value,
1362
1378
" scaladoc testcases" ,
1363
1379
" scaladoc/output/testcases" ,
1364
- " master" )
1380
+ " master"
1381
+ )
1365
1382
}.value,
1366
1383
1367
1384
Test / buildInfoKeys := Seq [BuildInfoKey ](
0 commit comments