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

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

Remove infrastructure to run bp2build

Bug: 315353489
Test: m blueprint_tests
Change-Id: Idcf6377d389b94c39e4e6ff4b8efa8a9f9e78b17
parent 8ff10586
Loading
Loading
Loading
Loading
+0 −9
Original line number Original line Diff line number Diff line
@@ -12,14 +12,11 @@ bootstrap_go_package {
        "sbox_proto",
        "sbox_proto",
        "soong",
        "soong",
        "soong-android-soongconfig",
        "soong-android-soongconfig",
        "soong-bazel",
        "soong-cquery",
        "soong-remoteexec",
        "soong-remoteexec",
        "soong-response",
        "soong-response",
        "soong-shared",
        "soong-shared",
        "soong-starlark",
        "soong-starlark",
        "soong-starlark-format",
        "soong-starlark-format",
        "soong-ui-bp2build_metrics_proto",
        "soong-ui-metrics_proto",
        "soong-ui-metrics_proto",
        "soong-android-allowlists",
        "soong-android-allowlists",


@@ -38,9 +35,6 @@ bootstrap_go_package {
        "arch.go",
        "arch.go",
        "arch_list.go",
        "arch_list.go",
        "base_module_context.go",
        "base_module_context.go",
        "bazel.go",
        "bazel_handler.go",
        "bazel_paths.go",
        "buildinfo_prop.go",
        "buildinfo_prop.go",
        "config.go",
        "config.go",
        "test_config.go",
        "test_config.go",
@@ -106,9 +100,6 @@ bootstrap_go_package {
        "androidmk_test.go",
        "androidmk_test.go",
        "apex_test.go",
        "apex_test.go",
        "arch_test.go",
        "arch_test.go",
        "bazel_handler_test.go",
        "bazel_paths_test.go",
        "bazel_test.go",
        "config_test.go",
        "config_test.go",
        "config_bp2build_test.go",
        "config_bp2build_test.go",
        "configured_jars_test.go",
        "configured_jars_test.go",
+0 −3
Original line number Original line Diff line number Diff line
@@ -111,9 +111,6 @@ func (a *allApexContributions) SetPrebuiltSelectionInfoProvider(ctx BaseModuleCo
		}
		}
	}
	}


	if ctx.Config().Bp2buildMode() { // Skip bp2build
		return
	}
	p := PrebuiltSelectionInfoMap{}
	p := PrebuiltSelectionInfoMap{}
	ctx.VisitDirectDepsWithTag(acDepTag, func(child Module) {
	ctx.VisitDirectDepsWithTag(acDepTag, func(child Module) {
		if m, ok := child.(*apexContributions); ok {
		if m, ok := child.(*apexContributions); ok {
+2 −2
Original line number Original line Diff line number Diff line
@@ -425,7 +425,7 @@ func osMutator(bpctx blueprint.BottomUpMutatorContext) {
	// blueprint.BottomUpMutatorContext because android.BottomUpMutatorContext
	// blueprint.BottomUpMutatorContext because android.BottomUpMutatorContext
	// filters out non-Soong modules.  Now that we've handled them, create a
	// filters out non-Soong modules.  Now that we've handled them, create a
	// normal android.BottomUpMutatorContext.
	// normal android.BottomUpMutatorContext.
	mctx := bottomUpMutatorContextFactory(bpctx, module, false, false)
	mctx := bottomUpMutatorContextFactory(bpctx, module, false)


	base := module.base()
	base := module.base()


@@ -570,7 +570,7 @@ func archMutator(bpctx blueprint.BottomUpMutatorContext) {
	// blueprint.BottomUpMutatorContext because android.BottomUpMutatorContext
	// blueprint.BottomUpMutatorContext because android.BottomUpMutatorContext
	// filters out non-Soong modules.  Now that we've handled them, create a
	// filters out non-Soong modules.  Now that we've handled them, create a
	// normal android.BottomUpMutatorContext.
	// normal android.BottomUpMutatorContext.
	mctx := bottomUpMutatorContextFactory(bpctx, module, false, false)
	mctx := bottomUpMutatorContextFactory(bpctx, module, false)


	base := module.base()
	base := module.base()


+0 −45
Original line number Original line Diff line number Diff line
@@ -112,8 +112,6 @@ type BaseModuleContext interface {
	// the first DependencyTag.
	// the first DependencyTag.
	GetDirectDep(name string) (blueprint.Module, blueprint.DependencyTag)
	GetDirectDep(name string) (blueprint.Module, blueprint.DependencyTag)


	ModuleFromName(name string) (blueprint.Module, bool)

	// VisitDirectDepsBlueprint calls visit for each direct dependency.  If there are multiple
	// VisitDirectDepsBlueprint calls visit for each direct dependency.  If there are multiple
	// direct dependencies on the same module visit will be called multiple times on that module
	// direct dependencies on the same module visit will be called multiple times on that module
	// and OtherModuleDependencyTag will return a different tag for each.
	// and OtherModuleDependencyTag will return a different tag for each.
@@ -209,12 +207,6 @@ type BaseModuleContext interface {
	// Calling this function prevents adding new dependencies.
	// Calling this function prevents adding new dependencies.
	getMissingDependencies() []string
	getMissingDependencies() []string


	// AddUnconvertedBp2buildDep stores module name of a direct dependency that was not converted via bp2build
	AddUnconvertedBp2buildDep(dep string)

	// AddMissingBp2buildDep stores the module name of a direct dependency that was not found.
	AddMissingBp2buildDep(dep string)

	Target() Target
	Target() Target
	TargetPrimary() bool
	TargetPrimary() bool


@@ -243,12 +235,8 @@ type baseModuleContext struct {


	strictVisitDeps bool // If true, enforce that all dependencies are enabled
	strictVisitDeps bool // If true, enforce that all dependencies are enabled


	bazelConversionMode bool
}
}


func (b *baseModuleContext) isBazelConversionMode() bool {
	return b.bazelConversionMode
}
func (b *baseModuleContext) OtherModuleName(m blueprint.Module) string {
func (b *baseModuleContext) OtherModuleName(m blueprint.Module) string {
	return b.bp.OtherModuleName(m)
	return b.bp.OtherModuleName(m)
}
}
@@ -296,18 +284,6 @@ func (b *baseModuleContext) blueprintBaseModuleContext() blueprint.BaseModuleCon
	return b.bp
	return b.bp
}
}


// AddUnconvertedBp2buildDep stores module name of a dependency that was not converted to Bazel.
func (b *baseModuleContext) AddUnconvertedBp2buildDep(dep string) {
	unconvertedDeps := &b.Module().base().commonProperties.BazelConversionStatus.UnconvertedDeps
	*unconvertedDeps = append(*unconvertedDeps, dep)
}

// AddMissingBp2buildDep stores module name of a dependency that was not found in a Android.bp file.
func (b *baseModuleContext) AddMissingBp2buildDep(dep string) {
	missingDeps := &b.Module().base().commonProperties.BazelConversionStatus.MissingDeps
	*missingDeps = append(*missingDeps, dep)
}

func (b *baseModuleContext) AddMissingDependencies(deps []string) {
func (b *baseModuleContext) AddMissingDependencies(deps []string) {
	if deps != nil {
	if deps != nil {
		missingDeps := &b.Module().base().commonProperties.MissingDeps
		missingDeps := &b.Module().base().commonProperties.MissingDeps
@@ -435,27 +411,6 @@ func (b *baseModuleContext) GetDirectDep(name string) (blueprint.Module, bluepri
	return b.getDirectDepFirstTag(name)
	return b.getDirectDepFirstTag(name)
}
}


func (b *baseModuleContext) ModuleFromName(name string) (blueprint.Module, bool) {
	if !b.isBazelConversionMode() {
		panic("cannot call ModuleFromName if not in bazel conversion mode")
	}
	var m blueprint.Module
	var ok bool
	if moduleName, _ := SrcIsModuleWithTag(name); moduleName != "" {
		m, ok = b.bp.ModuleFromName(moduleName)
	} else {
		m, ok = b.bp.ModuleFromName(name)
	}
	if !ok {
		return m, ok
	}
	// If this module is not preferred, tried to get the prebuilt version instead
	if a, aOk := m.(Module); aOk && !IsModulePrebuilt(a) && !IsModulePreferred(a) {
		return b.ModuleFromName("prebuilt_" + name)
	}
	return m, ok
}

func (b *baseModuleContext) VisitDirectDepsBlueprint(visit func(blueprint.Module)) {
func (b *baseModuleContext) VisitDirectDepsBlueprint(visit func(blueprint.Module)) {
	b.bp.VisitDirectDeps(visit)
	b.bp.VisitDirectDeps(visit)
}
}

android/bazel.go

deleted100644 → 0
+0 −784

File deleted.

Preview size limit exceeded, changes collapsed.

Loading