Skip to content

Upgrade to sbt 1.4.4 #10498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
[submodule "community-build/community-projects/scalatest"]
path = community-build/community-projects/scalatest
url = https://github.com/dotty-staging/scalatest
[submodule "community-build/community-projects/scopt"]
path = community-build/community-projects/scopt
url = https://github.com/dotty-staging/scopt
[submodule "community-build/community-projects/squants"]
path = community-build/community-projects/squants
url = https://github.com/dotty-staging/squants
[submodule "community-build/community-projects/scalap"]
path = community-build/community-projects/scalap
url = https://github.com/dotty-staging/scala
Expand Down
2 changes: 1 addition & 1 deletion community-build/community-projects/minitest
Submodule minitest updated 35 files
+0 −55 .circleci/config.yml
+26 −0 .github/workflows/scala.yml
+3 −1 .gitignore
+0 −6 .travis.yml
+32 −0 CHANGES.md
+7 −8 README.md
+65 −197 build.sbt
+0 −41 jvm_js/src/main/scala/minitest/platform/package.scala
+0 −35 native/src/main/scala/minitest/platform/Await.scala
+0 −35 native/src/main/scala/minitest/platform/package.scala
+1 −1 project/build.properties
+6 −14 project/plugins.sbt
+1 −13 publish.sbt
+50 −0 shared/src/main/scala-2/minitest/macros/CompileMacros.scala
+40 −0 shared/src/main/scala-2/minitest/macros/SourceLocationMacros.scala
+31 −0 shared/src/main/scala-3/minitest/macros/CompileMacros.scala
+26 −0 shared/src/main/scala-3/minitest/macros/SourceLocationMacros.scala
+2 −2 shared/src/main/scala/minitest/api/AbstractTestSuite.scala
+5 −15 shared/src/main/scala/minitest/api/Asserts.scala
+2 −13 shared/src/main/scala/minitest/api/SourceLocation.scala
+3 −3 shared/src/main/scala/minitest/api/TestSpec.scala
+1 −1 shared/src/main/scala/minitest/api/package.scala
+0 −38 shared/src/main/scala/minitest/runner/ConsoleLogger.scala
+2 −4 shared/src/main/scala/minitest/runner/Framework.scala
+0 −34 shared/src/main/scala/minitest/runner/Options.scala
+2 −3 shared/src/main/scala/minitest/runner/Runner.scala
+15 −11 shared/src/main/scala/minitest/runner/Task.scala
+0 −37 shared/src/main/scala_2.10/minitest/api/compat.scala
+0 −37 shared/src/main/scala_2.11/minitest/api/compat.scala
+0 −37 shared/src/main/scala_2.12/minitest/api/compat.scala
+0 −37 shared/src/main/scala_2.13/minitest/api/compat.scala
+3 −3 shared/src/test/scala/minitest/tests/DoesNotCompileTest.scala
+1 −3 shared/src/test/scala/minitest/tests/EnvironmentTest.scala
+8 −6 shared/src/test/scala/minitest/tests/SimpleTest.scala
+6 −5 shared/src/test/scala/minitest/tests/SourceLocationTest.scala
2 changes: 1 addition & 1 deletion community-build/community-projects/scalacheck
Submodule scalacheck updated 65 files
+169 −0 .github/workflows/ci.yml
+59 −0 .github/workflows/clean.yml
+5 −10 .gitignore
+0 −6 .travis.yml
+278 −0 CHANGELOG.markdown
+30 −0 CONTRIBUTING.markdown
+5 −5 README.markdown
+0 −89 RELEASE.markdown
+19 −0 bench/README.markdown
+162 −0 bench/src/main/scala/org/scalacheck/bench/GenBench.scala
+182 −51 build.sbt
+42 −12 doc/UserGuide.md
+2 −4 examples/commands-leveldb/build.sbt
+1 −0 examples/commands-leveldb/project/build.properties
+2 −4 examples/commands-nix/build.sbt
+1 −0 examples/commands-nix/project/build.properties
+2 −2 examples/commands-redis/build.sbt
+1 −0 examples/commands-redis/project/build.properties
+5 −9 examples/scalajs/README.md
+2 −4 examples/scalajs/build.sbt
+1 −1 examples/scalajs/project/build.properties
+0 −1 examples/scalajs/project/build.sbt
+2 −0 examples/scalajs/project/plugins.sbt
+3 −3 examples/simple-sbt/build.sbt
+1 −0 examples/simple-sbt/project/build.properties
+130 −4 jvm/src/test/scala/org/scalacheck/GenSpecification.scala
+9 −8 jvm/src/test/scala/org/scalacheck/PropertyFilterSpecification.scala
+5 −0 jvm/src/test/scala/org/scalacheck/SerializabilitySpecification.scala
+69 −3 jvm/src/test/scala/org/scalacheck/TestSpecification.scala
+3 −1 jvm/src/test/scala/org/scalacheck/rng/SeedSpecification.scala
+0 −1 project/MimaSettings.scala
+1 −1 project/build.properties
+209 −0 project/codegen.scala
+22 −8 project/plugin.sbt
+61 −0 release.sh
+5 −0 src/main/scala-2.13+/org/scalacheck/ScalaVersionSpecific.scala
+2 −0 src/main/scala-2.13-/org/scalacheck/ScalaVersionSpecific.scala
+1 −1 src/main/scala-2.13-/org/scalacheck/util/BuildableVersionSpecific.scala
+15 −19 src/main/scala/org/scalacheck/Arbitrary.scala
+0 −234 src/main/scala/org/scalacheck/ArbitraryArities.scala
+1 −5 src/main/scala/org/scalacheck/Cogen.scala
+0 −510 src/main/scala/org/scalacheck/CogenArities.scala
+568 −129 src/main/scala/org/scalacheck/Gen.scala
+0 −756 src/main/scala/org/scalacheck/GenArities.scala
+53 −27 src/main/scala/org/scalacheck/Prop.scala
+22 −8 src/main/scala/org/scalacheck/Properties.scala
+91 −88 src/main/scala/org/scalacheck/ScalaCheckFramework.scala
+6 −1 src/main/scala/org/scalacheck/Shrink.scala
+185 −73 src/main/scala/org/scalacheck/Test.scala
+3 −3 src/main/scala/org/scalacheck/commands/Commands.scala
+6 −4 src/main/scala/org/scalacheck/rng/Seed.scala
+10 −29 src/main/scala/org/scalacheck/util/Buildable.scala
+24 −15 src/main/scala/org/scalacheck/util/CmdLineParser.scala
+2 −2 src/main/scala/org/scalacheck/util/ConsoleReporter.scala
+10 −8 src/main/scala/org/scalacheck/util/Pretty.scala
+36 −0 src/test/scala/org/scalacheck/NoPropertyNestingSpecification.scala
+39 −1 src/test/scala/org/scalacheck/PropSpecification.scala
+57 −37 src/test/scala/org/scalacheck/ShrinkSpecification.scala
+87 −0 src/test/scala/org/scalacheck/StatsSpecification.scala
+3 −3 src/test/scala/org/scalacheck/examples/Examples.scala
+1 −1 src/test/scala/org/scalacheck/examples/MathSpec.scala
+0 −0 src/test/scala/org/scalacheck/util/PrettySpecification.scala
+0 −217 tools/codegen.scala
+0 −5 tools/codegen.sh
+3 −3 tools/travis-script.sh
1 change: 0 additions & 1 deletion community-build/community-projects/scopt
Submodule scopt deleted from 36ab21
1 change: 0 additions & 1 deletion community-build/community-projects/squants
Submodule squants deleted from bbbb64
2 changes: 1 addition & 1 deletion community-build/community-projects/stdLib213
Submodule stdLib213 updated 858 files
44 changes: 23 additions & 21 deletions community-build/src/scala/dotty/communitybuild/projects.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,18 @@ final case class SbtCommunityProject(
dependencies: List[CommunityProject] = Nil,
sbtPublishCommand: String = null) extends CommunityProject:
override val binaryName: String = "sbt"
private val baseCommand = s";clean ;set logLevel in Global := Level.Error ;set updateOptions in Global ~= (_.withLatestSnapshots(false)) ;++$compilerVersion! "

