@@ -1369,7 +1369,7 @@ object Build {
1369
1369
1370
1370
lazy val `scala3-nonbootstrapped` = project
1371
1371
.aggregate(`scala3-interfaces`, `scala3-library-nonbootstrapped` , `scala-library-nonbootstrapped`,
1372
- `tasty-core-nonbootstrapped`, `scala3-compiler-nonbootstrapped`)
1372
+ `tasty-core-nonbootstrapped`, `scala3-compiler-nonbootstrapped`, `scala3-sbt-bridge-nonbootstrapped` )
1373
1373
.settings(
1374
1374
name := " scala3-nonbootstrapped" ,
1375
1375
moduleName := " scala3-nonbootstrapped" ,
@@ -1383,6 +1383,53 @@ object Build {
1383
1383
target := target.value / " scala3-nonbootstrapped" ,
1384
1384
)
1385
1385
1386
+ /* Configuration of the org.scala-lang:scala3-sbt-bridge:*.**.**-nonbootstrapped project */
1387
+ lazy val `scala3-sbt-bridge-nonbootstrapped` = project.in(file(" sbt-bridge" ))
1388
+ .dependsOn(`scala3-compiler-nonbootstrapped`) // TODO: Would this actually evict the reference compiler in scala-tool?
1389
+ .settings(
1390
+ name := " scala3-sbt-bridge-nonbootstrapped" ,
1391
+ moduleName := " scala3-sbt-bridge" ,
1392
+ version := dottyNonBootstrappedVersion,
1393
+ versionScheme := Some (" semver-spec" ),
1394
+ scalaVersion := referenceVersion, // nonbootstrapped artifacts are compiled with the reference compiler (already officially published)
1395
+ crossPaths := false , // org.scala-lang:scala3-sbt-bridge doesn't have a crosspath
1396
+ autoScalaLibrary := false , // do not add a dependency to stdlib, we depend transitively on the stdlib from `scala3-compiler-nonbootstrapped`
1397
+ // Add the source directories for the stdlib (non-boostrapped)
1398
+ Compile / unmanagedSourceDirectories := Seq (baseDirectory.value / " src" ),
1399
+ // NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
1400
+ Compile / scalacOptions := Seq (" -deprecation" , " -feature" , " -unchecked" , " -encoding" , " UTF8" , " -language:implicitConversions" ),
1401
+ // Make sure that the produced artifacts have the minimum JVM version in the bytecode
1402
+ Compile / javacOptions ++= Seq (" --target" , Versions .minimumJVMVersion),
1403
+ Compile / scalacOptions ++= Seq (" --java-output-version" , Versions .minimumJVMVersion),
1404
+ // Packaging configuration of the stdlib
1405
+ Compile / packageBin / publishArtifact := true ,
1406
+ Compile / packageDoc / publishArtifact := false ,
1407
+ Compile / packageSrc / publishArtifact := true ,
1408
+ // Only publish compilation artifacts, no test artifacts
1409
+ Test / publishArtifact := false ,
1410
+ // non-bootstrapped stdlib is publishable (only locally)
1411
+ publish / skip := false ,
1412
+ // Project specific target folder. sbt doesn't like having two projects using the same target folder
1413
+ target := target.value / " scala3-sbt-bridge-nonbootstrapped" ,
1414
+ // sbt adds all the projects to scala-tool config which breaks building the scalaInstance
1415
+ // as a workaround, I build it manually by only adding the compiler
1416
+ scalaInstance := {
1417
+ val lm = dependencyResolution.value
1418
+ val log = streams.value.log
1419
+ val retrieveDir = streams.value.cacheDirectory / " scala3-compiler" / scalaVersion.value
1420
+ val comp = lm.retrieve(" org.scala-lang" % " scala3-compiler_3" %
1421
+ scalaVersion.value, scalaModuleInfo = None , retrieveDir, log)
1422
+ .fold(w => throw w.resolveException, identity)
1423
+ Defaults .makeScalaInstance(
1424
+ scalaVersion.value,
1425
+ Array .empty,
1426
+ comp.toSeq,
1427
+ Seq .empty,
1428
+ state.value,
1429
+ scalaInstanceTopLoader.value,
1430
+ )},
1431
+ )
1432
+
1386
1433
// ==============================================================================================
1387
1434
// =================================== SCALA STANDARD LIBRARY ===================================
1388
1435
// ==============================================================================================
0 commit comments