|
@@ -674,8 +674,12 @@ func (c *vndkSnapshotSingleton) GenerateBuildActions(ctx android.SingletonContex
|
|
|
snapshotArchDir := filepath.Join(snapshotDir, ctx.DeviceConfig().DeviceArch())
|
|
|
|
|
|
configsDir := filepath.Join(snapshotArchDir, "configs")
|
|
|
+ noticeDir := filepath.Join(snapshotArchDir, "NOTICE_FILES")
|
|
|
includeDir := filepath.Join(snapshotArchDir, "include")
|
|
|
|
|
|
+ // set of notice files copied.
|
|
|
+ noticeBuilt := make(map[string]bool)
|
|
|
+
|
|
|
// paths of VNDK modules for GPL license checking
|
|
|
modulePaths := make(map[string]string)
|
|
|
|
|
@@ -700,28 +704,36 @@ func (c *vndkSnapshotSingleton) GenerateBuildActions(ctx android.SingletonContex
|
|
|
snapshotLibOut := filepath.Join(snapshotArchDir, targetArch, "shared", vndkType, libPath.Base())
|
|
|
ret = append(ret, snapshot.CopyFileRule(pctx, ctx, libPath, snapshotLibOut))
|
|
|
|
|
|
+ // json struct to export snapshot information
|
|
|
+ prop := struct {
|
|
|
+ LicenseKinds []string `json:",omitempty"`
|
|
|
+ LicenseTexts []string `json:",omitempty"`
|
|
|
+ ExportedDirs []string `json:",omitempty"`
|
|
|
+ ExportedSystemDirs []string `json:",omitempty"`
|
|
|
+ ExportedFlags []string `json:",omitempty"`
|
|
|
+ RelativeInstallPath string `json:",omitempty"`
|
|
|
+ }{}
|
|
|
+
|
|
|
+ prop.LicenseKinds = m.EffectiveLicenseKinds()
|
|
|
+ prop.LicenseTexts = m.EffectiveLicenseFiles().Strings()
|
|
|
+
|
|
|
if ctx.Config().VndkSnapshotBuildArtifacts() {
|
|
|
- prop := struct {
|
|
|
- ExportedDirs []string `json:",omitempty"`
|
|
|
- ExportedSystemDirs []string `json:",omitempty"`
|
|
|
- ExportedFlags []string `json:",omitempty"`
|
|
|
- RelativeInstallPath string `json:",omitempty"`
|
|
|
- }{}
|
|
|
exportedInfo := ctx.ModuleProvider(m, FlagExporterInfoProvider).(FlagExporterInfo)
|
|
|
prop.ExportedFlags = exportedInfo.Flags
|
|
|
prop.ExportedDirs = exportedInfo.IncludeDirs.Strings()
|
|
|
prop.ExportedSystemDirs = exportedInfo.SystemIncludeDirs.Strings()
|
|
|
prop.RelativeInstallPath = m.RelativeInstallPath()
|
|
|
+ }
|
|
|
|
|
|
- propOut := snapshotLibOut + ".json"
|
|
|
+ propOut := snapshotLibOut + ".json"
|
|
|
|
|
|
- j, err := json.Marshal(prop)
|
|
|
- if err != nil {
|
|
|
- ctx.Errorf("json marshal to %q failed: %#v", propOut, err)
|
|
|
- return nil, false
|
|
|
- }
|
|
|
- ret = append(ret, snapshot.WriteStringToFileRule(ctx, string(j), propOut))
|
|
|
+ j, err := json.Marshal(prop)
|
|
|
+ if err != nil {
|
|
|
+ ctx.Errorf("json marshal to %q failed: %#v", propOut, err)
|
|
|
+ return nil, false
|
|
|
}
|
|
|
+ ret = append(ret, snapshot.WriteStringToFileRule(ctx, string(j), propOut))
|
|
|
+
|
|
|
return ret, true
|
|
|
}
|
|
|
|
|
@@ -761,6 +773,14 @@ func (c *vndkSnapshotSingleton) GenerateBuildActions(ctx android.SingletonContex
|
|
|
moduleNames[stem] = ctx.ModuleName(m)
|
|
|
modulePaths[stem] = ctx.ModuleDir(m)
|
|
|
|
|
|
+ for _, notice := range m.EffectiveLicenseFiles() {
|
|
|
+ if _, ok := noticeBuilt[notice.String()]; !ok {
|
|
|
+ noticeBuilt[notice.String()] = true
|
|
|
+ snapshotOutputs = append(snapshotOutputs, snapshot.CopyFileRule(
|
|
|
+ pctx, ctx, notice, filepath.Join(noticeDir, notice.String())))
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if ctx.Config().VndkSnapshotBuildArtifacts() {
|
|
|
headers = append(headers, m.SnapshotHeaders()...)
|
|
|
}
|