@@ -41,6 +41,8 @@ import scala.util.Properties.isJavaAtLeast
4141import org .portablescala .sbtplatformdeps .PlatformDepsPlugin .autoImport ._
4242import org .scalajs .linker .interface .{ModuleInitializer , StandardConfig }
4343
44+ import sbt .internal .inc .Analysis
45+
4446object DottyJSPlugin extends AutoPlugin {
4547 import Build ._
4648
@@ -1140,6 +1142,35 @@ object Build {
11401142 lazy val `scala3-library` = project.in(file(" library" )).asDottyLibrary(NonBootstrapped )
11411143 lazy val `scala3-library-bootstrapped` : Project = project.in(file(" library" )).asDottyLibrary(Bootstrapped )
11421144
1145+ /* Configuration of the org.scala-lang:scala-library:*.**.** project
1146+ * NOTES: - This project only exists as a POM, it should not be used as a dependency to any other sbt project here
1147+ * - The only commands you should run on this project are `publish` and `publishLocal`
1148+ * - This project produces no artifacts and has no sources
1149+ */
1150+ lazy val `scala-library` = project.in(file(" scala-library" ))
1151+ .settings(
1152+ name := " scala-library" ,
1153+ version := dottyVersion, // Keep the same version as the current Scala version
1154+ scalaVersion := referenceVersion, // sbt 1.x defaults to Scala 2.12.*. Therefore, resolution below tries to resolve scala3-library_2.12
1155+ crossPaths := false , // org.scala-lang:scala-library doesn't have a crosspath
1156+ libraryDependencies := Seq (organization.value %% " scala3-library" % version.value),
1157+ // Do not allow any sources or resources (managed or not, compilation or test) for this project
1158+ Compile / sources := Seq .empty,
1159+ Compile / resources := Seq .empty,
1160+ Test / sources := Seq .empty,
1161+ Test / resources := Seq .empty,
1162+ Compile / compile := {
1163+ streams.value.log.error(s " Compiling project ${name.value} is disabled. Please consider compiling ${(`scala3-library-bootstrapped` / name).value} instead. " )
1164+ Analysis .Empty
1165+ },
1166+ // Only publish a .pom, no need to publish empty artifacts
1167+ Compile / publishArtifact := false ,
1168+ Test / publishArtifact := false ,
1169+ // Make sure this project is not publishable. This will change starting from 3.8.0
1170+ publish / skip := true ,
1171+ )
1172+
1173+
11431174 def dottyLibrary (implicit mode : Mode ): Project = mode match {
11441175 case NonBootstrapped => `scala3-library`
11451176 case Bootstrapped => `scala3-library-bootstrapped`
0 commit comments