Add warnings for jsr305 nullable annotations

#KT-19115 Fixed
This commit is contained in:
e5l
2017-08-11 14:21:23 +03:00
parent 746de612ad
commit 5501cdf049
33 changed files with 506 additions and 198 deletions
@@ -156,18 +156,18 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
@Argument(
value = "-Xjsr305-annotations",
valueDescription = "{ignore|enable}",
description = "Specify global behavior for JSR-305 nullability annotations: ignore, or treat as other supported nullability annotations"
valueDescription = "{ignore|enable|warn}",
description = "Specify global behavior for JSR-305 nullability annotations: ignore, treat as other supported nullability annotations, or report a warning"
)
var jsr305GlobalReportLevel: String? by FreezableVar(Jsr305State.DEFAULT.description)
var jsr305GlobalState: String? by FreezableVar(Jsr305State.DEFAULT.description)
// Paths to output directories for friend modules.
var friendPaths: Array<String>? by FreezableVar(null)
override fun configureAnalysisFlags(): MutableMap<AnalysisFlag<*>, Any> {
val result = super.configureAnalysisFlags()
Jsr305State.findByDescription(jsr305GlobalReportLevel)?.let {
result.put(AnalysisFlag.loadJsr305Annotations, it)
Jsr305State.findByDescription(jsr305GlobalState)?.let {
result.put(AnalysisFlag.jsr305GlobalState, it)
}
return result
}