Skip to content

Commit

Permalink
Merge pull request #219 from jvican/1.0
Browse files Browse the repository at this point in the history
Mark compactify as a passing test
  • Loading branch information
eed3si9n authored Feb 6, 2017
2 parents 1141564 + 92c5ba2 commit 511ad6c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ final class IncHandler(directory: File, scriptedLog: Logger) extends BridgeProvi
p.checkMessage(index.toInt, expected, Severity.Error)
case (p, other, _) =>
p.unrecognizedArguments("checkError", other)
},
"checkNoClassFiles" -> {
case (p, Nil, i) =>
p.checkNoGeneratedClassFiles()
()
case (p, xs, _) => p.acceptsNoArguments("checkNoClassFiles", xs)
}
)

Expand All @@ -207,6 +213,7 @@ case class ProjectStructure(name: String, dependsOn: Vector[String], baseDirecto
}
val targetDir = baseDirectory / "target"
val classesDir = targetDir / "classes"
val generatedClassFiles = classesDir ** "*.class"
val scalaSourceDirectory = baseDirectory / "src" / "main" / "scala"
val javaSourceDirectory = baseDirectory / "src" / "main" / "java"
def scalaSources: List[File] =
Expand Down Expand Up @@ -301,6 +308,12 @@ case class ProjectStructure(name: String, dependsOn: Vector[String], baseDirecto
()
}

def checkNoGeneratedClassFiles(): Unit = {
val allClassFiles = generatedClassFiles.get.mkString("\n\t")
if (!allClassFiles.isEmpty)
sys.error(s"Classes existed:\n\t$allClassFiles")
}

def checkDependencies(i: IncInstance, className: String, expected: List[String]): Unit = {
val analysis = compile(i)
def classDeps(cls: String): Set[String] = analysis.relations.internalClassDep.forward(cls)
Expand Down
5 changes: 0 additions & 5 deletions zinc/src/sbt-test/source-dependencies/compactify/build.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
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
Expand Down
8 changes: 0 additions & 8 deletions zinc/src/sbt-test/source-dependencies/compactify/pending

This file was deleted.

6 changes: 6 additions & 0 deletions zinc/src/sbt-test/source-dependencies/compactify/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
> checkNoClassFiles
> compile
-> checkNoClassFiles
$ delete src/main/scala/For.scala src/main/scala/Nested.scala
> compile
> checkNoClassFiles

0 comments on commit 511ad6c

Please sign in to comment.