Skip to content
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

Fix presentation compiler testcases #22253

Merged
merged 1 commit into from
Dec 20, 2024
Merged
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
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
Loading