diff options
author | 2022-01-28 14:49:24 -0800 | |
---|---|---|
committer | 2022-01-28 15:56:07 -0800 | |
commit | aa1cab0a62d218a8ee0fb5840259a0be5976dffb (patch) | |
tree | d82395f567fe5ae545e587e8fb85076bbaf65041 /android_sdk | |
parent | ce56425a6b2329cd365beb5021ca6cf1b9dc6597 (diff) |
Generate sdk_repo notice files from license metadata
Use the new license metadata files to generate the notice files
for sdk_repo modules.
Bug: 207445310
Test: m sdk_repo_build_tools
Change-Id: I8079061fbdf7417c94eebbb1b31486d3f506f931
Diffstat (limited to 'android_sdk')
-rw-r--r-- | android_sdk/sdk_repo_host.go | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/android_sdk/sdk_repo_host.go b/android_sdk/sdk_repo_host.go index d64eb7a92..f050a2e87 100644 --- a/android_sdk/sdk_repo_host.go +++ b/android_sdk/sdk_repo_host.go @@ -122,17 +122,10 @@ func (s *sdkRepoHost) GenerateAndroidBuildActions(ctx android.ModuleContext) { s.CopySpecsToDir(ctx, builder, packageSpecs, dir) - // Collect licenses to write into NOTICE.txt - noticeMap := map[string]android.Paths{} - for path, pkgSpec := range packageSpecs { - licenseFiles := pkgSpec.EffectiveLicenseFiles() - if len(licenseFiles) > 0 { - noticeMap[path] = pkgSpec.EffectiveLicenseFiles() - } - } - notices := android.BuildNotices(ctx, noticeMap) + noticeFile := android.PathForModuleOut(ctx, "NOTICES.txt") + android.BuildNoticeTextOutputFromLicenseMetadata(ctx, noticeFile) builder.Command().Text("cp"). - Input(notices.TxtOutput.Path()). + Input(noticeFile). Text(filepath.Join(dir.String(), "NOTICE.txt")) // Handle `merge_zips` by extracting their contents into our tmpdir |