diff --git a/main/Load.scala b/main/Load.scala index 65c6739f8..de2e31ca2 100644 --- a/main/Load.scala +++ b/main/Load.scala @@ -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") diff --git a/sbt/src/sbt-test/project/auto-import/changes/build.sbt b/sbt/src/sbt-test/project/auto-import/changes/build.sbt index a03237561..4969afaa1 100644 --- a/sbt/src/sbt-test/project/auto-import/changes/build.sbt +++ b/sbt/src/sbt-test/project/auto-import/changes/build.sbt @@ -1,3 +1,5 @@ maxErrors := xyz -name := "Demo" \ No newline at end of file +name := "Demo" + +traceLevel := zyx \ No newline at end of file diff --git a/sbt/src/sbt-test/project/auto-import/project/P.scala b/sbt/src/sbt-test/project/auto-import/project/P.scala index 067fad606..61ae968ff 100644 --- a/sbt/src/sbt-test/project/auto-import/project/P.scala +++ b/sbt/src/sbt-test/project/auto-import/project/P.scala @@ -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 + "'" ) } ) +} } \ No newline at end of file