Skip to content

Commit

Permalink
Phiscally remove the ignored Scala 2 library-aux files instead of fil…
Browse files Browse the repository at this point in the history
…tering them out in `Compile / sources` (not reliable, for some reasone the AnyRef.scala was still compiled)

[Cherry-picked 2a142cd][modified]
  • Loading branch information
WojciechMazur committed Jul 10, 2024
1 parent 7b225e6 commit 5d56503
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
16 changes: 15 additions & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,21 @@ object Build {
IO.createDirectory(trgDir)
IO.unzip(scalaLibrarySourcesJar, trgDir)

((trgDir ** "*.scala") +++ (trgDir ** "*.java")).get.toSet
val (ignoredSources, sources) =
((trgDir ** "*.scala") +++ (trgDir ** "*.java")).get.toSet
.partition{file =>
// sources from https://github.com/scala/scala/tree/2.13.x/src/library-aux
val path = file.getPath.replace('\\', '/')
path.endsWith("scala-library-src/scala/Any.scala") ||
path.endsWith("scala-library-src/scala/AnyVal.scala") ||
path.endsWith("scala-library-src/scala/AnyRef.scala") ||
path.endsWith("scala-library-src/scala/Nothing.scala") ||
path.endsWith("scala-library-src/scala/Null.scala") ||
path.endsWith("scala-library-src/scala/Singleton.scala")
}
// These sources should be never compiled, filtering them out was not working correctly sometimes
ignoredSources.foreach(_.delete())
sources
} (Set(scalaLibrarySourcesJar)).toSeq
}.taskValue,
(Compile / sourceGenerators) += Def.task {
Expand Down
13 changes: 6 additions & 7 deletions project/MiMaFilters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ object MiMaFilters {
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.relaxedExtensionImports"),
ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$relaxedExtensionImports$"),
// end of New experimental features in 3.3.X

// New in 2.13.13
"scala.collection.mutable.ArrayBuffer.resizeUp", // private[mutable] def
// New in 2.13.14
"scala.util.Properties.consoleIsTerminal", // private[scala] lazy val
// end of new in Scala 2
)
) ++ Seq(
// New in 2.13.13
"scala.collection.mutable.ArrayBuffer.resizeUp", // private[mutable] def
// New in 2.13.14
"scala.util.Properties.consoleIsTerminal", // private[scala] lazy val
).map(ProblemFilters.exclude[DirectMissingMethodProblem])
val TastyCore: Seq[ProblemFilter] = Seq(
)
val Interfaces: Seq[ProblemFilter] = Seq(
Expand Down

0 comments on commit 5d56503

Please sign in to comment.