Add ability to declare licenses in soong.

See: http://go/android-license-checking-in-soong-v2-design

Bug: 151953481
Bug: 151177513
Bug: 67772237

Change-Id: I97943de53b071cd9918679c17015ed3397c172e9
This commit is contained in:
Bob Badour
2020-08-07 19:45:11 -07:00
parent e6056153cf
commit 8a36d94714
12 changed files with 1770 additions and 1 deletions

View File

@@ -31,6 +31,8 @@ func RegisterPackageBuildComponents(ctx RegistrationContext) {
type packageProperties struct {
// Specifies the default visibility for all modules defined in this package.
Default_visibility []string
// Specifies the default license terms for all modules defined in this package.
Default_applicable_licenses []string
}
type packageModule struct {
@@ -68,5 +70,9 @@ func PackageFactory() Module {
// its checking and parsing phases so make it the primary visibility property.
setPrimaryVisibilityProperty(module, "default_visibility", &module.properties.Default_visibility)
// The default_applicable_licenses property needs to be checked and parsed by the licenses module during
// its checking and parsing phases so make it the primary licenses property.
setPrimaryLicensesProperty(module, "default_applicable_licenses", &module.properties.Default_applicable_licenses)
return module
}