Links to frequently asked questions in a background discussion that shows how MyType
is actually used,
Using:
val settings = new Settings() settings.embeddedDefaults[MyType]
Inside SBT:
def embeddedDefaults[T: Manifest] { val loader = implicitly[Manifest[T]].erasure.getClassLoader explicitParentLoader = Some(loader) // for the Interpreter parentClassLoader getClasspath("app", loader) foreach { classpath.value = _ } getClasspath("boot", loader) foreach { bootclasspath.value = settings.bootclasspath.value + File.separator + _ } }
So, MyType
is only used to help SBT find the appropriate class loader. Presumably, you can select MyType
as an arbitrary class from your project that you want to receive from the interpreter. This is basically what Frequently Asked Questions means when he says: “MyType” is a representative class that must be included in the interpreter class path and in its application class loader.
source share