[2.x] fix: Fix pipelining flags applied to unsupported Scala versions (#8499)

Scala 2.x has supported pipelining since 2020. The fix now allows:
- All Scala 2.x versions (pipelining supported)
- Scala 3.5.0+ (pipelining added in 3.5)

Generated-by: AI-assisted
This commit is contained in:
Satoshi Dev 2026-01-12 19:44:49 -08:00 committed by GitHub
parent aeabb90d2d
commit 3a9e1ec725
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 8 deletions

View File

@ -1016,15 +1016,17 @@ object Defaults extends BuildCommon {
},
scalacOptions := {
val old = scalacOptions.value
if (exportPipelining.value)
Def.uncached(
Vector(
"-Ypickle-java",
"-Ypickle-write",
earlyOutput.value.toString
) ++ old
if (exportPipelining.value) {
val sv = scalaVersion.value
val shouldApplyFlags = !ScalaArtifacts.isScala3(sv) || VersionNumber(sv).matchesSemVer(
SemanticSelector(">=3.5.0")
)
else Def.uncached(old)
if (shouldApplyFlags)
Def.uncached(
Vector("-Ypickle-java", "-Ypickle-write", earlyOutput.value.toString) ++ old
)
else Def.uncached(old)
} else Def.uncached(old)
},
scalacOptions := {
val old = scalacOptions.value