-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Simplify output directory handling #4744
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
Conversation
@@ -37,7 +37,7 @@ private[repl] class Rendering(compiler: ReplCompiler, | |||
new java.net.URLClassLoader(compilerClasspath.toArray, classOf[ReplDriver].getClassLoader) | |||
} | |||
|
|||
myClassLoader = new AbstractFileClassLoader(compiler.directory, parent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compiler
is now unused
@@ -42,12 +42,8 @@ class GenBCode extends Phase { | |||
private[this] var myOutput: AbstractFile = _ | |||
|
|||
protected def outputDir(implicit ctx: Context): AbstractFile = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be private
now?
if (!isJar && !path.isDirectory) | ||
fail(s"'$arg' does not exist or is not a directory or .jar file", args) | ||
else { | ||
val output = if (isJar) JarArchive.create(path) else new PlainDirectory(path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will now hold on to an open jar during the whole compiler run instead of just backend. We didn't even open the jar before if we stopped before backend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an empty open jar, so not a big deal I think (it cannot be deleted on Windows while it's open, but who cares?)
d092765
to
8949f6c
Compare
Store the outputDir setting as an AbstractFile instead of a String, this way we can use a virtual output directory just by changing the setting instead of having to subclass GenBCode.
8949f6c
to
818dbbd
Compare
Also stop extending DottyTest because I don't understand the weird way it handles context. We'll need to clean up all that stuff some day.
Store the outputDir setting as an AbstractFile instead of a String, this
way we can use a virtual output directory in the REPL just by changing
the setting instead of having to subclass GenBCode.