Skip to content

Commit cc29658

Browse files
committed
chore: add new scala3-library projects
1 parent 16a6ff0 commit cc29658

File tree

3 files changed

+113
-4
lines changed

3 files changed

+113
-4
lines changed

.github/workflows/stdlib.yaml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010
contents: read
1111

1212
jobs:
13-
compile-nonbootstrapped:
13+
scala-library-nonbootstrapped:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Git Checkout
@@ -27,7 +27,25 @@ jobs:
2727
- name: Compile `scala-library-nonbootstrapped`
2828
run: ./project/scripts/sbt scala-library-nonbootstrapped/compile
2929

30-
compile-bootstrapped:
30+
scala3-library-nonbootstrapped:
31+
runs-on: ubuntu-latest
32+
##needs: [scala-library-nonbootstrapped] Add when we add support for caching here
33+
steps:
34+
- name: Git Checkout
35+
uses: actions/checkout@v4
36+
37+
- name: Set up JDK 17
38+
uses: actions/setup-java@v4
39+
with:
40+
distribution: 'temurin'
41+
java-version: 17
42+
cache: 'sbt'
43+
44+
- uses: sbt/setup-sbt@v1
45+
- name: Compile `scala3-library-nonbootstrapped`
46+
run: ./project/scripts/sbt scala3-library-nonbootstrapped/compile
47+
48+
scala-library-bootstrapped:
3149
runs-on: ubuntu-latest
3250
steps:
3351
- name: Git Checkout
@@ -44,3 +62,20 @@ jobs:
4462
- name: Compile `scala-library-bootstrapped`
4563
run: ./project/scripts/sbt scala-library-bootstrapped/compile
4664

65+
scala3-library-bootstrapped:
66+
runs-on: ubuntu-latest
67+
##needs: [scala-library-bootstrapped] Add when we add support for caching here
68+
steps:
69+
- name: Git Checkout
70+
uses: actions/checkout@v4
71+
72+
- name: Set up JDK 17
73+
uses: actions/setup-java@v4
74+
with:
75+
distribution: 'temurin'
76+
java-version: 17
77+
cache: 'sbt'
78+
79+
- uses: sbt/setup-sbt@v1
80+
- name: Compile `scala3-library-bootstrapped`
81+
run: ./project/scripts/sbt scala3-library-bootstrapped-new/compile

build.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ val `scala3-interfaces` = Build.`scala3-interfaces`
44
val `scala3-compiler` = Build.`scala3-compiler`
55
val `scala3-compiler-bootstrapped` = Build.`scala3-compiler-bootstrapped`
66
val `scala-library-nonbootstrapped` = Build.`scala-library-nonbootstrapped`
7+
val `scala3-library-nonbootstrapped` = Build.`scala3-library-nonbootstrapped`
78
val `scala-library-bootstrapped` = Build.`scala-library-bootstrapped`
9+
val `scala3-library-bootstrapped-new` = Build.`scala3-library-bootstrapped-new`
810
val `scala3-library` = Build.`scala3-library`
911
val `scala3-library-bootstrapped` = Build.`scala3-library-bootstrapped`
1012
val `scala3-library-bootstrappedJS` = Build.`scala3-library-bootstrappedJS`

