@@ -2007,6 +2007,7 @@ object Build {
20072007 // (not the actual version we use to compile the project)
20082008 scalaVersion := referenceVersion,
20092009 crossPaths := false , // org.scala-lang:scala-library doesn't have a crosspath
2010+ autoScalaLibrary := false , // DO NOT DEPEND ON THE STDLIB, IT IS THE STDLIB
20102011 // Add the source directories for the stdlib (non-boostrapped)
20112012 Compile / unmanagedSourceDirectories := Seq (baseDirectory.value / " src" ),
20122013 Compile / unmanagedSourceDirectories += baseDirectory.value / " src-bootstrapped" ,
@@ -2031,10 +2032,8 @@ object Build {
20312032 publish / skip := false ,
20322033 // Project specific target folder. sbt doesn't like having two projects using the same target folder
20332034 target := target.value / " scala-library-bootstrapped" ,
2034- // we need to have the `scala-library` artifact in the classpath for `ScalaLibraryPlugin` to work
2035- // this was the only way to not get the artifact evicted by sbt. Even a custom configuration didn't work
2036- // NOTE: true is the default value, just making things clearer here
2037- managedScalaInstance := true ,
2035+ // we do not need sbt to create a managed instance for us, we do it manually in the next setting
2036+ managedScalaInstance := false ,
20382037 // Configure the nonbootstrapped compiler
20392038 scalaInstance := {
20402039 val externalCompilerDeps = (`scala3-compiler-nonbootstrapped` / Compile / externalDependencyClasspath).value.map(_.data).toSet
@@ -2142,6 +2141,7 @@ object Build {
21422141 // because we allow cross-compilation.
21432142 versionScheme := Some (" always" ),
21442143 crossPaths := false ,
2144+ crossVersion := CrossVersion .disabled,
21452145 // sbt defaults to scala 2.12.x and metals will report issues as it doesn't consider the project a scala 3 project
21462146 // (not the actual version we use to compile the project)
21472147 scalaVersion := referenceVersion,
@@ -2192,10 +2192,7 @@ object Build {
21922192 libraryDependencies += (" org.scala-js" % " scalajs-javalib" % scalaJSVersion),
21932193 // Project specific target folder. sbt doesn't like having two projects using the same target folder
21942194 target := target.value / " scala-library" ,
2195- // we need to have the `scala-library` artifact in the classpath for `ScalaLibraryPlugin` to work
2196- // this was the only way to not get the artifact evicted by sbt. Even a custom configuration didn't work
2197- // NOTE: true is the default value, just making things clearer here
2198- managedScalaInstance := true ,
2195+ managedScalaInstance := false ,
21992196 autoScalaLibrary := false ,
22002197 // Configure the nonbootstrapped compiler
22012198 scalaInstance := {
@@ -3019,6 +3016,9 @@ object Build {
30193016 ),
30203017 // Work around https://github.com/eclipse/lsp4j/issues/295
30213018 dependencyOverrides += " org.eclipse.xtend" % " org.eclipse.xtend.lib" % " 2.16.0" ,
3019+ // Exclude the dependency that is resolved transively, the stdlib
3020+ // is a project dependency instead
3021+ excludeDependencies += " org.scala-lang" %% " scala3-library" ,
30223022 javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value,
30233023 ).
30243024 settings(
0 commit comments