mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-27 00:38:11 -07:00
get rid of the return by making the throw clause bigger.
I'm not sure what version I like better. small try blocks are also nice.
This commit is contained in:
parent
77eec73bd0
commit
aafb06fada
1 changed files with 11 additions and 13 deletions
|
@ -1,10 +1,10 @@
|
||||||
package com.beust.kobalt.misc
|
package com.beust.kobalt.misc
|
||||||
|
|
||||||
import com.beust.kobalt.api.IClasspathDependency
|
import com.beust.kobalt.KobaltException
|
||||||
import com.beust.kobalt.api.Project
|
import com.beust.kobalt.api.Project
|
||||||
import com.beust.kobalt.maven.DepFactory
|
import com.beust.kobalt.maven.DepFactory
|
||||||
import com.beust.kobalt.maven.dependency.MavenDependency
|
|
||||||
import com.beust.kobalt.maven.MavenId
|
import com.beust.kobalt.maven.MavenId
|
||||||
|
import com.beust.kobalt.maven.dependency.MavenDependency
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,13 +21,8 @@ public class CheckVersions @Inject constructor(val depFactory : DepFactory,
|
||||||
arrayListOf(it.compileDependencies, it.testDependencies).forEach { cds ->
|
arrayListOf(it.compileDependencies, it.testDependencies).forEach { cds ->
|
||||||
cds.forEach { compileDependency ->
|
cds.forEach { compileDependency ->
|
||||||
if (MavenId.isMavenId(compileDependency.id)) {
|
if (MavenId.isMavenId(compileDependency.id)) {
|
||||||
val dep: IClasspathDependency
|
|
||||||
try {
|
try {
|
||||||
dep = depFactory.create(compileDependency.shortId, executor, false /* go remote */)
|
val dep = depFactory.create(compileDependency.shortId, executor, false /* go remote */)
|
||||||
} catch(e: Exception) {
|
|
||||||
log(1, "cannot resolve ${compileDependency.shortId}. ignoring")
|
|
||||||
return@forEach
|
|
||||||
}
|
|
||||||
if (dep is MavenDependency) {
|
if (dep is MavenDependency) {
|
||||||
val other = compileDependency as MavenDependency
|
val other = compileDependency as MavenDependency
|
||||||
if (dep.id != compileDependency.id
|
if (dep.id != compileDependency.id
|
||||||
|
@ -35,6 +30,9 @@ public class CheckVersions @Inject constructor(val depFactory : DepFactory,
|
||||||
newVersions.add(dep.id)
|
newVersions.add(dep.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch(e: KobaltException) {
|
||||||
|
log(1, "cannot resolve ${compileDependency.shortId}. ignoring")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue