1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 16:28:12 -07:00

Better message when a dependency can't be resolved.

This commit is contained in:
Cedric Beust 2016-07-13 02:24:20 -08:00
parent e6efdc2f75
commit 3ac313b7bf
4 changed files with 14 additions and 10 deletions

View file

@ -33,7 +33,7 @@ class DependencyData @Inject constructor(val executors: KobaltExecutors, val dep
return DependencyData(d.id, scope, dep.jarFile.get().absolutePath)
}
fun allDeps(l: List<IClasspathDependency>) = dependencyManager.transitiveClosure(l)
fun allDeps(l: List<IClasspathDependency>, name: String) = dependencyManager.transitiveClosure(l, name)
val buildFile = BuildFile(Paths.get(buildFilePath), "GetDependenciesCommand")
val buildFileCompiler = buildFileCompilerFactory.create(listOf(buildFile), pluginInfo)
@ -46,12 +46,13 @@ class DependencyData @Inject constructor(val executors: KobaltExecutors, val dep
val allTasks = hashSetOf<TaskData>()
projectResult.projects.withIndex().forEach { wi ->
val project = wi.value
val name = project.name
progressListener?.onProgress(message = "Synchronizing project ${project.name} "
+ (wi.index + 1) + "/" + projectResult.projects.size)
val compileDependencies = pluginDependencies.map { toDependencyData(it, "compile") } +
allDeps(project.compileDependencies).map { toDependencyData(it, "compile") } +
allDeps(project.compileProvidedDependencies).map { toDependencyData(it, "compile") }
val testDependencies = allDeps(project.testDependencies).map { toDependencyData(it, "testCompile") }
allDeps(project.compileDependencies, name).map { toDependencyData(it, "compile") } +
allDeps(project.compileProvidedDependencies, name).map { toDependencyData(it, "compile") }
val testDependencies = allDeps(project.testDependencies, name).map { toDependencyData(it, "testCompile") }
val dependentProjects = project.dependsOn.map { it.name }

View file

@ -144,7 +144,7 @@ class KotlinCompiler @Inject constructor(
val executor = executors.newExecutor("KotlinCompiler", 10)
val compilerVersion = settings.kobaltCompilerVersion
val compilerDep = dependencyManager.create("org.jetbrains.kotlin:kotlin-compiler-embeddable:$compilerVersion")
val deps = dependencyManager.transitiveClosure(listOf(compilerDep))
val deps = dependencyManager.transitiveClosure(listOf(compilerDep), project?.name ?: "")
// Force a download of the compiler dependencies
deps.forEach { it.jarFile.get() }

View file

@ -160,7 +160,7 @@ class DownloadTest @Inject constructor(
@Test
fun variablesShouldBeExpanded() {
val dep = dependencyManager.createMaven("org.mapdb:mapdb:3.0.0-M3")
val closure = dependencyManager.transitiveClosure(listOf(dep))
val closure = dependencyManager.transitiveClosure(listOf(dep), "<testProject>")
val d = closure.filter { it.id.contains("eclipse-collections-api")}
Assert.assertEquals(d.size, 1)
}