-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix window path #5560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix window path #5560
Changes from 4 commits
1c721d8
a5e60dd
769233a
7727d51
0ff65a5
0a7ffbc
0c3e55b
4b3340f
23764fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,7 +174,7 @@ final class JrtClassPath(fs: java.nio.file.FileSystem) extends ClassPath with No | |
if (inPackage == "") Nil | ||
else { | ||
packageToModuleBases.getOrElse(inPackage, Nil).flatMap(x => | ||
Files.list(x.resolve(inPackage.replace('.', '/'))).iterator().asScala.filter(_.getFileName.toString.endsWith(".class"))).map(x => | ||
Files.list(x.resolve(FileUtils.dirPath(inPackage))).iterator().asScala.filter(_.getFileName.toString.endsWith(".class"))).map(x => | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you sure this is actually broken ? This code comes straight from scalac (https://github.com/scala/scala/blob/2.13.x/src/compiler/scala/tools/nsc/classpath/DirectoryClassPath.scala#L207) which I assume has received adequate testing under Windows /cc @retronym There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if it causes a problem, just get to this by a search. I'm wondering if there is any reason to use |
||
ClassFileEntryImpl(new PlainFile(new dotty.tools.io.File(x)))).toVector | ||
} | ||
} | ||
|
@@ -193,7 +193,7 @@ final class JrtClassPath(fs: java.nio.file.FileSystem) extends ClassPath with No | |
else { | ||
val inPackage = packageOf(className) | ||
packageToModuleBases.getOrElse(inPackage, Nil).iterator.flatMap{x => | ||
val file = x.resolve(className.replace('.', '/') + ".class") | ||
val file = x.resolve(FileUtils.dirPath(className) + ".class") | ||
if (Files.exists(file)) new PlainFile(new dotty.tools.io.File(file)) :: Nil else Nil | ||
}.take(1).toList.headOption | ||
} | ||
|
@@ -207,7 +207,7 @@ case class DirectoryClassPath(dir: JFile) extends JFileDirectoryLookup[ClassFile | |
|
||
def findClassFile(className: String): Option[AbstractFile] = { | ||
val relativePath = FileUtils.dirPath(className) | ||
val classFile = new JFile(s"$dir/$relativePath.class") | ||
val classFile = new JFile(dir, relativePath + ".class") | ||
if (classFile.exists) { | ||
val wrappedClassFile = new dotty.tools.io.File(classFile.toPath) | ||
val abstractClassFile = new PlainFile(wrappedClassFile) | ||
|
@@ -232,7 +232,7 @@ case class DirectorySourcePath(dir: JFile) extends JFileDirectoryLookup[SourceFi | |
private def findSourceFile(className: String): Option[AbstractFile] = { | ||
val relativePath = FileUtils.dirPath(className) | ||
val sourceFile = Stream("scala", "java") | ||
.map(ext => new JFile(s"$dir/$relativePath.$ext")) | ||
.map(ext => new JFile(dir, relativePath + "." + ext)) | ||
.collectFirst { case file if file.exists() => file } | ||
|
||
sourceFile.map { file => | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -623,13 +623,13 @@ object Build { | |
val args: List[String] = spaceDelimited("<arg>").parsed.toList | ||
val attList = (dependencyClasspath in Runtime).value | ||
val jars = packageAll.value | ||
import File.{ pathSeparator => sep } | ||
|
||
val scalaLib = findLib(attList, "scala-library") | ||
val dottyLib = jars("dotty-library") | ||
|
||
def run(args: List[String]): Unit = { | ||
val sep = File.pathSeparator | ||
val fullArgs = insertClasspathInArgs(args, s".$sep$dottyLib$sep$scalaLib") | ||
val fullArgs = insertClasspathInArgs(args, List(".", dottyLib, scalaLib).mkString(sep)) | ||
liufengyun marked this conversation as resolved.
Show resolved
Hide resolved
|
||
runProcess("java" :: fullArgs, wait = true) | ||
} | ||
|
||
|
@@ -645,7 +645,7 @@ object Build { | |
val asm = findLib(attList, "scala-asm") | ||
val dottyCompiler = jars("dotty-compiler") | ||
val dottyInterfaces = jars("dotty-interfaces") | ||
run(insertClasspathInArgs(args1, s"$dottyCompiler:$dottyInterfaces:$asm")) | ||
run(insertClasspathInArgs(args1, List(dottyCompiler, dottyInterfaces, asm).mkString(sep))) | ||
liufengyun marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} else run(args) | ||
}, | ||
|
||
|
@@ -1092,8 +1092,8 @@ object Build { | |
Developer( | ||
id = "liufengyun", | ||
name = "Liu Fengyun", | ||
email = "[email protected]", | ||
url = url("http://chaos-lab.com") | ||
email = "[email protected]", | ||
url = url("https://fengy.me") | ||
), | ||
Developer( | ||
id = "nicolasstucki", | ||
|
Uh oh!
There was an error while loading. Please reload this page.