filegroup.path is used to specify the include path for aidl files
filegroup { name: "foo", srcs: ["srcs/aidl/com/android/**/*.aidl"], path: "srcs/aidl", } cc_library { // or java_library, etc. name: "bar", srcs: [":foo"], } automatically adds "-Ipath/to/foo/srcs/aidl" when compiling the aidl files from foo for bar. This allows us to omit aidl include path when using sources in other places via file group. Bug: 135922046 Test: m (unit tests added) Change-Id: I9b42f316f2858fb6da72c2f58a314f391416e809
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
package java
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/google/blueprint"
|
||||
|
||||
"android/soong/android"
|
||||
@@ -63,6 +65,10 @@ var (
|
||||
func genAidl(ctx android.ModuleContext, aidlFile android.Path, aidlFlags string, deps android.Paths) android.Path {
|
||||
javaFile := android.GenPathWithExt(ctx, "aidl", aidlFile, "java")
|
||||
depFile := javaFile.String() + ".d"
|
||||
baseDir := strings.TrimSuffix(aidlFile.String(), aidlFile.Rel())
|
||||
if baseDir != "" {
|
||||
aidlFlags += " -I" + baseDir
|
||||
}
|
||||
|
||||
ctx.Build(pctx, android.BuildParams{
|
||||
Rule: aidl,
|
||||
|
Reference in New Issue
Block a user