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

Transitive dependencies for tests were not correct.

This commit is contained in:
Cedric Beust 2016-07-21 04:02:22 -08:00
parent 4ba5f5bee1
commit 45e40a1397
9 changed files with 59 additions and 35 deletions

View file

@ -33,7 +33,8 @@ class DependencyData @Inject constructor(val executors: KobaltExecutors, val dep
return DependencyData(d.id, scope, dep.jarFile.get().absolutePath)
}
fun allDeps(l: List<IClasspathDependency>, name: String) = dependencyManager.transitiveClosure(l, name)
fun allDeps(l: List<IClasspathDependency>, name: String) = dependencyManager.transitiveClosure(l,
requiredBy = name)
val buildFile = BuildFile(Paths.get(buildFilePath), "GetDependenciesCommand")
val buildFileCompiler = buildFileCompilerFactory.create(listOf(buildFile), pluginInfo)

View file

@ -183,7 +183,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), project?.name ?: "")
val deps = dependencyManager.transitiveClosure(listOf(compilerDep), requiredBy = project?.name ?: "")
// Force a download of the compiler dependencies
deps.forEach { it.jarFile.get() }

View file

@ -121,7 +121,7 @@ class PackagingPlugin @Inject constructor(val dependencyManager : DependencyMana
val analyzer = Analyzer().apply {
jar = aQute.bnd.osgi.Jar(project.projectProperties.get(Archives.JAR_NAME) as String)
val dependencies = project.compileDependencies + project.compileRuntimeDependencies
dependencyManager.calculateDependencies(project, context, dependencies).forEach {
dependencyManager.calculateDependencies(project, context, allDependencies = dependencies).forEach {
addClasspath(it.jarFile.get())
}
setProperty(Analyzer.BUNDLE_VERSION, project.version)

View file

@ -39,7 +39,8 @@ class WarGenerator @Inject constructor(val dependencyManager: DependencyManager)
// The transitive closure of libraries goes into WEB-INF/libs.
// Copy them all in kobaltBuild/war/WEB-INF/libs and create one IncludedFile out of that directory
//
val allDependencies = dependencyManager.calculateDependencies(project, context, project.compileDependencies)
val allDependencies = dependencyManager.calculateDependencies(project, context,
allDependencies = project.compileDependencies)
val outDir = project.buildDirectory + "/war"
val fullDir = outDir + "/" + LIB

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), "<testProject>")
val closure = dependencyManager.transitiveClosure(listOf(dep), false, "<testProject>")
val d = closure.filter { it.id.contains("eclipse-collections-api")}
Assert.assertEquals(d.size, 1)
}