mirror of https://github.com/sbt/sbt.git
Remove int-ant-style test
This commit is contained in:
parent
ea941545e4
commit
5d8b3e7dd9
|
|
@ -1,30 +0,0 @@
|
||||||
logLevel := Level.Debug
|
|
||||||
|
|
||||||
incOptions := incOptions.value.withNameHashing(false).withAntStyle(true)
|
|
||||||
|
|
||||||
/* Performs checks related to compilations:
|
|
||||||
* a) checks in which compilation given set of files was recompiled
|
|
||||||
* b) checks overall number of compilations performed
|
|
||||||
*/
|
|
||||||
TaskKey[Unit]("check-compilations") := {
|
|
||||||
val analysis = (compile in Compile).value match { case analysis: Analysis => analysis }
|
|
||||||
val srcDir = (scalaSource in Compile).value
|
|
||||||
def relative(f: java.io.File): java.io.File = f.relativeTo(srcDir) getOrElse f
|
|
||||||
val allCompilations = analysis.compilations.allCompilations
|
|
||||||
val recompiledFiles: Seq[Set[java.io.File]] = allCompilations map { c =>
|
|
||||||
val recompiledFiles = analysis.apis.internal.collect {
|
|
||||||
case (file, api) if api.compilation.startTime == c.startTime => relative(file)
|
|
||||||
}
|
|
||||||
recompiledFiles.toSet
|
|
||||||
}
|
|
||||||
def recompiledFilesInIteration(iteration: Int, fileNames: Set[String]) = {
|
|
||||||
val files = fileNames.map(new java.io.File(_))
|
|
||||||
assert(recompiledFiles(iteration) == files, "%s != %s".format(recompiledFiles(iteration), files))
|
|
||||||
}
|
|
||||||
assert(allCompilations.size == 2)
|
|
||||||
// B.scala and C.scala are compiled at the beginning, in the Ant-style incremental compilation
|
|
||||||
// they are not rebuild when A.scala.
|
|
||||||
recompiledFilesInIteration(0, Set("B.scala", "C.scala"))
|
|
||||||
// A.scala is changed and recompiled
|
|
||||||
recompiledFilesInIteration(1, Set("A.scala"))
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
package test3
|
|
||||||
|
|
||||||
trait A
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
package test3
|
|
||||||
|
|
||||||
trait A {
|
|
||||||
def foo = 1
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
package test3
|
|
||||||
|
|
||||||
trait B extends A
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
package test3
|
|
||||||
|
|
||||||
trait C {
|
|
||||||
def abc(a: A): Int = a.foo
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
# introduces first compile iteration
|
|
||||||
> compile
|
|
||||||
# remove A.foo method
|
|
||||||
$ copy-file changes/A1.scala src/main/scala/A.scala
|
|
||||||
# recompiles just A.scala in Ant mode so it introduces one more iteration
|
|
||||||
> compile
|
|
||||||
# check if there are only two compile iterations performed
|
|
||||||
> check-compilations
|
|
||||||
Loading…
Reference in New Issue