Older version with dash shows as newer
refreshVersions incorrectly shows 'x.y-whatever' as newer than 'x.y.z'
version.com.russhwolf..multiplatform-settings-no-arg=0.6.1
## # available=0.6-1.4-M1
## # available=0.6-1.4-M2
## # available=0.6-1.4-M3
## # available=0.6-1.4.0-rc
Thanks for the report! Indeed, for simplicity (on my end), dots and dashes are treated the same for now.
That gives more examples to tune a better version sorter.
Adding another (tricky) real-world example:
As of version 0.9.5 (release coming this week), we can have the following:
version.kotlinx.coroutines=1.3.8
## # available=1.3.8-1.4-rc-154
## # available=1.3.8-1.4.0-rc
## # available=1.3.8-1.4.0-rc-218
## # available=1.3.9-native-mt
## # available=1.3.9
but the correct order would be:
version.kotlinx.coroutines=1.3.8
## # available=1.3.8-1.4-rc-154
## # available=1.3.8-1.4.0-rc-218
## # available=1.3.8-1.4.0-rc
## # available=1.3.9
## # available=1.3.9-native-mt
@brewin developers are crazy creative with their naming scheme
The simplest solution is to use a rejectVersionIf
https://jmfayard.github.io/refreshVersions/update-dependencies/#filter-which-versions-are-added-to-versionsproperties
We can still tweak the version ordering system some day, because the scheme described here is quite common.
I might do it sometime next year as a mental exercise.
Is there any update on this? I currently reject snapshots with same version as release using candidate.value.startsWith(current.value) && candidate.stabilityLevel == StabilityLevel.Snapshot, but a custom sorting would be better.
No changes to expect on that in the foreseeable future, it's low priority, I already tuned the sorting algorithm to make it better, and you have a workaround.
Also, snapshots for the same release should not be shown.
Also, snapshots for the same release should not be shown.
Yes but in our case we bump the version immediately after releasing a new version. So our snapshots during feature dev are like 1.5.0-my_feature_under_dev-SNAPSHOT and won't be superseded by 1.5.0 after release.
I agree that this may not be the main case, but an api to inject a kind of custom comparator could be nice.