Skip to content

Commit 988d99d

Browse files
committed
chore: add the scala-library project
1 parent fb66af2 commit 988d99d

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ val `scala3-bootstrapped` = Build.`scala3-bootstrapped`
33
val `scala3-interfaces` = Build.`scala3-interfaces`
44
val `scala3-compiler` = Build.`scala3-compiler`
55
val `scala3-compiler-bootstrapped` = Build.`scala3-compiler-bootstrapped`
6+
val `scala-library-nonbootstrapped` = Build.`scala-library-nonbootstrapped`
67
val `scala3-library` = Build.`scala3-library`
78
val `scala3-library-bootstrapped` = Build.`scala3-library-bootstrapped`
89
val `scala3-library-bootstrappedJS` = Build.`scala3-library-bootstrappedJS`

project/Build.scala

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import scala.util.Properties.isJavaAtLeast
4141
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
4242
import org.scalajs.linker.interface.{ModuleInitializer, StandardConfig}
4343

44+
4445
object DottyJSPlugin extends AutoPlugin {
4546
import Build._
4647

@@ -1411,6 +1412,38 @@ object Build {
14111412
)
14121413
)
14131414

1415+
// ==============================================================================================
1416+
// =================================== SCALA STANDARD LIBRARY ===================================
1417+
// ==============================================================================================
1418+
1419+
/* Configuration of the org.scala-lang:scala-library:*.**.**-nonboostrapped project */
1420+
lazy val `scala-library-nonbootstrapped` = project.in(file("library"))
1421+
.settings(
1422+
name := "scala-library-nonbootstrapped",
1423+
moduleName := "scala-library",
1424+
version := dottyNonBootstrappedVersion,
1425+
versionScheme := Some("semver-spec"),
1426+
scalaVersion := referenceVersion, // nonbootstrapped artifacts are compiled with the reference compiler (already officially published)
1427+
crossPaths := false, // org.scala-lang:scala-library doesn't have a crosspath
1428+
// NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
1429+
Compile / scalacOptions := Seq("-deprecation", "-feature", "-unchecked", "-encoding", "UTF8", "-language:implicitConversions"),
1430+
// Add the source directories for the stdlib (non-boostrapped)
1431+
Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src"),
1432+
Compile / unmanagedSourceDirectories += baseDirectory.value / "src-non-bootstrapped",
1433+
// Only publish compilation artifacts, no test artifacts
1434+
Compile / publishArtifact := true,
1435+
Test / publishArtifact := false,
1436+
// Do not allow to publish this project for now
1437+
publish / skip := true,
1438+
// Project specific target folder. sbt doesn't like having two projects using the same target folder
1439+
target := target.value / "scala-library-nonbootstrapped",
1440+
// TODO HR: Why on earth is this necessary??
1441+
projectID ~= {id =>
1442+
val line = "scala.versionLine" -> versionLine
1443+
id.withExtraAttributes(id.extraAttributes + line)
1444+
},
1445+
)
1446+
14141447
def dottyLibrary(implicit mode: Mode): Project = mode match {
14151448
case NonBootstrapped => `scala3-library`
14161449
case Bootstrapped => `scala3-library-bootstrapped`

0 commit comments

Comments
 (0)