Fixes project/auto-plugins and add pending test for nested

There seems to be an issue with the discovery of auto plugins in an
inner nested class. The error you would get is:

[info] java.lang.ClassNotFoundException: sbttest.Imports.A$
[info] 	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
[info] 	at java.security.AccessController.doPrivileged(Native Method)
[info] 	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
[info] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
[info] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
[info] 	at java.lang.Class.forName0(Native Method)
[info] 	at java.lang.Class.forName(Class.java:249)
[info] 	at
sbt.internal.inc.ModuleUtilities$.getObject(ModuleUtilities.scala:16)
[info] 	at
sbt.internal.inc.ModuleUtilities$.getCheckedObject(ModuleUtilities.scala
:22)
[info] 	at
sbt.internal.inc.ModuleUtilities$$anonfun$getCheckedObjects$1.apply(Modu
leUtilities.scala:25)
[info] 	at
sbt.internal.inc.ModuleUtilities$$anonfun$getCheckedObjects$1.apply(Modu
leUtilities.scala:25)
[info] 	at scala.collection.immutable.Stream.map(Stream.scala:418)
[info] 	at
sbt.internal.inc.ModuleUtilities$.getCheckedObjects(ModuleUtilities.scal
a:25)
[info] 	at sbt.PluginDiscovery$.loadModules(PluginDiscovery.scala:138)
[info] 	at
sbt.PluginDiscovery$.binarySourceModules(PluginDiscovery.scala:132)
[info] 	at sbt.PluginDiscovery$.discover$1(PluginDiscovery.scala:36)
[info] 	at sbt.PluginDiscovery$.discoverAll(PluginDiscovery.scala:45)
[info] 	at sbt.internal.Load$.loadPlugins(Load.scala:856)
This commit is contained in:
Eugene Yokota 2016-05-06 01:39:13 -04:00
parent f8ef449789
commit 03c3c5cf08
4 changed files with 10 additions and 4 deletions

View File

@ -0,0 +1 @@
> plugins

View File

@ -0,0 +1,6 @@
package sbttest
import sbt._, syntax._, Keys._
object Imports {
object A extends AutoPlugin
}

View File

@ -1,8 +1,7 @@
// no package
// plugins declared within no package should be visible to other plugins in the _root_ package
import sbt._
import sbt.Keys._
import sbt._, syntax._, Keys._
object TopLevelImports {
lazy val topLevelDemo = settingKey[String]("A top level demo setting.")

View File

@ -3,12 +3,12 @@ package sbttest // you need package http://stackoverflow.com/questions/9822008/
import sbt._, syntax._, Keys._
import java.util.concurrent.atomic.{AtomicInteger => AInt}
object Imports
{
object A extends AutoPlugin
object B extends AutoPlugin
object E extends AutoPlugin
object Imports
{
lazy val q = config("q")
lazy val p = config("p").extend(q)