@@ -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,36 @@ 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+ versionScheme := Some (" semver-spec" ),
1155+ scalaVersion := referenceVersion, // sbt 1.x defaults to Scala 2.12.*. Therefore, resolution below tries to resolve scala3-library_2.12
1156+ crossPaths := false , // org.scala-lang:scala-library doesn't have a crosspath
1157+ libraryDependencies := Seq (organization.value %% " scala3-library" % version.value),
1158+ // Do not allow any sources or resources (managed or not, compilation or test) for this project
1159+ Compile / sources := Seq .empty,
1160+ Compile / resources := Seq .empty,
1161+ Test / sources := Seq .empty,
1162+ Test / resources := Seq .empty,
1163+ Compile / compile := {
1164+ streams.value.log.error(s " Compiling project ${name.value} is disabled. Please consider compiling ${(`scala3-library-bootstrapped` / name).value} instead. " )
1165+ Analysis .Empty
1166+ },
1167+ // Only publish a .pom, no need to publish empty artifacts
1168+ Compile / publishArtifact := false ,
1169+ Test / publishArtifact := false ,
1170+ // Make sure this project is not publishable. This will change starting from 3.8.0
1171+ publish / skip := true ,
1172+ )
1173+
1174+
11431175 def dottyLibrary (implicit mode : Mode ): Project = mode match {
11441176 case NonBootstrapped => `scala3-library`
11451177 case Bootstrapped => `scala3-library-bootstrapped`
0 commit comments