Skip to content

Commit 7cacd2d

Browse files
committed
Add TASTy-MiMa to stdlib-bootstrapped
1 parent d332059 commit 7cacd2d

File tree

3 files changed

+340
-0
lines changed

3 files changed

+340
-0
lines changed

project/Build.scala

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import org.scalajs.sbtplugin.ScalaJSPlugin
2121
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
2222
import sbtbuildinfo.BuildInfoPlugin
2323
import sbtbuildinfo.BuildInfoPlugin.autoImport._
24+
import sbttastymima.TastyMiMaPlugin
25+
import sbttastymima.TastyMiMaPlugin.autoImport._
2426

2527
import scala.util.Properties.isJavaAtLeast
2628
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
@@ -994,6 +996,28 @@ object Build {
994996
"scala.annotation.specialized",
995997
"scala.annotation.unspecialized",
996998
),
999+
tastyMiMaPreviousArtifacts += "org.scala-lang" % "scala-library" % stdlibVersion(Bootstrapped),
1000+
tastyMiMaCurrentClasspath := {
1001+
val javaBootCp = tastyMiMaJavaBootClasspath.value
1002+
val classDir = (Compile / classDirectory).value.toPath()
1003+
val cp0 = Attributed.data((Compile / fullClasspath).value).map(_.toPath())
1004+
val cp: Seq[Path] = classDir +: (javaBootCp ++ cp0)
1005+
(cp, classDir)
1006+
},
1007+
tastyMiMaConfig ~= { _.withMoreProblemFilters(TastyMiMaFilters.StdlibBootstrapped) },
1008+
tastyMiMaReportIssues := {
1009+
val minorVersion = previousDottyVersion.split('.')(1)
1010+
// TODO find a way around this and test in the CI
1011+
streams.value.log.warn(
1012+
s"""To allow TASTy-MiMa to read TASTy files generated by this vesion of the compile you must:
1013+
| * Modify the TASTy version to the latest stable release (latest version supported by TASTy-MiMa) in in tasty/src/dotty/tools/tasty/TastyFormat.scala
1014+
| - final val MinorVersion = $minorVersion
1015+
| - final val ExperimentalVersion = 0
1016+
| * Clean everiting to generate a compiler with those new TASTy vesrions
1017+
| * Run stdlib-bootstrapped/tastyMiMaReportIssues
1018+
|""".stripMargin)
1019+
tastyMiMaReportIssues.value
1020+
},
9971021
// TODO package only TASTy files.
9981022
// We first need to check that a project can depend on a JAR that only contains TASTy files.
9991023
// Compile / exportJars := true,

0 commit comments

Comments
 (0)