Export aidl, proto and sysprop generated headers separately
Previously, a cc library that included .aidl, .proto and/or .sysprop files and exported headers generated from at least one of those types would actually export generated headers from all of them. While headers generated from .sysprop files are always exported those generated from .aidl or .proto should only be exported when explicitly requested. This change treats them separately as expected. It has the potential to break the build as it could reduce the set of headers exported and so a dependent module that needed those would break. The fix in that case is to simply add one (or both) of the following to the module that previously exported those headers: aidl: { export_aidl_headers: true, } proto: { export_proto_headers: true, } Bug: 180712399 Test: m droid Change-Id: I488182e27dd423d261443612f98d5c112dd3ef8f
This commit is contained in:
@@ -4092,7 +4092,6 @@ func TestIncludeDirsExporting(t *testing.T) {
|
||||
)
|
||||
})
|
||||
|
||||
// TODO: fix this test as it exports all generated headers.
|
||||
t.Run("ensure only aidl headers are exported", func(t *testing.T) {
|
||||
ctx := testCc(t, genRuleModules+`
|
||||
cc_library_shared {
|
||||
@@ -4117,18 +4116,15 @@ func TestIncludeDirsExporting(t *testing.T) {
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/aidl/b.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/aidl/Bnb.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/aidl/Bpb.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/proto/a.pb.h
|
||||
`),
|
||||
expectedOrderOnlyDeps(`
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/aidl/b.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/aidl/Bnb.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/aidl/Bpb.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/proto/a.pb.h
|
||||
`),
|
||||
)
|
||||
})
|
||||
|
||||
// TODO: fix this test as it exports all generated headers.
|
||||
t.Run("ensure only proto headers are exported", func(t *testing.T) {
|
||||
ctx := testCc(t, genRuleModules+`
|
||||
cc_library_shared {
|
||||
@@ -4150,22 +4146,17 @@ func TestIncludeDirsExporting(t *testing.T) {
|
||||
`),
|
||||
expectedSystemIncludeDirs(``),
|
||||
expectedGeneratedHeaders(`
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/aidl/b.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/aidl/Bnb.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/aidl/Bpb.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/proto/a.pb.h
|
||||
`),
|
||||
expectedOrderOnlyDeps(`
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/aidl/b.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/aidl/Bnb.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/aidl/Bpb.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/proto/a.pb.h
|
||||
`),
|
||||
)
|
||||
})
|
||||
|
||||
// TODO: fix this test as it exports all generated headers including public and non-public.
|
||||
t.Run("ensure only non-public sysprop headers are exported", func(t *testing.T) {
|
||||
// TODO fix this test as it exports the sysprop public and non-public headers irrespective of
|
||||
// which include directory is exported.
|
||||
t.Run("ensure only sysprop headers are exported", func(t *testing.T) {
|
||||
ctx := testCc(t, genRuleModules+`
|
||||
cc_library_shared {
|
||||
name: "libfoo",
|
||||
@@ -4186,18 +4177,10 @@ func TestIncludeDirsExporting(t *testing.T) {
|
||||
expectedGeneratedHeaders(`
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/sysprop/include/a.sysprop.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/sysprop/public/include/a.sysprop.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/aidl/b.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/aidl/Bnb.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/aidl/Bpb.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/proto/a.pb.h
|
||||
`),
|
||||
expectedOrderOnlyDeps(`
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/sysprop/include/a.sysprop.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/sysprop/public/include/a.sysprop.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/aidl/b.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/aidl/Bnb.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/aidl/Bpb.h
|
||||
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/proto/a.pb.h
|
||||
`),
|
||||
)
|
||||
})
|
||||
|
Reference in New Issue
Block a user