File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed
scaladoc/src/dotty/tools/scaladoc/renderers Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -1317,6 +1317,26 @@ object Build {
13171317 sbt.IO .copyFile(cssSourceFile, cssDesitnationFile)
13181318 Seq (cssDesitnationFile)
13191319 }.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,
13201340 libraryDependencies ++= Dependencies .flexmarkDeps ++ Seq (
13211341 " nl.big-o" % " liqp" % " 0.6.7" ,
13221342 " 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:
5454
5555 val onlyRenderedResources : Seq [Resource ] =
5656 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) ++
6159 List (
6260 " scripts/inkuire-worker.js"
6361 ).map(dottyRes)
You can’t perform that action at this time.
0 commit comments