-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12931 from dotty-staging/fix-11861
Fix #11861 - hash nested calls to inline definitions
- Loading branch information
Showing
88 changed files
with
919 additions
and
63 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
sbt-test/source-dependencies/extension-change-second-tparams/A.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
object A { | ||
|
||
class Box[T](val value: T) | ||
|
||
extension (box: Box[Int]) def map[I <: Int](f: Int => I): Box[I] = new Box(f(box.value)) | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
sbt-test/source-dependencies/extension-change-second-tparams/B.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import A.Box | ||
import A.map | ||
|
||
class B { | ||
val n = Box(5).map(x => x * 3) | ||
} |
25 changes: 25 additions & 0 deletions
25
sbt-test/source-dependencies/extension-change-second-tparams/build.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import sbt.internal.inc.Analysis | ||
import complete.DefaultParsers._ | ||
|
||
// Reset compiler iterations, necessary because tests run in batch mode | ||
val recordPreviousIterations = taskKey[Unit]("Record previous iterations.") | ||
recordPreviousIterations := { | ||
val log = streams.value.log | ||
CompileState.previousIterations = { | ||
val previousAnalysis = (previousCompile in Compile).value.analysis.asScala | ||
previousAnalysis match { | ||
case None => | ||
log.info("No previous analysis detected") | ||
0 | ||
case Some(a: Analysis) => a.compilations.allCompilations.size | ||
} | ||
} | ||
} | ||
|
||
val checkIterations = inputKey[Unit]("Verifies the accumulated number of iterations of incremental compilation.") | ||
|
||
checkIterations := { | ||
val expected: Int = (Space ~> NatBasic).parsed | ||
val actual: Int = ((compile in Compile).value match { case a: Analysis => a.compilations.allCompilations.size }) - CompileState.previousIterations | ||
assert(expected == actual, s"Expected $expected compilations, got $actual") | ||
} |
7 changes: 7 additions & 0 deletions
7
sbt-test/source-dependencies/extension-change-second-tparams/changes/A1.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
object A { | ||
|
||
class Box[T](val value: T) | ||
|
||
extension (box: Box[Int]) def map[I](f: Int => I): Box[I] = new Box(f(box.value)) | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
sbt-test/source-dependencies/extension-change-second-tparams/project/CompileState.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// This is necessary because tests are run in batch mode | ||
object CompileState { | ||
@volatile var previousIterations: Int = -1 | ||
} |
11 changes: 11 additions & 0 deletions
11
...est/source-dependencies/extension-change-second-tparams/project/DottyInjectedPlugin.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import sbt._ | ||
import Keys._ | ||
|
||
object DottyInjectedPlugin extends AutoPlugin { | ||
override def requires = plugins.JvmPlugin | ||
override def trigger = allRequirements | ||
|
||
override val projectSettings = Seq( | ||
scalaVersion := sys.props("plugin.scalaVersion") | ||
) | ||
} |
7 changes: 7 additions & 0 deletions
7
sbt-test/source-dependencies/extension-change-second-tparams/test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
> compile | ||
> recordPreviousIterations | ||
# Force recompilation of B because A.map, called by B.n, has changed | ||
$ copy-file changes/A1.scala A.scala | ||
> compile | ||
# 1 to recompile A, then 1 more to recompile B due to A.map change | ||
> checkIterations 2 |
5 changes: 5 additions & 0 deletions
5
sbt-test/source-dependencies/inline-rec-change-inline/A.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
object A { | ||
|
||
inline def callInline: Any = B.inlinedAny("yyy") | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
sbt-test/source-dependencies/inline-rec-change-inline/B.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
object B { | ||
|
||
inline def inlinedAny(x: String): x.type = x | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
sbt-test/source-dependencies/inline-rec-change-inline/C.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class C { | ||
val n = A.callInline | ||
} |
25 changes: 25 additions & 0 deletions
25
sbt-test/source-dependencies/inline-rec-change-inline/build.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import sbt.internal.inc.Analysis | ||
import complete.DefaultParsers._ | ||
|
||
// Reset compiler iterations, necessary because tests run in batch mode | ||
val recordPreviousIterations = taskKey[Unit]("Record previous iterations.") | ||
recordPreviousIterations := { | ||
val log = streams.value.log | ||
CompileState.previousIterations = { | ||
val previousAnalysis = (previousCompile in Compile).value.analysis.asScala | ||
previousAnalysis match { | ||
case None => | ||
log.info("No previous analysis detected") | ||
0 | ||
case Some(a: Analysis) => a.compilations.allCompilations.size | ||
} | ||
} | ||
} | ||
|
||
val checkIterations = inputKey[Unit]("Verifies the accumulated number of iterations of incremental compilation.") | ||
|
||
checkIterations := { | ||
val expected: Int = (Space ~> NatBasic).parsed | ||
val actual: Int = ((compile in Compile).value match { case a: Analysis => a.compilations.allCompilations.size }) - CompileState.previousIterations | ||
assert(expected == actual, s"Expected $expected compilations, got $actual") | ||
} |
5 changes: 5 additions & 0 deletions
5
sbt-test/source-dependencies/inline-rec-change-inline/changes/B1.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
object B { | ||
|
||
inline def inlinedAny(inline x: String): x.type = x | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
sbt-test/source-dependencies/inline-rec-change-inline/project/CompileState.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// This is necessary because tests are run in batch mode | ||
object CompileState { | ||
@volatile var previousIterations: Int = -1 | ||
} |
11 changes: 11 additions & 0 deletions
11
sbt-test/source-dependencies/inline-rec-change-inline/project/DottyInjectedPlugin.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import sbt._ | ||
import Keys._ | ||
|
||
object DottyInjectedPlugin extends AutoPlugin { | ||
override def requires = plugins.JvmPlugin | ||
override def trigger = allRequirements | ||
|
||
override val projectSettings = Seq( | ||
scalaVersion := sys.props("plugin.scalaVersion") | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
> compile | ||
> recordPreviousIterations | ||
# Force recompilation of A because B.inlinedAny, called by A.callInline, has added | ||
# the inline flag to one of its parameters. | ||
$ copy-file changes/B1.scala B.scala | ||
> compile | ||
# 1 to recompile B, then 1 more to recompile A due to B.inlinedAny change, | ||
# then 1 final compilation to recompile C due to A.callInline change | ||
> checkIterations 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
object A { | ||
|
||
inline def callInline: Any = B.inlinedAny("yyy") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
object B { | ||
|
||
inline def inlinedAny(x: String): x.type = x | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class C { | ||
val n = A.callInline | ||
} |
25 changes: 25 additions & 0 deletions
25
sbt-test/source-dependencies/inline-rec-change-param/build.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import sbt.internal.inc.Analysis | ||
import complete.DefaultParsers._ | ||
|
||
// Reset compiler iterations, necessary because tests run in batch mode | ||
val recordPreviousIterations = taskKey[Unit]("Record previous iterations.") | ||
recordPreviousIterations := { | ||
val log = streams.value.log | ||
CompileState.previousIterations = { | ||
val previousAnalysis = (previousCompile in Compile).value.analysis.asScala | ||
previousAnalysis match { | ||
case None => | ||
log.info("No previous analysis detected") | ||
0 | ||
case Some(a: Analysis) => a.compilations.allCompilations.size | ||
} | ||
} | ||
} | ||
|
||
val checkIterations = inputKey[Unit]("Verifies the accumulated number of iterations of incremental compilation.") | ||
|
||
checkIterations := { | ||
val expected: Int = (Space ~> NatBasic).parsed | ||
val actual: Int = ((compile in Compile).value match { case a: Analysis => a.compilations.allCompilations.size }) - CompileState.previousIterations | ||
assert(expected == actual, s"Expected $expected compilations, got $actual") | ||
} |
5 changes: 5 additions & 0 deletions
5
sbt-test/source-dependencies/inline-rec-change-param/changes/B1.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
object B { | ||
|
||
inline def inlinedAny(x: Any): x.type = x | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
sbt-test/source-dependencies/inline-rec-change-param/project/CompileState.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// This is necessary because tests are run in batch mode | ||
object CompileState { | ||
@volatile var previousIterations: Int = -1 | ||
} |
11 changes: 11 additions & 0 deletions
11
sbt-test/source-dependencies/inline-rec-change-param/project/DottyInjectedPlugin.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import sbt._ | ||
import Keys._ | ||
|
||
object DottyInjectedPlugin extends AutoPlugin { | ||
override def requires = plugins.JvmPlugin | ||
override def trigger = allRequirements | ||
|
||
override val projectSettings = Seq( | ||
scalaVersion := sys.props("plugin.scalaVersion") | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
> compile | ||
> recordPreviousIterations | ||
# Force recompilation of A because B.inlinedAny, called by A.callInline, has changed | ||
# the type of its parameters. | ||
$ copy-file changes/B1.scala B.scala | ||
> compile | ||
# 1 to recompile B, then 1 more to recompile A due to B.inlinedAny change, | ||
# then 1 final compilation to recompile C due to A.callInline change | ||
> checkIterations 3 |
5 changes: 5 additions & 0 deletions
5
sbt-test/source-dependencies/inline-rec-change-res-transparent/A.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
object A { | ||
|
||
inline def callInline: Any = B.inlinedAny("yyy") | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
sbt-test/source-dependencies/inline-rec-change-res-transparent/B.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
object B { | ||
|
||
transparent inline def inlinedAny(x: String): x.type = x | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
sbt-test/source-dependencies/inline-rec-change-res-transparent/C.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class C { | ||
val n = A.callInline | ||
} |
25 changes: 25 additions & 0 deletions
25
sbt-test/source-dependencies/inline-rec-change-res-transparent/build.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import sbt.internal.inc.Analysis | ||
import complete.DefaultParsers._ | ||
|
||
// Reset compiler iterations, necessary because tests run in batch mode | ||
val recordPreviousIterations = taskKey[Unit]("Record previous iterations.") | ||
recordPreviousIterations := { | ||
val log = streams.value.log | ||
CompileState.previousIterations = { | ||
val previousAnalysis = (previousCompile in Compile).value.analysis.asScala | ||
previousAnalysis match { | ||
case None => | ||
log.info("No previous analysis detected") | ||
0 | ||
case Some(a: Analysis) => a.compilations.allCompilations.size | ||
} | ||
} | ||
} | ||
|
||
val checkIterations = inputKey[Unit]("Verifies the accumulated number of iterations of incremental compilation.") | ||
|
||
checkIterations := { | ||
val expected: Int = (Space ~> NatBasic).parsed | ||
val actual: Int = ((compile in Compile).value match { case a: Analysis => a.compilations.allCompilations.size }) - CompileState.previousIterations | ||
assert(expected == actual, s"Expected $expected compilations, got $actual") | ||
} |
5 changes: 5 additions & 0 deletions
5
sbt-test/source-dependencies/inline-rec-change-res-transparent/changes/B1.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
object B { | ||
|
||
transparent inline def inlinedAny(x: String): String = x | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
sbt-test/source-dependencies/inline-rec-change-res-transparent/project/CompileState.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// This is necessary because tests are run in batch mode | ||
object CompileState { | ||
@volatile var previousIterations: Int = -1 | ||
} |
11 changes: 11 additions & 0 deletions
11
...t/source-dependencies/inline-rec-change-res-transparent/project/DottyInjectedPlugin.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import sbt._ | ||
import Keys._ | ||
|
||
object DottyInjectedPlugin extends AutoPlugin { | ||
override def requires = plugins.JvmPlugin | ||
override def trigger = allRequirements | ||
|
||
override val projectSettings = Seq( | ||
scalaVersion := sys.props("plugin.scalaVersion") | ||
) | ||
} |
9 changes: 9 additions & 0 deletions
9
sbt-test/source-dependencies/inline-rec-change-res-transparent/test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
> compile | ||
> recordPreviousIterations | ||
# Force recompilation of A because B.inlinedAny, called by A.callInline, has changed | ||
# the type of its result, while being an inline method. | ||
$ copy-file changes/B1.scala B.scala | ||
> compile | ||
# 1 to recompile B, then 1 more to recompile A due to B.inlinedAny change, | ||
# then 1 final compilation to recompile C due to A.callInline change | ||
> checkIterations 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
object A { | ||
|
||
inline def callInline: Any = B.inlinedAny("yyy") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
object B { | ||
|
||
inline def inlinedAny(x: String): x.type = x | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class C { | ||
val n = A.callInline | ||
} |
25 changes: 25 additions & 0 deletions
25
sbt-test/source-dependencies/inline-rec-change-res/build.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import sbt.internal.inc.Analysis | ||
import complete.DefaultParsers._ | ||
|
||
// Reset compiler iterations, necessary because tests run in batch mode | ||
val recordPreviousIterations = taskKey[Unit]("Record previous iterations.") | ||
recordPreviousIterations := { | ||
val log = streams.value.log | ||
CompileState.previousIterations = { | ||
val previousAnalysis = (previousCompile in Compile).value.analysis.asScala | ||
previousAnalysis match { | ||
case None => | ||
log.info("No previous analysis detected") | ||
0 | ||
case Some(a: Analysis) => a.compilations.allCompilations.size | ||
} | ||
} | ||
} | ||
|
||
val checkIterations = inputKey[Unit]("Verifies the accumulated number of iterations of incremental compilation.") | ||
|
||
checkIterations := { | ||
val expected: Int = (Space ~> NatBasic).parsed | ||
val actual: Int = ((compile in Compile).value match { case a: Analysis => a.compilations.allCompilations.size }) - CompileState.previousIterations | ||
assert(expected == actual, s"Expected $expected compilations, got $actual") | ||
} |
Oops, something went wrong.