1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-27 00:38:11 -07:00

Better StringVersion.

This commit is contained in:
Cedric Beust 2017-03-22 09:26:24 -07:00
parent 71d4cce999
commit c7714a5286
11 changed files with 119 additions and 189 deletions

View file

@ -39,8 +39,8 @@ class UpdateKobalt @Inject constructor(val github: GithubApi2, val wrapperProper
try {
val latestVersionString = latestVersionFuture.get()
val latestVersion = Versions.toLongVersion(latestVersionString)
val current = Versions.toLongVersion(Kobalt.version)
val latestVersion = StringVersion(latestVersionString)
val current = StringVersion(Kobalt.version)
val distFile = File(KFiles.distributionsDir)
if (latestVersion > current) {
if (distFile.exists()) {

View file

@ -12,7 +12,7 @@ import com.beust.kobalt.internal.build.BuildFile
import com.beust.kobalt.maven.DependencyManager
import com.beust.kobalt.misc.KFiles
import com.beust.kobalt.misc.KobaltExecutors
import com.beust.kobalt.misc.Versions
import com.beust.kobalt.misc.StringVersion
import com.beust.kobalt.misc.log
import com.google.inject.Inject
import java.io.File
@ -90,7 +90,7 @@ class RemoteDependencyData @Inject constructor(val executors: KobaltExecutors, v
val currentLatest = latestVersions[shortId]
if (currentLatest == null) latestVersions[shortId] = mid.version!!
else mid.version?.let { v ->
if (Versions.toLongVersion(currentLatest) < Versions.toLongVersion(v)) {
if (StringVersion(currentLatest) < StringVersion(v)) {
latestVersions[shortId] = v
}
}