mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-27 00:38:11 -07:00
Better checkVersions.
This commit is contained in:
parent
8e286fe6ad
commit
1cea9e7fad
1 changed files with 8 additions and 3 deletions
|
@ -27,9 +27,14 @@ class CheckVersions @Inject constructor(val depManager: DependencyManager,
|
||||||
val latestDep = depManager.create(dep.shortId, project.directory)
|
val latestDep = depManager.create(dep.shortId, project.directory)
|
||||||
val artifact = (latestDep as AetherDependency).artifact
|
val artifact = (latestDep as AetherDependency).artifact
|
||||||
val versions = aether.resolveVersion(artifact)
|
val versions = aether.resolveVersion(artifact)
|
||||||
val highest = versions?.highestVersion?.toString()
|
val releases = versions?.versions?.filter { !it.toString().contains("SNAP")}
|
||||||
if (highest != null && highest != dep.id
|
val highest = if (releases != null && releases.any()) {
|
||||||
&& Versions.toLongVersion(highest) > Versions.toLongVersion(dep.version)) {
|
releases.last().toString()
|
||||||
|
} else {
|
||||||
|
versions?.highestVersion.toString()
|
||||||
|
}
|
||||||
|
if (highest != dep.id
|
||||||
|
&& Versions.toLongVersion(highest) > Versions.toLongVersion(dep.version)) {
|
||||||
newVersions.add(artifact.groupId + ":" + artifact.artifactId + ":" + highest)
|
newVersions.add(artifact.groupId + ":" + artifact.artifactId + ":" + highest)
|
||||||
}
|
}
|
||||||
} catch(e: KobaltException) {
|
} catch(e: KobaltException) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue