Skip to content

Commit

Permalink
Added module_name to license metadata
Browse files Browse the repository at this point in the history
Test: m droid dist

Change-Id: Idfe01da3c41adc1354112cc4b44e035feca61a7b
  • Loading branch information
Ibrahim Kanouche authored and bbadour committed Oct 13, 2022
1 parent 49b5938 commit 4992078
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 47 deletions.
5 changes: 5 additions & 0 deletions android/license_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ func buildLicenseMetadata(ctx ModuleContext, licenseMetadataFile WritablePath) {
var orderOnlyDeps Paths
var args []string

if n := ctx.ModuleName(); n != "" {
args = append(args,
"-mn "+proptools.NinjaAndShellEscape(n))
}

if t := ctx.ModuleType(); t != "" {
args = append(args,
"-mt "+proptools.NinjaAndShellEscape(t))
Expand Down
2 changes: 2 additions & 0 deletions compliance/build_license_metadata/build_license_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func main() {

packageName := flags.String("p", "", "license package name")
moduleType := newMultiString(flags, "mt", "module type")
moduleName := flags.String("mn", "", "module name")
kinds := newMultiString(flags, "k", "license kinds")
moduleClass := newMultiString(flags, "mc", "module class")
conditions := newMultiString(flags, "c", "license conditions")
Expand All @@ -83,6 +84,7 @@ func main() {

metadata := license_metadata_proto.LicenseMetadata{}
metadata.PackageName = proto.String(*packageName)
metadata.ModuleName = proto.String(*moduleName)
metadata.ModuleTypes = *moduleType
metadata.ModuleClasses = *moduleClass
metadata.IsContainer = proto.Bool(*isContainer)
Expand Down
105 changes: 58 additions & 47 deletions compliance/license_metadata_proto/license_metadata.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions compliance/license_metadata_proto/license_metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ message LicenseMetadata {
// package_name identifies the source package. License texts are named relative to the package name.
optional string package_name = 1;

// module_name identifies the target
optional string module_name = 14;

repeated string module_types = 2;

repeated string module_classes = 3;
Expand Down Expand Up @@ -54,6 +57,9 @@ message LicenseMetadata {

// deps lists the license metadata files depended on.
repeated AnnotatedDependency deps = 13;

// next id: 15

}

// InstallMap messages describe the mapping from an input filesystem file to the path to the file
Expand Down

0 comments on commit 4992078

Please sign in to comment.