mirror of https://github.com/sbt/sbt.git
Fix for using automatic discovery of compiler plugins in projects that define plugins
git-svn-id: https://simple-build-tool.googlecode.com/svn/trunk@933 d89573ee-9141-11dd-94d4-bdf5e562f29c
This commit is contained in:
parent
fb64501c9b
commit
28061254b0
|
|
@ -46,16 +46,17 @@ object ClasspathUtilities
|
||||||
private[sbt] def compilerPlugins(classpath: Iterable[Path]): Iterable[File] =
|
private[sbt] def compilerPlugins(classpath: Iterable[Path]): Iterable[File] =
|
||||||
{
|
{
|
||||||
val loader = new URLClassLoader(classpath.map(_.asURL).toList.toArray)
|
val loader = new URLClassLoader(classpath.map(_.asURL).toList.toArray)
|
||||||
wrap.Wrappers.toList(loader.getResources("scalac-plugin.xml")).flatMap(asFile)
|
wrap.Wrappers.toList(loader.getResources("scalac-plugin.xml")).flatMap(asFile(true))
|
||||||
}
|
}
|
||||||
/** Converts the given URL to a File. If the URL is for an entry in a jar, the File for the jar is returned. */
|
/** Converts the given URL to a File. If the URL is for an entry in a jar, the File for the jar is returned. */
|
||||||
private[sbt] def asFile(url: URL) =
|
private[sbt] def asFile(url: URL): List[File] = asFile(false)(url)
|
||||||
|
private[sbt] def asFile(jarOnly: Boolean)(url: URL): List[File] =
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
url.getProtocol match
|
url.getProtocol match
|
||||||
{
|
{
|
||||||
case "file" => FileUtilities.toFile(url) :: Nil
|
case "file" if !jarOnly=> FileUtilities.toFile(url) :: Nil
|
||||||
case "jar" =>
|
case "jar" =>
|
||||||
val path = url.getPath
|
val path = url.getPath
|
||||||
val end = path.indexOf('!')
|
val end = path.indexOf('!')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue