diff --git a/build.sbt b/build.sbt index 9425c4eed1e9..c889f9c4c2a4 100644 --- a/build.sbt +++ b/build.sbt @@ -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` @@ -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 diff --git a/project/Build.scala b/project/Build.scala index 34901a406d2e..84aa45dcbea9 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -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:` + * 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) + .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. @@ -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 ++= {