From 75fffb14b8c74a6495d481f03586db7b505e737f Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Sun, 13 Jun 2021 15:23:16 -0700 Subject: Add a build flag to always enable errorprone per-target Currently, errorprone is only run if the RUN_ERROR_PRONE enviornment variable is true. Add a flag that individual modules can use to always enable errorprone. In a followup cl, I plan to add another flag that will force all errorprone checks to be errors, so that modules can be confident that they're not ignoring any errorprone checks. Bug: 190944875 Test: New unit test and manually Change-Id: Iab0c81642ed22a736add054147829e91a891d179 --- java/builder.go | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'java/builder.go') diff --git a/java/builder.go b/java/builder.go index cde87310f..ea011b8e1 100644 --- a/java/builder.go +++ b/java/builder.go @@ -279,23 +279,6 @@ func TransformJavaToClasses(ctx android.ModuleContext, outputFile android.Writab transformJavaToClasses(ctx, outputFile, shardIdx, srcFiles, srcJars, flags, deps, "javac", desc) } -func RunErrorProne(ctx android.ModuleContext, outputFile android.WritablePath, - srcFiles, srcJars android.Paths, flags javaBuilderFlags) { - - flags.processorPath = append(flags.errorProneProcessorPath, flags.processorPath...) - - if len(flags.errorProneExtraJavacFlags) > 0 { - if len(flags.javacFlags) > 0 { - flags.javacFlags += " " + flags.errorProneExtraJavacFlags - } else { - flags.javacFlags = flags.errorProneExtraJavacFlags - } - } - - transformJavaToClasses(ctx, outputFile, -1, srcFiles, srcJars, flags, nil, - "errorprone", "errorprone") -} - // Emits the rule to generate Xref input file (.kzip file) for the given set of source files and source jars // to compile with given set of builder flags, etc. func emitXrefRule(ctx android.ModuleContext, xrefFile android.WritablePath, idx int, -- cgit v1.2.3-59-g8ed1b