Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c68db4b3 authored by Colin Cross's avatar Colin Cross
Browse files

Remove InstallBypassMake and ToMakePath

InstallBypassMake and ToMakePath are obsolete, remove them.

Bug: 204136549
Test: m checkbuild
Change-Id: Ie5a6f7254b3d317ed6039e114ed6aec35e1ce273
parent e23a32bd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -518,7 +518,7 @@ func (a *AndroidMkEntries) fillInEntries(ctx fillInEntriesContext, mod blueprint
	a.AddStrings("LOCAL_TARGET_REQUIRED_MODULES", a.Target_required...)

	// If the install rule was generated by Soong tell Make about it.
	if amod.InstallBypassMake() && len(base.katiInstalls) > 0 {
	if len(base.katiInstalls) > 0 {
		// Assume the primary install file is last since it probably needs to depend on any other
		// installed files.  If that is not the case we can add a method to specify the primary
		// installed file.
+0 −9
Original line number Diff line number Diff line
@@ -569,9 +569,6 @@ 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)
	if ctx.Config().KatiEnabled() {
		path = path.ToMakePath()
	}
	return path
}

@@ -581,17 +578,11 @@ func (c *config) HostJNIToolPath(ctx PathContext, lib string) Path {
		ext = ".dylib"
	}
	path := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "lib64", false, lib+ext)
	if ctx.Config().KatiEnabled() {
		path = path.ToMakePath()
	}
	return path
}

func (c *config) HostJavaToolPath(ctx PathContext, tool string) Path {
	path := pathForInstall(ctx, ctx.Config().BuildOS, ctx.Config().BuildArch, "framework", false, tool)
	if ctx.Config().KatiEnabled() {
		path = path.ToMakePath()
	}
	return path
}

