Merge "Include license texts and kinds for VNDK snapshot"
This commit is contained in:
@@ -550,6 +550,7 @@ type Module interface {
|
|||||||
ExportedToMake() bool
|
ExportedToMake() bool
|
||||||
InitRc() Paths
|
InitRc() Paths
|
||||||
VintfFragments() Paths
|
VintfFragments() Paths
|
||||||
|
EffectiveLicenseKinds() []string
|
||||||
EffectiveLicenseFiles() Paths
|
EffectiveLicenseFiles() Paths
|
||||||
|
|
||||||
AddProperties(props ...interface{})
|
AddProperties(props ...interface{})
|
||||||
@@ -2024,6 +2025,10 @@ func (m *ModuleBase) ExportedToMake() bool {
|
|||||||
return m.commonProperties.NamespaceExportedToMake
|
return m.commonProperties.NamespaceExportedToMake
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *ModuleBase) EffectiveLicenseKinds() []string {
|
||||||
|
return m.commonProperties.Effective_license_kinds
|
||||||
|
}
|
||||||
|
|
||||||
func (m *ModuleBase) EffectiveLicenseFiles() Paths {
|
func (m *ModuleBase) EffectiveLicenseFiles() Paths {
|
||||||
result := make(Paths, 0, len(m.commonProperties.Effective_license_text))
|
result := make(Paths, 0, len(m.commonProperties.Effective_license_text))
|
||||||
for _, p := range m.commonProperties.Effective_license_text {
|
for _, p := range m.commonProperties.Effective_license_text {
|
||||||
|
24
cc/vndk.go
24
cc/vndk.go
@@ -674,8 +674,12 @@ func (c *vndkSnapshotSingleton) GenerateBuildActions(ctx android.SingletonContex
|
|||||||
snapshotArchDir := filepath.Join(snapshotDir, ctx.DeviceConfig().DeviceArch())
|
snapshotArchDir := filepath.Join(snapshotDir, ctx.DeviceConfig().DeviceArch())
|
||||||
|
|
||||||
configsDir := filepath.Join(snapshotArchDir, "configs")
|
configsDir := filepath.Join(snapshotArchDir, "configs")
|
||||||
|
noticeDir := filepath.Join(snapshotArchDir, "NOTICE_FILES")
|
||||||
includeDir := filepath.Join(snapshotArchDir, "include")
|
includeDir := filepath.Join(snapshotArchDir, "include")
|
||||||
|
|
||||||
|
// set of notice files copied.
|
||||||
|
noticeBuilt := make(map[string]bool)
|
||||||
|
|
||||||
// paths of VNDK modules for GPL license checking
|
// paths of VNDK modules for GPL license checking
|
||||||
modulePaths := make(map[string]string)
|
modulePaths := make(map[string]string)
|
||||||
|
|
||||||
@@ -700,18 +704,26 @@ func (c *vndkSnapshotSingleton) GenerateBuildActions(ctx android.SingletonContex
|
|||||||
snapshotLibOut := filepath.Join(snapshotArchDir, targetArch, "shared", vndkType, libPath.Base())
|
snapshotLibOut := filepath.Join(snapshotArchDir, targetArch, "shared", vndkType, libPath.Base())
|
||||||
ret = append(ret, snapshot.CopyFileRule(pctx, ctx, libPath, snapshotLibOut))
|
ret = append(ret, snapshot.CopyFileRule(pctx, ctx, libPath, snapshotLibOut))
|
||||||
|
|
||||||
if ctx.Config().VndkSnapshotBuildArtifacts() {
|
// json struct to export snapshot information
|
||||||
prop := struct {
|
prop := struct {
|
||||||
|
LicenseKinds []string `json:",omitempty"`
|
||||||
|
LicenseTexts []string `json:",omitempty"`
|
||||||
ExportedDirs []string `json:",omitempty"`
|
ExportedDirs []string `json:",omitempty"`
|
||||||
ExportedSystemDirs []string `json:",omitempty"`
|
ExportedSystemDirs []string `json:",omitempty"`
|
||||||
ExportedFlags []string `json:",omitempty"`
|
ExportedFlags []string `json:",omitempty"`
|
||||||
RelativeInstallPath string `json:",omitempty"`
|
RelativeInstallPath string `json:",omitempty"`
|
||||||
}{}
|
}{}
|
||||||
|
|
||||||
|
prop.LicenseKinds = m.EffectiveLicenseKinds()
|
||||||
|
prop.LicenseTexts = m.EffectiveLicenseFiles().Strings()
|
||||||
|
|
||||||
|
if ctx.Config().VndkSnapshotBuildArtifacts() {
|
||||||
exportedInfo := ctx.ModuleProvider(m, FlagExporterInfoProvider).(FlagExporterInfo)
|
exportedInfo := ctx.ModuleProvider(m, FlagExporterInfoProvider).(FlagExporterInfo)
|
||||||
prop.ExportedFlags = exportedInfo.Flags
|
prop.ExportedFlags = exportedInfo.Flags
|
||||||
prop.ExportedDirs = exportedInfo.IncludeDirs.Strings()
|
prop.ExportedDirs = exportedInfo.IncludeDirs.Strings()
|
||||||
prop.ExportedSystemDirs = exportedInfo.SystemIncludeDirs.Strings()
|
prop.ExportedSystemDirs = exportedInfo.SystemIncludeDirs.Strings()
|
||||||
prop.RelativeInstallPath = m.RelativeInstallPath()
|
prop.RelativeInstallPath = m.RelativeInstallPath()
|
||||||
|
}
|
||||||
|
|
||||||
propOut := snapshotLibOut + ".json"
|
propOut := snapshotLibOut + ".json"
|
||||||
|
|
||||||
@@ -721,7 +733,7 @@ func (c *vndkSnapshotSingleton) GenerateBuildActions(ctx android.SingletonContex
|
|||||||
return nil, false
|
return nil, false
|
||||||
}
|
}
|
||||||
ret = append(ret, snapshot.WriteStringToFileRule(ctx, string(j), propOut))
|
ret = append(ret, snapshot.WriteStringToFileRule(ctx, string(j), propOut))
|
||||||
}
|
|
||||||
return ret, true
|
return ret, true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -761,6 +773,14 @@ func (c *vndkSnapshotSingleton) GenerateBuildActions(ctx android.SingletonContex
|
|||||||
moduleNames[stem] = ctx.ModuleName(m)
|
moduleNames[stem] = ctx.ModuleName(m)
|
||||||
modulePaths[stem] = ctx.ModuleDir(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() {
|
if ctx.Config().VndkSnapshotBuildArtifacts() {
|
||||||
headers = append(headers, m.SnapshotHeaders()...)
|
headers = append(headers, m.SnapshotHeaders()...)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user