Soong: support Errorprone javacflags

Add support for an errorprone block in Java modules that accepts
additional javacflags for the errorprone build.

Sample:

    errorprone: {
        javacflags: ["-Xep:EqualsNaN:WARN"],
    },

Bug: 72004718
Test: m RUN_ERROR_PRONE=true
Test: manual - add block with ERROR to a project
Test: androidmk_test
Change-Id: I502248fe76c26aa19102f413af72a7324c35b7f4
This commit is contained in:
Andreas Gampe
2018-01-22 21:27:21 -08:00
parent 312ccb974f
commit f3e5b558e7
4 changed files with 38 additions and 0 deletions

View File

@@ -128,6 +128,7 @@ func init() {
"LOCAL_JAVA_RESOURCE_DIRS": "java_resource_dirs",
"LOCAL_JAVACFLAGS": "javacflags",
"LOCAL_ERROR_PRONE_FLAGS": "errorprone.javacflags",
"LOCAL_DX_FLAGS": "dxflags",
"LOCAL_JAVA_LIBRARIES": "libs",
"LOCAL_STATIC_JAVA_LIBRARIES": "static_libs",

View File

@@ -474,6 +474,24 @@ include $(call all-makefiles-under,$(LOCAL_PATH))
}
`,
},
{
desc: "errorprone options for java library",
in: `
include $(CLEAR_VARS)
LOCAL_ERROR_PRONE_FLAGS := -Xep:AsyncCallableReturnsNull:ERROR -Xep:AsyncFunctionReturnsNull:ERROR
include $(BUILD_JAVA_LIBRARY)
`,
expected: `
java_library {
errorprone: {
javacflags: [
"-Xep:AsyncCallableReturnsNull:ERROR",
"-Xep:AsyncFunctionReturnsNull:ERROR",
],
},
}
`,
},
}
func reformatBlueprint(input string) string {