Merge "track static deps when gatherint notices for apex" am: d21a743f73
am: ea55321af5
am: befbbf8b58
Change-Id: I1682e706136a36481b31bece378c111f618daa76
This commit is contained in:
@@ -168,6 +168,7 @@ func testApexContext(t *testing.T, bp string, handlers ...testCustomizer) (*andr
|
|||||||
"vendor/foo/devkeys/testkey.pem": nil,
|
"vendor/foo/devkeys/testkey.pem": nil,
|
||||||
"NOTICE": nil,
|
"NOTICE": nil,
|
||||||
"custom_notice": nil,
|
"custom_notice": nil,
|
||||||
|
"custom_notice_for_static_lib": nil,
|
||||||
"testkey2.avbpubkey": nil,
|
"testkey2.avbpubkey": nil,
|
||||||
"testkey2.pem": nil,
|
"testkey2.pem": nil,
|
||||||
"myapex-arm64.apex": nil,
|
"myapex-arm64.apex": nil,
|
||||||
@@ -372,6 +373,20 @@ func TestBasicApex(t *testing.T) {
|
|||||||
system_shared_libs: [],
|
system_shared_libs: [],
|
||||||
stl: "none",
|
stl: "none",
|
||||||
notice: "custom_notice",
|
notice: "custom_notice",
|
||||||
|
static_libs: ["libstatic"],
|
||||||
|
// TODO: remove //apex_available:platform
|
||||||
|
apex_available: [
|
||||||
|
"//apex_available:platform",
|
||||||
|
"myapex",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library_static {
|
||||||
|
name: "libstatic",
|
||||||
|
srcs: ["mylib.cpp"],
|
||||||
|
system_shared_libs: [],
|
||||||
|
stl: "none",
|
||||||
|
notice: "custom_notice_for_static_lib",
|
||||||
// TODO: remove //apex_available:platform
|
// TODO: remove //apex_available:platform
|
||||||
apex_available: [
|
apex_available: [
|
||||||
"//apex_available:platform",
|
"//apex_available:platform",
|
||||||
@@ -470,11 +485,12 @@ func TestBasicApex(t *testing.T) {
|
|||||||
|
|
||||||
mergeNoticesRule := ctx.ModuleForTests("myapex", "android_common_myapex_image").Rule("mergeNoticesRule")
|
mergeNoticesRule := ctx.ModuleForTests("myapex", "android_common_myapex_image").Rule("mergeNoticesRule")
|
||||||
noticeInputs := mergeNoticesRule.Inputs.Strings()
|
noticeInputs := mergeNoticesRule.Inputs.Strings()
|
||||||
if len(noticeInputs) != 2 {
|
if len(noticeInputs) != 3 {
|
||||||
t.Errorf("number of input notice files: expected = 2, actual = %q", len(noticeInputs))
|
t.Errorf("number of input notice files: expected = 3, actual = %q", len(noticeInputs))
|
||||||
}
|
}
|
||||||
ensureListContains(t, noticeInputs, "NOTICE")
|
ensureListContains(t, noticeInputs, "NOTICE")
|
||||||
ensureListContains(t, noticeInputs, "custom_notice")
|
ensureListContains(t, noticeInputs, "custom_notice")
|
||||||
|
ensureListContains(t, noticeInputs, "custom_notice_for_static_lib")
|
||||||
|
|
||||||
depsInfo := strings.Split(ctx.ModuleForTests("myapex", "android_common_myapex_image").Output("myapex-deps-info.txt").Args["content"], "\\n")
|
depsInfo := strings.Split(ctx.ModuleForTests("myapex", "android_common_myapex_image").Output("myapex-deps-info.txt").Args["content"], "\\n")
|
||||||
ensureListContains(t, depsInfo, "myjar <- myapex")
|
ensureListContains(t, depsInfo, "myjar <- myapex")
|
||||||
|
@@ -228,19 +228,15 @@ func (a *apexBundle) buildManifest(ctx android.ModuleContext, provideNativeLibs,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *apexBundle) buildNoticeFiles(ctx android.ModuleContext, apexFileName string) android.NoticeOutputs {
|
func (a *apexBundle) buildNoticeFiles(ctx android.ModuleContext, apexFileName string) android.NoticeOutputs {
|
||||||
noticeFiles := []android.Path{}
|
var noticeFiles android.Paths
|
||||||
for _, f := range a.filesInfo {
|
|
||||||
if f.module != nil {
|
a.walkPayloadDeps(ctx, func(ctx android.ModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) {
|
||||||
notices := f.module.NoticeFiles()
|
if externalDep {
|
||||||
if len(notices) > 0 {
|
return
|
||||||
|
}
|
||||||
|
notices := to.NoticeFiles()
|
||||||
noticeFiles = append(noticeFiles, notices...)
|
noticeFiles = append(noticeFiles, notices...)
|
||||||
}
|
})
|
||||||
}
|
|
||||||
}
|
|
||||||
// append the notice file specified in the apex module itself
|
|
||||||
if len(a.NoticeFiles()) > 0 {
|
|
||||||
noticeFiles = append(noticeFiles, a.NoticeFiles()...)
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(noticeFiles) == 0 {
|
if len(noticeFiles) == 0 {
|
||||||
return android.NoticeOutputs{}
|
return android.NoticeOutputs{}
|
||||||
|
Reference in New Issue
Block a user