Kapt3, Gradle: Fix kapt execution in tests. Check filtered dependencies list properly (KT-15459)
This commit is contained in:
committed by
Yan Zhulanow
parent
ec291455fa
commit
50a7164efe
+5
-1
@@ -97,7 +97,11 @@ class Kapt3KotlinGradleSubplugin : KotlinGradleSubplugin<KotlinCompile> {
|
||||
|
||||
fun handleSourceSet(sourceSetName: String) {
|
||||
val kaptConfiguration = project.findKaptConfiguration(sourceSetName)
|
||||
if (kaptConfiguration != null && kaptConfiguration.dependencies.size > 1) {
|
||||
val filteredDependencies = kaptConfiguration?.dependencies?.filter {
|
||||
it.group != getGroupName() || it.name != getArtifactName()
|
||||
} ?: emptyList()
|
||||
|
||||
if (kaptConfiguration != null && filteredDependencies.isNotEmpty()) {
|
||||
javaCompile.dependsOn(kaptConfiguration.buildDependencies)
|
||||
kaptClasspath.addAll(kaptConfiguration.resolve())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user