Revert "Use Unique lists instead of pointers in PackagingSpec."
This reverts commit db901f84d8fc7716d9fccfb09fdaca20750025fe.
Bug: 376489729
Test: builds
Flag: EXEMPT bugfix
Change-Id: Ia5dfcf7f4e3c70042001e60850e366934ab14df4
diff --git a/android/module_context.go b/android/module_context.go
index d71992d..9fa3a62 100644
--- a/android/module_context.go
+++ b/android/module_context.go
@@ -16,14 +16,13 @@
import (
"fmt"
+ "github.com/google/blueprint/depset"
"path"
"path/filepath"
"strings"
"github.com/google/blueprint"
- "github.com/google/blueprint/depset"
"github.com/google/blueprint/proptools"
- "github.com/google/blueprint/uniquelist"
)
// BuildParameters describes the set of potential parameters to build a Ninja rule.
@@ -555,8 +554,8 @@
return m.packageFile(fullInstallPath, srcPath, false)
}
-func (m *moduleContext) getAconfigPaths() Paths {
- return m.aconfigFilePaths
+func (m *moduleContext) getAconfigPaths() *Paths {
+ return &m.aconfigFilePaths
}
func (m *moduleContext) setAconfigPaths(paths Paths) {
@@ -571,12 +570,12 @@
srcPath: srcPath,
symlinkTarget: "",
executable: executable,
- effectiveLicenseFiles: uniquelist.Make(licenseFiles),
+ effectiveLicenseFiles: &licenseFiles,
partition: fullInstallPath.partition,
skipInstall: m.skipInstall(),
- aconfigPaths: uniquelist.Make(m.getAconfigPaths()),
+ aconfigPaths: m.getAconfigPaths(),
archType: m.target.Arch.ArchType,
- overrides: uniquelist.Make(overrides),
+ overrides: &overrides,
owner: m.ModuleName(),
}
m.packagingSpecs = append(m.packagingSpecs, spec)
@@ -704,9 +703,9 @@
executable: false,
partition: fullInstallPath.partition,
skipInstall: m.skipInstall(),
- aconfigPaths: uniquelist.Make(m.getAconfigPaths()),
+ aconfigPaths: m.getAconfigPaths(),
archType: m.target.Arch.ArchType,
- overrides: uniquelist.Make(overrides),
+ overrides: &overrides,
owner: m.ModuleName(),
})
@@ -751,9 +750,9 @@
executable: false,
partition: fullInstallPath.partition,
skipInstall: m.skipInstall(),
- aconfigPaths: uniquelist.Make(m.getAconfigPaths()),
+ aconfigPaths: m.getAconfigPaths(),
archType: m.target.Arch.ArchType,
- overrides: uniquelist.Make(overrides),
+ overrides: &overrides,
owner: m.ModuleName(),
})
diff --git a/android/packaging.go b/android/packaging.go
index d455788..acafcd4 100644
--- a/android/packaging.go
+++ b/android/packaging.go
@@ -23,7 +23,6 @@
"github.com/google/blueprint"
"github.com/google/blueprint/gobtools"
"github.com/google/blueprint/proptools"
- "github.com/google/blueprint/uniquelist"
)
// PackagingSpec abstracts a request to place a built artifact at a certain path in a package. A
@@ -44,7 +43,7 @@
// Whether relPathInPackage should be marked as executable or not
executable bool
- effectiveLicenseFiles uniquelist.UniqueList[Path]
+ effectiveLicenseFiles *Paths
partition string
@@ -54,13 +53,13 @@
skipInstall bool
// Paths of aconfig files for the built artifact
- aconfigPaths uniquelist.UniqueList[Path]
+ aconfigPaths *Paths
// ArchType of the module which produced this packaging spec
archType ArchType
// List of module names that this packaging spec overrides
- overrides uniquelist.UniqueList[string]
+ overrides *[]string
// Name of the module where this packaging spec is output of
owner string
@@ -71,12 +70,12 @@
SrcPath Path
SymlinkTarget string
Executable bool
- EffectiveLicenseFiles Paths
+ EffectiveLicenseFiles *Paths
Partition string
SkipInstall bool
- AconfigPaths Paths
+ AconfigPaths *Paths
ArchType ArchType
- Overrides []string
+ Overrides *[]string
Owner string
}
@@ -86,12 +85,12 @@
SrcPath: p.srcPath,
SymlinkTarget: p.symlinkTarget,
Executable: p.executable,
- EffectiveLicenseFiles: p.effectiveLicenseFiles.ToSlice(),
+ EffectiveLicenseFiles: p.effectiveLicenseFiles,
Partition: p.partition,
SkipInstall: p.skipInstall,
- AconfigPaths: p.aconfigPaths.ToSlice(),
+ AconfigPaths: p.aconfigPaths,
ArchType: p.archType,
- Overrides: p.overrides.ToSlice(),
+ Overrides: p.overrides,
Owner: p.owner,
}
}
@@ -101,12 +100,12 @@
p.srcPath = data.SrcPath
p.symlinkTarget = data.SymlinkTarget
p.executable = data.Executable
- p.effectiveLicenseFiles = uniquelist.Make(data.EffectiveLicenseFiles)
+ p.effectiveLicenseFiles = data.EffectiveLicenseFiles
p.partition = data.Partition
p.skipInstall = data.SkipInstall
- p.aconfigPaths = uniquelist.Make(data.AconfigPaths)
+ p.aconfigPaths = data.AconfigPaths
p.archType = data.ArchType
- p.overrides = uniquelist.Make(data.Overrides)
+ p.overrides = data.Overrides
p.owner = data.Owner
}
@@ -156,7 +155,10 @@
}
func (p *PackagingSpec) EffectiveLicenseFiles() Paths {
- return p.effectiveLicenseFiles.ToSlice()
+ if p.effectiveLicenseFiles == nil {
+ return Paths{}
+ }
+ return *p.effectiveLicenseFiles
}
func (p *PackagingSpec) Partition() string {
@@ -169,7 +171,7 @@
// Paths of aconfig files for the built artifact
func (p *PackagingSpec) GetAconfigPaths() Paths {
- return p.aconfigPaths.ToSlice()
+ return *p.aconfigPaths
}
type PackageModule interface {
@@ -434,7 +436,9 @@
}
all = append(all, ps)
depNames = append(depNames, child.Name())
- overridden = append(overridden, ps.overrides.ToSlice()...)
+ if ps.overrides != nil {
+ overridden = append(overridden, *ps.overrides...)
+ }
}
})