@@ -5,30 +5,51 @@ import sbt.internal.inc.ScalaInstance
5
5
6
6
// This class needs to be in package sbt to access the ClassLoaderCache
7
7
object Bootstrap {
8
+ /** A ScalaInstance (without scaladoc). */
8
9
def makeScalaInstance (
9
10
state : State ,
10
11
version : String ,
11
12
libraryJars : Array [File ],
12
13
compilerJars : Array [File ],
13
- docJars : Array [File ],
14
14
topLoader : ClassLoader
15
15
): ScalaInstance = {
16
16
// `extendedClassLoaderCache` is package private in package sbt
17
17
val cache = state.extendedClassLoaderCache
18
18
19
19
val libraryLoader = cache(libraryJars.toList, topLoader)
20
20
val compilerLoader = cache(compilerJars.toList, libraryLoader)
21
- val fullLoader = cache(docJars.toList, compilerLoader)
22
21
23
22
new ScalaInstance (
24
23
version = version,
25
- loader = fullLoader ,
24
+ loader = compilerLoader ,
26
25
loaderCompilerOnly = compilerLoader,
27
26
loaderLibraryOnly = libraryLoader,
28
27
libraryJars = libraryJars,
29
28
compilerJars = compilerJars,
30
- allJars = libraryJars ++ compilerJars ++ docJars ,
29
+ allJars = libraryJars ++ compilerJars,
31
30
explicitActual = Some (version)
32
31
)
33
32
}
34
- }
33
+
34
+ /** A ScalaInstance identical to `base` but with additional jars for scaladoc. */
35
+ def makeDocScalaInstance (
36
+ state : State ,
37
+ base : ScalaInstance ,
38
+ docJars : Array [File ]
39
+ ): ScalaInstance = {
40
+ val cache = state.extendedClassLoaderCache
41
+
42
+ val fullLoader = cache(docJars.toList, base.loaderCompilerOnly)
43
+
44
+ new ScalaInstance (
45
+ version = base.version,
46
+ loader = fullLoader,
47
+ loaderCompilerOnly = base.loaderCompilerOnly,
48
+ loaderLibraryOnly = base.loaderLibraryOnly,
49
+ libraryJars = base.libraryJars,
50
+ compilerJars = base.compilerJars,
51
+ allJars = base.allJars ++ docJars,
52
+ explicitActual = base.explicitActual
53
+ )
54
+ }
55
+ }
0 commit comments