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
This commit is contained in:
Colin Cross
2022-01-28 14:49:24 -08:00
parent ce56425a6b
commit aa1cab0a62
4 changed files with 25 additions and 66 deletions

View File

@@ -1321,6 +1321,9 @@ type ModuleBase struct {
// set of dependency module:location mappings used to populate the license metadata for
// apex containers.
licenseInstallMap []string
// The path to the generated license metadata file for the module.
licenseMetadataFile WritablePath
}
// A struct containing all relevant information about a Bazel target converted via bp2build.
@@ -2076,6 +2079,8 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)
variables: make(map[string]string),
}
m.licenseMetadataFile = PathForModuleOut(ctx, "meta_lic")
dependencyInstallFiles, dependencyPackagingSpecs := m.computeInstallDeps(ctx)
// set m.installFilesDepSet to only the transitive dependencies to be used as the dependencies
// of installed files of this module. It will be replaced by a depset including the installed
@@ -2207,7 +2212,7 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)
m.installFilesDepSet = newInstallPathsDepSet(m.installFiles, dependencyInstallFiles)
m.packagingSpecsDepSet = newPackagingSpecsDepSet(m.packagingSpecs, dependencyPackagingSpecs)
buildLicenseMetadata(ctx)
buildLicenseMetadata(ctx, m.licenseMetadataFile)
m.buildParams = ctx.buildParams
m.ruleParams = ctx.ruleParams