From febe7e56e1516af20cfb4edef9b9d47611031db1 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Sat, 27 Aug 2011 11:54:16 -0400 Subject: [PATCH] fix binary dependency recompilation problem introduced by fix for #108 --- main/Defaults.scala | 2 +- main/actions/AggressiveCompile.scala | 4 ---- .../source-dependencies/binary/changes/Break.scala | 1 + .../sbt-test/source-dependencies/binary/dep/A.scala | 3 +++ .../source-dependencies/binary/project/P.scala | 10 ++++++++++ sbt/src/sbt-test/source-dependencies/binary/test | 3 +++ .../sbt-test/source-dependencies/binary/use/B.scala | 3 +++ 7 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 sbt/src/sbt-test/source-dependencies/binary/changes/Break.scala create mode 100644 sbt/src/sbt-test/source-dependencies/binary/dep/A.scala create mode 100644 sbt/src/sbt-test/source-dependencies/binary/project/P.scala create mode 100644 sbt/src/sbt-test/source-dependencies/binary/test create mode 100644 sbt/src/sbt-test/source-dependencies/binary/use/B.scala diff --git a/main/Defaults.scala b/main/Defaults.scala index ccc05bda0..ce3b5fa5b 100644 --- a/main/Defaults.scala +++ b/main/Defaults.scala @@ -39,7 +39,7 @@ object Defaults extends BuildCommon (a.data, a.metadata get Keys.analysis getOrElse inc.Analysis.Empty) def analysisMap[T](cp: Seq[Attributed[T]]): Map[T, inc.Analysis] = - (cp map extractAnalysis).toMap + (for(a <- cp; an <- a.metadata get Keys.analysis) yield (a.data, an) ).toMap def buildCore: Seq[Setting[_]] = thisBuildCore ++ globalCore def thisBuildCore: Seq[Setting[_]] = inScope(GlobalScope.copy(project = Select(ThisBuild)))(Seq( diff --git a/main/actions/AggressiveCompile.scala b/main/actions/AggressiveCompile.scala index 589ad15ed..b7f505163 100644 --- a/main/actions/AggressiveCompile.scala +++ b/main/actions/AggressiveCompile.scala @@ -48,10 +48,6 @@ class AggressiveCompile(cacheDirectory: File) { import config._ import currentSetup._ - val getAPI = (f: File) => { - val extApis = getAnalysis(f) match { case Some(a) => a.apis.external; case None => Map.empty[String, Source] } - extApis.get _ - } val absClasspath = classpath.map(_.getCanonicalFile) val apiOption= (api: Either[Boolean, Source]) => api.right.toOption val cArgs = new CompilerArguments(compiler.scalaInstance, compiler.cp) diff --git a/sbt/src/sbt-test/source-dependencies/binary/changes/Break.scala b/sbt/src/sbt-test/source-dependencies/binary/changes/Break.scala new file mode 100644 index 000000000..88d8ef9a3 --- /dev/null +++ b/sbt/src/sbt-test/source-dependencies/binary/changes/Break.scala @@ -0,0 +1 @@ +object Break \ No newline at end of file diff --git a/sbt/src/sbt-test/source-dependencies/binary/dep/A.scala b/sbt/src/sbt-test/source-dependencies/binary/dep/A.scala new file mode 100644 index 000000000..91d3855f6 --- /dev/null +++ b/sbt/src/sbt-test/source-dependencies/binary/dep/A.scala @@ -0,0 +1,3 @@ +object A { + val x = 3 +} \ No newline at end of file diff --git a/sbt/src/sbt-test/source-dependencies/binary/project/P.scala b/sbt/src/sbt-test/source-dependencies/binary/project/P.scala new file mode 100644 index 000000000..d5d84e5a4 --- /dev/null +++ b/sbt/src/sbt-test/source-dependencies/binary/project/P.scala @@ -0,0 +1,10 @@ +import sbt._ +import Keys._ + +object B extends Build +{ + lazy val dep = Project("dep", file("dep")) + lazy val use = Project("use", file("use")) settings( + unmanagedJars in Compile <+= packageBin in (dep, Compile) map Attributed.blank + ) +} \ No newline at end of file diff --git a/sbt/src/sbt-test/source-dependencies/binary/test b/sbt/src/sbt-test/source-dependencies/binary/test new file mode 100644 index 000000000..148bfa51e --- /dev/null +++ b/sbt/src/sbt-test/source-dependencies/binary/test @@ -0,0 +1,3 @@ +> use/compile +$ copy-file changes/Break.scala dep/A.scala +-> use/compile diff --git a/sbt/src/sbt-test/source-dependencies/binary/use/B.scala b/sbt/src/sbt-test/source-dependencies/binary/use/B.scala new file mode 100644 index 000000000..5f371ab41 --- /dev/null +++ b/sbt/src/sbt-test/source-dependencies/binary/use/B.scala @@ -0,0 +1,3 @@ +object B { + val y = A.x +} \ No newline at end of file