@@ -1540,6 +1540,54 @@ object Build {
15401540 target := target.value / " scala3-library-bootstrapped" ,
15411541 )
15421542
1543+ // ==============================================================================================
1544+ // ===================================== TASTY CORE LIBRARY =====================================
1545+ // ==============================================================================================
1546+
1547+ /* Configuration of the org.scala-lang:tasty-core_3:*.**.**-nonbootstrapped project */
1548+ lazy val `tasty-core-nonbootstrapped` = project.in(file(" tasty" ))
1549+ .dependsOn(`scala3-library-nonbootstrapped`)
1550+ .settings(
1551+ name := " tasty-core-nonbootstrapped" ,
1552+ moduleName := " tasty-core" ,
1553+ version := dottyNonBootstrappedVersion,
1554+ versionScheme := Some (" semver-spec" ),
1555+ scalaVersion := referenceVersion, // nonbootstrapped artifacts are compiled with the reference compiler (already officially published)
1556+ crossPaths := true , // org.scala-lang:tasty-core has a crosspath
1557+ // sbt shouldn't add stdlib automatically, we depend on `scala3-library-nonbootstrapped`
1558+ autoScalaLibrary := false ,
1559+ // Add the source directories for the stdlib (non-boostrapped)
1560+ Compile / unmanagedSourceDirectories := Seq (baseDirectory.value / " src" ),
1561+ Compile / unmanagedSourceDirectories += baseDirectory.value / " src-non-bootstrapped" ,
1562+ // Make sure that the produced artifacts have the minimum JVM version in the bytecode
1563+ Compile / javacOptions ++= Seq (" --target" , Versions .minimumJVMVersion),
1564+ Compile / scalacOptions ++= Seq (" --java-output-version" , Versions .minimumJVMVersion),
1565+ // Only publish compilation artifacts, no test artifacts
1566+ Compile / publishArtifact := true ,
1567+ Test / publishArtifact := false ,
1568+ // Do not allow to publish this project for now
1569+ publish / skip := true ,
1570+ // Project specific target folder. sbt doesn't like having two projects using the same target folder
1571+ target := target.value / " tasty-core-nonbootstrapped" ,
1572+ // sbt adds all the projects to scala-tool config which breaks building the scalaInstance
1573+ // as a workaround, I build it manually by only adding the compiler
1574+ scalaInstance := {
1575+ val lm = dependencyResolution.value
1576+ val log = streams.value.log
1577+ val retrieveDir = streams.value.cacheDirectory / " scala3-compiler" / scalaVersion.value
1578+ val comp = lm.retrieve(" org.scala-lang" % " scala3-compiler_3" %
1579+ scalaVersion.value, scalaModuleInfo = None , retrieveDir, log)
1580+ .fold(w => throw w.resolveException, identity)
1581+ Defaults .makeScalaInstance(
1582+ scalaVersion.value,
1583+ Array .empty,
1584+ comp.toSeq,
1585+ Seq .empty,
1586+ state.value,
1587+ scalaInstanceTopLoader.value,
1588+ )},
1589+ )
1590+
15431591 def dottyLibrary (implicit mode : Mode ): Project = mode match {
15441592 case NonBootstrapped => `scala3-library`
15451593 case Bootstrapped => `scala3-library-bootstrapped`
0 commit comments