-
Notifications
You must be signed in to change notification settings - Fork 126
include only scala-library into the classpath during run #505
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
Changes from all commits
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 |
|---|---|---|
|
|
@@ -63,8 +63,10 @@ object ClasspathUtilities { | |
| final val AppClassPath = "app.class.path" | ||
| final val BootClassPath = "boot.class.path" | ||
|
|
||
| def createClasspathResources(classpath: Seq[File], instance: ScalaInstance): Map[String, String] = | ||
| createClasspathResources(classpath, instance.allJars) | ||
| def createClasspathResources(classpath: Seq[File], | ||
| instance: ScalaInstance): Map[String, String] = { | ||
| createClasspathResources(classpath, Array(instance.libraryJar)) | ||
| } | ||
|
|
||
| def createClasspathResources(appPaths: Seq[File], bootPaths: Seq[File]): Map[String, String] = { | ||
| def make(name: String, paths: Seq[File]) = name -> Path.makeString(paths) | ||
|
|
@@ -74,11 +76,16 @@ object ClasspathUtilities { | |
| private[sbt] def filterByClasspath(classpath: Seq[File], loader: ClassLoader): ClassLoader = | ||
| new ClasspathFilter(loader, xsbtiLoader, classpath.toSet) | ||
|
|
||
| /** | ||
| * Creates a ClassLoader that contains the classpath and the scala-library from | ||
| * the given instance. | ||
| */ | ||
| def makeLoader(classpath: Seq[File], instance: ScalaInstance): ClassLoader = | ||
| filterByClasspath(classpath, makeLoader(classpath, instance.loader, instance)) | ||
| filterByClasspath(classpath, makeLoader(classpath, instance.loaderLibraryOnly, instance)) | ||
|
Member
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. We actually should make even the addition of Here's an example of how we get the unwanted class on our classpath: scala/scala#6300 (comment). So far, we have worked around by forking tests.
Member
Author
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. ok. That sounds like a bug on sbt's Run or TestFramework. By the time someone called |
||
|
|
||
| def makeLoader(classpath: Seq[File], instance: ScalaInstance, nativeTemp: File): ClassLoader = | ||
| filterByClasspath(classpath, makeLoader(classpath, instance.loader, instance, nativeTemp)) | ||
| filterByClasspath(classpath, | ||
| makeLoader(classpath, instance.loaderLibraryOnly, instance, nativeTemp)) | ||
|
|
||
| def makeLoader(classpath: Seq[File], parent: ClassLoader, instance: ScalaInstance): ClassLoader = | ||
| toLoader(classpath, parent, createClasspathResources(classpath, instance)) | ||
|
|
||
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.
This is going to break quite a bit of code. I would honestly consider cutting a major breaking release...
xsbti.compileis quite core to the Zinc API.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.
How so? Do you think there would be observable changes to sbt or other Zinc downstream users? (Besides being able to use the correct scala-xml version)
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.
Didn't mean behaviour-wise, but API-wise 😄. I think
ScalaInstanceis used pretty much everywhere.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.
I see what you mean. Maybe I can try to add another constructor that is bincompat and deprecate it.
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.
Yes, please do 👍
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.
ok. Addressed the bincompat.