aboutsummaryrefslogtreecommitdiff
path: root/sbt-bridge/src/sbt-test/source-dependencies/canon
diff options
context:
space:
mode:
Diffstat (limited to 'sbt-bridge/src/sbt-test/source-dependencies/canon')
-rw-r--r--sbt-bridge/src/sbt-test/source-dependencies/canon/Use.scala3
-rw-r--r--sbt-bridge/src/sbt-test/source-dependencies/canon/actual/A.java4
-rw-r--r--sbt-bridge/src/sbt-test/source-dependencies/canon/actual/a.jarbin0 -> 634 bytes
-rw-r--r--sbt-bridge/src/sbt-test/source-dependencies/canon/build.sbt10
l---------sbt-bridge/src/sbt-test/source-dependencies/canon/lib/a.jar1
-rw-r--r--sbt-bridge/src/sbt-test/source-dependencies/canon/project/DottyInjectedPlugin.scala17
-rw-r--r--sbt-bridge/src/sbt-test/source-dependencies/canon/test10
7 files changed, 45 insertions, 0 deletions
diff --git a/sbt-bridge/src/sbt-test/source-dependencies/canon/Use.scala b/sbt-bridge/src/sbt-test/source-dependencies/canon/Use.scala
new file mode 100644
index 000000000..fe9e21714
--- /dev/null
+++ b/sbt-bridge/src/sbt-test/source-dependencies/canon/Use.scala
@@ -0,0 +1,3 @@
+object Use {
+ val x = A.x
+} \ No newline at end of file
diff --git a/sbt-bridge/src/sbt-test/source-dependencies/canon/actual/A.java b/sbt-bridge/src/sbt-test/source-dependencies/canon/actual/A.java
new file mode 100644
index 000000000..693c5b932
--- /dev/null
+++ b/sbt-bridge/src/sbt-test/source-dependencies/canon/actual/A.java
@@ -0,0 +1,4 @@
+// this is the source for the compiled class in a.jar
+public class A {
+ public static final int x = 3;
+}
diff --git a/sbt-bridge/src/sbt-test/source-dependencies/canon/actual/a.jar b/sbt-bridge/src/sbt-test/source-dependencies/canon/actual/a.jar
new file mode 100644
index 000000000..5c63ca5e9
--- /dev/null
+++ b/sbt-bridge/src/sbt-test/source-dependencies/canon/actual/a.jar
Binary files differ
diff --git a/sbt-bridge/src/sbt-test/source-dependencies/canon/build.sbt b/sbt-bridge/src/sbt-test/source-dependencies/canon/build.sbt
new file mode 100644
index 000000000..d23dff705
--- /dev/null
+++ b/sbt-bridge/src/sbt-test/source-dependencies/canon/build.sbt
@@ -0,0 +1,10 @@
+import complete.DefaultParsers._
+
+val checkIterations = inputKey[Unit]("Verifies the accumlated number of iterations of incremental compilation.")
+
+checkIterations := {
+ val expected: Int = (Space ~> NatBasic).parsed
+ val actual: Int = (compile in Compile).value.compilations.allCompilations.size
+ assert(expected == actual, s"Expected $expected compilations, got $actual")
+}
+
diff --git a/sbt-bridge/src/sbt-test/source-dependencies/canon/lib/a.jar b/sbt-bridge/src/sbt-test/source-dependencies/canon/lib/a.jar
new file mode 120000
index 000000000..9fa4156a8
--- /dev/null
+++ b/sbt-bridge/src/sbt-test/source-dependencies/canon/lib/a.jar
@@ -0,0 +1 @@
+../actual/a.jar \ No newline at end of file
diff --git a/sbt-bridge/src/sbt-test/source-dependencies/canon/project/DottyInjectedPlugin.scala b/sbt-bridge/src/sbt-test/source-dependencies/canon/project/DottyInjectedPlugin.scala
new file mode 100644
index 000000000..3433779b6
--- /dev/null
+++ b/sbt-bridge/src/sbt-test/source-dependencies/canon/project/DottyInjectedPlugin.scala
@@ -0,0 +1,17 @@
+import sbt._
+import Keys._
+
+object DottyInjectedPlugin extends AutoPlugin {
+ override def requires = plugins.JvmPlugin
+ override def trigger = allRequirements
+
+ override val projectSettings = Seq(
+ scalaVersion := "0.1-SNAPSHOT",
+ scalaOrganization := "ch.epfl.lamp",
+ scalacOptions += "-language:Scala2",
+ scalaBinaryVersion := "2.11",
+ autoScalaLibrary := false,
+ libraryDependencies ++= Seq("org.scala-lang" % "scala-library" % "2.11.5"),
+ scalaCompilerBridgeSource := ("ch.epfl.lamp" % "dotty-bridge" % "0.1.1-SNAPSHOT" % "component").sources()
+ )
+}
diff --git a/sbt-bridge/src/sbt-test/source-dependencies/canon/test b/sbt-bridge/src/sbt-test/source-dependencies/canon/test
new file mode 100644
index 000000000..13caf4871
--- /dev/null
+++ b/sbt-bridge/src/sbt-test/source-dependencies/canon/test
@@ -0,0 +1,10 @@
+# Tests that classpath entries that are different than their canonical representation are
+# handled properly. In particular, a symlink from lib/a.jar to lib/../actual/a.jar.0 is
+# available on the classpath and read by scalac. scalac 2.10.x does not interpret .jar.0
+# as a jar, so if sbt passes the canonical path, it will not be read.
+# This also verifies that compilation does not get repeatedly triggered by a mismatch in
+# paths.
+
+> compile
+> compile
+> checkIterations 1 \ No newline at end of file