diff options
Diffstat (limited to 'sbt-bridge/src/sbt-test/source-dependencies/constants')
5 files changed, 35 insertions, 0 deletions
diff --git a/sbt-bridge/src/sbt-test/source-dependencies/constants/changes/A1.scala b/sbt-bridge/src/sbt-test/source-dependencies/constants/changes/A1.scala new file mode 100644 index 000000000..f67b6f474 --- /dev/null +++ b/sbt-bridge/src/sbt-test/source-dependencies/constants/changes/A1.scala @@ -0,0 +1 @@ +object A { final val x = 1 } diff --git a/sbt-bridge/src/sbt-test/source-dependencies/constants/changes/A2.scala b/sbt-bridge/src/sbt-test/source-dependencies/constants/changes/A2.scala new file mode 100644 index 000000000..4f9396f13 --- /dev/null +++ b/sbt-bridge/src/sbt-test/source-dependencies/constants/changes/A2.scala @@ -0,0 +1 @@ +object A { final val x = 2 } diff --git a/sbt-bridge/src/sbt-test/source-dependencies/constants/changes/B.scala b/sbt-bridge/src/sbt-test/source-dependencies/constants/changes/B.scala new file mode 100644 index 000000000..058527993 --- /dev/null +++ b/sbt-bridge/src/sbt-test/source-dependencies/constants/changes/B.scala @@ -0,0 +1,4 @@ +object B +{ + def main(args: Array[String]) = assert(args(0).toInt == A.x ) +}
\ No newline at end of file diff --git a/sbt-bridge/src/sbt-test/source-dependencies/constants/project/DottyInjectedPlugin.scala b/sbt-bridge/src/sbt-test/source-dependencies/constants/project/DottyInjectedPlugin.scala new file mode 100644 index 000000000..3433779b6 --- /dev/null +++ b/sbt-bridge/src/sbt-test/source-dependencies/constants/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/constants/test b/sbt-bridge/src/sbt-test/source-dependencies/constants/test new file mode 100644 index 000000000..7a5ae5879 --- /dev/null +++ b/sbt-bridge/src/sbt-test/source-dependencies/constants/test @@ -0,0 +1,12 @@ +# Marked as pending, see https://github.com/sbt/sbt/issues/1543 +# Tests if source dependencies are tracked properly +# for compile-time constants (like final vals in top-level objects) +# see https://issues.scala-lang.org/browse/SI-7173 for details +# why compile-time constants can be tricky to track due to early inlining + +$ copy-file changes/B.scala B.scala + +$ copy-file changes/A1.scala A.scala +> run 1 +$ copy-file changes/A2.scala A.scala +> run 2 |