+3 −19
Original line number Diff line number Diff line
@@ -429,7 +429,6 @@ type ModuleContext interface {
	InstallInRecovery() bool
	InstallInRoot() bool
	InstallInVendor() bool
	InstallBypassMake() bool
	InstallForceOS() (*OsType, *ArchType)

	RequiredModuleNames() []string
@@ -496,7 +495,6 @@ type Module interface {
	InstallInRecovery() bool
	InstallInRoot() bool
	InstallInVendor() bool
	InstallBypassMake() bool
	InstallForceOS() (*OsType, *ArchType)
	HideFromMake()
	IsHideFromMake() bool
@@ -1704,10 +1702,6 @@ func (m *ModuleBase) InstallInRoot() bool {
	return false
}

func (m *ModuleBase) InstallBypassMake() bool {
	return true
}

func (m *ModuleBase) InstallForceOS() (*OsType, *ArchType) {
	return nil, nil
}
@@ -2829,10 +2823,6 @@ func (m *moduleContext) InstallInRoot() bool {
	return m.module.InstallInRoot()
}

func (m *moduleContext) InstallBypassMake() bool {
	return m.module.InstallBypassMake()
}

func (m *moduleContext) InstallForceOS() (*OsType, *ArchType) {
	return m.module.InstallForceOS()
}
@@ -2857,12 +2847,6 @@ func (m *moduleContext) skipInstall() bool {
		return true
	}

	if m.Device() {
		if m.Config().KatiEnabled() && !m.InstallBypassMake() {
			return true
		}
	}

	return false
}

@@ -2921,7 +2905,7 @@ func (m *moduleContext) installFile(installPath InstallPath, name string, srcPat
			orderOnlyDeps = deps
		}

		if m.Config().KatiEnabled() && m.InstallBypassMake() {
		if m.Config().KatiEnabled() {
			// When creating the install rule in Soong but embedding in Make, write the rule to a
			// makefile instead of directly to the ninja file so that main.mk can add the
			// dependencies from the `required` property that are hard to resolve in Soong.
@@ -2980,7 +2964,7 @@ func (m *moduleContext) InstallSymlink(installPath InstallPath, name string, src
	}
	if !m.skipInstall() {

		if m.Config().KatiEnabled() && m.InstallBypassMake() {
		if m.Config().KatiEnabled() {
			// When creating the symlink rule in Soong but embedding in Make, write the rule to a
			// makefile instead of directly to the ninja file so that main.mk can add the
			// dependencies from the `required` property that are hard to resolve in Soong.
@@ -3026,7 +3010,7 @@ func (m *moduleContext) InstallAbsoluteSymlink(installPath InstallPath, name str
	m.module.base().hooks.runInstallHooks(m, nil, fullInstallPath, true)

	if !m.skipInstall() {
		if m.Config().KatiEnabled() && m.InstallBypassMake() {
		if m.Config().KatiEnabled() {
			// When creating the symlink rule in Soong but embedding in Make, write the rule to a
			// makefile instead of directly to the ninja file so that main.mk can add the
			// dependencies from the `required` property that are hard to resolve in Soong.
+1 −5
Original line number Diff line number Diff line
@@ -204,10 +204,6 @@ type depsModule struct {
	}
}

func (m *depsModule) InstallBypassMake() bool {
	return true
}

func (m *depsModule) GenerateAndroidBuildActions(ctx ModuleContext) {
	outputFile := PathForModuleOut(ctx, ctx.ModuleName())
	ctx.Build(pctx, BuildParams{
@@ -450,7 +446,7 @@ func TestInstall(t *testing.T) {
	assertOrderOnlys(symlinkRule("foo"))
}

func TestInstallBypassMake(t *testing.T) {
func TestInstallKatiEnabled(t *testing.T) {
	if runtime.GOOS != "linux" {
		t.Skip("requires linux")
	}
+6 −14
Original line number Diff line number Diff line
@@ -112,7 +112,6 @@ type ModuleInstallPathContext interface {
	InstallInDebugRamdisk() bool
	InstallInRecovery() bool
	InstallInRoot() bool
	InstallBypassMake() bool
	InstallForceOS() (*OsType, *ArchType)
}

@@ -465,9 +464,6 @@ 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)
	if ctx.Config().KatiEnabled() {
		goBinaryInstallDir = goBinaryInstallDir.ToMakePath()
	}
	rel := Rel(ctx, goBinaryInstallDir.String(), goBinary.InstallPath())
	return goBinaryInstallDir.Join(ctx, rel)
}
@@ -1646,8 +1642,8 @@ func (p InstallPath) withRel(rel string) InstallPath {
	return p
}

// ToMakePath returns a new InstallPath that points to Make's install directory instead of Soong's,
// i.e. out/ instead of out/soong/.
// Deprecated: ToMakePath is a noop, PathForModuleInstall always returns Make paths when building
// embedded in Make.
func (p InstallPath) ToMakePath() InstallPath {
	p.makePath = true
	return p
@@ -1688,9 +1684,6 @@ func osAndArch(ctx ModuleInstallPathContext) (OsType, ArchType) {

func makePathForInstall(ctx ModuleInstallPathContext, os OsType, arch ArchType, partition string, debug bool, pathComponents ...string) InstallPath {
	ret := pathForInstall(ctx, os, arch, partition, debug, pathComponents...)
	if ctx.InstallBypassMake() && ctx.Config().KatiEnabled() {
		ret = ret.ToMakePath()
	}
	return ret
}

@@ -1732,7 +1725,10 @@ func pathForInstall(ctx PathContext, os OsType, arch ArchType, partition string,
		soongOutDir:  ctx.Config().soongOutDir,
		partitionDir: partionPath,
		partition:    partition,
		makePath:     false,
	}

	if ctx.Config().KatiEnabled() {
		base.makePath = true
	}

	return base.Join(ctx, pathComponents...)
@@ -2008,10 +2004,6 @@ func (m testModuleInstallPathContext) InstallInRoot() bool {
	return m.inRoot
}

func (m testModuleInstallPathContext) InstallBypassMake() bool {
	return false
}

func (m testModuleInstallPathContext) InstallForceOS() (*OsType, *ArchType) {
	return m.forceOS, m.forceArch
}
Loading