Skip to content

chore: add new scala3-library projects #23594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 37 additions & 2 deletions .github/workflows/stdlib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:
contents: read

jobs:
compile-nonbootstrapped:
scala-library-nonbootstrapped:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
Expand All @@ -27,7 +27,25 @@ jobs:
- name: Compile `scala-library-nonbootstrapped`
run: ./project/scripts/sbt scala-library-nonbootstrapped/compile

compile-bootstrapped:
scala3-library-nonbootstrapped:
runs-on: ubuntu-latest
##needs: [scala-library-nonbootstrapped] Add when we add support for caching here
steps:
- name: Git Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'

- uses: sbt/setup-sbt@v1
- name: Compile `scala3-library-nonbootstrapped`
run: ./project/scripts/sbt scala3-library-nonbootstrapped/compile

scala-library-bootstrapped:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
Expand All @@ -44,3 +62,20 @@ jobs:
- name: Compile `scala-library-bootstrapped`
run: ./project/scripts/sbt scala-library-bootstrapped/compile

scala3-library-bootstrapped:
runs-on: ubuntu-latest
##needs: [scala-library-bootstrapped] Add when we add support for caching here
steps:
- name: Git Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'

- uses: sbt/setup-sbt@v1
- name: Compile `scala3-library-bootstrapped`
run: ./project/scripts/sbt scala3-library-bootstrapped-new/compile
2 changes: 2 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ val `scala3-interfaces` = Build.`scala3-interfaces`
val `scala3-compiler` = Build.`scala3-compiler`
val `scala3-compiler-bootstrapped` = Build.`scala3-compiler-bootstrapped`
val `scala-library-nonbootstrapped` = Build.`scala-library-nonbootstrapped`
val `scala3-library-nonbootstrapped` = Build.`scala3-library-nonbootstrapped`
val `scala-library-bootstrapped` = Build.`scala-library-bootstrapped`
val `scala3-library-bootstrapped-new` = Build.`scala3-library-bootstrapped-new`
val `scala3-library` = Build.`scala3-library`
val `scala3-library-bootstrapped` = Build.`scala3-library-bootstrapped`
val `scala3-library-bootstrappedJS` = Build.`scala3-library-bootstrappedJS`
Expand Down
76 changes: 74 additions & 2 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,7 @@ object Build {
// =================================== SCALA STANDARD LIBRARY ===================================
// ==============================================================================================

/* Configuration of the org.scala-lang:scala-library:*.**.**-nonboostrapped project */
/* Configuration of the org.scala-lang:scala-library:*.**.**-nonbootstrapped project */
lazy val `scala-library-nonbootstrapped` = project.in(file("library"))
.enablePlugins(ScalaLibraryPlugin)
.settings(
Expand Down Expand Up @@ -1450,7 +1450,42 @@ object Build {
target := target.value / "scala-library-nonbootstrapped",
)

/* Configuration of the org.scala-lang:scala-library:*.**.**-boostrapped project */
/* Configuration of the org.scala-lang:scala3-library_3:*.**.**-nonbootstrapped project */
lazy val `scala3-library-nonbootstrapped` = project.in(file("library"))
.dependsOn(`scala-library-nonbootstrapped`)
.settings(
name := "scala3-library-nonbootstrapped",
moduleName := "scala3-library",
version := dottyNonBootstrappedVersion,
versionScheme := Some("semver-spec"),
scalaVersion := referenceVersion, // nonbootstrapped artifacts are compiled with the reference compiler (already officially published)
crossPaths := true, // org.scala-lang:scala3-library has a crosspath
// Do not depend on the `org.scala-lang:scala3-library` automatically, we manually depend on `scala-library-nonbootstrapped`
autoScalaLibrary := false,
// Drop all the scala tools in this project, so we can never generate any bytecode, or documentation
managedScalaInstance := false,
// This Project only has a dependency to `org.scala-lang:scala-library:*.**.**-nonbootstrapped`
Compile / sources := Seq(),
Compile / resources := Seq(),
Test / sources := Seq(),
Test / resources := Seq(),
// Bridge the common task to call the ones of the actual library project
Compile / compile := (`scala-library-nonbootstrapped` / Compile / compile).value,
Compile / doc := (`scala-library-nonbootstrapped` / Compile / doc).value,
Compile / run := (`scala-library-nonbootstrapped` / Compile / run).evaluated,
Test / compile := (`scala-library-nonbootstrapped` / Test / compile).value,
Test / doc := (`scala-library-nonbootstrapped` / Test / doc).value,
Test / run := (`scala-library-nonbootstrapped` / Test / run).evaluated,
// Only publish compilation artifacts, no test artifacts
Compile / publishArtifact := true,
Test / publishArtifact := false,
// Do not allow to publish this project for now
publish / skip := true,
// Project specific target folder. sbt doesn't like having two projects using the same target folder
target := target.value / "scala3-library-nonbootstrapped",
)

/* Configuration of the org.scala-lang:scala-library:*.**.**-bootstrapped project */
lazy val `scala-library-bootstrapped` = project.in(file("library"))
.enablePlugins(ScalaLibraryPlugin)
.settings(
Expand Down Expand Up @@ -1518,6 +1553,43 @@ object Build {
},
)

/* Configuration of the org.scala-lang:scala3-library_3:*.**.**-bootstrapped project */
lazy val `scala3-library-bootstrapped-new` = project.in(file("library"))
.dependsOn(`scala-library-bootstrapped`)
.settings(
name := "scala3-library-bootstrapped",
moduleName := "scala3-library",
version := dottyVersion,
versionScheme := Some("semver-spec"),
// sbt defaults to scala 2.12.x and metals will report issues as it doesn't consider the project a scala 3 project
// (not the actual version we use to compile the project)
scalaVersion := referenceVersion,
crossPaths := true, // org.scala-lang:scala3-library has a crosspath
// Do not depend on the `org.scala-lang:scala3-library` automatically, we manually depend on `scala-library-bootstrapped`
autoScalaLibrary := false,
// Drop all the scala tools in this project, so we can never generate any bytecode, or documentation
managedScalaInstance := false,
// This Project only has a dependency to `org.scala-lang:scala-library:*.**.**-bootstrapped`
Compile / sources := Seq(),
Compile / resources := Seq(),
Test / sources := Seq(),
Test / resources := Seq(),
// Bridge the common task to call the ones of the actual library project
Compile / compile := (`scala-library-bootstrapped` / Compile / compile).value,
Compile / doc := (`scala-library-bootstrapped` / Compile / doc).value,
Compile / run := (`scala-library-bootstrapped` / Compile / run).evaluated,
Test / compile := (`scala-library-bootstrapped` / Test / compile).value,
Test / doc := (`scala-library-bootstrapped` / Test / doc).value,
Test / run := (`scala-library-bootstrapped` / Test / run).evaluated,
// Only publish compilation artifacts, no test artifacts
Compile / publishArtifact := true,
Test / publishArtifact := false,
// Do not allow to publish this project for now
publish / skip := true,
// Project specific target folder. sbt doesn't like having two projects using the same target folder
target := target.value / "scala3-library-bootstrapped",
)

def dottyLibrary(implicit mode: Mode): Project = mode match {
case NonBootstrapped => `scala3-library`
case Bootstrapped => `scala3-library-bootstrapped`
Expand Down
Loading