mirror of https://github.com/sbt/sbt.git
Merge pull request #1328 from gkossakowski/cleanup-incremental-tests
Cleanup incremental tests
This commit is contained in:
commit
bb8bb1e667
|
|
@ -6,11 +6,13 @@ incOptions := incOptions.value.withAntStyle(true)
|
||||||
* a) checks in which compilation given set of files was recompiled
|
* a) checks in which compilation given set of files was recompiled
|
||||||
* b) checks overall number of compilations performed
|
* b) checks overall number of compilations performed
|
||||||
*/
|
*/
|
||||||
TaskKey[Unit]("check-compilations") <<= (compile in Compile, scalaSource in Compile) map { (a: sbt.inc.Analysis, src: java.io.File) =>
|
TaskKey[Unit]("check-compilations") := {
|
||||||
def relative(f: java.io.File): java.io.File = f.relativeTo(src) getOrElse f
|
val analysis = (compile in Compile).value
|
||||||
val allCompilations = a.compilations.allCompilations
|
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: Seq[Set[java.io.File]] = allCompilations map { c =>
|
||||||
val recompiledFiles = a.apis.internal.collect {
|
val recompiledFiles = analysis.apis.internal.collect {
|
||||||
case (file, api) if api.compilation.startTime == c.startTime => relative(file)
|
case (file, api) if api.compilation.startTime == c.startTime => relative(file)
|
||||||
}
|
}
|
||||||
recompiledFiles.toSet
|
recompiledFiles.toSet
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
# introduces first compile iteration
|
# introduces first compile iteration
|
||||||
> compile
|
> compile
|
||||||
# this change is local to method and does not change api so introduces
|
# remove A.foo method
|
||||||
# only one additional compile iteration
|
|
||||||
$ copy-file changes/A1.scala src/main/scala/A.scala
|
$ copy-file changes/A1.scala src/main/scala/A.scala
|
||||||
# second iteration
|
# recompiles just A.scala in Ant mode so it introduces one more iteration
|
||||||
> compile
|
> compile
|
||||||
# check if there are only two compile iterations performed
|
# check if there are only two compile iterations performed
|
||||||
> check-compilations
|
> check-compilations
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,13 @@ incOptions := incOptions.value.copy(recompileAllFraction = 1.0)
|
||||||
* a) checks in which compilation given set of files was recompiled
|
* a) checks in which compilation given set of files was recompiled
|
||||||
* b) checks overall number of compilations performed
|
* b) checks overall number of compilations performed
|
||||||
*/
|
*/
|
||||||
TaskKey[Unit]("check-compilations") <<= (compile in Compile, scalaSource in Compile) map { (a: sbt.inc.Analysis, src: java.io.File) =>
|
TaskKey[Unit]("check-compilations") := {
|
||||||
def relative(f: java.io.File): java.io.File = f.relativeTo(src) getOrElse f
|
val analysis = (compile in Compile).value
|
||||||
val allCompilations = a.compilations.allCompilations
|
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: Seq[Set[java.io.File]] = allCompilations map { c =>
|
||||||
val recompiledFiles = a.apis.internal.collect {
|
val recompiledFiles = analysis.apis.internal.collect {
|
||||||
case (file, api) if api.compilation.startTime == c.startTime => relative(file)
|
case (file, api) if api.compilation.startTime == c.startTime => relative(file)
|
||||||
}
|
}
|
||||||
recompiledFiles.toSet
|
recompiledFiles.toSet
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue