aboutsummaryrefslogtreecommitdiff
path: root/sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify
diff options
context:
space:
mode:
Diffstat (limited to 'sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify')
-rw-r--r--sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/build.sbt9
-rw-r--r--sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/project/DottyInjectedPlugin.scala17
-rw-r--r--sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/src/main/scala/For.scala44
-rw-r--r--sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/src/main/scala/Nested.scala41
-rw-r--r--sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/test8
5 files changed, 119 insertions, 0 deletions
diff --git a/sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/build.sbt b/sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/build.sbt
new file mode 100644
index 000000000..f44ca0862
--- /dev/null
+++ b/sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/build.sbt
@@ -0,0 +1,9 @@
+TaskKey[Unit]("output-empty") <<= classDirectory in Configurations.Compile map { outputDirectory =>
+ def classes = (outputDirectory ** "*.class").get
+ if(!classes.isEmpty) sys.error("Classes existed:\n\t" + classes.mkString("\n\t")) else ()
+}
+
+// apparently Travis CI stopped allowing long file names
+// it fails with the default setting of 255 characters so
+// we have to set lower limit ourselves
+scalacOptions ++= Seq("-Xmax-classfile-name", "240")
diff --git a/sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/project/DottyInjectedPlugin.scala b/sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/project/DottyInjectedPlugin.scala
new file mode 100644
index 000000000..3433779b6
--- /dev/null
+++ b/sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/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/bridge/src/sbt-test/source-dependencies/compactify/src/main/scala/For.scala b/sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/src/main/scala/For.scala
new file mode 100644
index 000000000..5d1b8c4db
--- /dev/null
+++ b/sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/src/main/scala/For.scala
@@ -0,0 +1,44 @@
+package somereallylongpackagenamethatwilltestsbtsanalyzer_somereallylongpackagenamethatwilltestsbtsanalyzer.somereallylongpackagenamethatwilltestsbtsanalyzer
+
+object T
+{
+ val y = List(3)
+ for(a <- y;
+ b <- y;
+ c <- y;
+ d <- y;
+ e <- y;
+ f <- y;
+ g <- y;
+ h <- y;
+ i <- y;
+ j <- y;
+ k <- y;
+ l <- y;
+ m <- y;
+ n <- y;
+ o <- y;
+ p <- y;
+ q <- y;
+ r <- y;
+ s <- y;
+ t <- y;
+ u <- y;
+ v <- y;
+ w <- y;
+ x <- y;
+ yx <- y;
+ z <- y;
+ aa <- y;
+ bb <- y;
+ cc <- y;
+ dd <- y;
+ ee <- y;
+ ff <- y;
+ gg <- y;
+ hh<- y;
+ ii <- y;
+ jj <- y;
+ kk <- y
+ ) yield a + b + c + d + e
+} \ No newline at end of file
diff --git a/sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/src/main/scala/Nested.scala b/sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/src/main/scala/Nested.scala
new file mode 100644
index 000000000..798868d72
--- /dev/null
+++ b/sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/src/main/scala/Nested.scala
@@ -0,0 +1,41 @@
+package test
+
+object TopLevelModule1
+{
+ object InnerModule1
+ {
+ object InnerModule2
+ {
+ trait Z { def q = 3 }
+ def x = 3
+ }
+ }
+ class InnerClass1
+ {
+ class InnerClass2
+ {
+ val z = new TopLevelModule1.InnerClass2
+ }
+ object InnerModule3
+ {
+ val y = new TopLevel1 with InnerModule1.InnerModule2.Z { val x = 4 }
+ }
+ }
+ class InnerClass2
+}
+class TopLevel1
+{
+ object Inner1_1
+}
+object TopLevel1
+{
+ class Inner1_2
+ object Inner1_2
+}
+
+object TopLevel2
+class TopLevel2
+
+object TopLevel3
+
+class TopLevel4 \ No newline at end of file
diff --git a/sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/test b/sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/test
new file mode 100644
index 000000000..e2abf578b
--- /dev/null
+++ b/sbt-bridge/bridge/src/sbt-test/source-dependencies/compactify/test
@@ -0,0 +1,8 @@
+# Marked pending due to https://github.com/sbt/sbt/issues/1553
+
+> output-empty
+> compile
+-> output-empty
+$ delete src/main/scala/For.scala src/main/scala/Nested.scala
+> compile
+> output-empty \ No newline at end of file