@@ -1662,6 +1662,62 @@ object Build {
1662
1662
)},
1663
1663
)
1664
1664
1665
+ /* Configuration of the org.scala-lang:tasty-core_3:*.**.**-bootstrapped project */
1666
+ lazy val `tasty-core-bootstrapped-new` = project.in(file(" tasty" ))
1667
+ .dependsOn(`scala3-library-bootstrapped`)
1668
+ .settings(
1669
+ name := " tasty-core-bootstrapped" ,
1670
+ moduleName := " tasty-core" ,
1671
+ version := dottyVersion,
1672
+ versionScheme := Some (" semver-spec" ),
1673
+ scalaVersion := dottyNonBootstrappedVersion, // nonbootstrapped artifacts are compiled with the reference compiler (already officially published)
1674
+ crossPaths := true , // org.scala-lang:tasty-core has a crosspath
1675
+ // sbt shouldn't add stdlib automatically, we depend on `scala3-library-nonbootstrapped`
1676
+ autoScalaLibrary := false ,
1677
+ // Add the source directories for the stdlib (non-boostrapped)
1678
+ Compile / unmanagedSourceDirectories := Seq (baseDirectory.value / " src" ),
1679
+ Compile / unmanagedSourceDirectories += baseDirectory.value / " src-bootstrapped" ,
1680
+ // Make sure that the produced artifacts have the minimum JVM version in the bytecode
1681
+ Compile / javacOptions ++= Seq (" --target" , Versions .minimumJVMVersion),
1682
+ Compile / scalacOptions ++= Seq (" --java-output-version" , Versions .minimumJVMVersion),
1683
+ // Packaging configuration of the stdlib
1684
+ Compile / packageBin / publishArtifact := true ,
1685
+ Compile / packageDoc / publishArtifact := false ,
1686
+ Compile / packageSrc / publishArtifact := true ,
1687
+ // Only publish compilation artifacts, no test artifacts
1688
+ Test / publishArtifact := false ,
1689
+ // Do not allow to publish this project for now
1690
+ publish / skip := false ,
1691
+ // Project specific target folder. sbt doesn't like having two projects using the same target folder
1692
+ target := target.value / " tasty-core-bootstrapped" ,
1693
+ // Configure to use the non-bootstrapped compiler
1694
+ scalaInstance := {
1695
+ val externalCompilerDeps = (`scala3-compiler-nonbootstrapped` / Compile / externalDependencyClasspath).value.map(_.data).toSet
1696
+
1697
+ // IMPORTANT: We need to use actual jars to form the ScalaInstance and not
1698
+ // just directories containing classfiles because sbt maintains a cache of
1699
+ // compiler instances. This cache is invalidated based on timestamps
1700
+ // however this is only implemented on jars, directories are never
1701
+ // invalidated.
1702
+ val tastyCore = (`tasty-core-nonbootstrapped` / Compile / packageBin).value
1703
+ val scalaLibrary = (`scala-library-nonbootstrapped` / Compile / packageBin).value
1704
+ val scala3Interfaces = (`scala3-interfaces` / Compile / packageBin).value
1705
+ val scala3Compiler = (`scala3-compiler-nonbootstrapped` / Compile / packageBin).value
1706
+
1707
+ Defaults .makeScalaInstance(
1708
+ dottyNonBootstrappedVersion,
1709
+ libraryJars = Array (scalaLibrary),
1710
+ allCompilerJars = Seq (tastyCore, scala3Interfaces, scala3Compiler) ++ externalCompilerDeps,
1711
+ allDocJars = Seq .empty,
1712
+ state.value,
1713
+ scalaInstanceTopLoader.value
1714
+ )
1715
+ },
1716
+ scalaCompilerBridgeBinaryJar := {
1717
+ Some ((`scala3-sbt-bridge-nonbootstrapped` / Compile / packageBin).value)
1718
+ },
1719
+ )
1720
+
1665
1721
// ==============================================================================================
1666
1722
// ======================================= SCALA COMPILER =======================================
1667
1723
// ==============================================================================================
0 commit comments