Skip to content

Commit

Permalink
chore: regroup all the library settings in a single function
Browse files Browse the repository at this point in the history
  • Loading branch information
hamzaremmal committed Jan 17, 2025
1 parent 1270d13 commit e758b2a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,9 @@ object Build {
}

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

def asDottyLibrary(implicit mode: Mode): Project = {
val base =
project.withCommonSettings.
settings(
versionScheme := Some("semver-spec"),
libraryDependencies += "org.scala-lang" % "scala-library" % stdlibVersion,
).
settings(dottyLibrarySettings)
val base = project
.withCommonSettings
.withDottyLibrarySettings
if (mode == Bootstrapped) {
base.settings(
(Compile/doc) := {
Expand Down Expand Up @@ -2505,6 +2503,10 @@ object Build {
case NonBootstrapped => commonNonBootstrappedSettings
case Bootstrapped => commonBootstrappedSettings
})

def withDottyLibrarySettings(implicit mode: Mode) =
project.settings(dottyLibrarySettings)

}

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

0 comments on commit e758b2a

Please sign in to comment.