Merge "Remove baseModuleContext.debug" into main

This commit is contained in:
Cole Faust 2023-10-17 16:38:02 +00:00 committed by Gerrit Code Review
commit 03787bea6d
5 changed files with 12 additions and 21 deletions

View file

@ -789,7 +789,7 @@ func (c *config) HostToolDir() string {
}
func (c *config) HostToolPath(ctx PathContext, tool string) Path {
path := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "bin", false, tool)
path := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "bin", tool)
return path
}
@ -798,12 +798,12 @@ func (c *config) HostJNIToolPath(ctx PathContext, lib string) Path {
if runtime.GOOS == "darwin" {
ext = ".dylib"
}
path := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "lib64", false, lib+ext)
path := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "lib64", lib+ext)
return path
}
func (c *config) HostJavaToolPath(ctx PathContext, tool string) Path {
path := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "framework", false, tool)
path := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "framework", tool)
return path
}
@ -812,7 +812,7 @@ func (c *config) HostCcSharedLibPath(ctx PathContext, lib string) Path {
if ctx.Config().BuildArch.Multilib == "lib64" {
libDir = "lib64"
}
return pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, libDir, false, lib+".so")
return pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, libDir, lib+".so")
}
// PrebuiltOS returns the name of the host OS used in prebuilts directories.

View file

@ -380,7 +380,6 @@ type BaseModuleContext interface {
Device() bool
Darwin() bool
Windows() bool
Debug() bool
PrimaryArch() bool
}
@ -2675,7 +2674,6 @@ type baseModuleContext struct {
target Target
multiTargets []Target
targetPrimary bool
debug bool
walkPath []Module
tagPath []blueprint.DependencyTag
@ -3306,10 +3304,6 @@ func (b *baseModuleContext) Windows() bool {
return b.os == Windows
}
func (b *baseModuleContext) Debug() bool {
return b.debug
}
func (b *baseModuleContext) PrimaryArch() bool {
if len(b.config.Targets[b.target.Os]) <= 1 {
return true

View file

@ -480,7 +480,7 @@ func (p OutputPaths) Strings() []string {
// PathForGoBinary returns the path to the installed location of a bootstrap_go_binary module.
func PathForGoBinary(ctx PathContext, goBinary bootstrap.GoBinaryTool) Path {
goBinaryInstallDir := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "bin", false)
goBinaryInstallDir := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "bin")
rel := Rel(ctx, goBinaryInstallDir.String(), goBinary.InstallPath())
return goBinaryInstallDir.Join(ctx, rel)
}
@ -1684,19 +1684,19 @@ func (p InstallPath) ToMakePath() InstallPath {
func PathForModuleInstall(ctx ModuleInstallPathContext, pathComponents ...string) InstallPath {
os, arch := osAndArch(ctx)
partition := modulePartition(ctx, os)
return pathForInstall(ctx, os, arch, partition, ctx.Debug(), pathComponents...)
return pathForInstall(ctx, os, arch, partition, pathComponents...)
}
// PathForHostDexInstall returns an InstallPath representing the install path for the
// module appended with paths...
func PathForHostDexInstall(ctx ModuleInstallPathContext, pathComponents ...string) InstallPath {
return pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "", ctx.Debug(), pathComponents...)
return pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "", pathComponents...)
}
// PathForModuleInPartitionInstall is similar to PathForModuleInstall but partition is provided by the caller
func PathForModuleInPartitionInstall(ctx ModuleInstallPathContext, partition string, pathComponents ...string) InstallPath {
os, arch := osAndArch(ctx)
return pathForInstall(ctx, os, arch, partition, ctx.Debug(), pathComponents...)
return pathForInstall(ctx, os, arch, partition, pathComponents...)
}
func osAndArch(ctx ModuleInstallPathContext) (OsType, ArchType) {
@ -1712,7 +1712,7 @@ func osAndArch(ctx ModuleInstallPathContext) (OsType, ArchType) {
return os, arch
}
func pathForInstall(ctx PathContext, os OsType, arch ArchType, partition string, debug bool,
func pathForInstall(ctx PathContext, os OsType, arch ArchType, partition string,
pathComponents ...string) InstallPath {
var partitionPaths []string
@ -1742,9 +1742,6 @@ func pathForInstall(ctx PathContext, os OsType, arch ArchType, partition string,
}
partitionPaths = []string{"host", osName + "-" + archName, partition}
}
if debug {
partitionPaths = append([]string{"debug"}, partitionPaths...)
}
partitionPath, err := validatePath(partitionPaths...)
if err != nil {

View file

@ -871,7 +871,7 @@ func (c *RuleBuilderCommand) PathForOutput(path WritablePath) string {
func sboxPathForToolRel(ctx BuilderContext, path Path) string {
// Errors will be handled in RuleBuilder.Build where we have a context to report them
toolDir := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "", false)
toolDir := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "")
relOutSoong, isRelOutSoong, _ := maybeRelErr(toolDir.String(), path.String())
if isRelOutSoong {
// The tool is in the Soong output directory, it will be copied to __SBOX_OUT_DIR__/tools/out

View file

@ -60,7 +60,7 @@ func robolectricTestSuite(ctx SingletonContext, files map[string]InstallPaths) W
for _, module := range SortedKeys(files) {
installedPaths = append(installedPaths, files[module]...)
}
testCasesDir := pathForInstall(ctx, ctx.Config().BuildOS, X86, "testcases", false)
testCasesDir := pathForInstall(ctx, ctx.Config().BuildOS, X86, "testcases")
outputFile := PathForOutput(ctx, "packaging", "robolectric-tests.zip")
rule := NewRuleBuilder(pctx, ctx)
@ -69,7 +69,7 @@ func robolectricTestSuite(ctx SingletonContext, files map[string]InstallPaths) W
FlagWithArg("-P ", "host/testcases").
FlagWithArg("-C ", testCasesDir.String()).
FlagWithRspFileInputList("-r ", outputFile.ReplaceExtension(ctx, "rsp"), installedPaths.Paths()).
Flag("-sha256")
Flag("-sha256")
rule.Build("robolectric_tests_zip", "robolectric-tests.zip")
return outputFile