mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
GITHUB-326: Fix crash with file dependencies.
Fixes https://github.com/cbeust/kobalt/issues/326.
This commit is contained in:
parent
d948f5ec5d
commit
456d8365bd
1 changed files with 14 additions and 12 deletions
|
@ -10,7 +10,6 @@ import com.beust.kobalt.internal.PluginInfo
|
|||
import com.beust.kobalt.internal.TaskManager
|
||||
import com.beust.kobalt.internal.build.BuildFile
|
||||
import com.beust.kobalt.maven.DependencyManager
|
||||
import com.beust.kobalt.maven.MavenId
|
||||
import com.beust.kobalt.maven.dependency.FileDependency
|
||||
import com.beust.kobalt.misc.KFiles
|
||||
import com.beust.kobalt.misc.KobaltExecutors
|
||||
|
@ -82,8 +81,9 @@ class RemoteDependencyData @Inject constructor(val executors: KobaltExecutors, v
|
|||
fun mapOfLatestVersions(l: List<DependencyData>) : Map<String, String> {
|
||||
fun p(l: List<DependencyData>, latestVersions: java.util.HashMap<String, String>) {
|
||||
l.forEach {
|
||||
val mid = MavenId.create(it.id)
|
||||
val shortId = mid.artifactId + ":" + mid.artifactId
|
||||
val mid = dependencyManager.create(it.id)
|
||||
if (mid.isMaven) {
|
||||
val shortId = mid.shortId
|
||||
val currentLatest = latestVersions[shortId]
|
||||
if (currentLatest == null) latestVersions[shortId] = mid.version!!
|
||||
else mid.version?.let { v ->
|
||||
|
@ -91,6 +91,7 @@ class RemoteDependencyData @Inject constructor(val executors: KobaltExecutors, v
|
|||
latestVersions[shortId] = v
|
||||
}
|
||||
}
|
||||
}
|
||||
p(it.children, latestVersions)
|
||||
}
|
||||
}
|
||||
|
@ -101,10 +102,11 @@ class RemoteDependencyData @Inject constructor(val executors: KobaltExecutors, v
|
|||
val map = mapOfLatestVersions(result)
|
||||
GraphUtil.map(result, { d: DependencyData -> d.children },
|
||||
{d: DependencyData ->
|
||||
val mid = MavenId.create(d.id)
|
||||
val shortId = mid.artifactId + ":" + mid.artifactId
|
||||
val version = map[shortId]
|
||||
val mid = dependencyManager.create(d.id)
|
||||
if (mid.isMaven) {
|
||||
val version = map[mid.shortId]
|
||||
d.isLatest = version == mid.version
|
||||
}
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue