[KAPT] Skip kapt tasks if no annotations processors are provided (#4190)

So we don't do any preparation, don't spin up compiler.  And user will see SKIPPED in task execution
This commit is contained in:
Andrey
2021-03-15 11:37:06 +03:00
committed by GitHub
parent 77161af92a
commit fe6ddcc1fa
3 changed files with 19 additions and 3 deletions
@@ -209,6 +209,7 @@ class Kapt3ComponentRegistrar : ComponentRegistrar {
if (processingClasspath.isEmpty()) {
// Skip annotation processing if no annotation processors were provided
if (mode != AptMode.WITH_COMPILATION) {
logger.info("No annotation processors provided. Skip KAPT processing.")
abortAnalysis()
}
return false
@@ -274,4 +275,4 @@ class Kapt3ComponentRegistrar : ComponentRegistrar {
return AnalysisResult.success(bindingTrace.bindingContext, module, shouldGenerateCode = false)
}
}
}
}