val dependencyOverrides = List(
// dependencyOverrides doesn't seem to understand `%%%`
""""org.scalacheck" %% "scalacheck" % "1.15.2-SNAPSHOT"""",
""""org.scalacheck" %% "scalacheck_sjs1" % "1.15.2-SNAPSHOT""""
)

private val baseCommand =
"clean; set logLevel in Global := Level.Error; set updateOptions in Global ~= (_.withLatestSnapshots(false)); "
++ s"""set dependencyOverrides in ThisBuild ++= ${dependencyOverrides.mkString("Seq(", ", ", ")")}; """
++ s"++$compilerVersion!; "

override val testCommand = s"$baseCommand$sbtTestCommand"
override val publishCommand = s"$baseCommand$sbtPublishCommand"

Expand All @@ -85,7 +96,7 @@ final case class SbtCommunityProject(
if (forceUpgradeSbtScalajsPlugin) List(s"--addPluginSbtFile=$sbtScalaJSPluginFilePath")
else Nil
extraSbtArgs ++ sbtProps ++ List(
"-sbt-version", "1.3.8",
"-sbt-version", "1.4.4",
"-Dsbt.supershell=false",
s"--addPluginSbtFile=$sbtPluginFilePath"
) ++ scalaJSPluginArgs
Expand Down Expand Up @@ -172,14 +183,14 @@ object projects:

lazy val scalacheck = SbtCommunityProject(
project = "scalacheck",
sbtTestCommand = "jvm/test",
sbtPublishCommand = ";set jvm/publishArtifact in (Compile, packageDoc) := false ;jvm/publishLocal"
sbtTestCommand = "jvm/test;js/test",
sbtPublishCommand = "jvm/publishLocal;js/publishLocal"
)

lazy val scalatest = SbtCommunityProject(
project = "scalatest",
sbtTestCommand = ";scalacticDotty/clean;scalacticTestDotty/test;scalatestTestDotty/test",
sbtPublishCommand = ";scalacticDotty/publishLocal; scalatestDotty/publishLocal"
sbtTestCommand = "scalacticDotty/clean;scalacticTestDotty/test; scalatestTestDotty/test",
sbtPublishCommand = "scalacticDotty/publishLocal; scalatestDotty/publishLocal"
)

lazy val scalatestplusScalacheck = SbtCommunityProject(
Expand All @@ -194,21 +205,11 @@ object projects:
sbtTestCommand = "xml/test",
)

lazy val scopt = SbtCommunityProject(
project = "scopt",
sbtTestCommand = "scoptJVM/compile",
)

lazy val scalap = SbtCommunityProject(
project = "scalap",
sbtTestCommand = "scalap/compile",
)

lazy val squants = SbtCommunityProject(
project = "squants",
sbtTestCommand = "squantsJVM/compile",
)

lazy val betterfiles = SbtCommunityProject(
project = "betterfiles",
sbtTestCommand = "dotty-community-build/compile",
Expand All @@ -221,7 +222,8 @@ object projects:

lazy val minitest = SbtCommunityProject(
project = "minitest",
sbtTestCommand = "dotty-community-build/compile",
sbtTestCommand = "test",
dependencies = List(scalacheck)
)

lazy val fastparse = SbtCommunityProject(
Expand All @@ -233,7 +235,7 @@ object projects:
project = "stdLib213",
extraSbtArgs = List("-Dscala.build.compileWithDotty=true"),
sbtTestCommand = """library/compile""",
sbtPublishCommand = """;set publishArtifact in (library, Compile, packageDoc) := false ;library/publishLocal""",
sbtPublishCommand = """set publishArtifact in (library, Compile, packageDoc) := false ;library/publishLocal""",
)

lazy val shapeless = SbtCommunityProject(
Expand All @@ -256,9 +258,9 @@ object projects:
// has not been updated since 2018, so no 2.13 compat. Some akka tests are dropped due to MutableBehaviour being
// dropped in the 2.13 compatible release

// sbtTestCommand = ";set ThisBuild / useEffpiPlugin := false; effpi/test:compile; plugin/test:compile; benchmarks/test:compile; examples/test:compile; pluginBenchmarks/test:compile",
// sbtTestCommand = "set ThisBuild / useEffpiPlugin := false; effpi/test:compile; plugin/test:compile; benchmarks/test:compile; examples/test:compile; pluginBenchmarks/test:compile",

sbtTestCommand = ";set ThisBuild / useEffpiPlugin := false; effpi/test:compile; benchmarks/test:compile; examples/test:compile; pluginBenchmarks/test:compile",
sbtTestCommand = "set ThisBuild / useEffpiPlugin := false; effpi/test:compile; benchmarks/test:compile; examples/test:compile; pluginBenchmarks/test:compile",
)

// TODO @odersky? It got broken by #5458
Expand Down Expand Up @@ -313,7 +315,7 @@ object projects:

lazy val endpoints4s = SbtCommunityProject(
project = "endpoints4s",
sbtTestCommand = ";json-schemaJVM/compile;algebraJVM/compile;openapiJVM/compile;http4s-server/compile;http4s-client/compile;play-server/compile;play-client/compile;akka-http-server/compile;akka-http-client/compile"
sbtTestCommand = "json-schemaJVM/compile;algebraJVM/compile;openapiJVM/compile;http4s-server/compile;http4s-client/compile;play-server/compile;play-client/compile;akka-http-server/compile;akka-http-client/compile"
)

lazy val catsEffect2 = SbtCommunityProject(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ class CommunityBuildTestB extends CommunityBuildTest:
@Test def scalaz = projects.scalaz.run()
@Test def scas = projects.scas.run()
@Test def sconfig = projects.sconfig.run()
@Test def scopt = projects.scopt.run()
@Test def shapeless = projects.shapeless.run()
@Test def squants = projects.squants.run()
@Test def stdLib213 = projects.stdLib213.run()
@Test def xmlInterpolator = projects.xmlInterpolator.run()
@Test def zio = projects.zio.run()
Expand Down
15 changes: 14 additions & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,14 @@ object Build {
}
// Do not cut off the bottom of large stack traces (default is 1024)
"-XX:MaxJavaStackTraceDepth=1000000" :: agentOptions ::: ciOptions
}
},

excludeLintKeys ++= Set(
// We set these settings in `commonSettings`, if a project
// uses `commonSettings` but overrides `unmanagedSourceDirectories`,
// sbt will complain if we don't exclude them here.
Keys.scalaSource, Keys.javaSource
),
)

