Skip to content

Commit

Permalink
Fix presentation compiler testcases (#22253)
Browse files Browse the repository at this point in the history
This PR fixes the scala3-presentation-compiler-testcases dependency of scala3-presentation-compiler to be test-only.
  • Loading branch information
mbovel authored Dec 20, 2024
2 parents 0bfa1af + ad6e194 commit 8a2961b
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ object Build {
* Reference version should track the latest version pushed to Maven:
* - In main branch it should be the last RC version
* - In release branch it should be the last stable release
*
* Warning: Change of this variable needs to be consulted with `expectedTastyVersion`
*
* Warning: Change of this variable needs to be consulted with `expectedTastyVersion`
*/
val referenceVersion = "3.6.3-RC1"

Expand All @@ -106,8 +106,8 @@ object Build {
*
* Should only be referred from `dottyVersion` or settings/tasks requiring simplified version string,
* eg. `compatMode` or Windows native distribution version.
*
* Warning: Change of this variable might require updating `expectedTastyVersion`
*
* Warning: Change of this variable might require updating `expectedTastyVersion`
*/
val developedVersion = "3.6.4"

Expand All @@ -119,13 +119,13 @@ object Build {
* During final, stable release is set exactly to `developedVersion`.
*/
val baseVersion = s"$developedVersion-RC1"
/** The version of TASTY that should be emitted, checked in runtime test
* For defails on how TASTY version should be set see related discussions:

/** The version of TASTY that should be emitted, checked in runtime test
* For defails on how TASTY version should be set see related discussions:
* - https://github.com/scala/scala3/issues/13447#issuecomment-912447107
* - https://github.com/scala/scala3/issues/14306#issuecomment-1069333516
* - https://github.com/scala/scala3/pull/19321
*
*
* Simplified rules, given 3.$minor.$patch = $developedVersion
* - Major version is always 28
* - TASTY minor version:
Expand Down Expand Up @@ -1447,7 +1447,7 @@ object Build {

lazy val `scala3-presentation-compiler` = project.in(file("presentation-compiler"))
.withCommonSettings(Bootstrapped)
.dependsOn(`scala3-compiler-bootstrapped`, `scala3-library-bootstrapped`, `scala3-presentation-compiler-testcases`)
.dependsOn(`scala3-compiler-bootstrapped`, `scala3-library-bootstrapped`, `scala3-presentation-compiler-testcases` % "test->test")
.settings(presentationCompilerSettings)
.settings(scala3PresentationCompilerBuildInfo)
.settings(
Expand Down Expand Up @@ -2505,7 +2505,7 @@ object Build {
case Bootstrapped => commonBootstrappedSettings
})
}

/* Tests TASTy version invariants during NIGHLY, RC or Stable releases */
def checkReleasedTastyVersion(): Unit = {
lazy val (scalaMinor, scalaPatch, scalaIsRC) = baseVersion.split("\\.|-").take(4) match {
Expand All @@ -2518,19 +2518,19 @@ object Build {
case Array("28", minor, "experimental", _) => (minor.toInt, true)
case other => sys.error(s"Invalid TASTy version string: $expectedTastyVersion")
}

if(isNightly) {
assert(tastyIsExperimental, "TASTY needs to be experimental in nightly builds")
val expectedTastyMinor = if(scalaPatch == 0) scalaMinor else scalaMinor + 1
assert(tastyMinor == expectedTastyMinor, "Invalid TASTy minor version")
}

if(isRelease) {
assert(scalaMinor == tastyMinor, "Minor versions of TASTY vesion and Scala version should match in release builds")
if (scalaIsRC && scalaPatch == 0)
assert(tastyIsExperimental, "TASTy should be experimental when releasing a new minor version RC")
else
assert(!tastyIsExperimental, "Stable version cannot use experimental TASTY")
assert(!tastyIsExperimental, "Stable version cannot use experimental TASTY")
}
}
}
Expand Down

0 comments on commit 8a2961b

Please sign in to comment.