From e197d8b174208baa68f442b8c50910ad3be1aa34 Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Tue, 5 Jan 2021 10:33:16 +0900 Subject: 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 --- java/java.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'java/java.go') diff --git a/java/java.go b/java/java.go index 18dd9bda4..82b53be1d 100644 --- a/java/java.go +++ b/java/java.go @@ -304,6 +304,9 @@ type CompilerDeviceProperties struct { // whether to generate Binder#GetTransaction name method. Generate_get_transaction_name *bool + + // list of flags that will be passed to the AIDL compiler + Flags []string } // If true, export a copy of the module as a -hostdex module for host testing. @@ -872,6 +875,8 @@ func (j *Module) aidlFlags(ctx android.ModuleContext, aidlPreprocess android.Opt var flags []string var deps android.Paths + flags = append(flags, j.deviceProperties.Aidl.Flags...) + if aidlPreprocess.Valid() { flags = append(flags, "-p"+aidlPreprocess.String()) deps = append(deps, aidlPreprocess.Path()) -- cgit v1.2.3-59-g8ed1b