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 {
96
96
case cl : URLClassLoader =>
97
97
// Loads the classes loaded by this class loader
98
98
// 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)
100
101
newClasspath.mkString(" " , java.io.File .pathSeparator, if (classpath0 == " " ) " " else java.io.File .pathSeparator + classpath0)
101
102
case _ => classpath0
102
103
}
Original file line number Diff line number Diff line change @@ -167,9 +167,9 @@ case class Site(
167
167
private def defaultParams (pageLocation : JFile , additionalDepth : Int = 0 ): DefaultParams = {
168
168
val pathFromRoot = stripRoot(pageLocation)
169
169
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) + " ."
173
173
}
174
174
175
175
DefaultParams (
@@ -203,7 +203,7 @@ case class Site(
203
203
204
204
val path = if (scala.util.Properties .isWin)
205
205
e.path.map(_.replace(" <" , " _" ).replace(" >" , " _" ))
206
- else
206
+ else
207
207
e.path
208
208
val target = mkdirs(fs.getPath(outDir.getAbsolutePath + sep + " api" + sep + path.mkString(sep) + suffix))
209
209
val params = defaultParams(target.toFile, - 1 ).withPosts(blogInfo).withEntity(Some (e)).toMap
You can’t perform that action at this time.
0 commit comments