@@ -1451,7 +1451,7 @@ object Build {
1451
1451
lazy val `scala3-bootstrapped-new` = project
1452
1452
.aggregate(`scala3-interfaces`, `scala3-library-bootstrapped-new` , `scala-library-bootstrapped`,
1453
1453
`tasty-core-bootstrapped-new`, `scala3-compiler-bootstrapped-new`, `scala3-sbt-bridge-bootstrapped`,
1454
- `scala3-staging-new`)
1454
+ `scala3-staging-new`, `scala3-tasty-inspector-new` )
1455
1455
.settings(
1456
1456
name := " scala3-bootstrapped" ,
1457
1457
moduleName := " scala3-bootstrapped" ,
@@ -1590,6 +1590,63 @@ object Build {
1590
1590
},
1591
1591
)
1592
1592
1593
+ /* Configuration of the org.scala-lang:scala3-tasty-inspector:*.**.**-bootstrapped project */
1594
+ lazy val `scala3-tasty-inspector-new` = project.in(file(" tasty-inspector" ))
1595
+ // We want the compiler to be present in the compiler classpath when compiling this project but not
1596
+ // when compiling a project that depends on scala3-tasty-inspector (see sbt-test/sbt-dotty/tasty-inspector-example-project),
1597
+ // but we always need it to be present on the JVM classpath at runtime.
1598
+ .dependsOn(`scala3-compiler-bootstrapped-new` % " provided; compile->runtime; test->test" )
1599
+ .settings(
1600
+ name := " scala3-tasty-inspector" ,
1601
+ moduleName := " scala3-tasty-inspector" ,
1602
+ version := dottyVersion,
1603
+ versionScheme := Some (" semver-spec" ),
1604
+ scalaVersion := referenceVersion,
1605
+ crossPaths := true , // org.scala-lang:scala3-tasty-inspector has a crosspath
1606
+ autoScalaLibrary := false , // do not add a dependency to stdlib, we depend transitively on the stdlib from `scala3-compiler-bootstrapped`
1607
+ // Add the source directories for the sbt-bridge (boostrapped)
1608
+ Compile / unmanagedSourceDirectories := Seq (baseDirectory.value / " src" ),
1609
+ Test / unmanagedSourceDirectories := Seq (baseDirectory.value / " test" ),
1610
+ // NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
1611
+ Compile / scalacOptions := Seq (" -deprecation" , " -feature" , " -unchecked" , " -encoding" , " UTF8" , " -language:implicitConversions" ),
1612
+ // Make sure that the produced artifacts have the minimum JVM version in the bytecode
1613
+ Compile / javacOptions ++= Seq (" --target" , Versions .minimumJVMVersion),
1614
+ Compile / scalacOptions ++= Seq (" --java-output-version" , Versions .minimumJVMVersion),
1615
+ // Packaging configuration of `scala3-staging`
1616
+ Compile / packageBin / publishArtifact := true ,
1617
+ Compile / packageDoc / publishArtifact := false ,
1618
+ Compile / packageSrc / publishArtifact := true ,
1619
+ // Only publish compilation artifacts, no test artifacts
1620
+ Test / publishArtifact := false ,
1621
+ publish / skip := false ,
1622
+ // Configure to use the non-bootstrapped compiler
1623
+ scalaInstance := {
1624
+ val externalCompilerDeps = (`scala3-compiler-nonbootstrapped` / Compile / externalDependencyClasspath).value.map(_.data).toSet
1625
+
1626
+ // IMPORTANT: We need to use actual jars to form the ScalaInstance and not
1627
+ // just directories containing classfiles because sbt maintains a cache of
1628
+ // compiler instances. This cache is invalidated based on timestamps
1629
+ // however this is only implemented on jars, directories are never
1630
+ // invalidated.
1631
+ val tastyCore = (`tasty-core-nonbootstrapped` / Compile / packageBin).value
1632
+ val scalaLibrary = (`scala-library-nonbootstrapped` / Compile / packageBin).value
1633
+ val scala3Interfaces = (`scala3-interfaces` / Compile / packageBin).value
1634
+ val scala3Compiler = (`scala3-compiler-nonbootstrapped` / Compile / packageBin).value
1635
+
1636
+ Defaults .makeScalaInstance(
1637
+ dottyNonBootstrappedVersion,
1638
+ libraryJars = Array (scalaLibrary),
1639
+ allCompilerJars = Seq (tastyCore, scala3Interfaces, scala3Compiler) ++ externalCompilerDeps,
1640
+ allDocJars = Seq .empty,
1641
+ state.value,
1642
+ scalaInstanceTopLoader.value
1643
+ )
1644
+ },
1645
+ scalaCompilerBridgeBinaryJar := {
1646
+ Some ((`scala3-sbt-bridge-nonbootstrapped` / Compile / packageBin).value)
1647
+ },
1648
+ )
1649
+
1593
1650
// ==============================================================================================
1594
1651
// =================================== SCALA STANDARD LIBRARY ===================================
1595
1652
// ==============================================================================================
0 commit comments