Skip to content

Commit edc6dba

Browse files
authored
Update src/main/kotlin/org/hiero/gradle/spotless/SortModuleInfoRequiresStep.kt
Signed-off-by: Jendrik Johannes <jendrik@onepiece.software>
1 parent 87596f8 commit edc6dba

1 file changed

Lines changed: 1 addition & 20 deletions

File tree

src/main/kotlin/org/hiero/gradle/spotless/SortModuleInfoRequiresStep.kt

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -97,26 +97,7 @@ class SortModuleInfoRequiresStep {
9797
}
9898

9999
// Sort exports alphabetically by the exported package name
100-
val exportsComparator =
101-
Comparator<List<String>> { a, b ->
102-
val nameA =
103-
a.first()
104-
.trim()
105-
.removePrefix("exports")
106-
.trim()
107-
.split(Regex("[\\s;]"))
108-
.first()
109-
val nameB =
110-
b.first()
111-
.trim()
112-
.removePrefix("exports")
113-
.trim()
114-
.split(Regex("[\\s;]"))
115-
.first()
116-
nameA.compareTo(nameB)
117-
}
118-
119-
exports.sortWith(exportsComparator)
100+
exports.sortBy { it.first() }
120101
requiresTransitive.sortWith(requiresComparator)
121102
requires.sortWith(requiresComparator)
122103
requiresStaticTransitive.sortWith(requiresComparator)

0 commit comments

Comments
 (0)