Correct classpath for plugins

This commit is contained in:
Mark Harrah 2009-12-07 19:02:30 -05:00
parent 41563c59bb
commit 14db8c2079
3 changed files with 9 additions and 1 deletions

View File

@ -110,6 +110,7 @@ class Launch(val bootDirectory: File, repositories: List[Repository]) extends xs
def target = new UpdateApp(Application(id))
def failLabel = id.name + " " + id.version
def lockFile = updateLockFile
def mainClasspath = classpath
lazy val mainClass: Class[T] forSome { type T <: xsbti.AppMain } =
{

View File

@ -15,6 +15,8 @@ trait Provider extends NotNull
def parentLoader: ClassLoader
def lockFile: File
def classpath = Provider.getJars(baseDirectories)
def retrieveFailed: Nothing = fail("")
def retrieveCorrupt(missing: Iterable[String]): Nothing = fail(": missing " + missing.mkString(", "))
private def fail(extra: String) =
@ -44,7 +46,7 @@ trait Provider extends NotNull
}
def createLoader =
{
val jars = Provider.getJars(baseDirectories)
val jars = classpath
(jars, new URLClassLoader(jars.map(_.toURI.toURL), parentLoader) )
}
}

View File

@ -1,5 +1,7 @@
package xsbti;
import java.io.File;
public interface AppProvider
{
/** Returns the ScalaProvider that this AppProvider will use. */
@ -14,5 +16,8 @@ public interface AppProvider
* It is guaranteed that newMain().getClass() == mainClass()*/
public AppMain newMain();
/** The classpath from which the main class is loaded, excluding Scala jars.*/
public File[] mainClasspath();
public ComponentProvider components();
}