File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
compiler/src/dotty/tools/dotc/quoted
doc-tool/src/dotty/tools/dottydoc/staticsite Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,8 @@ object QuoteDriver {
9696 case cl : URLClassLoader =>
9797 // Loads the classes loaded by this class loader
9898 // When executing `run` or `test` in sbt the classpath is not in the property java.class.path
99- val newClasspath = cl.getURLs.map(_.getFile())
99+ import java .nio .file .Paths
100+ val newClasspath = cl.getURLs.map(url => Paths .get(url.toURI).toFile)
100101 newClasspath.mkString(" " , java.io.File .pathSeparator, if (classpath0 == " " ) " " else java.io.File .pathSeparator + classpath0)
101102 case _ => classpath0
102103 }
Original file line number Diff line number Diff line change @@ -167,9 +167,9 @@ case class Site(
167167 private def defaultParams (pageLocation : JFile , additionalDepth : Int = 0 ): DefaultParams = {
168168 val pathFromRoot = stripRoot(pageLocation)
169169 val baseUrl : String = {
170- val rootLen = root.getAbsolutePath.split(sep).length
171- val assetLen = pageLocation.getAbsolutePath.split(sep).length
172- " ../" * (assetLen - rootLen - 1 + additionalDepth) + " ."
170+ val rootLen = root.toPath.normalize.getNameCount
171+ val assetLen = pageLocation.toPath.normalize.getNameCount
172+ " ../" * (assetLen - rootLen + additionalDepth) + " ."
173173 }
174174
175175 DefaultParams (
@@ -203,7 +203,7 @@ case class Site(
203203
204204 val path = if (scala.util.Properties .isWin)
205205 e.path.map(_.replace(" <" , " _" ).replace(" >" , " _" ))
206- else
206+ else
207207 e.path
208208 val target = mkdirs(fs.getPath(outDir.getAbsolutePath + sep + " api" + sep + path.mkString(sep) + suffix))
209209 val params = defaultParams(target.toFile, - 1 ).withPosts(blogInfo).withEntity(Some (e)).toMap
You can’t perform that action at this time.
0 commit comments