Test build now compiles correctly with kapt removed from the build tree.

This commit is contained in:
Clinton Alexander 2017-03-17 12:17:50 +00:00
parent 4775756fb0
commit b4a5902faf

View File

@ -27,8 +27,13 @@ sourceSets {
generated {
java {
srcDir "${projectDir}/generated/source/kapt/main/"
compileClasspath += sourceSets.main.compileClasspath + sourceSets.main.output
}
}
test {
compileClasspath += sourceSets.generated.output + sourceSets.main.compileClasspath
runtimeClasspath += compileClasspath
}
}
dependencies {
@ -60,8 +65,10 @@ project.afterEvaluate {
jar.dependsOn.each { jar.dependsOn.remove it }
buildGenerated.dependsOn.each { buildGenerated.dependsOn.remove it }
jar.dependsOn buildGenerated
compileTestKotlin.dependsOn buildGenerated
buildGenerated.dependsOn classes
compileKotlin.dependsOn.remove kaptKotlin
compileTestKotlin.dependsOn.remove kaptTestKotlin
buildKapt.dependsOn kaptKotlin
buildKapt.mustRunAfter kaptKotlin
}