Kapt: Allow to disable info->warning mapping in logger (#KT-24985)
This commit is contained in:
+6
@@ -83,6 +83,7 @@ class Kapt3KotlinGradleSubplugin : KotlinGradleSubplugin<KotlinCompile> {
|
||||
companion object {
|
||||
private val VERBOSE_OPTION_NAME = "kapt.verbose"
|
||||
private val USE_WORKER_API = "kapt.use.worker.api"
|
||||
private val INFO_AS_WARNINGS = "kapt.info.as.warnings"
|
||||
|
||||
const val KAPT_WORKER_DEPENDENCIES_CONFIGURATION_NAME = "kotlinKaptWorkerDependencies"
|
||||
|
||||
@@ -112,6 +113,10 @@ class Kapt3KotlinGradleSubplugin : KotlinGradleSubplugin<KotlinCompile> {
|
||||
return isWorkerAPISupported() && hasProperty(USE_WORKER_API) && property(USE_WORKER_API) == "true"
|
||||
}
|
||||
|
||||
fun Project.isInfoAsWarnings(): Boolean {
|
||||
return hasProperty(INFO_AS_WARNINGS) && property(INFO_AS_WARNINGS) == "true"
|
||||
}
|
||||
|
||||
fun findMainKaptConfiguration(project: Project) = project.findKaptConfiguration(MAIN_KAPT_CONFIGURATION_NAME)
|
||||
|
||||
fun createAptConfigurationIfNeeded(project: Project, sourceSetName: String): Configuration {
|
||||
@@ -332,6 +337,7 @@ class Kapt3KotlinGradleSubplugin : KotlinGradleSubplugin<KotlinCompile> {
|
||||
pluginOptions += SubpluginOption("useLightAnalysis", "${kaptExtension.useLightAnalysis}")
|
||||
pluginOptions += SubpluginOption("correctErrorTypes", "${kaptExtension.correctErrorTypes}")
|
||||
pluginOptions += SubpluginOption("mapDiagnosticLocations", "${kaptExtension.mapDiagnosticLocations}")
|
||||
pluginOptions += SubpluginOption("infoAsWarnings", "${project.isInfoAsWarnings()}")
|
||||
pluginOptions += FilesSubpluginOption("stubs", listOf(getKaptStubsDir()))
|
||||
|
||||
if (project.isKaptVerbose()) {
|
||||
|
||||
Reference in New Issue
Block a user