forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,120 changed files
with
82 additions
and
860 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package sbt | ||
|
||
import sbt.internal.classpath.ClassLoaderCache | ||
import sbt.internal.inc.ScalaInstance | ||
|
||
// This class needs to be in package sbt to access the ClassLoaderCache | ||
object Bootstrap { | ||
def makeScalaInstance( | ||
state: State, | ||
version: String, | ||
libraryJars: Array[File], | ||
compilerJars: Array[File], | ||
docJars: Array[File], | ||
topLoader: ClassLoader | ||
): ScalaInstance = { | ||
// `extendedClassLoaderCache` is package private in package sbt | ||
val cache = state.extendedClassLoaderCache | ||
|
||
val libraryLoader = cache(libraryJars.toList, topLoader) | ||
val compilerLoader = cache(compilerJars.toList, libraryLoader) | ||
val fullLoader = cache(docJars.toList, compilerLoader) | ||
|
||
new ScalaInstance( | ||
version = version, | ||
loader = fullLoader, | ||
loaderCompilerOnly = compilerLoader, | ||
loaderLibraryOnly = libraryLoader, | ||
libraryJars = libraryJars, | ||
compilerJars = compilerJars, | ||
allJars = libraryJars ++ compilerJars ++ docJars, | ||
explicitActual = Some(version) | ||
) | ||
} | ||
} |
Oops, something went wrong.