You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 8, 2022. It is now read-only.
This is more precise than scanning the urls manually, and fits better with
running partest from build tools, where we resolve the class path using maven/ivy.
The main mode of running partest should be to let some other tool handle dependency
resolution and setting up the classpath, and partest should just take that path,
and work from there. Ideally, its only knowledge about the classpath is the
holy trifecta (library/reflect/compiler).
The core idea is to ask the loader for the code source of a representative class:
```
val classLoader = ScalaClassLoader fromURLs (testClassPath map (_.toURI.toURL))
val canaryClass =
name match {
case "library" => Class.forName("scala.Unit", false, classLoader)
case "reflect" => Class.forName("scala.reflect.api.Symbols", false, classLoader)
case "compiler" => Class.forName("scala.tools.nsc.Main", false, classLoader)
}
Path(canaryClass.getProtectionDomain.getCodeSource.getLocation.getPath)
```
0 commit comments