mirror of https://github.com/sbt/sbt.git
Using the data structures that I added in the previous commits, it is now possible to rework the run and test task to use (configurable) layered class loaders. The layering strategy is globally set to LayeringStrategy.Default. The default strategy leads to what is effectively a three layered ClassLoader for the both the test and run tasks. The first layer contains the scala instance (and test framework loader in the test task). The second layer contains all of the dependencies for the configuration while the third layer contains the project artifacts. The layering strategy is very easily changed both at the Global or Configuration level, e.g. adding Test / layeringStrategy := LayeringStrategy.Flat to the project build.sbt will make the test task not even use the scala instance and instead a create a single layer containing the full classpath of the test task. I also tried to ensure that all of the ClassLoaders have good toString overrides so that it's easy to see how the ClassLoader is constructed with, e.g. `show testLoader`, in the sbt console. In this commit, the ClassLoaderCache instances are settings. In the next commit, I make them tasks so that we can easily clear out the caches with a command. |
||
|---|---|---|
| .. | ||
| src | ||
| NOTICE | ||