Fix naming issue

This commit is contained in:
Him188 2020-04-02 23:00:20 +08:00 committed by GitHub
parent 0c905f8cd0
commit 5120e79fec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,7 +93,7 @@ fun Project.findLatestFile(): Map.Entry<String, File>? {
.onEach { println("all files=$it") }
.filter { it.name.matches(Regex("""${project.name}-([0-9]|\.)*-all\.jar""")) }
.onEach { println("matched file: ${it.name}") }
.associateBy { it.nameWithoutExtension.substringAfterLast('-') }
.associateBy { it.nameWithoutExtension.substringAfterLast('-').replace("-all", "") }
.onEach { println("versions: $it") }
.maxBy {
it.key.split('.').foldRightIndexed(0) { index: Int, s: String, acc: Int ->