aboutsummaryrefslogtreecommitdiff
path: root/sbt-bridge/bridge/src/sbt-test/source-dependencies/inherited-deps-java/build.sbt
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-10-11 17:28:39 +0200
committerGuillaume Martres <smarter@ubuntu.com>2016-11-22 01:35:06 +0100
commit2d10c87ce537fb42fdb134efcae53dca7305a7b7 (patch)
treea3629c9a3ad6db3e9d07df8fa8621f8c8211076c /sbt-bridge/bridge/src/sbt-test/source-dependencies/inherited-deps-java/build.sbt
parent34d64f381362b12a595fd26690c7c9b1c26d16f7 (diff)
downloaddotty-2d10c87ce537fb42fdb134efcae53dca7305a7b7.tar.gz
dotty-2d10c87ce537fb42fdb134efcae53dca7305a7b7.tar.bz2
dotty-2d10c87ce537fb42fdb134efcae53dca7305a7b7.zip
Move sbt-bridge
Diffstat (limited to 'sbt-bridge/bridge/src/sbt-test/source-dependencies/inherited-deps-java/build.sbt')
-rw-r--r--sbt-bridge/bridge/src/sbt-test/source-dependencies/inherited-deps-java/build.sbt30
1 files changed, 30 insertions, 0 deletions
diff --git a/sbt-bridge/bridge/src/sbt-test/source-dependencies/inherited-deps-java/build.sbt b/sbt-bridge/bridge/src/sbt-test/source-dependencies/inherited-deps-java/build.sbt
new file mode 100644
index 000000000..c25b54921
--- /dev/null
+++ b/sbt-bridge/bridge/src/sbt-test/source-dependencies/inherited-deps-java/build.sbt
@@ -0,0 +1,30 @@
+// this test is specific to the old incremental compilation algorithm
+incOptions := incOptions.value.withNameHashing(false)
+
+lazy val verifyDeps = taskKey[Unit]("verify inherited dependencies are properly extracted")
+
+verifyDeps := {
+ val a = compile.in(Compile).value
+ same(a.relations.publicInherited.internal.forwardMap, expectedDeps.forwardMap)
+}
+
+lazy val expected = Seq(
+ "A" -> Seq("C", "D", "E", "G", "J"),
+ "B" -> Seq("C", "D", "G", "J"),
+ "C" -> Seq("D", "G", "J"),
+ "D" -> Seq("G", "J"),
+ "E" -> Seq(),
+ "F" -> Seq(),
+ "G" -> Seq("J"),
+ "J" -> Seq()
+)
+lazy val pairs =
+ expected.map { case (from,tos) =>
+ (toFile(from), tos.map(toFile))
+ }
+lazy val expectedDeps = (Relation.empty[File,File] /: pairs) { case (r, (x,ys)) => r + (x,ys) }
+def toFile(s: String) = file(s + ".java").getAbsoluteFile
+
+def same[T](x: T, y: T): Unit = {
+ assert(x == y, s"\nActual: $x, \nExpected: $y")
+}