Skip to content

Commit

Permalink
🐛 Fix VersionCatalog section ordering
Browse files Browse the repository at this point in the history
The sections are now ordered as described in the gradle documentation: https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
  • Loading branch information
MaxMichel2 committed Aug 28, 2024
1 parent e0e317a commit f13d3c2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ internal sealed class TomlSection(open val name: String) {

object Root: TomlSection("root")
object Versions: TomlSection("versions")
object Plugins: TomlSection("plugins")
object Bundles: TomlSection("bundles")
object Libraries: TomlSection("libraries")
object Bundles: TomlSection("bundles")
object Plugins: TomlSection("plugins")
data class Custom(override val name: String) : TomlSection(name)

companion object {
val orderedSections = listOf(Root, Bundles, Plugins, Versions, Libraries)
val orderedSections = listOf(Root, Versions, Libraries, Bundles, Plugins)

fun from(name: String): TomlSection = orderedSections.firstOrNull { it.name == name } ?: Custom(name)
}
Expand Down

0 comments on commit f13d3c2

Please sign in to comment.