@@ -40,6 +40,9 @@ import sbttastymima.TastyMiMaPlugin.autoImport._
40
40
41
41
import scala .util .Properties .isJavaAtLeast
42
42
43
+ import scala .xml .{Node => XmlNode , NodeSeq => XmlNodeSeq , _ }
44
+ import scala .xml .transform .{RewriteRule , RuleTransformer }
45
+
43
46
import org .portablescala .sbtplatformdeps .PlatformDepsPlugin .autoImport ._
44
47
45
48
object Build {
@@ -1893,14 +1896,15 @@ object Build {
1893
1896
|| file._2.endsWith(" UnitOps.tasty" ) || file._2.endsWith(" UnitOps.class" ) || file._2.endsWith(" UnitOps$.class" )
1894
1897
|| file._2.endsWith(" AnonFunctionXXL.tasty" ) || file._2.endsWith(" AnonFunctionXXL.class" ))
1895
1898
},
1896
- libraryDependencies += (" org.scala-js" %% " scalajs-library" % scalaJSVersion).cross(CrossVersion .for3Use2_13),
1899
+ libraryDependencies += (" org.scala-js" %% " scalajs-library" % scalaJSVersion % Provided ).cross(CrossVersion .for3Use2_13),
1897
1900
libraryDependencies += (" org.scala-js" % " scalajs-javalib" % scalaJSVersion),
1898
1901
// Project specific target folder. sbt doesn't like having two projects using the same target folder
1899
1902
target := target.value / " scala-library" ,
1900
1903
// we need to have the `scala-library` artifact in the classpath for `ScalaLibraryPlugin` to work
1901
1904
// this was the only way to not get the artifact evicted by sbt. Even a custom configuration didn't work
1902
1905
// NOTE: true is the default value, just making things clearer here
1903
1906
managedScalaInstance := true ,
1907
+ autoScalaLibrary := false ,
1904
1908
// Configure the nonbootstrapped compiler
1905
1909
scalaInstance := {
1906
1910
val externalCompilerDeps = (`scala3-compiler-nonbootstrapped` / Compile / externalDependencyClasspath).value.map(_.data).toSet
@@ -1927,6 +1931,16 @@ object Build {
1927
1931
scalaCompilerBridgeBinaryJar := {
1928
1932
Some ((`scala3-sbt-bridge-nonbootstrapped` / Compile / packageBin).value)
1929
1933
},
1934
+ // See https://stackoverflow.com/a/51416386
1935
+ pomPostProcess := { (node : XmlNode ) =>
1936
+ new RuleTransformer (new RewriteRule {
1937
+ override def transform (node : XmlNode ): XmlNodeSeq = node match {
1938
+ case e : Elem if e.label == " dependency" && e.child.exists(child => child.label == " artifactId" && child.text == " scalajs-library_2.13" ) =>
1939
+ XmlNodeSeq .Empty
1940
+ case _ => node
1941
+ }
1942
+ }).transform(node).head
1943
+ },
1930
1944
)
1931
1945
1932
1946
/* Configuration of the org.scala-lang:scala3-library_sjs1_3:*.**.**-bootstrapped project */
0 commit comments