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

Warn about network calls.

This commit is contained in:
Cedric Beust 2016-02-19 07:43:54 +04:00
parent 9b9a50e7f8
commit da0cc233d9

View file

@ -7,6 +7,7 @@ import com.beust.kobalt.maven.dependency.FileDependency
import com.beust.kobalt.maven.dependency.MavenDependency import com.beust.kobalt.maven.dependency.MavenDependency
import com.beust.kobalt.misc.DependencyExecutor import com.beust.kobalt.misc.DependencyExecutor
import com.beust.kobalt.misc.KobaltExecutors import com.beust.kobalt.misc.KobaltExecutors
import com.beust.kobalt.misc.warn
import com.google.inject.Key import com.google.inject.Key
import java.util.concurrent.ExecutorService import java.util.concurrent.ExecutorService
import javax.inject.Inject import javax.inject.Inject
@ -40,10 +41,14 @@ public class DepFactory @Inject constructor(val localRepo: LocalRepo,
if (tentativeVersion != null && ! MavenId.isRangedVersion(tentativeVersion)) tentativeVersion if (tentativeVersion != null && ! MavenId.isRangedVersion(tentativeVersion)) tentativeVersion
else { else {
var localVersion: String? = tentativeVersion var localVersion: String? = tentativeVersion
if (localFirst) localVersion = localRepo.findLocalVersion(mavenId.groupId, mavenId.artifactId, mavenId.packaging) if (localFirst) localVersion = localRepo.findLocalVersion(mavenId.groupId, mavenId.artifactId,
mavenId.packaging)
if (localFirst && localVersion != null) { if (localFirst && localVersion != null) {
localVersion localVersion
} else { } else {
if (! localFirst) {
warn("The id \"$id\" doesn't contain a version, which will cause a network call")
}
repoResult = remoteRepo.findCorrectRepo(id) repoResult = remoteRepo.findCorrectRepo(id)
if (!repoResult.found) { if (!repoResult.found) {
throw KobaltException("Couldn't resolve $id") throw KobaltException("Couldn't resolve $id")