lazy val disableDocSetting =
Expand Down Expand Up @@ -1197,6 +1204,12 @@ object Build {
unmanagedSourceDirectories in Compile +=
baseDirectory.value / "../language-server/src/dotty/tools/languageserver/config",
sbtTestDirectory := baseDirectory.value / "sbt-test",

// The batch mode accidentally became the default with no way to disable
// it in sbt 1.4 (https://github.com/sbt/sbt/issues/5913#issuecomment-716003195).
// We enable it explicitly here to make it clear that we're using it.
scriptedBatchExecution := true,

scriptedLaunchOpts ++= Seq(
"-Dplugin.version=" + version.value,
"-Dplugin.scalaVersion=" + dottyVersion,
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.3.12
sbt.version=1.4.4
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
import sbt.internal.inc.Analysis
import complete.DefaultParsers._

InputKey[Unit]("check-number-of-compiler-iterations") := {
val args = spaceDelimited("<arg>").parsed
val a = (compile in Compile).value.asInstanceOf[sbt.internal.inc.Analysis]
assert(args.size == 1)
val expectedIterationsNumber = args(0).toInt
assert(a.compilations.allCompilations.size == expectedIterationsNumber, "a.compilations.allCompilations.size = %d (expected %d)".format(a.compilations.allCompilations.size, expectedIterationsNumber))
// 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")
}
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
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
> recordPreviousIterations
# Test for separate compilation and proper value of
# the OVERRIDE flag when abstract types, type alias
# and structural type are involved
Expand All @@ -11,4 +12,4 @@ $ copy-file changes/Bar1.scala src/main/scala/Bar.scala
# second iteration
#> compile
# check if there are only two compile iterations performed
> checkNumberOfCompilerIterations 2
> checkIterations 2
23 changes: 18 additions & 5 deletions sbt-dotty/sbt-test/source-dependencies/canon/build.sbt
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
import sbt.internal.inc.Analysis
import complete.DefaultParsers._

val checkIterations = inputKey[Unit]("Verifies the accumlated number of iterations of incremental compilation.")
// 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
}
}
}

