Skip to content

chore: add the scala-library project #23510

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ val `scala3-bootstrapped` = Build.`scala3-bootstrapped`
val `scala3-interfaces` = Build.`scala3-interfaces`
val `scala3-compiler` = Build.`scala3-compiler`
val `scala3-compiler-bootstrapped` = Build.`scala3-compiler-bootstrapped`
val `scala-library` = Build.`scala-library`
val `scala3-library` = Build.`scala3-library`
val `scala3-library-bootstrapped` = Build.`scala3-library-bootstrapped`
val `scala3-library-bootstrappedJS` = Build.`scala3-library-bootstrappedJS`
Expand Down
32 changes: 32 additions & 0 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ import scala.util.Properties.isJavaAtLeast
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
import org.scalajs.linker.interface.{ModuleInitializer, StandardConfig}

import sbt.internal.inc.Analysis

object DottyJSPlugin extends AutoPlugin {
import Build._

Expand Down Expand Up @@ -1140,6 +1142,36 @@ object Build {
lazy val `scala3-library` = project.in(file("library")).asDottyLibrary(NonBootstrapped)
lazy val `scala3-library-bootstrapped`: Project = project.in(file("library")).asDottyLibrary(Bootstrapped)

/* Configuration of the org.scala-lang:scala-library:*.**.** project
* NOTES: - This project only exists as a POM, it should not be used as a dependency to any other sbt project here
* - The only commands you should run on this project are `publish` and `publishLocal`
* - This project produces no artifacts and has no sources
*/
lazy val `scala-library` = project.in(file("scala-library"))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: publishSettings are missing here, but I prefer to add them when we are ready to release

.settings(
name := "scala-library",
version := dottyVersion, // Keep the same version as the current Scala version
versionScheme := Some("semver-spec"),
scalaVersion := referenceVersion, // sbt 1.x defaults to Scala 2.12.*. Therefore, resolution below tries to resolve scala3-library_2.12
crossPaths := false, // org.scala-lang:scala-library doesn't have a crosspath
libraryDependencies := Seq(organization.value %% "scala3-library" % version.value),
// Do not allow any sources or resources (managed or not, compilation or test) for this project
Compile / sources := Seq.empty,
Compile / resources := Seq.empty,
Test / sources := Seq.empty,
Test / resources := Seq.empty,
Compile / compile := {
streams.value.log.error(s"Compiling project ${name.value} is disabled. Please consider compiling ${(`scala3-library-bootstrapped` / name).value} instead.")
Analysis.Empty
},
// Only publish a .pom, no need to publish empty artifacts
Compile / publishArtifact := false,
Test / publishArtifact := false,
// Make sure this project is not publishable. This will change starting from 3.8.0
publish / skip := true,
)


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