@@ -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 ) =
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
@@ -1267,7 +1267,20 @@ object Build {
1267
1267
s " -source-links:github://lampepfl/dotty/ $referenceVersion" ,
1268
1268
) ++ scalacOptionsDocSettings ++ revision ++ params ++ targets
1269
1269
import _root_ .scala .sys .process ._
1270
- 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
+
1271
1284
}
1272
1285
1273
1286
val SourceLinksIntegrationTest = config(" sourceLinksIntegrationTest" ) extend Test
@@ -1314,8 +1327,7 @@ object Build {
1314
1327
generateSelfDocumentation := Def .taskDyn {
1315
1328
generateDocumentation(
1316
1329
(Compile / classDirectory).value.getAbsolutePath :: Nil ,
1317
- " scaladoc" , " scaladoc/output/self" , VersionUtil .gitHash,
1318
- Seq (" -usejavacp" )
1330
+ " scaladoc" , " scaladoc/output/self" , VersionUtil .gitHash
1319
1331
)
1320
1332
}.value,
1321
1333
generateScalaDocumentation := Def .inputTaskDyn {
@@ -1356,7 +1368,7 @@ object Build {
1356
1368
s " -source-links:docs=github://lampepfl/dotty/master#docs " ,
1357
1369
" -doc-root-content" , docRootFile.toString,
1358
1370
" -Ydocument-synthetic-types"
1359
- )
1371
+ ), usingScript = false
1360
1372
))
1361
1373
}.evaluated,
1362
1374
@@ -1365,8 +1377,7 @@ object Build {
1365
1377
(Test / Build .testcasesOutputDir).value,
1366
1378
" scaladoc testcases" ,
1367
1379
" scaladoc/output/testcases" ,
1368
- " master" ,
1369
- Seq (" -usejavacp" )
1380
+ " master"
1370
1381
)
1371
1382
}.value,
1372
1383
0 commit comments