File tree 2 files changed +22
-4
lines changed
scaladoc/src/dotty/tools/scaladoc/renderers
2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -1317,6 +1317,26 @@ object Build {
1317
1317
sbt.IO .copyFile(cssSourceFile, cssDesitnationFile)
1318
1318
Seq (cssDesitnationFile)
1319
1319
}.taskValue,
1320
+ Compile / resourceGenerators += Def .task {
1321
+ import _root_ .scala .sys .process ._
1322
+ import _root_ .scala .concurrent ._
1323
+ import ExecutionContext .Implicits .global
1324
+ val inkuireVersion = " 1.0.0-M2"
1325
+ val inkuireLink = s " https://github.com/VirtusLab/Inkuire/releases/download/ $inkuireVersion/inkuire.js "
1326
+ val inkuireDestinationFile = (Compile / resourceManaged).value / " dotty_res" / " scripts" / " inkuire.js"
1327
+ sbt.IO .touch(inkuireDestinationFile)
1328
+ val downloadProcess = (new java.net.URL (inkuireLink) #> inkuireDestinationFile).run()
1329
+ val result : Future [Int ] = Future (blocking(downloadProcess.exitValue()))
1330
+ val res = try {
1331
+ Await .result(result, duration.Duration (20 , " sec" ))
1332
+ } catch {
1333
+ case _ : TimeoutException =>
1334
+ downloadProcess.destroy()
1335
+ throw new MessageOnlyException (s " Failed to fetch inkuire.js from $inkuireLink: Download timeout " )
1336
+ }
1337
+ if (res != 0 ) throw new MessageOnlyException (s " Failed to fetch inkuire.js from $inkuireLink: Error code $res" )
1338
+ Seq (inkuireDestinationFile)
1339
+ }.taskValue,
1320
1340
libraryDependencies ++= Dependencies .flexmarkDeps ++ Seq (
1321
1341
" nl.big-o" % " liqp" % " 0.6.7" ,
1322
1342
" org.jsoup" % " jsoup" % " 1.13.1" , // Needed to process .html files for static site
Original file line number Diff line number Diff line change @@ -54,10 +54,8 @@ trait Resources(using ctx: DocContext) extends Locations, Writer:
54
54
55
55
val onlyRenderedResources : Seq [Resource ] =
56
56
List (
57
- (" https://github.com/VirtusLab/Inkuire/releases/download/1.0.0-M2/inkuire.js" , " scripts/inkuire.js" ),
58
- ).map { case (url, path) =>
59
- Resource .URLToCopy (url, path)
60
- } ++
57
+ " scripts/inkuire.js"
58
+ ).map(dottyRes) ++
61
59
List (
62
60
" scripts/inkuire-worker.js"
63
61
).map(dottyRes)
You can’t perform that action at this time.
0 commit comments