checkIterations := {
val analysis = (compile in Compile).value.asInstanceOf[sbt.internal.inc.Analysis]
val checkIterations = inputKey[Unit]("Verifies the accumulated number of iterations of incremental compilation.")

checkIterations := {
val expected: Int = (Space ~> NatBasic).parsed
val actual: Int = analysis.compilations.allCompilations.size
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")
}

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
}
1 change: 1 addition & 0 deletions sbt-dotty/sbt-test/source-dependencies/canon/test
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
> recordPreviousIterations
# Tests that classpath entries that are different than their canonical representation are
# handled properly. In particular, a symlink from lib/a.jar to lib/../actual/a.jar.0 is
# available on the classpath and read by scalac. scalac 2.10.x does not interpret .jar.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
import sbt.internal.inc.Analysis
import complete.DefaultParsers._

val checkIterations = inputKey[Unit]("Verifies the accumlated number of iterations of incremental compilation.")
// 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
}
}
}

checkIterations := {
val analysis = (compile in Compile).value.asInstanceOf[sbt.internal.inc.Analysis]
val checkIterations = inputKey[Unit]("Verifies the accumulated number of iterations of incremental compilation.")

checkIterations := {
val expected: Int = (Space ~> NatBasic).parsed
val actual: Int = analysis.compilations.allCompilations.size
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")
}

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
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
> recordPreviousIterations
> compile
$ copy-file changes/A2.scala A.scala
# Second compilation round, there should be no third round (we don't need to recompile B.scala)
Expand Down
23 changes: 18 additions & 5 deletions sbt-dotty/sbt-test/source-dependencies/inline-inherited/build.sbt
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
import sbt.internal.inc.Analysis
import complete.DefaultParsers._

val checkIterations = inputKey[Unit]("Verifies the accumlated number of iterations of incremental compilation.")
// 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
}
}
}

