Skip to content

Commit cc869c3

Browse files
committed
chore: add the scala-library project
1 parent 01447df commit cc869c3

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ val `scala3-bootstrapped` = Build.`scala3-bootstrapped`
33
val `scala3-interfaces` = Build.`scala3-interfaces`
44
val `scala3-compiler` = Build.`scala3-compiler`
55
val `scala3-compiler-bootstrapped` = Build.`scala3-compiler-bootstrapped`
6+
val `scala-library` = Build.`scala-library`
67
val `scala3-library` = Build.`scala3-library`
78
val `scala3-library-bootstrapped` = Build.`scala3-library-bootstrapped`
89
val `scala3-library-bootstrappedJS` = Build.`scala3-library-bootstrappedJS`

project/Build.scala

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ import scala.util.Properties.isJavaAtLeast
4141
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
4242
import org.scalajs.linker.interface.{ModuleInitializer, StandardConfig}
4343

44+
import sbt.internal.inc.Analysis
45+
4446
object 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

Comments
 (0)