filegroup.path is used to specify the include path for aidl files

am: 2907459e43

Change-Id: Ibf604d664111401d4bcca20db20c754c6845f05a
This commit is contained in:
Jiyong Park
2019-07-19 04:51:18 -07:00
committed by android-build-merger
6 changed files with 39 additions and 3 deletions

View File

@@ -2277,6 +2277,9 @@ func TestFuzzTarget(t *testing.T) {
ctx.ModuleForTests("fuzz_smoke_test", variant).Rule("cc")
}
func TestAidl(t *testing.T) {
}
func assertString(t *testing.T, got, expected string) {
t.Helper()
if got != expected {

View File

@@ -120,6 +120,11 @@ func genAidl(ctx android.ModuleContext, rule *android.RuleBuilder, aidlFile andr
headerBn := outDir.Join(ctx, aidlPackage, "Bn"+shortName+".h")
headerBp := outDir.Join(ctx, aidlPackage, "Bp"+shortName+".h")
baseDir := strings.TrimSuffix(aidlFile.String(), aidlFile.Rel())
if baseDir != "" {
aidlFlags += " -I" + baseDir
}
cmd := rule.Command()
cmd.BuiltTool(ctx, "aidl-cpp").
FlagWithDepFile("-d", depFile).

View File

@@ -16,6 +16,7 @@ package cc
import (
"path/filepath"
"strings"
"testing"
)
@@ -42,7 +43,8 @@ func TestGen(t *testing.T) {
ctx := testCc(t, `
filegroup {
name: "fg",
srcs: ["b.aidl"],
srcs: ["sub/c.aidl"],
path: "sub",
}
cc_library_shared {
@@ -59,6 +61,12 @@ func TestGen(t *testing.T) {
if !inList("-I"+filepath.Dir(aidl.Output.String()), libfoo.flags.GlobalFlags) {
t.Errorf("missing aidl includes in global flags")
}
aidlCommand := aidl.RuleParams.Command
if !strings.Contains(aidlCommand, "-Isub") {
t.Errorf("aidl command for c.aidl should contain \"-Isub\", but was %q", aidlCommand)
}
})
}

View File

@@ -265,6 +265,7 @@ func CreateTestContext(bp string, fs map[string][]byte,
"bar.c": nil,
"a.proto": nil,
"b.aidl": nil,
"sub/c.aidl": nil,
"my_include": nil,
"foo.map.txt": nil,
"liba.so": nil,