Merge pull request #5447 from eed3si9n/wip/ordering

Make bare setting loading order alphabetical
This commit is contained in:
eugene yokota 2020-02-26 16:25:24 -05:00 committed by GitHub
commit a2563f0088
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 1 deletions

View File

@ -8,6 +8,7 @@
package sbt
import java.io.File
import java.util.Locale
import KeyRanks.DSetting
import sbt.io.{ GlobFilter, Path }
@ -114,7 +115,9 @@ object BuildPaths {
private[this] def defaultDependencyBase(globalBase: File) = globalBase / "dependency"
private[this] def defaultGlobalZinc(globalBase: File) = globalBase / "zinc"
def configurationSources(base: File): Seq[File] = (base * (GlobFilter("*.sbt") - ".sbt")).get
def configurationSources(base: File): Seq[File] =
(base * (GlobFilter("*.sbt") - ".sbt")).get
.sortBy(_.getName.toLowerCase(Locale.ENGLISH))
def pluginDirectory(definitionBase: File) = definitionBase / PluginsDirectoryName
def evalOutputDirectory(base: File) = outputDirectory(base) / "config-classes"

View File

@ -0,0 +1 @@
Compile / scalacOptions += "a"

View File

@ -0,0 +1 @@
Compile / scalacOptions += "b"

View File

@ -0,0 +1,12 @@
val check = taskKey[Unit]("")
lazy val root = (project in file("."))
.settings(
Compile / scalacOptions += "multi-project",
check := {
val xs = (Compile / scalacOptions).value
assert(xs.toList == List("multi-project", "a", "b", "bare", "c"), s"$xs")
}
)
Compile / scalacOptions += "bare"

View File

@ -0,0 +1 @@
Compile / scalacOptions += "c"

View File

@ -0,0 +1 @@
> check