Skip to content
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

chore: add the scala-library-cc project #22852

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
6 changes: 5 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ val `scala3-bench-bootstrapped` = Build.`scala3-bench-bootstrapped`
val `scala3-bench-micro` = Build.`scala3-bench-micro`
val `scala2-library-bootstrapped` = Build.`scala2-library-bootstrapped`
val `scala2-library-tasty` = Build.`scala2-library-tasty`
val `scala2-library-cc` = Build.`scala2-library-cc`
val `scala2-library-cc-tasty` = Build.`scala2-library-cc-tasty`
val `tasty-core` = Build.`tasty-core`
val `tasty-core-bootstrapped` = Build.`tasty-core-bootstrapped`
Expand All @@ -38,6 +37,11 @@ val `sbt-community-build` = Build.`sbt-community-build`
val `scala3-presentation-compiler` = Build.`scala3-presentation-compiler`
val `scala3-presentation-compiler-testcases` = Build.`scala3-presentation-compiler-testcases`

// The Capture Checked Standard Library
val `scala-library-cc` = Build.`scala-library-cc`
val `scala3-library-cc` = Build.`scala3-library-cc`
val `scala2-library-cc` = Build.`scala2-library-cc`

val sjsSandbox = Build.sjsSandbox
val sjsJUnitTests = Build.sjsJUnitTests
val sjsCompilerTests = Build.sjsCompilerTests
Expand Down
47 changes: 46 additions & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1236,6 +1236,49 @@ object Build {
settings(moduleName := "scala2-library")
// -Ycheck:all is set in project/scripts/scala2-library-tasty-mima.sh

// ==============================================================================================
// ========================= SCALA-LIBRARY-CC PROJECTS & CONFIGURATION ==========================
// ==============================================================================================

/** The Experimental Capture Checked Standard Library
*
* This project aggregates the _capture checked_ shared library, often called scala 2 library, and
* the _capture checked_ new library, often called scala 3 library.
*
* It is published under the following name: `org.scala-lang:scala-library-cc:<VERSION>`
* The artifact not only contains TASTy, but it also contains classfiles
*/
lazy val `scala-library-cc` = project.in(file("scala-library-cc"))
.aggregate(`scala2-library-cc`, `scala3-library-cc`)
.settings(
version := dottyVersion,
crossPaths := false,
// No source files should be included in this project, it aggregates from both libraries
Compile / sources := Nil,
Test / sources := Nil,
// Include all the files from the shared, what we call scala2-stdlib, library
Compile / packageBin / mappings ++= (`scala2-library-cc` / Compile / packageBin / mappings).value,
Compile / packageSrc / mappings ++= (`scala2-library-cc` / Compile / packageSrc / mappings).value,
Compile / packageDoc / mappings ++= (`scala2-library-cc` / Compile / packageDoc / mappings).value,
// Include all the files from the new, what we call scala3-stdlib, library
Compile / packageBin / mappings ++= (`scala3-library-cc` / Compile / packageBin / mappings).value,
Compile / packageSrc / mappings ++= (`scala3-library-cc` / Compile / packageSrc / mappings).value,
Compile / packageDoc / mappings ++= (`scala3-library-cc` / Compile / packageDoc / mappings).value,
// Content of the `META-INF/MANIFEST.MF`
Compile / packageOptions := {
val manifest = new java.util.jar.Manifest()
val attributes = manifest.getMainAttributes
Seq(Package.JarManifest(manifest))
}
)

lazy val `scala3-library-cc` = project.in(file("library")).asDottyLibrary(Bootstrapped)
Copy link
Member Author

Choose a reason for hiding this comment

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

This project is still a WIP

.dependsOn(`scala2-library-cc`)
.settings(
libraryDependencies := Seq(), // Drop the dependency to the stable Scala 2 artifact
publish / skip := true, // Do not publish this package alone (it is published as part of scala-library-cc)
)

/** Scala 2 library compiled by dotty using the latest published sources of the library.
*
* This version of the library is not (yet) TASTy/binary compatible with the Scala 2 compiled library.
Expand All @@ -1245,10 +1288,12 @@ object Build {
dependsOn(dottyCompiler(Bootstrapped) % "provided; compile->runtime; test->test").
settings(scala2LibraryBootstrappedSettings).
settings(
moduleName := "scala2-library-cc",
scalacOptions += "-Ycheck:all",
publish / skip := true, // Do not publish this package alone (it is published as part of scala-library-cc)
)

// ==============================================================================================

lazy val scala2LibraryBootstrappedSettings = Seq(
javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value,
Compile / scalacOptions ++= {
Expand Down
Loading