don't add _root_ to definitions in the empty package

This commit is contained in:
Mark Harrah 2011-09-11 13:46:27 -04:00
parent abcd9a041f
commit 1b0c619308
3 changed files with 12 additions and 4 deletions

View File

@ -497,7 +497,8 @@ object Load
ModuleUtilities.getObject(pluginName, loader).asInstanceOf[Plugin].settings
def importAll(values: Seq[String]) = if(values.isEmpty) Nil else values.map( _ + "._" ).mkString("import ", ", ", "") :: Nil
def importAllRoot(values: Seq[String]) = importAll(values.map("_root_." + _))
def importAllRoot(values: Seq[String]) = importAll(values map rootedName)
def rootedName(s: String) = if(s contains '.') "_root_." + s else s
def findPlugins(analysis: inc.Analysis): Seq[String] = discover(analysis, "sbt.Plugin")
def findDefinitions(analysis: inc.Analysis): Seq[String] = discover(analysis, "sbt.Build")

View File

@ -1,3 +1,5 @@
maxErrors := xyz
name := "Demo"
name := "Demo"
traceLevel := zyx

View File

@ -1,7 +1,11 @@
package name.example
import sbt._
object Q extends Plugin {
val zyx = -3
}
package name.example {
object P extends Plugin {
val xyz = 3
val checkMaxErrors = TaskKey[Unit]("check-max-errors")
@ -11,4 +15,5 @@ object P extends Plugin {
checkMaxErrors <<= Keys.maxErrors map { me => assert(me == xyz, "Expected maxErrors to be " + xyz + ", but it was " + me ) },
checkName <<= Keys.name map { n => assert(n == "Demo", "Expected name to be 'Demo', but it was '" + n + "'" ) }
)
}
}