Skip to content

Commit 1778a6e

Browse files
authored
Regroup all the library settings in a single function (#22401)
`dottyLibrarySettings` is only used `asDottyLibrary` but `asDottyLibrary` still adds additional settings. I have now regrouped all of the library settings in `dottyLibrarySettings` for better readability (and management)
2 parents 14112c4 + f46687e commit 1778a6e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

project/Build.scala

+7-8
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,9 @@ object Build {
11041104
}
11051105

11061106
// Settings shared between scala3-library, scala3-library-bootstrapped and scala3-library-bootstrappedJS
1107-
lazy val dottyLibrarySettings = Seq(
1107+
def dottyLibrarySettings(implicit mode: Mode) = Seq(
1108+
versionScheme := Some("semver-spec"),
1109+
libraryDependencies += "org.scala-lang" % "scala-library" % stdlibVersion,
11081110
(Compile / scalacOptions) ++= Seq(
11091111
// Needed so that the library sources are visible when `dotty.tools.dotc.core.Definitions#init` is called
11101112
"-sourcepath", (Compile / sourceDirectories).value.map(_.getAbsolutePath).distinct.mkString(File.pathSeparator),
@@ -2415,13 +2417,9 @@ object Build {
24152417
settings(dottyCompilerSettings)
24162418

24172419
def asDottyLibrary(implicit mode: Mode): Project = {
2418-
val base =
2419-
project.withCommonSettings.
2420-
settings(
2421-
versionScheme := Some("semver-spec"),
2422-
libraryDependencies += "org.scala-lang" % "scala-library" % stdlibVersion,
2423-
).
2424-
settings(dottyLibrarySettings)
2420+
val base = project
2421+
.withCommonSettings
2422+
.settings(dottyLibrarySettings)
24252423
if (mode == Bootstrapped) {
24262424
base.settings(
24272425
(Compile/doc) := {
@@ -2505,6 +2503,7 @@ object Build {
25052503
case NonBootstrapped => commonNonBootstrappedSettings
25062504
case Bootstrapped => commonBootstrappedSettings
25072505
})
2506+
25082507
}
25092508

25102509
/* Tests TASTy version invariants during NIGHLY, RC or Stable releases */

0 commit comments

Comments
 (0)