checkIterations := {
val analysis = (compile in Compile).value.asInstanceOf[sbt.internal.inc.Analysis]
val checkIterations = inputKey[Unit]("Verifies the accumulated number of iterations of incremental compilation.")

checkIterations := {
val expected: Int = (Space ~> NatBasic).parsed
val actual: Int = analysis.compilations.allCompilations.size
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")
}

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
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
> recordPreviousIterations
> compile
# Force recompilation of B, B.getInline hasn't changed so C shouldn't be recompiled.
$ copy-file changes/B1.scala B.scala
Expand Down
23 changes: 18 additions & 5 deletions sbt-dotty/sbt-test/source-dependencies/inner-class/build.sbt
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
import sbt.internal.inc.Analysis
import complete.DefaultParsers._

val checkIterations = inputKey[Unit]("Verifies the accumlated number of iterations of incremental compilation.")
// 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
}
}
}

checkIterations := {
val analysis = (compile in Compile).value.asInstanceOf[sbt.internal.inc.Analysis]
val checkIterations = inputKey[Unit]("Verifies the accumulated number of iterations of incremental compilation.")

checkIterations := {
val expected: Int = (Space ~> NatBasic).parsed
val actual: Int = analysis.compilations.allCompilations.size
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")
}

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
}
1 change: 1 addition & 0 deletions sbt-dotty/sbt-test/source-dependencies/inner-class/test
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
> recordPreviousIterations
> run

# Recompile B (no meaningful change, this is just so that the dependencies on A.InnerClass are
Expand Down
Loading