project/Build.scala

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,7 @@ object Build {
14171417
// =================================== SCALA STANDARD LIBRARY ===================================
14181418
// ==============================================================================================
14191419

1420-
/* Configuration of the org.scala-lang:scala-library:*.**.**-nonboostrapped project */
1420+
/* Configuration of the org.scala-lang:scala-library:*.**.**-nonbootstrapped project */
14211421
lazy val `scala-library-nonbootstrapped` = project.in(file("library"))
14221422
.enablePlugins(ScalaLibraryPlugin)
14231423
.settings(
@@ -1450,7 +1450,42 @@ object Build {
14501450
target := target.value / "scala-library-nonbootstrapped",
14511451
)
14521452

1453-
/* Configuration of the org.scala-lang:scala-library:*.**.**-boostrapped project */
1453+
/* Configuration of the org.scala-lang:scala3-library_3:*.**.**-nonbootstrapped project */
1454+
lazy val `scala3-library-nonbootstrapped` = project.in(file("library"))
1455+
.dependsOn(`scala-library-nonbootstrapped`)
1456+
.settings(
1457+
name := "scala3-library-nonbootstrapped",
1458+
moduleName := "scala3-library",
1459+
version := dottyNonBootstrappedVersion,
1460+
versionScheme := Some("semver-spec"),
1461+
scalaVersion := referenceVersion, // nonbootstrapped artifacts are compiled with the reference compiler (already officially published)
1462+
crossPaths := true, // org.scala-lang:scala3-library has a crosspath
1463+
// Do not depend on the `org.scala-lang:scala3-library` automatically, we manually depend on `scala-library-nonbootstrapped`
1464+
autoScalaLibrary := false,
1465+
// Drop all the scala tools in this project, so we can never generate any bytecode, or documentation
1466+
managedScalaInstance := false,
1467+
// This Project only has a dependency to `org.scala-lang:scala-library:*.**.**-nonbootstrapped`
1468+
Compile / sources := Seq(),
1469+
Compile / resources := Seq(),
1470+
Test / sources := Seq(),
1471+
Test / resources := Seq(),
1472+
// Bridge the common task to call the ones of the actual library project
1473+
Compile / compile := (`scala-library-nonbootstrapped` / Compile / compile).value,
1474+
Compile / doc := (`scala-library-nonbootstrapped` / Compile / doc).value,
1475+
Compile / run := (`scala-library-nonbootstrapped` / Compile / run).evaluated,
1476+
Test / compile := (`scala-library-nonbootstrapped` / Test / compile).value,
1477+
Test / doc := (`scala-library-nonbootstrapped` / Test / doc).value,
1478+
Test / run := (`scala-library-nonbootstrapped` / Test / run).evaluated,
1479+
// Only publish compilation artifacts, no test artifacts
1480+
Compile / publishArtifact := true,
1481+
Test / publishArtifact := false,
1482+
// Do not allow to publish this project for now
1483+
publish / skip := true,
1484+
// Project specific target folder. sbt doesn't like having two projects using the same target folder
1485+
target := target.value / "scala3-library-nonbootstrapped",
1486+
)
1487+
1488+
/* Configuration of the org.scala-lang:scala-library:*.**.**-bootstrapped project */
14541489
lazy val `scala-library-bootstrapped` = project.in(file("library"))
14551490
.enablePlugins(ScalaLibraryPlugin)
14561491
.settings(
@@ -1518,6 +1553,43 @@ object Build {
15181553
},
15191554
)
15201555

1556+
/* Configuration of the org.scala-lang:scala3-library_3:*.**.**-bootstrapped project */
1557+
lazy val `scala3-library-bootstrapped-new` = project.in(file("library"))
1558+
.dependsOn(`scala-library-bootstrapped`)
1559+
.settings(
1560+
name := "scala3-library-bootstrapped",
1561+
moduleName := "scala3-library",
1562+
version := dottyVersion,
1563+
versionScheme := Some("semver-spec"),
1564+
// sbt defaults to scala 2.12.x and metals will report issues as it doesn't consider the project a scala 3 project
1565+
// (not the actual version we use to compile the project)
1566+
scalaVersion := referenceVersion,
1567+
crossPaths := true, // org.scala-lang:scala3-library has a crosspath
1568+
// Do not depend on the `org.scala-lang:scala3-library` automatically, we manually depend on `scala-library-bootstrapped`
1569+
autoScalaLibrary := false,
1570+
// Drop all the scala tools in this project, so we can never generate any bytecode, or documentation
1571+
managedScalaInstance := false,
1572+
// This Project only has a dependency to `org.scala-lang:scala-library:*.**.**-bootstrapped`
1573+
Compile / sources := Seq(),
1574+
Compile / resources := Seq(),
1575+
Test / sources := Seq(),
1576+
Test / resources := Seq(),
1577+
// Bridge the common task to call the ones of the actual library project
1578+
Compile / compile := (`scala-library-bootstrapped` / Compile / compile).value,
1579+
Compile / doc := (`scala-library-bootstrapped` / Compile / doc).value,
1580+
Compile / run := (`scala-library-bootstrapped` / Compile / run).evaluated,
1581+
Test / compile := (`scala-library-bootstrapped` / Test / compile).value,
1582+
Test / doc := (`scala-library-bootstrapped` / Test / doc).value,
1583+
Test / run := (`scala-library-bootstrapped` / Test / run).evaluated,
1584+
// Only publish compilation artifacts, no test artifacts
1585+
Compile / publishArtifact := true,
1586+
Test / publishArtifact := false,
1587+
// Do not allow to publish this project for now
1588+
publish / skip := true,
1589+
// Project specific target folder. sbt doesn't like having two projects using the same target folder
1590+
target := target.value / "scala3-library-bootstrapped",
1591+
)
1592+
15211593
def dottyLibrary(implicit mode: Mode): Project = mode match {
15221594
case NonBootstrapped => `scala3-library`
15231595
case Bootstrapped => `scala3-library-bootstrapped`

0 commit comments

Comments
 (0)