Add "aidl.flags:" property for cc_/java_ modules
The property can be used to pass additional flags to the AIDL compiler. For example, cc_library { .. srcs: ["Foo.aidl"], aidl: { flags: [ "-Werror", // warnings as error "-Weverything", // turn on all warnings ], }, } Bug: 168028537 Test: soong test Change-Id: I8120eeae7cd7b1acdd34c554af996a29e760a368
This commit is contained in:
@@ -2424,6 +2424,22 @@ func TestAidlExportIncludeDirsFromImports(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestAidlFlagsArePassedToTheAidlCompiler(t *testing.T) {
|
||||
ctx, _ := testJava(t, `
|
||||
java_library {
|
||||
name: "foo",
|
||||
srcs: ["aidl/foo/IFoo.aidl"],
|
||||
aidl: { flags: ["-Werror"], },
|
||||
}
|
||||
`)
|
||||
|
||||
aidlCommand := ctx.ModuleForTests("foo", "android_common").Rule("aidl").RuleParams.Command
|
||||
expectedAidlFlag := "-Werror"
|
||||
if !strings.Contains(aidlCommand, expectedAidlFlag) {
|
||||
t.Errorf("aidl command %q does not contain %q", aidlCommand, expectedAidlFlag)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDataNativeBinaries(t *testing.T) {
|
||||
ctx, config := testJava(t, `
|
||||
java_test_host {
|
||||
|
Reference in New Issue
Block a user