@@ -1363,6 +1363,73 @@ object Build {
1363
1363
)
1364
1364
)
1365
1365
1366
+ // ==============================================================================================
1367
+ // ================================= NON-BOOTSTRAPPED PROJECTS ==================================
1368
+ // ==============================================================================================
1369
+
1370
+ lazy val `scala3-nonbootstrapped` = project
1371
+ .aggregate(`scala3-interfaces`, `scala3-library-nonbootstrapped` , `scala-library-nonbootstrapped`,
1372
+ `tasty-core-nonbootstrapped`, `scala3-compiler-nonbootstrapped`, `scala3-sbt-bridge-nonbootstrapped`)
1373
+ .settings(
1374
+ name := " scala3-nonbootstrapped" ,
1375
+ moduleName := " scala3-nonbootstrapped" ,
1376
+ version := dottyNonBootstrappedVersion,
1377
+ // Nothing to be published by this project, it is only an aggregate
1378
+ Compile / publishArtifact := false ,
1379
+ Test / publishArtifact := false ,
1380
+ // Nothing to be published by this project
1381
+ publish / skip := true ,
1382
+ // Project specific target folder. sbt doesn't like having two projects using the same target folder
1383
+ target := target.value / " scala3-nonbootstrapped" ,
1384
+ )
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
+
1366
1433
// ==============================================================================================
1367
1434
// =================================== SCALA STANDARD LIBRARY ===================================
1368
1435
// ==============================================================================================
@@ -1391,11 +1458,14 @@ object Build {
1391
1458
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
1392
1459
Compile / javacOptions ++= Seq (" --target" , Versions .minimumJVMVersion),
1393
1460
Compile / scalacOptions ++= Seq (" --java-output-version" , Versions .minimumJVMVersion),
1461
+ // Packaging configuration of the stdlib
1462
+ Compile / packageBin / publishArtifact := true ,
1463
+ Compile / packageDoc / publishArtifact := false ,
1464
+ Compile / packageSrc / publishArtifact := true ,
1394
1465
// Only publish compilation artifacts, no test artifacts
1395
- Compile / publishArtifact := true ,
1396
1466
Test / publishArtifact := false ,
1397
- // Do not allow to publish this project for now
1398
- publish / skip := true ,
1467
+ // non-bootstrapped stdlib is publishable (only locally)
1468
+ publish / skip := false ,
1399
1469
// Project specific target folder. sbt doesn't like having two projects using the same target folder
1400
1470
target := target.value / " scala-library-nonbootstrapped" ,
1401
1471
)
@@ -1426,11 +1496,15 @@ object Build {
1426
1496
Test / compile := (`scala-library-nonbootstrapped` / Test / compile).value,
1427
1497
Test / doc := (`scala-library-nonbootstrapped` / Test / doc).value,
1428
1498
Test / run := (`scala-library-nonbootstrapped` / Test / run).evaluated,
1499
+ Test / test := (`scala-library-nonbootstrapped` / Test / test).value,
1500
+ // Packaging configuration of the stdlib
1501
+ Compile / packageBin / publishArtifact := true ,
1502
+ Compile / packageDoc / publishArtifact := false ,
1503
+ Compile / packageSrc / publishArtifact := true ,
1429
1504
// Only publish compilation artifacts, no test artifacts
1430
- Compile / publishArtifact := true ,
1431
1505
Test / publishArtifact := false ,
1432
1506
// Do not allow to publish this project for now
1433
- publish / skip := true ,
1507
+ publish / skip := false ,
1434
1508
// Project specific target folder. sbt doesn't like having two projects using the same target folder
1435
1509
target := target.value / " scala3-library-nonbootstrapped" ,
1436
1510
)
@@ -1443,7 +1517,7 @@ object Build {
1443
1517
moduleName := " scala-library" ,
1444
1518
version := dottyVersion,
1445
1519
versionScheme := Some (" semver-spec" ),
1446
- // sbt defaults to scala 2.12.x and metals will report issues as it doesn't consider the project a scala 3 project
1520
+ // sbt defaults to scala 2.12.x and metals will report issues as it doesn't consider the project a scala 3 project
1447
1521
// (not the actual version we use to compile the project)
1448
1522
scalaVersion := referenceVersion,
1449
1523
crossPaths := false , // org.scala-lang:scala-library doesn't have a crosspath
@@ -1511,7 +1585,7 @@ object Build {
1511
1585
moduleName := " scala3-library" ,
1512
1586
version := dottyVersion,
1513
1587
versionScheme := Some (" semver-spec" ),
1514
- // sbt defaults to scala 2.12.x and metals will report issues as it doesn't consider the project a scala 3 project
1588
+ // sbt defaults to scala 2.12.x and metals will report issues as it doesn't consider the project a scala 3 project
1515
1589
// (not the actual version we use to compile the project)
1516
1590
scalaVersion := referenceVersion,
1517
1591
crossPaths := true , // org.scala-lang:scala3-library has a crosspath
@@ -1562,11 +1636,14 @@ object Build {
1562
1636
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
1563
1637
Compile / javacOptions ++= Seq (" --target" , Versions .minimumJVMVersion),
1564
1638
Compile / scalacOptions ++= Seq (" --java-output-version" , Versions .minimumJVMVersion),
1639
+ // Packaging configuration of the stdlib
1640
+ Compile / packageBin / publishArtifact := true ,
1641
+ Compile / packageDoc / publishArtifact := false ,
1642
+ Compile / packageSrc / publishArtifact := true ,
1565
1643
// Only publish compilation artifacts, no test artifacts
1566
- Compile / publishArtifact := true ,
1567
1644
Test / publishArtifact := false ,
1568
1645
// Do not allow to publish this project for now
1569
- publish / skip := true ,
1646
+ publish / skip := false ,
1570
1647
// Project specific target folder. sbt doesn't like having two projects using the same target folder
1571
1648
target := target.value / " tasty-core-nonbootstrapped" ,
1572
1649
// sbt adds all the projects to scala-tool config which breaks building the scalaInstance
@@ -1575,7 +1652,7 @@ object Build {
1575
1652
val lm = dependencyResolution.value
1576
1653
val log = streams.value.log
1577
1654
val retrieveDir = streams.value.cacheDirectory / " scala3-compiler" / scalaVersion.value
1578
- val comp = lm.retrieve(" org.scala-lang" % " scala3-compiler_3" %
1655
+ val comp = lm.retrieve(" org.scala-lang" % " scala3-compiler_3" %
1579
1656
scalaVersion.value, scalaModuleInfo = None , retrieveDir, log)
1580
1657
.fold(w => throw w.resolveException, identity)
1581
1658
Defaults .makeScalaInstance(
@@ -1623,11 +1700,14 @@ object Build {
1623
1700
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
1624
1701
Compile / javacOptions ++= Seq (" --target" , Versions .minimumJVMVersion),
1625
1702
Compile / scalacOptions ++= Seq (" --java-output-version" , Versions .minimumJVMVersion),
1703
+ // Packaging configuration of the stdlib
1704
+ Compile / packageBin / publishArtifact := true ,
1705
+ Compile / packageDoc / publishArtifact := false ,
1706
+ Compile / packageSrc / publishArtifact := true ,
1626
1707
// Only publish compilation artifacts, no test artifacts
1627
- Compile / publishArtifact := true ,
1628
1708
Test / publishArtifact := false ,
1629
1709
// Do not allow to publish this project for now
1630
- publish / skip := true ,
1710
+ publish / skip := false ,
1631
1711
// Project specific target folder. sbt doesn't like having two projects using the same target folder
1632
1712
target := target.value / " scala3-compiler-nonbootstrapped" ,
1633
1713
// Generate compiler.properties, used by sbt
@@ -1656,7 +1736,7 @@ object Build {
1656
1736
val lm = dependencyResolution.value
1657
1737
val log = streams.value.log
1658
1738
val retrieveDir = streams.value.cacheDirectory / " scala3-compiler" / scalaVersion.value
1659
- val comp = lm.retrieve(" org.scala-lang" % " scala3-compiler_3" %
1739
+ val comp = lm.retrieve(" org.scala-lang" % " scala3-compiler_3" %
1660
1740
scalaVersion.value, scalaModuleInfo = None , retrieveDir, log)
1661
1741
.fold(w => throw w.resolveException, identity)
1662
1742
Defaults .makeScalaInstance(
0 commit comments