diff --git a/OWNERS b/OWNERS
index e5374ed..58edc89 100644
--- a/OWNERS
+++ b/OWNERS
@@ -3,29 +3,13 @@
 # approving build related projects.
 
 # AMER
-agespino@google.com  #{LAST_RESORT_SUGGESTION}
 ccross@android.com
 colefaust@google.com
-cparsons@google.com  #{LAST_RESORT_SUGGESTION}
-dacek@google.com  #{LAST_RESORT_SUGGESTION}
-delmerico@google.com  #{LAST_RESORT_SUGGESTION}
 dwillemsen@google.com
-eakammer@google.com  #{LAST_RESORT_SUGGESTION}
 jihoonkang@google.com
-jobredeaux@google.com  #{LAST_RESORT_SUGGESTION}
 joeo@google.com
-juu@google.com  #{LAST_RESORT_SUGGESTION}
 lamontjones@google.com
 mrziwang@google.com
 spandandas@google.com
-tradical@google.com  #{LAST_RESORT_SUGGESTION}
-usta@google.com  #{LAST_RESORT_SUGGESTION}
-vinhdaitran@google.com  #{LAST_RESORT_SUGGESTION}
 weiwli@google.com
-yudiliu@google.com
-
-# APAC
-jingwen@google.com  #{LAST_RESORT_SUGGESTION}
-
-# EMEA
-lberki@google.com  #{LAST_RESORT_SUGGESTION}
+yudiliu@google.com
\ No newline at end of file
diff --git a/aconfig/Android.bp b/aconfig/Android.bp
index faa4ddb..3c79f19 100644
--- a/aconfig/Android.bp
+++ b/aconfig/Android.bp
@@ -11,29 +11,20 @@
         "sbox_proto",
         "soong",
         "soong-android",
-        "soong-bazel",
-        "soong-android",
-        "soong-java",
-        "soong-rust",
     ],
     srcs: [
         "aconfig_declarations.go",
         "aconfig_values.go",
         "aconfig_value_set.go",
         "all_aconfig_declarations.go",
-        "cc_aconfig_library.go",
+        "exported_java_aconfig_library.go",
         "init.go",
-        "java_aconfig_library.go",
         "testing.go",
-        "rust_aconfig_library.go",
     ],
     testSrcs: [
         "aconfig_declarations_test.go",
         "aconfig_values_test.go",
         "aconfig_value_set_test.go",
-        "java_aconfig_library_test.go",
-        "cc_aconfig_library_test.go",
-        "rust_aconfig_library_test.go",
     ],
     pluginFor: ["soong_build"],
 }
diff --git a/aconfig/aconfig_declarations.go b/aconfig/aconfig_declarations.go
index 897f892..c4fc31a 100644
--- a/aconfig/aconfig_declarations.go
+++ b/aconfig/aconfig_declarations.go
@@ -19,14 +19,13 @@
 	"strings"
 
 	"android/soong/android"
-	"android/soong/bazel"
+
 	"github.com/google/blueprint"
 )
 
 type DeclarationsModule struct {
 	android.ModuleBase
 	android.DefaultableModuleBase
-	android.BazelModuleBase
 
 	// Properties for "aconfig_declarations"
 	properties struct {
@@ -38,6 +37,9 @@
 
 		// Values from TARGET_RELEASE / RELEASE_ACONFIG_VALUE_SETS
 		Values []string `blueprint:"mutated"`
+
+		// Container(system/vendor/apex) that this module belongs to
+		Container string
 	}
 
 	intermediatePath android.WritablePath
@@ -49,7 +51,6 @@
 	android.InitAndroidModule(module)
 	android.InitDefaultableModule(module)
 	module.AddProperties(&module.properties)
-	android.InitBazelModule(module)
 
 	return module
 }
@@ -69,6 +70,8 @@
 	if len(module.properties.Package) == 0 {
 		ctx.PropertyErrorf("package", "missing package property")
 	}
+	// TODO(b/311155208): Add mandatory check for container after all pre-existing
+	// ones are changed.
 
 	// Add a dependency on the aconfig_value_sets defined in
 	// RELEASE_ACONFIG_VALUE_SETS, and add any aconfig_values that
@@ -110,12 +113,22 @@
 }
 
 // Provider published by aconfig_value_set
-type declarationsProviderData struct {
-	Package          string
-	IntermediatePath android.WritablePath
+type DeclarationsProviderData struct {
+	Package                     string
+	Container                   string
+	IntermediateCacheOutputPath android.WritablePath
+	IntermediateDumpOutputPath  android.WritablePath
 }
 
-var declarationsProviderKey = blueprint.NewProvider(declarationsProviderData{})
+var DeclarationsProviderKey = blueprint.NewProvider(DeclarationsProviderData{})
+
+// This is used to collect the aconfig declarations info on the transitive closure,
+// the data is keyed on the container.
+type TransitiveDeclarationsInfo struct {
+	AconfigFiles map[string]android.Paths
+}
+
+var TransitiveDeclarationsInfoProvider = blueprint.NewProvider(TransitiveDeclarationsInfo{})
 
 func (module *DeclarationsModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
 	// Get the values that came from the global RELEASE_ACONFIG_VALUE_SETS flag
@@ -137,14 +150,14 @@
 
 	// Intermediate format
 	declarationFiles := android.PathsForModuleSrc(ctx, module.properties.Srcs)
-	intermediatePath := android.PathForModuleOut(ctx, "intermediate.pb")
+	intermediateCacheFilePath := android.PathForModuleOut(ctx, "intermediate.pb")
 	defaultPermission := ctx.Config().ReleaseAconfigFlagDefaultPermission()
 	inputFiles := make([]android.Path, len(declarationFiles))
 	copy(inputFiles, declarationFiles)
 	inputFiles = append(inputFiles, valuesFiles...)
 	ctx.Build(pctx, android.BuildParams{
 		Rule:        aconfigRule,
-		Output:      intermediatePath,
+		Output:      intermediateCacheFilePath,
 		Inputs:      inputFiles,
 		Description: "aconfig_declarations",
 		Args: map[string]string{
@@ -156,32 +169,73 @@
 		},
 	})
 
-	ctx.SetProvider(declarationsProviderKey, declarationsProviderData{
-		Package:          module.properties.Package,
-		IntermediatePath: intermediatePath,
+	intermediateDumpFilePath := android.PathForModuleOut(ctx, "intermediate.txt")
+	ctx.Build(pctx, android.BuildParams{
+		Rule:        aconfigTextRule,
+		Output:      intermediateDumpFilePath,
+		Inputs:      android.Paths{intermediateCacheFilePath},
+		Description: "aconfig_text",
+	})
+
+	ctx.SetProvider(DeclarationsProviderKey, DeclarationsProviderData{
+		Package:                     module.properties.Package,
+		Container:                   module.properties.Container,
+		IntermediateCacheOutputPath: intermediateCacheFilePath,
+		IntermediateDumpOutputPath:  intermediateDumpFilePath,
 	})
 
 }
+func CollectDependencyAconfigFiles(ctx android.ModuleContext, mergedAconfigFiles *map[string]android.Paths) {
+	if *mergedAconfigFiles == nil {
+		*mergedAconfigFiles = make(map[string]android.Paths)
+	}
+	ctx.VisitDirectDeps(func(module android.Module) {
+		if dep := ctx.OtherModuleProvider(module, DeclarationsProviderKey).(DeclarationsProviderData); dep.IntermediateCacheOutputPath != nil {
+			(*mergedAconfigFiles)[dep.Container] = append((*mergedAconfigFiles)[dep.Container], dep.IntermediateCacheOutputPath)
+			return
+		}
+		if dep := ctx.OtherModuleProvider(module, TransitiveDeclarationsInfoProvider).(TransitiveDeclarationsInfo); len(dep.AconfigFiles) > 0 {
+			for container, v := range dep.AconfigFiles {
+				(*mergedAconfigFiles)[container] = append((*mergedAconfigFiles)[container], v...)
+			}
+		}
+	})
 
-type bazelAconfigDeclarationsAttributes struct {
-	Srcs    bazel.LabelListAttribute
-	Package string
+	for container, aconfigFiles := range *mergedAconfigFiles {
+		(*mergedAconfigFiles)[container] = mergeAconfigFiles(ctx, aconfigFiles)
+	}
+
+	ctx.SetProvider(TransitiveDeclarationsInfoProvider, TransitiveDeclarationsInfo{
+		AconfigFiles: *mergedAconfigFiles,
+	})
 }
 
-func (module *DeclarationsModule) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	if ctx.ModuleType() != "aconfig_declarations" {
-		return
-	}
-	srcs := bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, module.properties.Srcs))
-
-	attrs := bazelAconfigDeclarationsAttributes{
-		Srcs:    srcs,
-		Package: module.properties.Package,
-	}
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "aconfig_declarations",
-		Bzl_load_location: "//build/bazel/rules/aconfig:aconfig_declarations.bzl",
+func mergeAconfigFiles(ctx android.ModuleContext, inputs android.Paths) android.Paths {
+	inputs = android.LastUniquePaths(inputs)
+	if len(inputs) == 1 {
+		return android.Paths{inputs[0]}
 	}
 
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: module.Name()}, &attrs)
+	output := android.PathForModuleOut(ctx, "aconfig_merged.pb")
+
+	ctx.Build(pctx, android.BuildParams{
+		Rule:        mergeAconfigFilesRule,
+		Description: "merge aconfig files",
+		Inputs:      inputs,
+		Output:      output,
+		Args: map[string]string{
+			"flags": android.JoinWithPrefix(inputs.Strings(), "--cache "),
+		},
+	})
+
+	return android.Paths{output}
+}
+
+func SetAconfigFileMkEntries(m *android.ModuleBase, entries *android.AndroidMkEntries, aconfigFiles map[string]android.Paths) {
+	if m.InstallInVendor() {
+		entries.SetPaths("LOCAL_ACONFIG_FILES", aconfigFiles["vendor"])
+	} else {
+		// TODO(b/311155208): The container here should be system.
+		entries.SetPaths("LOCAL_ACONFIG_FILES", aconfigFiles[""])
+	}
 }
diff --git a/aconfig/aconfig_declarations_test.go b/aconfig/aconfig_declarations_test.go
index e0d8f7d..9035c71 100644
--- a/aconfig/aconfig_declarations_test.go
+++ b/aconfig/aconfig_declarations_test.go
@@ -26,6 +26,7 @@
 		aconfig_declarations {
 			name: "module_name",
 			package: "com.example.package",
+			container: "com.android.foo",
 			srcs: [
 				"foo.aconfig",
 				"bar.aconfig",
@@ -37,9 +38,13 @@
 	module := result.ModuleForTests("module_name", "").Module().(*DeclarationsModule)
 
 	// Check that the provider has the right contents
-	depData := result.ModuleProvider(module, declarationsProviderKey).(declarationsProviderData)
+	depData := result.ModuleProvider(module, DeclarationsProviderKey).(DeclarationsProviderData)
 	android.AssertStringEquals(t, "package", depData.Package, "com.example.package")
-	if !strings.HasSuffix(depData.IntermediatePath.String(), "/intermediate.pb") {
-		t.Errorf("Missing intermediates path in provider: %s", depData.IntermediatePath.String())
+	android.AssertStringEquals(t, "container", depData.Container, "com.android.foo")
+	if !strings.HasSuffix(depData.IntermediateCacheOutputPath.String(), "/intermediate.pb") {
+		t.Errorf("Missing intermediates proto path in provider: %s", depData.IntermediateCacheOutputPath.String())
+	}
+	if !strings.HasSuffix(depData.IntermediateDumpOutputPath.String(), "/intermediate.txt") {
+		t.Errorf("Missing intermediates text path in provider: %s", depData.IntermediateDumpOutputPath.String())
 	}
 }
diff --git a/aconfig/aconfig_value_set.go b/aconfig/aconfig_value_set.go
index cd178d4..94c322a 100644
--- a/aconfig/aconfig_value_set.go
+++ b/aconfig/aconfig_value_set.go
@@ -16,7 +16,6 @@
 
 import (
 	"android/soong/android"
-	"android/soong/bazel"
 	"github.com/google/blueprint"
 )
 
@@ -24,7 +23,6 @@
 type ValueSetModule struct {
 	android.ModuleBase
 	android.DefaultableModuleBase
-	android.BazelModuleBase
 
 	properties struct {
 		// aconfig_values modules
@@ -38,7 +36,6 @@
 	android.InitAndroidModule(module)
 	android.InitDefaultableModule(module)
 	module.AddProperties(&module.properties)
-	android.InitBazelModule(module)
 
 	return module
 }
@@ -91,23 +88,3 @@
 		AvailablePackages: packages,
 	})
 }
-
-type bazelAconfigValueSetAttributes struct {
-	Values bazel.LabelListAttribute
-}
-
-func (module *ValueSetModule) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	if ctx.ModuleType() != "aconfig_value_set" {
-		return
-	}
-
-	attrs := bazelAconfigValueSetAttributes{
-		Values: bazel.MakeLabelListAttribute(android.BazelLabelForModuleDeps(ctx, module.properties.Values)),
-	}
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "aconfig_value_set",
-		Bzl_load_location: "//build/bazel/rules/aconfig:aconfig_value_set.bzl",
-	}
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: module.Name()}, &attrs)
-}
diff --git a/aconfig/aconfig_values.go b/aconfig/aconfig_values.go
index 03a930d..621aae8 100644
--- a/aconfig/aconfig_values.go
+++ b/aconfig/aconfig_values.go
@@ -16,7 +16,6 @@
 
 import (
 	"android/soong/android"
-	"android/soong/bazel"
 	"github.com/google/blueprint"
 )
 
@@ -24,7 +23,6 @@
 type ValuesModule struct {
 	android.ModuleBase
 	android.DefaultableModuleBase
-	android.BazelModuleBase
 
 	properties struct {
 		// aconfig files, relative to this Android.bp file
@@ -41,7 +39,6 @@
 	android.InitAndroidModule(module)
 	android.InitDefaultableModule(module)
 	module.AddProperties(&module.properties)
-	android.InitBazelModule(module)
 
 	return module
 }
@@ -69,27 +66,3 @@
 	}
 	ctx.SetProvider(valuesProviderKey, providerData)
 }
-
-type bazelAconfigValuesAttributes struct {
-	Srcs    bazel.LabelListAttribute
-	Package string
-}
-
-func (module *ValuesModule) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	if ctx.ModuleType() != "aconfig_values" {
-		return
-	}
-
-	srcs := bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, module.properties.Srcs))
-
-	attrs := bazelAconfigValuesAttributes{
-		Srcs:    srcs,
-		Package: module.properties.Package,
-	}
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "aconfig_values",
-		Bzl_load_location: "//build/bazel/rules/aconfig:aconfig_values.bzl",
-	}
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: module.Name()}, &attrs)
-}
diff --git a/aconfig/all_aconfig_declarations.go b/aconfig/all_aconfig_declarations.go
index 6096c6c..2686e76 100644
--- a/aconfig/all_aconfig_declarations.go
+++ b/aconfig/all_aconfig_declarations.go
@@ -37,17 +37,17 @@
 	// Find all of the aconfig_declarations modules
 	var cacheFiles android.Paths
 	ctx.VisitAllModules(func(module android.Module) {
-		if !ctx.ModuleHasProvider(module, declarationsProviderKey) {
+		if !ctx.ModuleHasProvider(module, DeclarationsProviderKey) {
 			return
 		}
-		decl := ctx.ModuleProvider(module, declarationsProviderKey).(declarationsProviderData)
-		cacheFiles = append(cacheFiles, decl.IntermediatePath)
+		decl := ctx.ModuleProvider(module, DeclarationsProviderKey).(DeclarationsProviderData)
+		cacheFiles = append(cacheFiles, decl.IntermediateCacheOutputPath)
 	})
 
 	// Generate build action for aconfig
 	this.intermediatePath = android.PathForIntermediates(ctx, "all_aconfig_declarations.pb")
 	ctx.Build(pctx, android.BuildParams{
-		Rule:        allDeclarationsRule,
+		Rule:        AllDeclarationsRule,
 		Inputs:      cacheFiles,
 		Output:      this.intermediatePath,
 		Description: "all_aconfig_declarations",
diff --git a/aconfig/codegen/Android.bp b/aconfig/codegen/Android.bp
new file mode 100644
index 0000000..494f7e6
--- /dev/null
+++ b/aconfig/codegen/Android.bp
@@ -0,0 +1,32 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+bootstrap_go_package {
+    name: "soong-aconfig-codegen",
+    pkgPath: "android/soong/aconfig/codegen",
+    deps: [
+        "blueprint",
+        "blueprint-pathtools",
+        "sbox_proto",
+        "soong",
+        "soong-aconfig",
+        "soong-android",
+        "soong-bazel",
+        "soong-java",
+        "soong-rust",
+    ],
+    srcs: [
+        "cc_aconfig_library.go",
+        "init.go",
+        "java_aconfig_library.go",
+        "rust_aconfig_library.go",
+        "testing.go",
+    ],
+    testSrcs: [
+        "java_aconfig_library_test.go",
+        "cc_aconfig_library_test.go",
+        "rust_aconfig_library_test.go",
+    ],
+    pluginFor: ["soong_build"],
+}
diff --git a/aconfig/cc_aconfig_library.go b/aconfig/codegen/cc_aconfig_library.go
similarity index 74%
rename from aconfig/cc_aconfig_library.go
rename to aconfig/codegen/cc_aconfig_library.go
index 210a581..30f6863 100644
--- a/aconfig/cc_aconfig_library.go
+++ b/aconfig/codegen/cc_aconfig_library.go
@@ -12,11 +12,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package aconfig
+package codegen
 
 import (
+	"android/soong/aconfig"
 	"android/soong/android"
-	"android/soong/bazel"
 	"android/soong/cc"
 
 	"github.com/google/blueprint"
@@ -92,7 +92,7 @@
 	if len(declarationsModules) != 1 {
 		panic(fmt.Errorf("Exactly one aconfig_declarations property required"))
 	}
-	declarations := ctx.OtherModuleProvider(declarationsModules[0], declarationsProviderKey).(declarationsProviderData)
+	declarations := ctx.OtherModuleProvider(declarationsModules[0], aconfig.DeclarationsProviderKey).(aconfig.DeclarationsProviderData)
 
 	// Figure out the generated file paths.  This has to match aconfig's codegen_cpp.rs.
 	this.generatedDir = android.PathForModuleGen(ctx)
@@ -122,7 +122,7 @@
 	if len(declarationsModules) != 1 {
 		panic(fmt.Errorf("Exactly one aconfig_declarations property required"))
 	}
-	declarations := ctx.OtherModuleProvider(declarationsModules[0], declarationsProviderKey).(declarationsProviderData)
+	declarations := ctx.OtherModuleProvider(declarationsModules[0], aconfig.DeclarationsProviderKey).(aconfig.DeclarationsProviderData)
 
 	mode := proptools.StringDefault(this.properties.Mode, "production")
 	if !isModeSupported(mode) {
@@ -131,7 +131,7 @@
 
 	ctx.Build(pctx, android.BuildParams{
 		Rule:  cppRule,
-		Input: declarations.IntermediatePath,
+		Input: declarations.IntermediateCacheOutputPath,
 		Outputs: []android.WritablePath{
 			this.generatedCpp,
 			this.generatedH,
@@ -143,41 +143,3 @@
 		},
 	})
 }
-
-type bazelCcAconfigLibraryAttributes struct {
-	cc.SdkAttributes
-	Aconfig_declarations bazel.LabelAttribute
-	Dynamic_deps         bazel.LabelListAttribute
-}
-
-// Convert the cc_aconfig_library module to bazel.
-//
-// This method is called from cc.ConvertWithBp2build to actually convert the
-// cc_aconfig_library module. This is necessary since the factory method of this
-// module type returns a cc library and the bp2build conversion is called on the
-// cc library type.
-
-func (this *CcAconfigLibraryCallbacks) GeneratorBp2build(ctx android.Bp2buildMutatorContext, module *cc.Module) bool {
-	if ctx.ModuleType() != "cc_aconfig_library" {
-		return false
-	}
-
-	attrs := bazelCcAconfigLibraryAttributes{
-		SdkAttributes:        cc.Bp2BuildParseSdkAttributes(module),
-		Aconfig_declarations: *bazel.MakeLabelAttribute(android.BazelLabelForModuleDepSingle(ctx, this.properties.Aconfig_declarations).Label),
-		Dynamic_deps:         bazel.MakeLabelListAttribute(android.BazelLabelForModuleDeps(ctx, []string{baseLibDep})),
-	}
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_aconfig_library",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_aconfig_library.bzl",
-	}
-
-	ctx.CreateBazelTargetModule(
-		props,
-		android.CommonAttributes{
-			Name: ctx.ModuleName(),
-			Tags: android.ApexAvailableTagsWithoutTestApexes(ctx, module),
-		},
-		&attrs)
-	return true
-}
diff --git a/aconfig/cc_aconfig_library_test.go b/aconfig/codegen/cc_aconfig_library_test.go
similarity index 66%
rename from aconfig/cc_aconfig_library_test.go
rename to aconfig/codegen/cc_aconfig_library_test.go
index ba27250..3de4626 100644
--- a/aconfig/cc_aconfig_library_test.go
+++ b/aconfig/codegen/cc_aconfig_library_test.go
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package aconfig
+package codegen
 
 import (
 	"fmt"
@@ -104,3 +104,61 @@
 			}
 		`, bpMode))
 }
+
+func TestAndroidMkCcLibrary(t *testing.T) {
+	bp := `
+		aconfig_declarations {
+			name: "my_aconfig_declarations_foo",
+			package: "com.example.package",
+			srcs: ["foo.aconfig"],
+			container: "vendor",
+		}
+
+		cc_aconfig_library {
+			name: "my_cc_aconfig_library_foo",
+			aconfig_declarations: "my_aconfig_declarations_foo",
+			vendor_available: true,
+		}
+
+		aconfig_declarations {
+			name: "my_aconfig_declarations_bar",
+			package: "com.example.package",
+			srcs: ["bar.aconfig"],
+		}
+
+		cc_aconfig_library {
+			name: "my_cc_aconfig_library_bar",
+			aconfig_declarations: "my_aconfig_declarations_bar",
+			vendor_available: true,
+		}
+
+		cc_library {
+			name: "my_cc_library",
+			srcs: [
+				"src/foo.cc",
+			],
+			static_libs: [
+				"my_cc_aconfig_library_foo",
+				"my_cc_aconfig_library_bar",
+			],
+			vendor: true,
+		}
+
+		cc_library {
+			name: "server_configurable_flags",
+			srcs: ["server_configurable_flags.cc"],
+		}
+	`
+	result := android.GroupFixturePreparers(
+		PrepareForTestWithAconfigBuildComponents,
+		cc.PrepareForTestWithCcDefaultModules).
+		ExtendWithErrorHandler(android.FixtureExpectsNoErrors).RunTestWithBp(t, bp)
+
+	module := result.ModuleForTests("my_cc_library", "android_arm64_armv8-a_shared").Module()
+
+	entry := android.AndroidMkEntriesForTest(t, result.TestContext, module)[0]
+
+	makeVar := entry.EntryMap["LOCAL_ACONFIG_FILES"]
+	android.AssertIntEquals(t, "len(LOCAL_ACONFIG_FILES)", 1, len(makeVar))
+	android.EnsureListContainsSuffix(t, makeVar, "my_aconfig_declarations_foo/intermediate.pb")
+}
diff --git a/aconfig/codegen/init.go b/aconfig/codegen/init.go
new file mode 100644
index 0000000..0bff9d2
--- /dev/null
+++ b/aconfig/codegen/init.go
@@ -0,0 +1,83 @@
+// Copyright 2023 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package codegen
+
+import (
+	"android/soong/android"
+
+	"github.com/google/blueprint"
+)
+
+var (
+	pctx = android.NewPackageContext("android/soong/aconfig/codegen")
+
+	// For java_aconfig_library: Generate java library
+	javaRule = pctx.AndroidStaticRule("java_aconfig_library",
+		blueprint.RuleParams{
+			Command: `rm -rf ${out}.tmp` +
+				` && mkdir -p ${out}.tmp` +
+				` && ${aconfig} create-java-lib` +
+				`    --mode ${mode}` +
+				`    --cache ${in}` +
+				`    --out ${out}.tmp` +
+				` && $soong_zip -write_if_changed -jar -o ${out} -C ${out}.tmp -D ${out}.tmp` +
+				` && rm -rf ${out}.tmp`,
+			CommandDeps: []string{
+				"$aconfig",
+				"$soong_zip",
+			},
+			Restat: true,
+		}, "mode")
+
+	// For cc_aconfig_library: Generate C++ library
+	cppRule = pctx.AndroidStaticRule("cc_aconfig_library",
+		blueprint.RuleParams{
+			Command: `rm -rf ${gendir}` +
+				` && mkdir -p ${gendir}` +
+				` && ${aconfig} create-cpp-lib` +
+				`    --mode ${mode}` +
+				`    --cache ${in}` +
+				`    --out ${gendir}`,
+			CommandDeps: []string{
+				"$aconfig",
+			},
+		}, "gendir", "mode")
+
+	// For rust_aconfig_library: Generate Rust library
+	rustRule = pctx.AndroidStaticRule("rust_aconfig_library",
+		blueprint.RuleParams{
+			Command: `rm -rf ${gendir}` +
+				` && mkdir -p ${gendir}` +
+				` && ${aconfig} create-rust-lib` +
+				`    --mode ${mode}` +
+				`    --cache ${in}` +
+				`    --out ${gendir}`,
+			CommandDeps: []string{
+				"$aconfig",
+			},
+		}, "gendir", "mode")
+)
+
+func init() {
+	RegisterBuildComponents(android.InitRegistrationContext)
+	pctx.HostBinToolVariable("aconfig", "aconfig")
+	pctx.HostBinToolVariable("soong_zip", "soong_zip")
+}
+
+func RegisterBuildComponents(ctx android.RegistrationContext) {
+	ctx.RegisterModuleType("cc_aconfig_library", CcAconfigLibraryFactory)
+	ctx.RegisterModuleType("java_aconfig_library", JavaDeclarationsLibraryFactory)
+	ctx.RegisterModuleType("rust_aconfig_library", RustAconfigLibraryFactory)
+}
diff --git a/aconfig/codegen/java_aconfig_library.go b/aconfig/codegen/java_aconfig_library.go
new file mode 100644
index 0000000..202e358
--- /dev/null
+++ b/aconfig/codegen/java_aconfig_library.go
@@ -0,0 +1,102 @@
+// Copyright 2023 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package codegen
+
+import (
+	"fmt"
+
+	"android/soong/aconfig"
+	"android/soong/android"
+	"android/soong/java"
+
+	"github.com/google/blueprint"
+	"github.com/google/blueprint/proptools"
+)
+
+type declarationsTagType struct {
+	blueprint.BaseDependencyTag
+}
+
+var declarationsTag = declarationsTagType{}
+
+var aconfigSupportedModes = []string{"production", "test", "exported"}
+
+type JavaAconfigDeclarationsLibraryProperties struct {
+	// name of the aconfig_declarations module to generate a library for
+	Aconfig_declarations string
+
+	// default mode is "production", the other accepted modes are:
+	// "test": to generate test mode version of the library
+	// "exported": to generate exported mode version of the library
+	// an error will be thrown if the mode is not supported
+	Mode *string
+}
+
+type JavaAconfigDeclarationsLibraryCallbacks struct {
+	properties JavaAconfigDeclarationsLibraryProperties
+}
+
+func JavaDeclarationsLibraryFactory() android.Module {
+	callbacks := &JavaAconfigDeclarationsLibraryCallbacks{}
+	return java.GeneratedJavaLibraryModuleFactory("java_aconfig_library", callbacks, &callbacks.properties)
+}
+
+func (callbacks *JavaAconfigDeclarationsLibraryCallbacks) DepsMutator(module *java.GeneratedJavaLibraryModule, ctx android.BottomUpMutatorContext) {
+	declarations := callbacks.properties.Aconfig_declarations
+	if len(declarations) == 0 {
+		// TODO: Add test for this case
+		ctx.PropertyErrorf("aconfig_declarations", "aconfig_declarations property required")
+	} else {
+		ctx.AddDependency(ctx.Module(), declarationsTag, declarations)
+	}
+
+	// Add aconfig-annotations-lib as a dependency for the optimization / code stripping annotations
+	module.AddSharedLibrary("aconfig-annotations-lib")
+	// TODO(b/303773055): Remove the annotation after access issue is resolved.
+	module.AddSharedLibrary("unsupportedappusage")
+}
+
+func (callbacks *JavaAconfigDeclarationsLibraryCallbacks) GenerateSourceJarBuildActions(module *java.GeneratedJavaLibraryModule, ctx android.ModuleContext) android.Path {
+	// Get the values that came from the global RELEASE_ACONFIG_VALUE_SETS flag
+	declarationsModules := ctx.GetDirectDepsWithTag(declarationsTag)
+	if len(declarationsModules) != 1 {
+		panic(fmt.Errorf("Exactly one aconfig_declarations property required"))
+	}
+	declarations := ctx.OtherModuleProvider(declarationsModules[0], aconfig.DeclarationsProviderKey).(aconfig.DeclarationsProviderData)
+
+	// Generate the action to build the srcjar
+	srcJarPath := android.PathForModuleGen(ctx, ctx.ModuleName()+".srcjar")
+
+	mode := proptools.StringDefault(callbacks.properties.Mode, "production")
+	if !isModeSupported(mode) {
+		ctx.PropertyErrorf("mode", "%q is not a supported mode", mode)
+	}
+
+	ctx.Build(pctx, android.BuildParams{
+		Rule:        javaRule,
+		Input:       declarations.IntermediateCacheOutputPath,
+		Output:      srcJarPath,
+		Description: "aconfig.srcjar",
+		Args: map[string]string{
+			"mode": mode,
+		},
+	})
+
+	return srcJarPath
+}
+
+func isModeSupported(mode string) bool {
+	return android.InList(mode, aconfigSupportedModes)
+}
diff --git a/aconfig/java_aconfig_library_test.go b/aconfig/codegen/java_aconfig_library_test.go
similarity index 84%
rename from aconfig/java_aconfig_library_test.go
rename to aconfig/codegen/java_aconfig_library_test.go
index a803672..2523abc 100644
--- a/aconfig/java_aconfig_library_test.go
+++ b/aconfig/codegen/java_aconfig_library_test.go
@@ -12,11 +12,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package aconfig
+package codegen
 
 import (
 	"fmt"
-	"strings"
 	"testing"
 
 	"android/soong/android"
@@ -34,14 +33,25 @@
 		ExtendWithErrorHandler(android.FixtureExpectsNoErrors).
 		RunTestWithBp(t, bp+`
 			aconfig_declarations {
-				name: "my_aconfig_declarations",
+				name: "my_aconfig_declarations_foo",
 				package: "com.example.package",
 				srcs: ["foo.aconfig"],
 			}
 
 			java_aconfig_library {
-				name: "my_java_aconfig_library",
-				aconfig_declarations: "my_aconfig_declarations",
+				name: "my_java_aconfig_library_foo",
+				aconfig_declarations: "my_aconfig_declarations_foo",
+			}
+
+			aconfig_declarations {
+				name: "my_aconfig_declarations_bar",
+				package: "com.example.package",
+				srcs: ["bar.aconfig"],
+			}
+
+			java_aconfig_library {
+				name: "my_java_aconfig_library_bar",
+				aconfig_declarations: "my_aconfig_declarations_bar",
 			}
 		`)
 
@@ -51,9 +61,7 @@
 
 	makeVar := entry.EntryMap["LOCAL_ACONFIG_FILES"]
 	android.AssertIntEquals(t, "len(LOCAL_ACONFIG_FILES)", 1, len(makeVar))
-	if !strings.HasSuffix(makeVar[0], "intermediate.pb") {
-		t.Errorf("LOCAL_ACONFIG_FILES should end with /intermediates.pb, instead it is: %s", makeVar[0])
-	}
+	android.EnsureListContainsSuffix(t, makeVar, "android_common/aconfig_merged.pb")
 }
 
 func TestAndroidMkJavaLibrary(t *testing.T) {
@@ -64,7 +72,8 @@
 				"src/foo.java",
 			],
 			static_libs: [
-				"my_java_aconfig_library",
+				"my_java_aconfig_library_foo",
+				"my_java_aconfig_library_bar",
 			],
 			platform_apis: true,
 		}
@@ -81,7 +90,8 @@
 				"src/foo.java",
 			],
 			static_libs: [
-				"my_java_aconfig_library",
+				"my_java_aconfig_library_foo",
+				"my_java_aconfig_library_bar",
 			],
 			platform_apis: true,
 		}
@@ -98,7 +108,8 @@
 				"src/foo.java",
 			],
 			static_libs: [
-				"my_java_aconfig_library",
+				"my_java_aconfig_library_foo",
+				"my_java_aconfig_library_bar",
 			],
 			platform_apis: true,
 			main_class: "foo",
@@ -116,7 +127,8 @@
 				"src/foo.java",
 			],
 			static_libs: [
-				"my_java_aconfig_library",
+				"my_java_aconfig_library_foo",
+				"my_java_aconfig_library_bar",
 			],
 			platform_apis: true,
 		}
@@ -134,7 +146,8 @@
 				"src/foo.java",
 			],
 			static_libs: [
-				"my_java_aconfig_library",
+				"my_java_aconfig_library_foo",
+				"my_java_aconfig_library_bar",
 			],
 			platform_apis: true,
 		}
diff --git a/aconfig/rust_aconfig_library.go b/aconfig/codegen/rust_aconfig_library.go
similarity index 94%
rename from aconfig/rust_aconfig_library.go
rename to aconfig/codegen/rust_aconfig_library.go
index 265685e..e587056 100644
--- a/aconfig/rust_aconfig_library.go
+++ b/aconfig/codegen/rust_aconfig_library.go
@@ -1,8 +1,9 @@
-package aconfig
+package codegen
 
 import (
 	"fmt"
 
+	"android/soong/aconfig"
 	"android/soong/android"
 	"android/soong/rust"
 
@@ -64,7 +65,7 @@
 	if len(declarationsModules) != 1 {
 		panic(fmt.Errorf("Exactly one aconfig_declarations property required"))
 	}
-	declarations := ctx.OtherModuleProvider(declarationsModules[0], declarationsProviderKey).(declarationsProviderData)
+	declarations := ctx.OtherModuleProvider(declarationsModules[0], aconfig.DeclarationsProviderKey).(aconfig.DeclarationsProviderData)
 
 	mode := proptools.StringDefault(a.Properties.Mode, "production")
 	if !isModeSupported(mode) {
@@ -73,7 +74,7 @@
 
 	ctx.Build(pctx, android.BuildParams{
 		Rule:  rustRule,
-		Input: declarations.IntermediatePath,
+		Input: declarations.IntermediateCacheOutputPath,
 		Outputs: []android.WritablePath{
 			generatedSource,
 		},
diff --git a/aconfig/rust_aconfig_library_test.go b/aconfig/codegen/rust_aconfig_library_test.go
similarity index 99%
rename from aconfig/rust_aconfig_library_test.go
rename to aconfig/codegen/rust_aconfig_library_test.go
index 3aeab76..c09f701 100644
--- a/aconfig/rust_aconfig_library_test.go
+++ b/aconfig/codegen/rust_aconfig_library_test.go
@@ -1,4 +1,4 @@
-package aconfig
+package codegen
 
 import (
 	"fmt"
diff --git a/aconfig/codegen/testing.go b/aconfig/codegen/testing.go
new file mode 100644
index 0000000..3e1c22e
--- /dev/null
+++ b/aconfig/codegen/testing.go
@@ -0,0 +1,25 @@
+// Copyright (C) 2021 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package codegen
+
+import (
+	"android/soong/aconfig"
+	"android/soong/android"
+)
+
+var PrepareForTestWithAconfigBuildComponents = android.FixtureRegisterWithContext(func(ctx android.RegistrationContext) {
+	ctx.RegisterModuleType("aconfig_declarations", aconfig.DeclarationsFactory)
+	RegisterBuildComponents(ctx)
+})
diff --git a/aconfig/exported_java_aconfig_library.go b/aconfig/exported_java_aconfig_library.go
new file mode 100644
index 0000000..45c5e39
--- /dev/null
+++ b/aconfig/exported_java_aconfig_library.go
@@ -0,0 +1,56 @@
+// Copyright 2023 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package aconfig
+
+import (
+	"android/soong/android"
+)
+
+func ExportedJavaDeclarationsLibraryFactory() android.Singleton {
+	return &exportedJavaDeclarationsLibrarySingleton{}
+}
+
+type exportedJavaDeclarationsLibrarySingleton struct {
+	intermediatePath android.OutputPath
+}
+
+func (this *exportedJavaDeclarationsLibrarySingleton) GenerateBuildActions(ctx android.SingletonContext) {
+	// Find all of the aconfig_declarations modules
+	var cacheFiles android.Paths
+	ctx.VisitAllModules(func(module android.Module) {
+		if !ctx.ModuleHasProvider(module, DeclarationsProviderKey) {
+			return
+		}
+		decl := ctx.ModuleProvider(module, DeclarationsProviderKey).(DeclarationsProviderData)
+		cacheFiles = append(cacheFiles, decl.IntermediateCacheOutputPath)
+	})
+
+	// Generate build action for aconfig
+	this.intermediatePath = android.PathForIntermediates(ctx, "exported_java_aconfig_library.jar")
+	ctx.Build(pctx, android.BuildParams{
+		Rule:        exportedJavaRule,
+		Inputs:      cacheFiles,
+		Output:      this.intermediatePath,
+		Description: "exported_java_aconfig_library",
+		Args: map[string]string{
+			"cache_files": android.JoinPathsWithPrefix(cacheFiles, " "),
+		},
+	})
+	ctx.Phony("exported_java_aconfig_library", this.intermediatePath)
+}
+
+func (this *exportedJavaDeclarationsLibrarySingleton) MakeVars(ctx android.MakeVarsContext) {
+	ctx.DistForGoalWithFilename("sdk", this.intermediatePath, "android-flags.jar")
+}
diff --git a/aconfig/init.go b/aconfig/init.go
index 626e66d..05fab4c 100644
--- a/aconfig/init.go
+++ b/aconfig/init.go
@@ -40,60 +40,47 @@
 			Restat: true,
 		}, "release_version", "package", "declarations", "values", "default-permission")
 
-	// For java_aconfig_library: Generate java library
-	javaRule = pctx.AndroidStaticRule("java_aconfig_library",
+	// For create-device-config-sysprops: Generate aconfig flag value map text file
+	aconfigTextRule = pctx.AndroidStaticRule("aconfig_text",
 		blueprint.RuleParams{
-			Command: `rm -rf ${out}.tmp` +
-				` && mkdir -p ${out}.tmp` +
-				` && ${aconfig} create-java-lib` +
-				`    --mode ${mode}` +
-				`    --cache ${in}` +
-				`    --out ${out}.tmp` +
-				` && $soong_zip -write_if_changed -jar -o ${out} -C ${out}.tmp -D ${out}.tmp` +
-				` && rm -rf ${out}.tmp`,
+			Command: `${aconfig} dump --format bool` +
+				` --cache ${in}` +
+				` --out ${out}.tmp` +
+				` && ( if cmp -s ${out}.tmp ${out} ; then rm ${out}.tmp ; else mv ${out}.tmp ${out} ; fi )`,
 			CommandDeps: []string{
-				"$aconfig",
-				"$soong_zip",
+				"${aconfig}",
 			},
 			Restat: true,
-		}, "mode")
-
-	// For cc_aconfig_library: Generate C++ library
-	cppRule = pctx.AndroidStaticRule("cc_aconfig_library",
-		blueprint.RuleParams{
-			Command: `rm -rf ${gendir}` +
-				` && mkdir -p ${gendir}` +
-				` && ${aconfig} create-cpp-lib` +
-				`    --mode ${mode}` +
-				`    --cache ${in}` +
-				`    --out ${gendir}`,
-			CommandDeps: []string{
-				"$aconfig",
-			},
-		}, "gendir", "mode")
-
-	// For rust_aconfig_library: Generate Rust library
-	rustRule = pctx.AndroidStaticRule("rust_aconfig_library",
-		blueprint.RuleParams{
-			Command: `rm -rf ${gendir}` +
-				` && mkdir -p ${gendir}` +
-				` && ${aconfig} create-rust-lib` +
-				`    --mode ${mode}` +
-				`    --cache ${in}` +
-				`    --out ${gendir}`,
-			CommandDeps: []string{
-				"$aconfig",
-			},
-		}, "gendir", "mode")
+		})
 
 	// For all_aconfig_declarations: Combine all parsed_flags proto files
-	allDeclarationsRule = pctx.AndroidStaticRule("all_aconfig_declarations_dump",
+	AllDeclarationsRule = pctx.AndroidStaticRule("All_aconfig_declarations_dump",
 		blueprint.RuleParams{
 			Command: `${aconfig} dump --format protobuf --out ${out} ${cache_files}`,
 			CommandDeps: []string{
 				"${aconfig}",
 			},
 		}, "cache_files")
+
+	mergeAconfigFilesRule = pctx.AndroidStaticRule("mergeAconfigFilesRule",
+		blueprint.RuleParams{
+			Command:     `${aconfig} dump --dedup --format protobuf --out $out $flags`,
+			CommandDeps: []string{"${aconfig}"},
+		}, "flags")
+	// For exported_java_aconfig_library: Generate a JAR from all
+	// java_aconfig_libraries to be consumed by apps built outside the
+	// platform
+	exportedJavaRule = pctx.AndroidStaticRule("exported_java_aconfig_library",
+		blueprint.RuleParams{
+			Command: `rm -rf ${out}.tmp` +
+				`&& for cache in ${cache_files}; do ${aconfig} create-java-lib --cache $$cache --out ${out}.tmp; done` +
+				`&& $soong_zip -write_if_changed -jar -o ${out} -C ${out}.tmp -D ${out}.tmp` +
+				`&& rm -rf ${out}.tmp`,
+			CommandDeps: []string{
+				"$aconfig",
+				"$soong_zip",
+			},
+		}, "cache_files")
 )
 
 func init() {
@@ -106,8 +93,6 @@
 	ctx.RegisterModuleType("aconfig_declarations", DeclarationsFactory)
 	ctx.RegisterModuleType("aconfig_values", ValuesFactory)
 	ctx.RegisterModuleType("aconfig_value_set", ValueSetFactory)
-	ctx.RegisterModuleType("cc_aconfig_library", CcAconfigLibraryFactory)
-	ctx.RegisterModuleType("java_aconfig_library", JavaDeclarationsLibraryFactory)
-	ctx.RegisterModuleType("rust_aconfig_library", RustAconfigLibraryFactory)
 	ctx.RegisterParallelSingletonType("all_aconfig_declarations", AllAconfigDeclarationsFactory)
+	ctx.RegisterParallelSingletonType("exported_java_aconfig_library", ExportedJavaDeclarationsLibraryFactory)
 }
diff --git a/aconfig/java_aconfig_library.go b/aconfig/java_aconfig_library.go
deleted file mode 100644
index eedb3c3..0000000
--- a/aconfig/java_aconfig_library.go
+++ /dev/null
@@ -1,158 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package aconfig
-
-import (
-	"fmt"
-
-	"android/soong/android"
-	"android/soong/bazel"
-	"android/soong/java"
-	"github.com/google/blueprint"
-	"github.com/google/blueprint/proptools"
-)
-
-type declarationsTagType struct {
-	blueprint.BaseDependencyTag
-}
-
-var declarationsTag = declarationsTagType{}
-
-var aconfigSupportedModes = []string{"production", "test", "exported"}
-
-type JavaAconfigDeclarationsLibraryProperties struct {
-	// name of the aconfig_declarations module to generate a library for
-	Aconfig_declarations string
-
-	// default mode is "production", the other accepted modes are:
-	// "test": to generate test mode version of the library
-	// "exported": to generate exported mode version of the library
-	// an error will be thrown if the mode is not supported
-	Mode *string
-}
-
-type JavaAconfigDeclarationsLibraryCallbacks struct {
-	properties JavaAconfigDeclarationsLibraryProperties
-}
-
-func JavaDeclarationsLibraryFactory() android.Module {
-	callbacks := &JavaAconfigDeclarationsLibraryCallbacks{}
-	return java.GeneratedJavaLibraryModuleFactory("java_aconfig_library", callbacks, &callbacks.properties)
-}
-
-func (callbacks *JavaAconfigDeclarationsLibraryCallbacks) DepsMutator(module *java.GeneratedJavaLibraryModule, ctx android.BottomUpMutatorContext) {
-	declarations := callbacks.properties.Aconfig_declarations
-	if len(declarations) == 0 {
-		// TODO: Add test for this case
-		ctx.PropertyErrorf("aconfig_declarations", "aconfig_declarations property required")
-	} else {
-		ctx.AddDependency(ctx.Module(), declarationsTag, declarations)
-	}
-
-	// Add aconfig-annotations-lib as a dependency for the optimization / code stripping annotations
-	module.AddSharedLibrary("aconfig-annotations-lib")
-	// TODO(b/303773055): Remove the annotation after access issue is resolved.
-	module.AddSharedLibrary("unsupportedappusage")
-}
-
-func (callbacks *JavaAconfigDeclarationsLibraryCallbacks) GenerateSourceJarBuildActions(module *java.GeneratedJavaLibraryModule, ctx android.ModuleContext) android.Path {
-	// Get the values that came from the global RELEASE_ACONFIG_VALUE_SETS flag
-	declarationsModules := ctx.GetDirectDepsWithTag(declarationsTag)
-	if len(declarationsModules) != 1 {
-		panic(fmt.Errorf("Exactly one aconfig_declarations property required"))
-	}
-	declarations := ctx.OtherModuleProvider(declarationsModules[0], declarationsProviderKey).(declarationsProviderData)
-
-	// Generate the action to build the srcjar
-	srcJarPath := android.PathForModuleGen(ctx, ctx.ModuleName()+".srcjar")
-
-	mode := proptools.StringDefault(callbacks.properties.Mode, "production")
-	if !isModeSupported(mode) {
-		ctx.PropertyErrorf("mode", "%q is not a supported mode", mode)
-	}
-
-	ctx.Build(pctx, android.BuildParams{
-		Rule:        javaRule,
-		Input:       declarations.IntermediatePath,
-		Output:      srcJarPath,
-		Description: "aconfig.srcjar",
-		Args: map[string]string{
-			"mode": mode,
-		},
-	})
-
-	// Tell the java module about the .aconfig files, so they can be propagated up the dependency chain.
-	// TODO: It would be nice to have that propagation code here instead of on java.Module and java.JavaInfo.
-	module.AddAconfigIntermediate(declarations.IntermediatePath)
-
-	return srcJarPath
-}
-
-func isModeSupported(mode string) bool {
-	return android.InList(mode, aconfigSupportedModes)
-}
-
-type bazelJavaAconfigLibraryAttributes struct {
-	Aconfig_declarations bazel.LabelAttribute
-	Sdk_version          *string
-	Libs                 bazel.LabelListAttribute
-}
-
-func (callbacks *JavaAconfigDeclarationsLibraryCallbacks) Bp2build(ctx android.Bp2buildMutatorContext, module *java.GeneratedJavaLibraryModule) {
-	if ctx.ModuleType() != "java_aconfig_library" {
-		return
-	}
-
-	// By default, soong builds the aconfig java library with private_current, however
-	// bazel currently doesn't support it so we default it to system_current. One reason
-	// is that the dependency of all java_aconfig_library aconfig-annotations-lib is
-	// built with system_current. For the java aconfig library itself it doesn't really
-	// matter whether it uses private API or system API because the only module it uses
-	// is DeviceConfig which is in system, and the rdeps of the java aconfig library
-	// won't change its sdk version either, so this should be fine.
-	// Ideally we should only use the default value if it is not set by the user, but
-	// bazel only supports a limited sdk versions, for example, the java_aconfig_library
-	// modules in framework/base use core_platform which is not supported by bazel yet.
-	// TODO(b/302148527): change soong to default to system_current as well.
-	sdkVersion := "system_current"
-
-	var libs bazel.LabelListAttribute
-	archVariantProps := module.GetArchVariantProperties(ctx, &java.CommonProperties{})
-	for axis, configToProps := range archVariantProps {
-		for config, p := range configToProps {
-			if archProps, ok := p.(*java.CommonProperties); ok {
-				var libLabels []bazel.Label
-				for _, d := range archProps.Libs {
-					neverlinkLabel := android.BazelLabelForModuleDepSingle(ctx, d)
-					neverlinkLabel.Label = neverlinkLabel.Label + "-neverlink"
-					libLabels = append(libLabels, neverlinkLabel)
-				}
-				libs.SetSelectValue(axis, config, (bazel.MakeLabelList(libLabels)))
-			}
-		}
-	}
-
-	attrs := bazelJavaAconfigLibraryAttributes{
-		Aconfig_declarations: *bazel.MakeLabelAttribute(android.BazelLabelForModuleDepSingle(ctx, callbacks.properties.Aconfig_declarations).Label),
-		Sdk_version:          &sdkVersion,
-		Libs:                 libs,
-	}
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "java_aconfig_library",
-		Bzl_load_location: "//build/bazel/rules/java:java_aconfig_library.bzl",
-	}
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: ctx.ModuleName()}, &attrs)
-}
diff --git a/aidl_library/aidl_library.go b/aidl_library/aidl_library.go
index 2c0aef7..b49c516 100644
--- a/aidl_library/aidl_library.go
+++ b/aidl_library/aidl_library.go
@@ -16,8 +16,6 @@
 
 import (
 	"android/soong/android"
-	"android/soong/bazel"
-
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/proptools"
 )
@@ -53,57 +51,9 @@
 
 type AidlLibrary struct {
 	android.ModuleBase
-	android.BazelModuleBase
 	properties aidlLibraryProperties
 }
 
-type bazelAidlLibraryAttributes struct {
-	Srcs                bazel.LabelListAttribute
-	Hdrs                bazel.LabelListAttribute
-	Strip_import_prefix *string
-	Deps                bazel.LabelListAttribute
-}
-
-func (lib *AidlLibrary) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	srcs := bazel.MakeLabelListAttribute(
-		android.BazelLabelForModuleSrc(
-			ctx,
-			lib.properties.Srcs,
-		),
-	)
-
-	hdrs := bazel.MakeLabelListAttribute(
-		android.BazelLabelForModuleSrc(
-			ctx,
-			lib.properties.Hdrs,
-		),
-	)
-
-	tags := []string{"apex_available=//apex_available:anyapex"}
-	deps := bazel.MakeLabelListAttribute(android.BazelLabelForModuleDeps(ctx, lib.properties.Deps))
-
-	attrs := &bazelAidlLibraryAttributes{
-		Srcs:                srcs,
-		Hdrs:                hdrs,
-		Strip_import_prefix: lib.properties.Strip_import_prefix,
-		Deps:                deps,
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "aidl_library",
-		Bzl_load_location: "//build/bazel/rules/aidl:aidl_library.bzl",
-	}
-
-	ctx.CreateBazelTargetModule(
-		props,
-		android.CommonAttributes{
-			Name: lib.Name(),
-			Tags: bazel.MakeStringListAttribute(tags),
-		},
-		attrs,
-	)
-}
-
 type AidlLibraryInfo struct {
 	// The direct aidl files of the module
 	Srcs android.Paths
@@ -170,7 +120,6 @@
 	module := &AidlLibrary{}
 	module.AddProperties(&module.properties)
 	android.InitAndroidModule(module)
-	android.InitBazelModule(module)
 	return module
 }
 
diff --git a/android/Android.bp b/android/Android.bp
index 62f534c..2ac1d5f 100644
--- a/android/Android.bp
+++ b/android/Android.bp
@@ -12,14 +12,11 @@
         "sbox_proto",
         "soong",
         "soong-android-soongconfig",
-        "soong-bazel",
-        "soong-cquery",
         "soong-remoteexec",
         "soong-response",
         "soong-shared",
         "soong-starlark",
         "soong-starlark-format",
-        "soong-ui-bp2build_metrics_proto",
         "soong-ui-metrics_proto",
         "soong-android-allowlists",
 
@@ -38,9 +35,6 @@
         "arch.go",
         "arch_list.go",
         "base_module_context.go",
-        "bazel.go",
-        "bazel_handler.go",
-        "bazel_paths.go",
         "buildinfo_prop.go",
         "config.go",
         "test_config.go",
@@ -106,9 +100,6 @@
         "androidmk_test.go",
         "apex_test.go",
         "arch_test.go",
-        "bazel_handler_test.go",
-        "bazel_paths_test.go",
-        "bazel_test.go",
         "config_test.go",
         "config_bp2build_test.go",
         "configured_jars_test.go",
diff --git a/android/androidmk.go b/android/androidmk.go
index f6e8799..c4b93c7 100644
--- a/android/androidmk.go
+++ b/android/androidmk.go
@@ -540,6 +540,10 @@
 		a.SetPaths("LOCAL_SOONG_INSTALL_SYMLINKS", base.katiSymlinks.InstallPaths().Paths())
 	}
 
+	if len(base.testData) > 0 {
+		a.AddStrings("LOCAL_TEST_DATA", androidMkDataPaths(base.testData)...)
+	}
+
 	if am, ok := mod.(ApexModule); ok {
 		a.SetBoolIfTrue("LOCAL_NOT_AVAILABLE_FOR_PLATFORM", am.NotAvailableForPlatform())
 	}
@@ -936,10 +940,13 @@
 
 // A utility func to format LOCAL_TEST_DATA outputs. See the comments on DataPath to understand how
 // to use this func.
-func AndroidMkDataPaths(data []DataPath) []string {
+func androidMkDataPaths(data []DataPath) []string {
 	var testFiles []string
 	for _, d := range data {
 		rel := d.SrcPath.Rel()
+		if d.WithoutRel {
+			rel = d.SrcPath.Base()
+		}
 		path := d.SrcPath.String()
 		// LOCAL_TEST_DATA requires the rel portion of the path to be removed from the path.
 		if !strings.HasSuffix(path, rel) {
diff --git a/android/apex_contributions.go b/android/apex_contributions.go
index 9b188de..f13659a 100644
--- a/android/apex_contributions.go
+++ b/android/apex_contributions.go
@@ -111,9 +111,6 @@
 		}
 	}
 
-	if ctx.Config().Bp2buildMode() { // Skip bp2build
-		return
-	}
 	p := PrebuiltSelectionInfoMap{}
 	ctx.VisitDirectDepsWithTag(acDepTag, func(child Module) {
 		if m, ok := child.(*apexContributions); ok {
diff --git a/android/arch.go b/android/arch.go
index 152016c..c39db02 100644
--- a/android/arch.go
+++ b/android/arch.go
@@ -425,7 +425,7 @@
 	// blueprint.BottomUpMutatorContext because android.BottomUpMutatorContext
 	// filters out non-Soong modules.  Now that we've handled them, create a
 	// normal android.BottomUpMutatorContext.
-	mctx := bottomUpMutatorContextFactory(bpctx, module, false, false)
+	mctx := bottomUpMutatorContextFactory(bpctx, module, false)
 
 	base := module.base()
 
@@ -446,8 +446,10 @@
 		}
 	}
 
+	createCommonOSVariant := base.commonProperties.CreateCommonOSVariant
+
 	// If there are no supported OSes then disable the module.
-	if len(moduleOSList) == 0 {
+	if len(moduleOSList) == 0 && !createCommonOSVariant {
 		base.Disable()
 		return
 	}
@@ -458,7 +460,6 @@
 		osNames[i] = os.String()
 	}
 
-	createCommonOSVariant := base.commonProperties.CreateCommonOSVariant
 	if createCommonOSVariant {
 		// A CommonOS variant was requested so add it to the list of OS variants to
 		// create. It needs to be added to the end because it needs to depend on the
@@ -570,7 +571,7 @@
 	// blueprint.BottomUpMutatorContext because android.BottomUpMutatorContext
 	// filters out non-Soong modules.  Now that we've handled them, create a
 	// normal android.BottomUpMutatorContext.
-	mctx := bottomUpMutatorContextFactory(bpctx, module, false, false)
+	mctx := bottomUpMutatorContextFactory(bpctx, module, false)
 
 	base := module.base()
 
diff --git a/android/base_module_context.go b/android/base_module_context.go
index ec9c888..4312e9b 100644
--- a/android/base_module_context.go
+++ b/android/base_module_context.go
@@ -112,8 +112,6 @@
 	// the first 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
 	// direct dependencies on the same module visit will be called multiple times on that module
 	// and OtherModuleDependencyTag will return a different tag for each.
@@ -209,12 +207,6 @@
 	// Calling this function prevents adding new dependencies.
 	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
 	TargetPrimary() bool
 
@@ -243,12 +235,8 @@
 
 	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 {
 	return b.bp.OtherModuleName(m)
 }
@@ -296,18 +284,6 @@
 	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) {
 	if deps != nil {
 		missingDeps := &b.Module().base().commonProperties.MissingDeps
@@ -435,27 +411,6 @@
 	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)) {
 	b.bp.VisitDirectDeps(visit)
 }
diff --git a/android/bazel.go b/android/bazel.go
deleted file mode 100644
index 1602b9b..0000000
--- a/android/bazel.go
+++ /dev/null
@@ -1,784 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package android
-
-import (
-	"bufio"
-	"errors"
-	"fmt"
-	"strings"
-
-	"android/soong/ui/metrics/bp2build_metrics_proto"
-
-	"github.com/google/blueprint"
-	"github.com/google/blueprint/bootstrap"
-	"github.com/google/blueprint/proptools"
-
-	"android/soong/android/allowlists"
-)
-
-const (
-	// A sentinel value to be used as a key in Bp2BuildConfig for modules with
-	// no package path. This is also the module dir for top level Android.bp
-	// modules.
-	Bp2BuildTopLevel = "."
-)
-
-type MixedBuildEnabledStatus int
-
-const (
-	// This module can be mixed_built.
-	MixedBuildEnabled = iota
-
-	// There is a technical incompatibility preventing this module from being
-	// bazel-analyzed. Note: the module might also be incompatible.
-	TechnicalIncompatibility
-
-	// This module cannot be mixed_built due to some incompatibility with it
-	// that is not a platform incompatibility. Example: the module-type is not
-	// enabled, or is not bp2build-converted.
-	ModuleIncompatibility
-
-	// Missing dependencies. We can't query Bazel for modules if it has missing dependencies, there
-	// will be failures.
-	ModuleMissingDeps
-)
-
-// FileGroupAsLibrary describes a filegroup module that is converted to some library
-// such as aidl_library or proto_library.
-type FileGroupAsLibrary interface {
-	ShouldConvertToAidlLibrary(ctx BazelConversionPathContext) bool
-	ShouldConvertToProtoLibrary(ctx BazelConversionPathContext) bool
-	GetAidlLibraryLabel(ctx BazelConversionPathContext) string
-	GetProtoLibraryLabel(ctx BazelConversionPathContext) string
-}
-
-type BazelConversionStatus struct {
-	// Information about _all_ bp2build targets generated by this module. Multiple targets are
-	// supported as Soong handles some things within a single target that we may choose to split into
-	// multiple targets, e.g. renderscript, protos, yacc within a cc module.
-	Bp2buildInfo []bp2buildInfo `blueprint:"mutated"`
-
-	// UnconvertedBp2buildDep stores the module names of direct dependency that were not converted to
-	// Bazel
-	UnconvertedDeps []string `blueprint:"mutated"`
-
-	// MissingBp2buildDep stores the module names of direct dependency that were not found
-	MissingDeps []string `blueprint:"mutated"`
-
-	// If non-nil, indicates that the module could not be converted successfully
-	// with bp2build. This will describe the reason the module could not be converted.
-	UnconvertedReason *UnconvertedReason
-
-	// The Partition this module will be installed on.
-	// TODO(b/306200980) Investigate how to handle modules that are installed in multiple
-	// partitions.
-	Partition string `blueprint:"mutated"`
-}
-
-// The reason a module could not be converted to a BUILD target via bp2build.
-// This should match bp2build_metrics_proto.UnconvertedReason, but omits private
-// proto-related fields that prevent copying this struct.
-type UnconvertedReason struct {
-	// Should correspond to a valid value in bp2build_metrics_proto.UnconvertedReasonType.
-	// A raw int is used here instead, because blueprint logic requires that all transitive
-	// fields of module definitions be primitives.
-	ReasonType int
-	Detail     string
-}
-
-type BazelModuleProperties struct {
-	// The label of the Bazel target replacing this Soong module. When run in conversion mode, this
-	// will import the handcrafted build target into the autogenerated file. Note: this may result in
-	// a conflict due to duplicate targets if bp2build_available is also set.
-	Label *string
-
-	// If true, bp2build will generate the converted Bazel target for this module. Note: this may
-	// cause a conflict due to the duplicate targets if label is also set.
-	//
-	// This is a bool pointer to support tristates: true, false, not set.
-	//
-	// To opt in a module, set bazel_module: { bp2build_available: true }
-	// To opt out a module, set bazel_module: { bp2build_available: false }
-	// To defer the default setting for the directory, do not set the value.
-	Bp2build_available *bool
-
-	// CanConvertToBazel is set via InitBazelModule to indicate that a module type can be converted to
-	// Bazel with Bp2build.
-	CanConvertToBazel bool `blueprint:"mutated"`
-}
-
-// Properties contains common module properties for Bazel migration purposes.
-type properties struct {
-	// In "Bazel mixed build" mode, this represents the Bazel target replacing
-	// this Soong module.
-	Bazel_module BazelModuleProperties
-}
-
-// namespacedVariableProperties is a map from a string representing a Soong
-// config variable namespace, like "android" or "vendor_name" to a slice of
-// pointer to a struct containing a single field called Soong_config_variables
-// whose value mirrors the structure in the Blueprint file.
-type namespacedVariableProperties map[string][]interface{}
-
-// BazelModuleBase contains the property structs with metadata for modules which can be converted to
-// Bazel.
-type BazelModuleBase struct {
-	bazelProperties properties
-
-	// namespacedVariableProperties is used for soong_config_module_type support
-	// in bp2build. Soong config modules allow users to set module properties
-	// based on custom product variables defined in Android.bp files. These
-	// variables are namespaced to prevent clobbering, especially when set from
-	// Makefiles.
-	namespacedVariableProperties namespacedVariableProperties
-
-	// baseModuleType is set when this module was created from a module type
-	// defined by a soong_config_module_type. Every soong_config_module_type
-	// "wraps" another module type, e.g. a soong_config_module_type can wrap a
-	// cc_defaults to a custom_cc_defaults, or cc_binary to a custom_cc_binary.
-	// This baseModuleType is set to the wrapped module type.
-	baseModuleType string
-}
-
-// Bazelable is specifies the interface for modules that can be converted to Bazel.
-type Bazelable interface {
-	bazelProps() *properties
-	HasHandcraftedLabel() bool
-	HandcraftedLabel() string
-	GetBazelLabel(ctx BazelConversionPathContext, module blueprint.Module) string
-	ShouldConvertWithBp2build(ctx ShouldConvertWithBazelContext) bool
-	shouldConvertWithBp2build(shouldConvertModuleContext, shouldConvertParams) bool
-
-	// ConvertWithBp2build either converts the module to a Bazel build target or
-	// declares the module as unconvertible (for logging and metrics).
-	// Modules must implement this function to be bp2build convertible. The function
-	// must either create at least one Bazel target module (using ctx.CreateBazelTargetModule or
-	// its related functions), or declare itself unconvertible using ctx.MarkBp2buildUnconvertible.
-	ConvertWithBp2build(ctx Bp2buildMutatorContext)
-
-	// namespacedVariableProps is a map from a soong config variable namespace
-	// (e.g. acme, android) to a map of interfaces{}, which are really
-	// reflect.Struct pointers, representing the value of the
-	// soong_config_variables property of a module. The struct pointer is the
-	// one with the single member called Soong_config_variables, which itself is
-	// a struct containing fields for each supported feature in that namespace.
-	//
-	// The reason for using a slice of interface{} is to support defaults
-	// propagation of the struct pointers.
-	namespacedVariableProps() namespacedVariableProperties
-	setNamespacedVariableProps(props namespacedVariableProperties)
-	BaseModuleType() string
-	SetBaseModuleType(baseModuleType string)
-}
-
-// ApiProvider is implemented by modules that contribute to an API surface
-type ApiProvider interface {
-	ConvertWithApiBp2build(ctx TopDownMutatorContext)
-}
-
-// MixedBuildBuildable is an interface that module types should implement in order
-// to be "handled by Bazel" in a mixed build.
-type MixedBuildBuildable interface {
-	// IsMixedBuildSupported returns true if and only if this module should be
-	// "handled by Bazel" in a mixed build.
-	// This "escape hatch" allows modules with corner-case scenarios to opt out
-	// of being built with Bazel.
-	IsMixedBuildSupported(ctx BaseModuleContext) bool
-
-	// QueueBazelCall invokes request-queueing functions on the BazelContext
-	// so that these requests are handled when Bazel's cquery is invoked.
-	QueueBazelCall(ctx BaseModuleContext)
-
-	// ProcessBazelQueryResponse uses Bazel information (obtained from the BazelContext)
-	// to set module fields and providers to propagate this module's metadata upstream.
-	// This effectively "bridges the gap" between Bazel and Soong in a mixed build.
-	// Soong modules depending on this module should be oblivious to the fact that
-	// this module was handled by Bazel.
-	ProcessBazelQueryResponse(ctx ModuleContext)
-}
-
-// BazelModule is a lightweight wrapper interface around Module for Bazel-convertible modules.
-type BazelModule interface {
-	Module
-	Bazelable
-}
-
-// InitBazelModule is a wrapper function that decorates a BazelModule with Bazel-conversion
-// properties.
-func InitBazelModule(module BazelModule) {
-	module.AddProperties(module.bazelProps())
-	module.bazelProps().Bazel_module.CanConvertToBazel = true
-}
-
-// BazelHandcraftedHook is a load hook to possibly register the current module as
-// a "handcrafted" Bazel target of a given name. If the current module should be
-// registered in this way, the hook function should return the target name. If
-// it should not be registered in this way, this function should return the empty string.
-type BazelHandcraftedHook func(ctx LoadHookContext) string
-
-// AddBazelHandcraftedHook adds a load hook to (maybe) mark the given module so that
-// it is treated by bp2build as if it has a handcrafted Bazel target.
-func AddBazelHandcraftedHook(module BazelModule, hook BazelHandcraftedHook) {
-	AddLoadHook(module, func(ctx LoadHookContext) {
-		var targetName string = hook(ctx)
-		if len(targetName) > 0 {
-			moduleDir := ctx.ModuleDir()
-			if moduleDir == Bp2BuildTopLevel {
-				moduleDir = ""
-			}
-			label := fmt.Sprintf("//%s:%s", moduleDir, targetName)
-			module.bazelProps().Bazel_module.Label = &label
-		}
-	})
-}
-
-// bazelProps returns the Bazel properties for the given BazelModuleBase.
-func (b *BazelModuleBase) bazelProps() *properties {
-	return &b.bazelProperties
-}
-
-func (b *BazelModuleBase) namespacedVariableProps() namespacedVariableProperties {
-	return b.namespacedVariableProperties
-}
-
-func (b *BazelModuleBase) setNamespacedVariableProps(props namespacedVariableProperties) {
-	b.namespacedVariableProperties = props
-}
-
-func (b *BazelModuleBase) BaseModuleType() string {
-	return b.baseModuleType
-}
-
-func (b *BazelModuleBase) SetBaseModuleType(baseModuleType string) {
-	b.baseModuleType = baseModuleType
-}
-
-// HasHandcraftedLabel returns whether this module has a handcrafted Bazel label.
-func (b *BazelModuleBase) HasHandcraftedLabel() bool {
-	return b.bazelProperties.Bazel_module.Label != nil
-}
-
-// HandcraftedLabel returns the handcrafted label for this module, or empty string if there is none
-func (b *BazelModuleBase) HandcraftedLabel() string {
-	return proptools.String(b.bazelProperties.Bazel_module.Label)
-}
-
-// GetBazelLabel returns the Bazel label for the given BazelModuleBase.
-func (b *BazelModuleBase) GetBazelLabel(ctx BazelConversionPathContext, module blueprint.Module) string {
-	if b.HasHandcraftedLabel() {
-		return b.HandcraftedLabel()
-	}
-	if b.ShouldConvertWithBp2build(ctx) {
-		return bp2buildModuleLabel(ctx, module)
-	}
-	panic(fmt.Errorf("requested non-existent label for module %s", module.Name()))
-}
-
-type Bp2BuildConversionAllowlist struct {
-	// Configure modules in these directories to enable bp2build_available: true or false by default.
-	defaultConfig allowlists.Bp2BuildConfig
-
-	// Keep any existing BUILD files (and do not generate new BUILD files) for these directories
-	// in the synthetic Bazel workspace.
-	keepExistingBuildFile map[string]bool
-
-	// Per-module allowlist to always opt modules into both bp2build and Bazel Dev Mode mixed
-	// builds. These modules are usually in directories with many other modules that are not ready
-	// for conversion.
-	//
-	// A module can either be in this list or its directory allowlisted entirely
-	// in bp2buildDefaultConfig, but not both at the same time.
-	moduleAlwaysConvert map[string]bool
-
-	// Per-module-type allowlist to always opt modules in to both bp2build and
-	// Bazel Dev Mode mixed builds when they have the same type as one listed.
-	moduleTypeAlwaysConvert map[string]bool
-
-	// Per-module denylist to always opt modules out of bp2build conversion.
-	moduleDoNotConvert map[string]bool
-}
-
-// NewBp2BuildAllowlist creates a new, empty Bp2BuildConversionAllowlist
-// which can be populated using builder pattern Set* methods
-func NewBp2BuildAllowlist() Bp2BuildConversionAllowlist {
-	return Bp2BuildConversionAllowlist{
-		allowlists.Bp2BuildConfig{},
-		map[string]bool{},
-		map[string]bool{},
-		map[string]bool{},
-		map[string]bool{},
-	}
-}
-
-// SetDefaultConfig copies the entries from defaultConfig into the allowlist
-func (a Bp2BuildConversionAllowlist) SetDefaultConfig(defaultConfig allowlists.Bp2BuildConfig) Bp2BuildConversionAllowlist {
-	if a.defaultConfig == nil {
-		a.defaultConfig = allowlists.Bp2BuildConfig{}
-	}
-	for k, v := range defaultConfig {
-		a.defaultConfig[k] = v
-	}
-
-	return a
-}
-
-// SetKeepExistingBuildFile copies the entries from keepExistingBuildFile into the allowlist
-func (a Bp2BuildConversionAllowlist) SetKeepExistingBuildFile(keepExistingBuildFile map[string]bool) Bp2BuildConversionAllowlist {
-	if a.keepExistingBuildFile == nil {
-		a.keepExistingBuildFile = map[string]bool{}
-	}
-	for k, v := range keepExistingBuildFile {
-		a.keepExistingBuildFile[k] = v
-	}
-
-	return a
-}
-
-// SetModuleAlwaysConvertList copies the entries from moduleAlwaysConvert into the allowlist
-func (a Bp2BuildConversionAllowlist) SetModuleAlwaysConvertList(moduleAlwaysConvert []string) Bp2BuildConversionAllowlist {
-	if a.moduleAlwaysConvert == nil {
-		a.moduleAlwaysConvert = map[string]bool{}
-	}
-	for _, m := range moduleAlwaysConvert {
-		a.moduleAlwaysConvert[m] = true
-	}
-
-	return a
-}
-
-// SetModuleTypeAlwaysConvertList copies the entries from moduleTypeAlwaysConvert into the allowlist
-func (a Bp2BuildConversionAllowlist) SetModuleTypeAlwaysConvertList(moduleTypeAlwaysConvert []string) Bp2BuildConversionAllowlist {
-	if a.moduleTypeAlwaysConvert == nil {
-		a.moduleTypeAlwaysConvert = map[string]bool{}
-	}
-	for _, m := range moduleTypeAlwaysConvert {
-		a.moduleTypeAlwaysConvert[m] = true
-	}
-
-	return a
-}
-
-// SetModuleDoNotConvertList copies the entries from moduleDoNotConvert into the allowlist
-func (a Bp2BuildConversionAllowlist) SetModuleDoNotConvertList(moduleDoNotConvert []string) Bp2BuildConversionAllowlist {
-	if a.moduleDoNotConvert == nil {
-		a.moduleDoNotConvert = map[string]bool{}
-	}
-	for _, m := range moduleDoNotConvert {
-		a.moduleDoNotConvert[m] = true
-	}
-
-	return a
-}
-
-// ShouldKeepExistingBuildFileForDir returns whether an existing BUILD file should be
-// added to the build symlink forest based on the current global configuration.
-func (a Bp2BuildConversionAllowlist) ShouldKeepExistingBuildFileForDir(dir string) bool {
-	if _, ok := a.keepExistingBuildFile[dir]; ok {
-		// Exact dir match
-		return true
-	}
-	var i int
-	// Check if subtree match
-	for {
-		j := strings.Index(dir[i:], "/")
-		if j == -1 {
-			return false //default
-		}
-		prefix := dir[0 : i+j]
-		i = i + j + 1 // skip the "/"
-		if recursive, ok := a.keepExistingBuildFile[prefix]; ok && recursive {
-			return true
-		}
-	}
-}
-
-var bp2BuildAllowListKey = NewOnceKey("Bp2BuildAllowlist")
-var bp2buildAllowlist OncePer
-
-func GetBp2BuildAllowList() Bp2BuildConversionAllowlist {
-	return bp2buildAllowlist.Once(bp2BuildAllowListKey, func() interface{} {
-		return NewBp2BuildAllowlist().SetDefaultConfig(allowlists.Bp2buildDefaultConfig).
-			SetKeepExistingBuildFile(allowlists.Bp2buildKeepExistingBuildFile).
-			SetModuleAlwaysConvertList(allowlists.Bp2buildModuleAlwaysConvertList).
-			SetModuleTypeAlwaysConvertList(allowlists.Bp2buildModuleTypeAlwaysConvertList).
-			SetModuleDoNotConvertList(allowlists.Bp2buildModuleDoNotConvertList)
-	}).(Bp2BuildConversionAllowlist)
-}
-
-// MixedBuildsEnabled returns a MixedBuildEnabledStatus regarding whether
-// a module is ready to be replaced by a converted or handcrafted Bazel target.
-// As a side effect, calling this method will also log whether this module is
-// mixed build enabled for metrics reporting.
-func MixedBuildsEnabled(ctx BaseModuleContext) MixedBuildEnabledStatus {
-	platformIncompatible := isPlatformIncompatible(ctx.Os(), ctx.Arch().ArchType)
-	if platformIncompatible {
-		ctx.Config().LogMixedBuild(ctx, false)
-		return TechnicalIncompatibility
-	}
-
-	if ctx.Config().AllowMissingDependencies() {
-		missingDeps := ctx.getMissingDependencies()
-		// If there are missing dependencies, querying Bazel will fail. Soong instead fails at execution
-		// time, not loading/analysis. disable mixed builds and fall back to Soong to maintain that
-		// behavior.
-		if len(missingDeps) > 0 {
-			ctx.Config().LogMixedBuild(ctx, false)
-			return ModuleMissingDeps
-		}
-	}
-
-	module := ctx.Module()
-	apexInfo := ctx.Provider(ApexInfoProvider).(ApexInfo)
-	withinApex := !apexInfo.IsForPlatform()
-	mixedBuildEnabled := ctx.Config().IsMixedBuildsEnabled() &&
-		module.Enabled() &&
-		convertedToBazel(ctx, module) &&
-		ctx.Config().BazelContext.IsModuleNameAllowed(module.Name(), withinApex)
-	ctx.Config().LogMixedBuild(ctx, mixedBuildEnabled)
-
-	if mixedBuildEnabled {
-		return MixedBuildEnabled
-	}
-	return ModuleIncompatibility
-}
-
-func isGoModule(module blueprint.Module) bool {
-	if _, ok := module.(*bootstrap.GoPackage); ok {
-		return true
-	}
-	if _, ok := module.(*bootstrap.GoBinary); ok {
-		return true
-	}
-	return false
-}
-
-// ConvertedToBazel returns whether this module has been converted (with bp2build or manually) to Bazel.
-func convertedToBazel(ctx BazelConversionContext, module blueprint.Module) bool {
-	// Special-case bootstrap_go_package and bootstrap_go_binary
-	// These do not implement Bazelable, but have been converted
-	if isGoModule(module) {
-		return true
-	}
-	b, ok := module.(Bazelable)
-	if !ok {
-		return false
-	}
-
-	return b.HasHandcraftedLabel() || b.shouldConvertWithBp2build(ctx, shouldConvertParams{
-		module:     module,
-		moduleDir:  ctx.OtherModuleDir(module),
-		moduleName: ctx.OtherModuleName(module),
-		moduleType: ctx.OtherModuleType(module),
-	})
-}
-
-type ShouldConvertWithBazelContext interface {
-	ModuleErrorf(format string, args ...interface{})
-	Module() Module
-	Config() Config
-	ModuleType() string
-	ModuleName() string
-	ModuleDir() string
-}
-
-// ShouldConvertWithBp2build returns whether the given BazelModuleBase should be converted with bp2build
-func (b *BazelModuleBase) ShouldConvertWithBp2build(ctx ShouldConvertWithBazelContext) bool {
-	return b.shouldConvertWithBp2build(ctx, shouldConvertParams{
-		module:     ctx.Module(),
-		moduleDir:  ctx.ModuleDir(),
-		moduleName: ctx.ModuleName(),
-		moduleType: ctx.ModuleType(),
-	})
-}
-
-type bazelOtherModuleContext interface {
-	ModuleErrorf(format string, args ...interface{})
-	Config() Config
-	OtherModuleType(m blueprint.Module) string
-	OtherModuleName(m blueprint.Module) string
-	OtherModuleDir(m blueprint.Module) string
-}
-
-func isPlatformIncompatible(osType OsType, arch ArchType) bool {
-	return osType == Windows || // Windows toolchains are not currently supported.
-		osType == LinuxBionic || // Linux Bionic toolchains are not currently supported.
-		osType == LinuxMusl || // Linux musl toolchains are not currently supported (b/259266326).
-		arch == Riscv64 // TODO(b/262192655) Riscv64 toolchains are not currently supported.
-}
-
-type shouldConvertModuleContext interface {
-	ModuleErrorf(format string, args ...interface{})
-	Config() Config
-}
-
-type shouldConvertParams struct {
-	module     blueprint.Module
-	moduleType string
-	moduleDir  string
-	moduleName string
-}
-
-func (b *BazelModuleBase) shouldConvertWithBp2build(ctx shouldConvertModuleContext, p shouldConvertParams) bool {
-	if !b.bazelProps().Bazel_module.CanConvertToBazel {
-		return false
-	}
-
-	module := p.module
-
-	propValue := b.bazelProperties.Bazel_module.Bp2build_available
-	packagePath := moduleDirWithPossibleOverride(ctx, module, p.moduleDir)
-
-	// Modules in unit tests which are enabled in the allowlist by type or name
-	// trigger this conditional because unit tests run under the "." package path
-	isTestModule := packagePath == Bp2BuildTopLevel && proptools.BoolDefault(propValue, false)
-	if isTestModule {
-		return true
-	}
-
-	moduleName := moduleNameWithPossibleOverride(ctx, module, p.moduleName)
-	// use "prebuilt_" + original module name as the java_import(_host) module name,
-	// to avoid the failure that a normal module and a prebuilt module with
-	// the same name are both allowlisted. This cannot be applied to all the *_import
-	// module types. For example, android_library_import has to use original module
-	// name here otherwise the *-nodeps targets cannot be handled correctly.
-	// TODO(b/304385140): remove this special casing
-	if p.moduleType == "java_import" || p.moduleType == "java_import_host" {
-		moduleName = module.Name()
-	}
-
-	allowlist := ctx.Config().Bp2buildPackageConfig
-
-	moduleNameAllowed := allowlist.moduleAlwaysConvert[moduleName]
-	moduleTypeAllowed := allowlist.moduleTypeAlwaysConvert[p.moduleType]
-	allowlistConvert := moduleNameAllowed || moduleTypeAllowed
-	if moduleNameAllowed && moduleTypeAllowed {
-		ctx.ModuleErrorf("A module %q of type %q cannot be in moduleAlwaysConvert and also be in moduleTypeAlwaysConvert", moduleName, p.moduleType)
-		return false
-	}
-
-	if allowlist.moduleDoNotConvert[moduleName] {
-		if moduleNameAllowed {
-			ctx.ModuleErrorf("a module %q cannot be in moduleDoNotConvert and also be in moduleAlwaysConvert", moduleName)
-		}
-		return false
-	}
-
-	// This is a tristate value: true, false, or unset.
-	if ok, directoryPath := bp2buildDefaultTrueRecursively(packagePath, allowlist.defaultConfig); ok {
-		if moduleNameAllowed {
-			ctx.ModuleErrorf("A module cannot be in a directory marked Bp2BuildDefaultTrue"+
-				" or Bp2BuildDefaultTrueRecursively and also be in moduleAlwaysConvert. Directory: '%s'"+
-				" Module: '%s'", directoryPath, moduleName)
-			return false
-		}
-
-		// Allow modules to explicitly opt-out.
-		return proptools.BoolDefault(propValue, true)
-	}
-
-	// Allow modules to explicitly opt-in.
-	return proptools.BoolDefault(propValue, allowlistConvert)
-}
-
-// bp2buildDefaultTrueRecursively checks that the package contains a prefix from the
-// set of package prefixes where all modules must be converted. That is, if the
-// package is x/y/z, and the list contains either x, x/y, or x/y/z, this function will
-// return true.
-//
-// However, if the package is x/y, and it matches a Bp2BuildDefaultFalse "x/y" entry
-// exactly, this module will return false early.
-//
-// This function will also return false if the package doesn't match anything in
-// the config.
-//
-// This function will also return the allowlist entry which caused a particular
-// package to be enabled. Since packages can be enabled via a recursive declaration,
-// the path returned will not always be the same as the one provided.
-func bp2buildDefaultTrueRecursively(packagePath string, config allowlists.Bp2BuildConfig) (bool, string) {
-	// Check if the package path has an exact match in the config.
-	if config[packagePath] == allowlists.Bp2BuildDefaultTrue || config[packagePath] == allowlists.Bp2BuildDefaultTrueRecursively {
-		return true, packagePath
-	} else if config[packagePath] == allowlists.Bp2BuildDefaultFalse || config[packagePath] == allowlists.Bp2BuildDefaultFalseRecursively {
-		return false, packagePath
-	}
-
-	// If not, check for the config recursively.
-	packagePrefix := packagePath
-
-	// e.g. for x/y/z, iterate over x/y, then x, taking the most-specific value from the allowlist.
-	for strings.Contains(packagePrefix, "/") {
-		dirIndex := strings.LastIndex(packagePrefix, "/")
-		packagePrefix = packagePrefix[:dirIndex]
-		switch value := config[packagePrefix]; value {
-		case allowlists.Bp2BuildDefaultTrueRecursively:
-			// package contains this prefix and this prefix should convert all modules
-			return true, packagePrefix
-		case allowlists.Bp2BuildDefaultFalseRecursively:
-			//package contains this prefix and this prefix should NOT convert any modules
-			return false, packagePrefix
-		}
-		// Continue to the next part of the package dir.
-
-	}
-
-	return false, packagePath
-}
-
-func registerBp2buildConversionMutator(ctx RegisterMutatorsContext) {
-	ctx.BottomUp("bp2build_conversion", bp2buildConversionMutator).Parallel()
-	ctx.BottomUp("bp2build_deps", bp2buildDepsMutator).Parallel()
-}
-
-func bp2buildConversionMutator(ctx BottomUpMutatorContext) {
-	// If an existing BUILD file in the module directory has a target defined
-	// with this same name as this module, assume that this is an existing
-	// definition for this target.
-	if ctx.Config().HasBazelBuildTargetInSource(ctx.ModuleDir(), ctx.ModuleName()) {
-		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_DEFINED_IN_BUILD_FILE, ctx.ModuleName())
-		return
-	}
-	bModule, ok := ctx.Module().(Bazelable)
-	if !ok {
-		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_TYPE_UNSUPPORTED, "")
-		return
-	}
-	// There may be cases where the target is created by a macro rather than in a BUILD file, those
-	// should be captured as well.
-	if bModule.HasHandcraftedLabel() {
-		// Defer to the BUILD target. Generating an additional target would
-		// cause a BUILD file conflict.
-		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_DEFINED_IN_BUILD_FILE, "")
-		return
-	}
-	// TODO: b/285631638 - Differentiate between denylisted modules and missing bp2build capabilities.
-	if !bModule.shouldConvertWithBp2build(ctx, shouldConvertParams{
-		module:     ctx.Module(),
-		moduleDir:  ctx.ModuleDir(),
-		moduleName: ctx.ModuleName(),
-		moduleType: ctx.ModuleType(),
-	}) {
-		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_UNSUPPORTED, "")
-		return
-	}
-	if ctx.Module().base().GetUnconvertedReason() != nil {
-		return
-	}
-
-	bModule.ConvertWithBp2build(ctx)
-
-	installCtx := &baseModuleContextToModuleInstallPathContext{ctx}
-	ctx.Module().base().setPartitionForBp2build(modulePartition(installCtx, true))
-
-	if len(ctx.Module().base().Bp2buildTargets()) == 0 && ctx.Module().base().GetUnconvertedReason() == nil {
-		panic(fmt.Errorf("illegal bp2build invariant: module '%s' was neither converted nor marked unconvertible", ctx.ModuleName()))
-	}
-
-	// If an existing BUILD file in the module directory has a target defined
-	// with the same name as any target generated by this module, assume that this
-	// is an existing definition for this target. (These generated target names
-	// may be different than the module name, as checked at the beginning of this function!)
-	for _, targetInfo := range ctx.Module().base().Bp2buildTargets() {
-		if ctx.Config().HasBazelBuildTargetInSource(targetInfo.TargetPackage(), targetInfo.TargetName()) {
-			// Defer to the BUILD target. Generating an additional target would
-			// cause a BUILD file conflict.
-			ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_DEFINED_IN_BUILD_FILE, targetInfo.TargetName())
-			return
-		}
-	}
-}
-
-// TODO: b/285631638 - Add this as a new mutator to the bp2build conversion mutators.
-// Currently, this only exists to prepare test coverage for the launch of this feature.
-func bp2buildDepsMutator(ctx BottomUpMutatorContext) {
-	if ctx.Module().base().GetUnconvertedReason() != nil {
-		return
-	}
-
-	if len(ctx.Module().GetMissingBp2buildDeps()) > 0 {
-		exampleDep := ctx.Module().GetMissingBp2buildDeps()[0]
-		ctx.MarkBp2buildUnconvertible(
-			bp2build_metrics_proto.UnconvertedReasonType_UNCONVERTED_DEP, exampleDep)
-	}
-
-	// Transitively mark modules unconvertible with the following set of conditions.
-	ctx.VisitDirectDeps(func(dep Module) {
-		if dep.base().GetUnconvertedReason() == nil {
-			return
-		}
-
-		if dep.base().GetUnconvertedReason().ReasonType ==
-			int(bp2build_metrics_proto.UnconvertedReasonType_DEFINED_IN_BUILD_FILE) {
-			return
-		}
-
-		if ctx.OtherModuleDependencyTag(dep) != Bp2buildDepTag {
-			return
-		}
-
-		ctx.MarkBp2buildUnconvertible(
-			bp2build_metrics_proto.UnconvertedReasonType_UNCONVERTED_DEP, dep.Name())
-	})
-}
-
-// GetMainClassInManifest scans the manifest file specified in filepath and returns
-// the value of attribute Main-Class in the manifest file if it exists, or returns error.
-// WARNING: this is for bp2build converters of java_* modules only.
-func GetMainClassInManifest(c Config, filepath string) (string, error) {
-	file, err := c.fs.Open(filepath)
-	if err != nil {
-		return "", err
-	}
-	defer file.Close()
-	scanner := bufio.NewScanner(file)
-	for scanner.Scan() {
-		line := scanner.Text()
-		if strings.HasPrefix(line, "Main-Class:") {
-			return strings.TrimSpace(line[len("Main-Class:"):]), nil
-		}
-	}
-
-	return "", errors.New("Main-Class is not found.")
-}
-
-func AttachValidationActions(ctx ModuleContext, outputFilePath Path, validations Paths) ModuleOutPath {
-	validatedOutputFilePath := PathForModuleOut(ctx, "validated", outputFilePath.Base())
-	ctx.Build(pctx, BuildParams{
-		Rule:        CpNoPreserveSymlink,
-		Description: "run validations " + outputFilePath.Base(),
-		Output:      validatedOutputFilePath,
-		Input:       outputFilePath,
-		Validations: validations,
-	})
-	return validatedOutputFilePath
-}
-
-func RunsOn(hostSupported bool, deviceSupported bool, unitTest bool) []string {
-	var runsOn []string
-
-	if hostSupported && deviceSupported {
-		runsOn = []string{"host_without_device", "device"}
-	} else if hostSupported {
-		if unitTest {
-			runsOn = []string{"host_without_device"}
-		} else {
-			runsOn = []string{"host_with_device"}
-		}
-	} else if deviceSupported {
-		runsOn = []string{"device"}
-	}
-
-	return runsOn
-}
diff --git a/android/bazel_handler.go b/android/bazel_handler.go
deleted file mode 100644
index 0c65415..0000000
--- a/android/bazel_handler.go
+++ /dev/null
@@ -1,1593 +0,0 @@
-// Copyright 2020 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package android
-
-import (
-	"bytes"
-	"crypto/sha1"
-	"encoding/hex"
-	"fmt"
-	"os"
-	"path"
-	"path/filepath"
-	"regexp"
-	"runtime"
-	"sort"
-	"strings"
-	"sync"
-
-	"android/soong/android/allowlists"
-	"android/soong/bazel/cquery"
-	"android/soong/shared"
-	"android/soong/starlark_import"
-
-	"android/soong/bazel"
-
-	"github.com/google/blueprint"
-	"github.com/google/blueprint/metrics"
-)
-
-var (
-	_                 = pctx.HostBinToolVariable("bazelBuildRunfilesTool", "build-runfiles")
-	buildRunfilesRule = pctx.AndroidStaticRule("bazelBuildRunfiles", blueprint.RuleParams{
-		Command:     "${bazelBuildRunfilesTool} ${in} ${outDir}",
-		Depfile:     "",
-		Description: "",
-		CommandDeps: []string{"${bazelBuildRunfilesTool}"},
-	}, "outDir")
-)
-
-func registerMixedBuildsMutator(ctx RegisterMutatorsContext) {
-	ctx.BottomUp("mixed_builds_prep", mixedBuildsPrepareMutator).Parallel()
-}
-
-func RegisterMixedBuildsMutator(ctx RegistrationContext) {
-	ctx.FinalDepsMutators(registerMixedBuildsMutator)
-}
-
-func mixedBuildsPrepareMutator(ctx BottomUpMutatorContext) {
-	if m := ctx.Module(); m.Enabled() {
-		if mixedBuildMod, ok := m.(MixedBuildBuildable); ok {
-			mixedBuildEnabled := MixedBuildsEnabled(ctx)
-			queueMixedBuild := mixedBuildMod.IsMixedBuildSupported(ctx) && mixedBuildEnabled == MixedBuildEnabled
-			if queueMixedBuild {
-				mixedBuildMod.QueueBazelCall(ctx)
-			}
-		}
-	}
-}
-
-type cqueryRequest interface {
-	// Name returns a string name for this request type. Such request type names must be unique,
-	// and must only consist of alphanumeric characters.
-	Name() string
-
-	// StarlarkFunctionBody returns a starlark function body to process this request type.
-	// The returned string is the body of a Starlark function which obtains
-	// all request-relevant information about a target and returns a string containing
-	// this information.
-	// The function should have the following properties:
-	//   - The arguments are `target` (a configured target) and `id_string` (the label + configuration).
-	//   - The return value must be a string.
-	//   - The function body should not be indented outside of its own scope.
-	StarlarkFunctionBody() string
-}
-
-// Portion of cquery map key to describe target configuration.
-type configKey struct {
-	arch    string
-	osType  OsType
-	apexKey ApexConfigKey
-}
-
-type ApexConfigKey struct {
-	WithinApex     bool
-	ApexSdkVersion string
-	ApiDomain      string
-}
-
-func (c ApexConfigKey) String() string {
-	return fmt.Sprintf("%s_%s_%s", withinApexToString(c.WithinApex), c.ApexSdkVersion, c.ApiDomain)
-}
-
-func withinApexToString(withinApex bool) string {
-	if withinApex {
-		return "within_apex"
-	}
-	return ""
-}
-
-func (c configKey) String() string {
-	return fmt.Sprintf("%s::%s::%s", c.arch, c.osType, c.apexKey)
-}
-
-// Map key to describe bazel cquery requests.
-type cqueryKey struct {
-	label       string
-	requestType cqueryRequest
-	configKey   configKey
-}
-
-func makeCqueryKey(label string, cqueryRequest cqueryRequest, cfgKey configKey) cqueryKey {
-	if strings.HasPrefix(label, "//") {
-		// Normalize Bazel labels to specify main repository explicitly.
-		label = "@" + label
-	}
-	return cqueryKey{label, cqueryRequest, cfgKey}
-}
-
-func (c cqueryKey) String() string {
-	return fmt.Sprintf("cquery(%s,%s,%s)", c.label, c.requestType.Name(), c.configKey)
-}
-
-type invokeBazelContext interface {
-	GetEventHandler() *metrics.EventHandler
-}
-
-// BazelContext is a context object useful for interacting with Bazel during
-// the course of a build. Use of Bazel to evaluate part of the build graph
-// is referred to as a "mixed build". (Some modules are managed by Soong,
-// some are managed by Bazel). To facilitate interop between these build
-// subgraphs, Soong may make requests to Bazel and evaluate their responses
-// so that Soong modules may accurately depend on Bazel targets.
-type BazelContext interface {
-	// Add a cquery request to the bazel request queue. All queued requests
-	// will be sent to Bazel on a subsequent invocation of InvokeBazel.
-	QueueBazelRequest(label string, requestType cqueryRequest, cfgKey configKey)
-
-	// ** Cquery Results Retrieval Functions
-	// The below functions pertain to retrieving cquery results from a prior
-	// InvokeBazel function call and parsing the results.
-
-	// Returns result files built by building the given bazel target label.
-	GetOutputFiles(label string, cfgKey configKey) ([]string, error)
-
-	// Returns the results of GetOutputFiles and GetCcObjectFiles in a single query (in that order).
-	GetCcInfo(label string, cfgKey configKey) (cquery.CcInfo, error)
-
-	// Returns the results of the GetApexInfo query (including output files)
-	GetApexInfo(label string, cfgkey configKey) (cquery.ApexInfo, error)
-
-	// Returns the results of the GetCcUnstrippedInfo query
-	GetCcUnstrippedInfo(label string, cfgkey configKey) (cquery.CcUnstrippedInfo, error)
-
-	// Returns the results of the GetPrebuiltFileInfo query
-	GetPrebuiltFileInfo(label string, cfgKey configKey) (cquery.PrebuiltFileInfo, error)
-
-	// ** end Cquery Results Retrieval Functions
-
-	// Issues commands to Bazel to receive results for all cquery requests
-	// queued in the BazelContext. The ctx argument is optional and is only
-	// used for performance data collection
-	InvokeBazel(config Config, ctx invokeBazelContext) error
-
-	// Returns true if Bazel handling is enabled for the module with the given name.
-	// Note that this only implies "bazel mixed build" allowlisting. The caller
-	// should independently verify the module is eligible for Bazel handling
-	// (for example, that it is MixedBuildBuildable).
-	IsModuleNameAllowed(moduleName string, withinApex bool) bool
-
-	// Returns the bazel output base (the root directory for all bazel intermediate outputs).
-	OutputBase() string
-
-	// Returns build statements which should get registered to reflect Bazel's outputs.
-	BuildStatementsToRegister() []*bazel.BuildStatement
-
-	// Returns the depsets defined in Bazel's aquery response.
-	AqueryDepsets() []bazel.AqueryDepset
-
-	QueueBazelSandwichCqueryRequests(config Config) error
-}
-
-type bazelRunner interface {
-	issueBazelCommand(cmdRequest bazel.CmdRequest, paths *bazelPaths, eventHandler *metrics.EventHandler) (output string, errorMessage string, error error)
-}
-
-type bazelPaths struct {
-	homeDir       string
-	bazelPath     string
-	outputBase    string
-	workspaceDir  string
-	soongOutDir   string
-	metricsDir    string
-	bazelDepsFile string
-}
-
-// A context object which tracks queued requests that need to be made to Bazel,
-// and their results after the requests have been made.
-type mixedBuildBazelContext struct {
-	bazelRunner
-	paths *bazelPaths
-	// cquery requests that have not yet been issued to Bazel. This list is maintained
-	// in a sorted state, and is guaranteed to have no duplicates.
-	requests     []cqueryKey
-	requestMutex sync.Mutex // requests can be written in parallel
-
-	results map[cqueryKey]string // Results of cquery requests after Bazel invocations
-
-	// Build statements which should get registered to reflect Bazel's outputs.
-	buildStatements []*bazel.BuildStatement
-
-	// Depsets which should be used for Bazel's build statements.
-	depsets []bazel.AqueryDepset
-
-	// Per-module allowlist/denylist functionality to control whether analysis of
-	// modules are handled by Bazel. For modules which do not have a Bazel definition
-	// (or do not sufficiently support bazel handling via MixedBuildBuildable),
-	// this allowlist will have no effect, even if the module is explicitly allowlisted here.
-	// Per-module denylist to opt modules out of bazel handling.
-	bazelDisabledModules map[string]bool
-	// Per-module allowlist to opt modules in to bazel handling.
-	bazelEnabledModules map[string]bool
-	// DCLA modules are enabled when used in apex.
-	bazelDclaEnabledModules map[string]bool
-
-	targetProduct      string
-	targetBuildVariant string
-}
-
-var _ BazelContext = &mixedBuildBazelContext{}
-
-// A bazel context to use when Bazel is disabled.
-type noopBazelContext struct{}
-
-var _ BazelContext = noopBazelContext{}
-
-func (n noopBazelContext) QueueBazelRequest(_ string, _ cqueryRequest, _ configKey) {
-	panic("unimplemented")
-}
-
-func (n noopBazelContext) QueueBazelSandwichCqueryRequests(config Config) error {
-	panic("unimplemented")
-}
-
-func (n noopBazelContext) GetOutputFiles(_ string, _ configKey) ([]string, error) {
-	panic("unimplemented")
-}
-
-func (n noopBazelContext) GetCcInfo(_ string, _ configKey) (cquery.CcInfo, error) {
-	panic("unimplemented")
-}
-
-func (n noopBazelContext) GetApexInfo(_ string, _ configKey) (cquery.ApexInfo, error) {
-	panic("unimplemented")
-}
-
-func (n noopBazelContext) GetCcUnstrippedInfo(_ string, _ configKey) (cquery.CcUnstrippedInfo, error) {
-	//TODO implement me
-	panic("implement me")
-}
-
-func (n noopBazelContext) GetPrebuiltFileInfo(_ string, _ configKey) (cquery.PrebuiltFileInfo, error) {
-	panic("implement me")
-}
-
-func (n noopBazelContext) InvokeBazel(_ Config, _ invokeBazelContext) error {
-	panic("unimplemented")
-}
-
-func (m noopBazelContext) OutputBase() string {
-	return ""
-}
-
-func (n noopBazelContext) IsModuleNameAllowed(_ string, _ bool) bool {
-	return false
-}
-
-func (m noopBazelContext) BuildStatementsToRegister() []*bazel.BuildStatement {
-	return []*bazel.BuildStatement{}
-}
-
-func (m noopBazelContext) AqueryDepsets() []bazel.AqueryDepset {
-	return []bazel.AqueryDepset{}
-}
-
-// A bazel context to use for tests.
-type MockBazelContext struct {
-	OutputBaseDir string
-
-	LabelToOutputFiles      map[string][]string
-	LabelToCcInfo           map[string]cquery.CcInfo
-	LabelToPythonBinary     map[string]string
-	LabelToApexInfo         map[string]cquery.ApexInfo
-	LabelToCcBinary         map[string]cquery.CcUnstrippedInfo
-	LabelToPrebuiltFileInfo map[string]cquery.PrebuiltFileInfo
-
-	BazelRequests map[string]bool
-}
-
-func (m MockBazelContext) QueueBazelRequest(label string, requestType cqueryRequest, cfgKey configKey) {
-	key := BuildMockBazelContextRequestKey(label, requestType, cfgKey.arch, cfgKey.osType, cfgKey.apexKey)
-	if m.BazelRequests == nil {
-		m.BazelRequests = make(map[string]bool)
-	}
-	m.BazelRequests[key] = true
-}
-
-func (m MockBazelContext) QueueBazelSandwichCqueryRequests(config Config) error {
-	panic("unimplemented")
-}
-
-func (m MockBazelContext) GetOutputFiles(label string, _ configKey) ([]string, error) {
-	result, ok := m.LabelToOutputFiles[label]
-	if !ok {
-		return []string{}, fmt.Errorf("no target with label %q in LabelToOutputFiles", label)
-	}
-	return result, nil
-}
-
-func (m MockBazelContext) GetCcInfo(label string, cfgKey configKey) (cquery.CcInfo, error) {
-	result, ok := m.LabelToCcInfo[label]
-	if !ok {
-		key := BuildMockBazelContextResultKey(label, cfgKey.arch, cfgKey.osType, cfgKey.apexKey)
-		result, ok = m.LabelToCcInfo[key]
-		if !ok {
-			return cquery.CcInfo{}, fmt.Errorf("no target with label %q in LabelToCcInfo", label)
-		}
-	}
-	return result, nil
-}
-
-func (m MockBazelContext) GetApexInfo(label string, _ configKey) (cquery.ApexInfo, error) {
-	result, ok := m.LabelToApexInfo[label]
-	if !ok {
-		return cquery.ApexInfo{}, fmt.Errorf("no target with label %q in LabelToApexInfo", label)
-	}
-	return result, nil
-}
-
-func (m MockBazelContext) GetCcUnstrippedInfo(label string, _ configKey) (cquery.CcUnstrippedInfo, error) {
-	result, ok := m.LabelToCcBinary[label]
-	if !ok {
-		return cquery.CcUnstrippedInfo{}, fmt.Errorf("no target with label %q in LabelToCcBinary", label)
-	}
-	return result, nil
-}
-
-func (m MockBazelContext) GetPrebuiltFileInfo(label string, _ configKey) (cquery.PrebuiltFileInfo, error) {
-	result, ok := m.LabelToPrebuiltFileInfo[label]
-	if !ok {
-		return cquery.PrebuiltFileInfo{}, fmt.Errorf("no target with label %q in LabelToPrebuiltFileInfo", label)
-	}
-	return result, nil
-}
-
-func (m MockBazelContext) InvokeBazel(_ Config, _ invokeBazelContext) error {
-	panic("unimplemented")
-}
-
-func (m MockBazelContext) IsModuleNameAllowed(_ string, _ bool) bool {
-	return true
-}
-
-func (m MockBazelContext) OutputBase() string { return m.OutputBaseDir }
-
-func (m MockBazelContext) BuildStatementsToRegister() []*bazel.BuildStatement {
-	return []*bazel.BuildStatement{}
-}
-
-func (m MockBazelContext) AqueryDepsets() []bazel.AqueryDepset {
-	return []bazel.AqueryDepset{}
-}
-
-var _ BazelContext = MockBazelContext{}
-
-func BuildMockBazelContextRequestKey(label string, request cqueryRequest, arch string, osType OsType, apexKey ApexConfigKey) string {
-	cfgKey := configKey{
-		arch:    arch,
-		osType:  osType,
-		apexKey: apexKey,
-	}
-
-	return strings.Join([]string{label, request.Name(), cfgKey.String()}, "_")
-}
-
-func BuildMockBazelContextResultKey(label string, arch string, osType OsType, apexKey ApexConfigKey) string {
-	cfgKey := configKey{
-		arch:    arch,
-		osType:  osType,
-		apexKey: apexKey,
-	}
-
-	return strings.Join([]string{label, cfgKey.String()}, "_")
-}
-
-func (bazelCtx *mixedBuildBazelContext) QueueBazelRequest(label string, requestType cqueryRequest, cfgKey configKey) {
-	key := makeCqueryKey(label, requestType, cfgKey)
-	bazelCtx.requestMutex.Lock()
-	defer bazelCtx.requestMutex.Unlock()
-
-	// Insert key into requests, maintaining the sort, and only if it's not duplicate.
-	keyString := key.String()
-	foundEqual := false
-	notLessThanKeyString := func(i int) bool {
-		s := bazelCtx.requests[i].String()
-		v := strings.Compare(s, keyString)
-		if v == 0 {
-			foundEqual = true
-		}
-		return v >= 0
-	}
-	targetIndex := sort.Search(len(bazelCtx.requests), notLessThanKeyString)
-	if foundEqual {
-		return
-	}
-
-	if targetIndex == len(bazelCtx.requests) {
-		bazelCtx.requests = append(bazelCtx.requests, key)
-	} else {
-		bazelCtx.requests = append(bazelCtx.requests[:targetIndex+1], bazelCtx.requests[targetIndex:]...)
-		bazelCtx.requests[targetIndex] = key
-	}
-}
-
-func (bazelCtx *mixedBuildBazelContext) GetOutputFiles(label string, cfgKey configKey) ([]string, error) {
-	key := makeCqueryKey(label, cquery.GetOutputFiles, cfgKey)
-	if rawString, ok := bazelCtx.results[key]; ok {
-		bazelOutput := strings.TrimSpace(rawString)
-
-		return cquery.GetOutputFiles.ParseResult(bazelOutput), nil
-	}
-	return nil, fmt.Errorf("no bazel response found for %v", key)
-}
-
-func (bazelCtx *mixedBuildBazelContext) GetCcInfo(label string, cfgKey configKey) (cquery.CcInfo, error) {
-	key := makeCqueryKey(label, cquery.GetCcInfo, cfgKey)
-	if rawString, ok := bazelCtx.results[key]; ok {
-		bazelOutput := strings.TrimSpace(rawString)
-		return cquery.GetCcInfo.ParseResult(bazelOutput)
-	}
-	return cquery.CcInfo{}, fmt.Errorf("no bazel response found for %v", key)
-}
-
-func (bazelCtx *mixedBuildBazelContext) GetApexInfo(label string, cfgKey configKey) (cquery.ApexInfo, error) {
-	key := makeCqueryKey(label, cquery.GetApexInfo, cfgKey)
-	if rawString, ok := bazelCtx.results[key]; ok {
-		return cquery.GetApexInfo.ParseResult(strings.TrimSpace(rawString))
-	}
-	return cquery.ApexInfo{}, fmt.Errorf("no bazel response found for %v", key)
-}
-
-func (bazelCtx *mixedBuildBazelContext) GetCcUnstrippedInfo(label string, cfgKey configKey) (cquery.CcUnstrippedInfo, error) {
-	key := makeCqueryKey(label, cquery.GetCcUnstrippedInfo, cfgKey)
-	if rawString, ok := bazelCtx.results[key]; ok {
-		return cquery.GetCcUnstrippedInfo.ParseResult(strings.TrimSpace(rawString))
-	}
-	return cquery.CcUnstrippedInfo{}, fmt.Errorf("no bazel response for %s", key)
-}
-
-func (bazelCtx *mixedBuildBazelContext) GetPrebuiltFileInfo(label string, cfgKey configKey) (cquery.PrebuiltFileInfo, error) {
-	key := makeCqueryKey(label, cquery.GetPrebuiltFileInfo, cfgKey)
-	if rawString, ok := bazelCtx.results[key]; ok {
-		return cquery.GetPrebuiltFileInfo.ParseResult(strings.TrimSpace(rawString))
-	}
-	return cquery.PrebuiltFileInfo{}, fmt.Errorf("no bazel response for %s", key)
-}
-
-func AddToStringSet(set map[string]bool, items []string) {
-	for _, item := range items {
-		set[item] = true
-	}
-}
-
-func GetBazelEnabledAndDisabledModules(buildMode SoongBuildMode, forceEnabled map[string]struct{}) (map[string]bool, map[string]bool) {
-	disabledModules := map[string]bool{}
-	enabledModules := map[string]bool{}
-
-	switch buildMode {
-	case BazelProdMode:
-		AddToStringSet(enabledModules, allowlists.ProdMixedBuildsEnabledList)
-		for enabledAdHocModule := range forceEnabled {
-			enabledModules[enabledAdHocModule] = true
-		}
-	case BazelStagingMode:
-		// Staging mode includes all prod modules plus all staging modules.
-		AddToStringSet(enabledModules, allowlists.ProdMixedBuildsEnabledList)
-		AddToStringSet(enabledModules, allowlists.StagingMixedBuildsEnabledList)
-		for enabledAdHocModule := range forceEnabled {
-			enabledModules[enabledAdHocModule] = true
-		}
-	default:
-		panic("Expected BazelProdMode or BazelStagingMode")
-	}
-	return enabledModules, disabledModules
-}
-
-func GetBazelEnabledModules(buildMode SoongBuildMode) []string {
-	enabledModules, disabledModules := GetBazelEnabledAndDisabledModules(buildMode, nil)
-	enabledList := make([]string, 0, len(enabledModules))
-	for module := range enabledModules {
-		if !disabledModules[module] {
-			enabledList = append(enabledList, module)
-		}
-	}
-	sort.Strings(enabledList)
-	return enabledList
-}
-
-func NewBazelContext(c *config) (BazelContext, error) {
-	if c.BuildMode != BazelProdMode && c.BuildMode != BazelStagingMode {
-		return noopBazelContext{}, nil
-	}
-
-	enabledModules, disabledModules := GetBazelEnabledAndDisabledModules(c.BuildMode, c.BazelModulesForceEnabledByFlag())
-
-	paths := bazelPaths{
-		soongOutDir: c.soongOutDir,
-	}
-	var missing []string
-	vars := []struct {
-		name string
-		ptr  *string
-
-		// True if the environment variable needs to be tracked so that changes to the variable
-		// cause the ninja file to be regenerated, false otherwise. False should only be set for
-		// environment variables that have no effect on the generated ninja file.
-		track bool
-	}{
-		{"BAZEL_HOME", &paths.homeDir, true},
-		{"BAZEL_PATH", &paths.bazelPath, true},
-		{"BAZEL_OUTPUT_BASE", &paths.outputBase, true},
-		{"BAZEL_WORKSPACE", &paths.workspaceDir, true},
-		{"BAZEL_METRICS_DIR", &paths.metricsDir, false},
-		{"BAZEL_DEPS_FILE", &paths.bazelDepsFile, true},
-	}
-	for _, v := range vars {
-		if v.track {
-			if s := c.Getenv(v.name); len(s) > 1 {
-				*v.ptr = s
-				continue
-			}
-		} else if s, ok := c.env[v.name]; ok {
-			*v.ptr = s
-		} else {
-			missing = append(missing, v.name)
-		}
-	}
-	if len(missing) > 0 {
-		return nil, fmt.Errorf("missing required env vars to use bazel: %s", missing)
-	}
-
-	targetBuildVariant := "user"
-	if c.Eng() {
-		targetBuildVariant = "eng"
-	} else if c.Debuggable() {
-		targetBuildVariant = "userdebug"
-	}
-	targetProduct := "unknown"
-	if c.HasDeviceProduct() {
-		targetProduct = c.DeviceProduct()
-	}
-	dclaMixedBuildsEnabledList := []string{}
-	if c.BuildMode == BazelProdMode {
-		dclaMixedBuildsEnabledList = allowlists.ProdDclaMixedBuildsEnabledList
-	} else if c.BuildMode == BazelStagingMode {
-		dclaMixedBuildsEnabledList = append(allowlists.ProdDclaMixedBuildsEnabledList,
-			allowlists.StagingDclaMixedBuildsEnabledList...)
-	}
-	dclaEnabledModules := map[string]bool{}
-	AddToStringSet(dclaEnabledModules, dclaMixedBuildsEnabledList)
-	return &mixedBuildBazelContext{
-		bazelRunner:             &builtinBazelRunner{c.UseBazelProxy, absolutePath(c.outDir)},
-		paths:                   &paths,
-		bazelEnabledModules:     enabledModules,
-		bazelDisabledModules:    disabledModules,
-		bazelDclaEnabledModules: dclaEnabledModules,
-		targetProduct:           targetProduct,
-		targetBuildVariant:      targetBuildVariant,
-	}, nil
-}
-
-func (p *bazelPaths) BazelMetricsDir() string {
-	return p.metricsDir
-}
-
-func (context *mixedBuildBazelContext) IsModuleNameAllowed(moduleName string, withinApex bool) bool {
-	if context.bazelDisabledModules[moduleName] {
-		return false
-	}
-	if context.bazelEnabledModules[moduleName] {
-		return true
-	}
-	if withinApex && context.bazelDclaEnabledModules[moduleName] {
-		return true
-	}
-
-	return false
-}
-
-func pwdPrefix() string {
-	// Darwin doesn't have /proc
-	if runtime.GOOS != "darwin" {
-		return "PWD=/proc/self/cwd"
-	}
-	return ""
-}
-
-type bazelCommand struct {
-	command string
-	// query or label
-	expression string
-}
-
-type builtinBazelRunner struct {
-	useBazelProxy bool
-	outDir        string
-}
-
-// Issues the given bazel command with given build label and additional flags.
-// Returns (stdout, stderr, error). The first and second return values are strings
-// containing the stdout and stderr of the run command, and an error is returned if
-// the invocation returned an error code.
-func (r *builtinBazelRunner) issueBazelCommand(cmdRequest bazel.CmdRequest, paths *bazelPaths, eventHandler *metrics.EventHandler) (string, string, error) {
-	if r.useBazelProxy {
-		eventHandler.Begin("client_proxy")
-		defer eventHandler.End("client_proxy")
-		proxyClient := bazel.NewProxyClient(r.outDir)
-		resp, err := proxyClient.IssueCommand(cmdRequest)
-
-		if err != nil {
-			return "", "", err
-		}
-		if len(resp.ErrorString) > 0 {
-			return "", "", fmt.Errorf(resp.ErrorString)
-		}
-		return resp.Stdout, resp.Stderr, nil
-	} else {
-		eventHandler.Begin("bazel command")
-		defer eventHandler.End("bazel command")
-
-		stdout, stderr, err := bazel.ExecBazel(paths.bazelPath, absolutePath(paths.syntheticWorkspaceDir()), cmdRequest)
-		return string(stdout), string(stderr), err
-	}
-}
-
-func (context *mixedBuildBazelContext) createBazelCommand(config Config, runName bazel.RunName, command bazelCommand,
-	extraFlags ...string) bazel.CmdRequest {
-	if runtime.GOOS != "linux" && runtime.GOOS != "darwin" {
-		panic("Unknown GOOS: " + runtime.GOOS)
-	}
-	cmdFlags := []string{
-		"--output_base=" + absolutePath(context.paths.outputBase),
-		command.command,
-		command.expression,
-		"--profile=" + shared.BazelMetricsFilename(context.paths, runName),
-
-		"--host_platform=@soong_injection//product_config_platforms:mixed_builds_product_" + runtime.GOOS + "_x86_64",
-		"--//build/bazel/product_config:target_build_variant=" + context.targetBuildVariant,
-		// Don't specify --platforms, because on some products/branches (like kernel-build-tools)
-		// the main platform for mixed_builds_product-variant doesn't exist because an arch isn't
-		// specified in product config. The derivative platforms that config_node transitions into
-		// will still work.
-
-		// Suppress noise
-		"--ui_event_filters=-INFO",
-		"--noshow_progress",
-		"--norun_validations",
-	}
-	cmdFlags = append(cmdFlags, extraFlags...)
-
-	extraEnv := []string{
-		"HOME=" + context.paths.homeDir,
-		pwdPrefix(),
-		"BUILD_DIR=" + absolutePath(context.paths.soongOutDir),
-		// Make OUT_DIR absolute here so build/bazel/bin/bazel uses the correct
-		// OUT_DIR at <root>/out, instead of <root>/out/soong/workspace/out.
-		"OUT_DIR=" + absolutePath(context.paths.outDir()),
-		// Disables local host detection of gcc; toolchain information is defined
-		// explicitly in BUILD files.
-		"BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1",
-	}
-	capturedEnvVars, err := starlark_import.GetStarlarkValue[[]string]("captured_env_vars")
-	if err != nil {
-		panic(err)
-	}
-	for _, envvar := range capturedEnvVars {
-		val := config.Getenv(envvar)
-		if val == "" {
-			continue
-		}
-		extraEnv = append(extraEnv, fmt.Sprintf("%s=%s", envvar, val))
-	}
-	envVars := append(os.Environ(), extraEnv...)
-
-	return bazel.CmdRequest{cmdFlags, envVars}
-}
-
-func (context *mixedBuildBazelContext) printableCqueryCommand(bazelCmd bazel.CmdRequest) string {
-	args := append([]string{context.paths.bazelPath}, bazelCmd.Argv...)
-	outputString := strings.Join(bazelCmd.Env, " ") + " \"" + strings.Join(args, "\" \"") + "\""
-	return outputString
-}
-
-func (context *mixedBuildBazelContext) mainBzlFileContents() []byte {
-	// TODO(cparsons): Define configuration transitions programmatically based
-	// on available archs.
-	contents := `
-#####################################################
-# This file is generated by soong_build. Do not edit.
-#####################################################
-def _config_node_transition_impl(settings, attr):
-    if attr.os == "android" and attr.arch == "target":
-        target = "mixed_builds_product"
-    else:
-        target = "mixed_builds_product_%s_%s" % (attr.os, attr.arch)
-    apex_name = ""
-    if attr.within_apex:
-        # //build/bazel/rules/apex:apex_name has to be set to a non_empty value,
-        # otherwise //build/bazel/rules/apex:non_apex will be true and the
-        # "-D__ANDROID_APEX__" compiler flag will be missing. Apex_name is used
-        # in some validation on bazel side which don't really apply in mixed
-        # build because soong will do the work, so we just set it to a fixed
-        # value here.
-        apex_name = "dcla_apex"
-    outputs = {
-        "//command_line_option:platforms": "@soong_injection//product_config_platforms:%s" % target,
-        "@//build/bazel/rules/apex:within_apex": attr.within_apex,
-        "@//build/bazel/rules/apex:min_sdk_version": attr.apex_sdk_version,
-        "@//build/bazel/rules/apex:apex_name": apex_name,
-        "@//build/bazel/rules/apex:api_domain": attr.api_domain,
-    }
-
-    return outputs
-
-_config_node_transition = transition(
-    implementation = _config_node_transition_impl,
-    inputs = [],
-    outputs = [
-        "//command_line_option:platforms",
-        "@//build/bazel/rules/apex:within_apex",
-        "@//build/bazel/rules/apex:min_sdk_version",
-        "@//build/bazel/rules/apex:apex_name",
-        "@//build/bazel/rules/apex:api_domain",
-    ],
-)
-
-def _passthrough_rule_impl(ctx):
-    return [DefaultInfo(files = depset(ctx.files.deps))]
-
-config_node = rule(
-    implementation = _passthrough_rule_impl,
-    attrs = {
-        "arch"    : attr.string(mandatory = True),
-        "os"      : attr.string(mandatory = True),
-        "within_apex" : attr.bool(default = False),
-        "apex_sdk_version" : attr.string(mandatory = True),
-        "api_domain" : attr.string(mandatory = True),
-        "deps"    : attr.label_list(cfg = _config_node_transition, allow_files = True),
-        "_allowlist_function_transition": attr.label(default = "@bazel_tools//tools/allowlists/function_transition_allowlist"),
-    },
-)
-
-
-# Rule representing the root of the build, to depend on all Bazel targets that
-# are required for the build. Building this target will build the entire Bazel
-# build tree.
-mixed_build_root = rule(
-    implementation = _passthrough_rule_impl,
-    attrs = {
-        "deps" : attr.label_list(),
-    },
-)
-
-def _phony_root_impl(ctx):
-    return []
-
-# Rule to depend on other targets but build nothing.
-# This is useful as follows: building a target of this rule will generate
-# symlink forests for all dependencies of the target, without executing any
-# actions of the build.
-phony_root = rule(
-    implementation = _phony_root_impl,
-    attrs = {"deps" : attr.label_list()},
-)
-`
-
-	return []byte(contents)
-}
-
-func (context *mixedBuildBazelContext) mainBuildFileContents() []byte {
-	// TODO(cparsons): Map label to attribute programmatically; don't use hard-coded
-	// architecture mapping.
-	formatString := `
-# This file is generated by soong_build. Do not edit.
-load(":main.bzl", "config_node", "mixed_build_root", "phony_root")
-
-%s
-
-mixed_build_root(name = "buildroot",
-    deps = [%s],
-    testonly = True, # Unblocks testonly deps.
-)
-
-phony_root(name = "phonyroot",
-    deps = [":buildroot"],
-    testonly = True, # Unblocks testonly deps.
-)
-`
-	configNodeFormatString := `
-config_node(name = "%s",
-    arch = "%s",
-    os = "%s",
-    within_apex = %s,
-    apex_sdk_version = "%s",
-    api_domain = "%s",
-    deps = [%s],
-    testonly = True, # Unblocks testonly deps.
-)
-`
-
-	configNodesSection := ""
-
-	labelsByConfig := map[string][]string{}
-
-	for _, val := range context.requests {
-		labelString := fmt.Sprintf("\"@%s\"", val.label)
-		configString := getConfigString(val)
-		labelsByConfig[configString] = append(labelsByConfig[configString], labelString)
-	}
-
-	// Configs need to be sorted to maintain determinism of the BUILD file.
-	sortedConfigs := make([]string, 0, len(labelsByConfig))
-	for val := range labelsByConfig {
-		sortedConfigs = append(sortedConfigs, val)
-	}
-	sort.Slice(sortedConfigs, func(i, j int) bool { return sortedConfigs[i] < sortedConfigs[j] })
-
-	allLabels := []string{}
-	for _, configString := range sortedConfigs {
-		labels := labelsByConfig[configString]
-		configTokens := strings.Split(configString, "|")
-		if len(configTokens) < 2 {
-			panic(fmt.Errorf("Unexpected config string format: %s", configString))
-		}
-		archString := configTokens[0]
-		osString := configTokens[1]
-		withinApex := "False"
-		apexSdkVerString := ""
-		apiDomainString := ""
-		if osString == "android" {
-			// api domains are meaningful only for device variants
-			apiDomainString = "system"
-		}
-		targetString := fmt.Sprintf("%s_%s", osString, archString)
-		if len(configTokens) > 2 {
-			targetString += "_" + configTokens[2]
-			if configTokens[2] == withinApexToString(true) {
-				withinApex = "True"
-			}
-		}
-		if len(configTokens) > 3 {
-			targetString += "_" + configTokens[3]
-			apexSdkVerString = configTokens[3]
-		}
-		if len(configTokens) > 4 {
-			apiDomainString = configTokens[4]
-			targetString += "_" + apiDomainString
-		}
-		allLabels = append(allLabels, fmt.Sprintf("\":%s\"", targetString))
-		labelsString := strings.Join(labels, ",\n            ")
-		configNodesSection += fmt.Sprintf(configNodeFormatString, targetString, archString, osString, withinApex, apexSdkVerString, apiDomainString,
-			labelsString)
-	}
-
-	return []byte(fmt.Sprintf(formatString, configNodesSection, strings.Join(allLabels, ",\n            ")))
-}
-
-func indent(original string) string {
-	result := ""
-	for _, line := range strings.Split(original, "\n") {
-		result += "  " + line + "\n"
-	}
-	return result
-}
-
-// Returns the file contents of the buildroot.cquery file that should be used for the cquery
-// expression in order to obtain information about buildroot and its dependencies.
-// The contents of this file depend on the mixedBuildBazelContext's requests; requests are enumerated
-// and grouped by their request type. The data retrieved for each label depends on its
-// request type.
-func (context *mixedBuildBazelContext) cqueryStarlarkFileContents() []byte {
-	requestTypeToCqueryIdEntries := map[cqueryRequest][]string{}
-	requestTypes := []cqueryRequest{}
-	for _, val := range context.requests {
-		cqueryId := getCqueryId(val)
-		mapEntryString := fmt.Sprintf("%q : True", cqueryId)
-		if _, seenKey := requestTypeToCqueryIdEntries[val.requestType]; !seenKey {
-			requestTypes = append(requestTypes, val.requestType)
-		}
-		requestTypeToCqueryIdEntries[val.requestType] =
-			append(requestTypeToCqueryIdEntries[val.requestType], mapEntryString)
-	}
-	labelRegistrationMapSection := ""
-	functionDefSection := ""
-	mainSwitchSection := ""
-
-	mapDeclarationFormatString := `
-%s = {
-  %s
-}
-`
-	functionDefFormatString := `
-def %s(target, id_string):
-%s
-`
-	mainSwitchSectionFormatString := `
-  if id_string in %s:
-    return id_string + ">>" + %s(target, id_string)
-`
-
-	for _, requestType := range requestTypes {
-		labelMapName := requestType.Name() + "_Labels"
-		functionName := requestType.Name() + "_Fn"
-		labelRegistrationMapSection += fmt.Sprintf(mapDeclarationFormatString,
-			labelMapName,
-			strings.Join(requestTypeToCqueryIdEntries[requestType], ",\n  "))
-		functionDefSection += fmt.Sprintf(functionDefFormatString,
-			functionName,
-			indent(requestType.StarlarkFunctionBody()))
-		mainSwitchSection += fmt.Sprintf(mainSwitchSectionFormatString,
-			labelMapName, functionName)
-	}
-
-	formatString := `
-# This file is generated by soong_build. Do not edit.
-
-{LABEL_REGISTRATION_MAP_SECTION}
-
-{FUNCTION_DEF_SECTION}
-
-def get_arch(target):
-  # TODO(b/199363072): filegroups and file targets aren't associated with any
-  # specific platform architecture in mixed builds. This is consistent with how
-  # Soong treats filegroups, but it may not be the case with manually-written
-  # filegroup BUILD targets.
-  buildoptions = build_options(target)
-
-  if buildoptions == None:
-    # File targets do not have buildoptions. File targets aren't associated with
-    #  any specific platform architecture in mixed builds, so use the host.
-    return "x86_64|linux"
-  platforms = buildoptions["//command_line_option:platforms"]
-  if len(platforms) != 1:
-    # An individual configured target should have only one platform architecture.
-    # Note that it's fine for there to be multiple architectures for the same label,
-    # but each is its own configured target.
-    fail("expected exactly 1 platform for " + str(target.label) + " but got " + str(platforms))
-  platform_name = platforms[0].name
-  if platform_name == "host":
-    return "HOST"
-  if not platform_name.startswith("mixed_builds_product"):
-    fail("expected platform name of the form 'mixed_builds_product_android_<arch>' or 'mixed_builds_product_linux_<arch>', but was " + str(platforms))
-  platform_name = platform_name.removeprefix("mixed_builds_product").removeprefix("_")
-  config_key = ""
-  if not platform_name:
-    config_key = "target|android"
-  elif platform_name.startswith("android_"):
-    config_key = platform_name.removeprefix("android_") + "|android"
-  elif platform_name.startswith("linux_"):
-    config_key = platform_name.removeprefix("linux_") + "|linux"
-  else:
-    fail("expected platform name of the form 'mixed_builds_product_android_<arch>' or 'mixed_builds_product_linux_<arch>', but was " + str(platforms))
-
-  within_apex = buildoptions.get("//build/bazel/rules/apex:within_apex")
-  apex_sdk_version = buildoptions.get("//build/bazel/rules/apex:min_sdk_version")
-  api_domain = buildoptions.get("//build/bazel/rules/apex:api_domain")
-
-  if within_apex:
-    config_key += "|within_apex"
-  if apex_sdk_version != None and len(apex_sdk_version) > 0:
-    config_key += "|" + apex_sdk_version
-  if api_domain != None and len(api_domain) > 0:
-    config_key += "|" + api_domain
-
-  return config_key
-
-def format(target):
-  id_string = str(target.label) + "|" + get_arch(target)
-
-  # TODO(b/248106697): Remove once Bazel is updated to always normalize labels.
-  if id_string.startswith("//"):
-    id_string = "@" + id_string
-
-  {MAIN_SWITCH_SECTION}
-
-  # This target was not requested via cquery, and thus must be a dependency
-  # of a requested target.
-  return id_string + ">>NONE"
-`
-	replacer := strings.NewReplacer(
-		"{LABEL_REGISTRATION_MAP_SECTION}", labelRegistrationMapSection,
-		"{FUNCTION_DEF_SECTION}", functionDefSection,
-		"{MAIN_SWITCH_SECTION}", mainSwitchSection)
-
-	return []byte(replacer.Replace(formatString))
-}
-
-// Returns a path containing build-related metadata required for interfacing
-// with Bazel. Example: out/soong/bazel.
-func (p *bazelPaths) intermediatesDir() string {
-	return filepath.Join(p.soongOutDir, "bazel")
-}
-
-// Returns the path where the contents of the @soong_injection repository live.
-// It is used by Soong to tell Bazel things it cannot over the command line.
-func (p *bazelPaths) injectedFilesDir() string {
-	return filepath.Join(p.soongOutDir, bazel.SoongInjectionDirName)
-}
-
-// Returns the path of the synthetic Bazel workspace that contains a symlink
-// forest composed the whole source tree and BUILD files generated by bp2build.
-func (p *bazelPaths) syntheticWorkspaceDir() string {
-	return filepath.Join(p.soongOutDir, "workspace")
-}
-
-// Returns the path to the top level out dir ($OUT_DIR).
-func (p *bazelPaths) outDir() string {
-	return filepath.Dir(p.soongOutDir)
-}
-
-const buildrootLabel = "@soong_injection//mixed_builds:buildroot"
-
-var (
-	cqueryCmd        = bazelCommand{"cquery", fmt.Sprintf("deps(%s, 2)", buildrootLabel)}
-	aqueryCmd        = bazelCommand{"aquery", fmt.Sprintf("deps(%s)", buildrootLabel)}
-	buildCmd         = bazelCommand{"build", "@soong_injection//mixed_builds:phonyroot"}
-	allBazelCommands = []bazelCommand{aqueryCmd, cqueryCmd, buildCmd}
-)
-
-// This can't be part of bp2build_product_config.go because it would create a circular go package dependency
-func getLabelsForBazelSandwichPartitions(variables *ProductVariables) []string {
-	targetProduct := "unknown"
-	if variables.DeviceProduct != nil {
-		targetProduct = *variables.DeviceProduct
-	}
-	currentProductFolder := fmt.Sprintf("build/bazel/products/%s", targetProduct)
-	if len(variables.PartitionVarsForBazelMigrationOnlyDoNotUse.ProductDirectory) > 0 {
-		currentProductFolder = fmt.Sprintf("%s%s", variables.PartitionVarsForBazelMigrationOnlyDoNotUse.ProductDirectory, targetProduct)
-	}
-	var ret []string
-	if variables.PartitionVarsForBazelMigrationOnlyDoNotUse.PartitionQualifiedVariables["system"].BuildingImage {
-		ret = append(ret, "@//"+currentProductFolder+":system_image")
-		ret = append(ret, "@//"+currentProductFolder+":run_system_image_test")
-	}
-	return ret
-}
-
-func GetBazelSandwichCqueryRequests(config Config) ([]cqueryKey, error) {
-	partitionLabels := getLabelsForBazelSandwichPartitions(&config.productVariables)
-	result := make([]cqueryKey, 0, len(partitionLabels))
-	labelRegex := regexp.MustCompile("^@?//([a-zA-Z0-9/_-]+):[a-zA-Z0-9_-]+$")
-	// Note that bazel "targets" are different from soong "targets", the bazel targets are
-	// synonymous with soong modules, and soong targets are a configuration a module is built in.
-	for _, target := range partitionLabels {
-		match := labelRegex.FindStringSubmatch(target)
-		if match == nil {
-			return nil, fmt.Errorf("invalid label, must match `^@?//([a-zA-Z0-9/_-]+):[a-zA-Z0-9_-]+$`: %s", target)
-		}
-
-		// change this to config.BuildOSTarget if we add host targets
-		soongTarget := config.AndroidCommonTarget
-		if soongTarget.Os.Class != Device {
-			// kernel-build-tools seems to set the AndroidCommonTarget to a linux host
-			// target for some reason, disable device builds in that case.
-			continue
-		}
-
-		result = append(result, cqueryKey{
-			label:       target,
-			requestType: cquery.GetOutputFiles,
-			configKey: configKey{
-				arch:   soongTarget.Arch.String(),
-				osType: soongTarget.Os,
-			},
-		})
-	}
-	return result, nil
-}
-
-// QueueBazelSandwichCqueryRequests queues cquery requests for all the bazel labels in
-// bazel_sandwich_targets. These will later be given phony targets so that they can be built on the
-// command line.
-func (context *mixedBuildBazelContext) QueueBazelSandwichCqueryRequests(config Config) error {
-	requests, err := GetBazelSandwichCqueryRequests(config)
-	if err != nil {
-		return err
-	}
-	for _, request := range requests {
-		context.QueueBazelRequest(request.label, request.requestType, request.configKey)
-	}
-
-	return nil
-}
-
-// Issues commands to Bazel to receive results for all cquery requests
-// queued in the BazelContext.
-func (context *mixedBuildBazelContext) InvokeBazel(config Config, ctx invokeBazelContext) error {
-	eventHandler := ctx.GetEventHandler()
-	eventHandler.Begin("bazel")
-	defer eventHandler.End("bazel")
-
-	if metricsDir := context.paths.BazelMetricsDir(); metricsDir != "" {
-		if err := os.MkdirAll(metricsDir, 0777); err != nil {
-			return err
-		}
-	}
-	context.results = make(map[cqueryKey]string)
-	if err := context.runCquery(config, ctx); err != nil {
-		return err
-	}
-	if err := context.runAquery(config, ctx); err != nil {
-		return err
-	}
-	if err := context.generateBazelSymlinks(config, ctx); err != nil {
-		return err
-	}
-
-	// Clear requests.
-	context.requests = []cqueryKey{}
-	return nil
-}
-
-func (context *mixedBuildBazelContext) runCquery(config Config, ctx invokeBazelContext) error {
-	eventHandler := ctx.GetEventHandler()
-	eventHandler.Begin("cquery")
-	defer eventHandler.End("cquery")
-	soongInjectionPath := absolutePath(context.paths.injectedFilesDir())
-	mixedBuildsPath := filepath.Join(soongInjectionPath, "mixed_builds")
-	if _, err := os.Stat(mixedBuildsPath); os.IsNotExist(err) {
-		err = os.MkdirAll(mixedBuildsPath, 0777)
-		if err != nil {
-			return err
-		}
-	}
-	if err := writeFileBytesIfChanged(filepath.Join(soongInjectionPath, "WORKSPACE.bazel"), []byte{}, 0666); err != nil {
-		return err
-	}
-	if err := writeFileBytesIfChanged(filepath.Join(mixedBuildsPath, "main.bzl"), context.mainBzlFileContents(), 0666); err != nil {
-		return err
-	}
-	if err := writeFileBytesIfChanged(filepath.Join(mixedBuildsPath, "BUILD.bazel"), context.mainBuildFileContents(), 0666); err != nil {
-		return err
-	}
-	cqueryFileRelpath := filepath.Join(context.paths.injectedFilesDir(), "buildroot.cquery")
-	if err := writeFileBytesIfChanged(absolutePath(cqueryFileRelpath), context.cqueryStarlarkFileContents(), 0666); err != nil {
-		return err
-	}
-
-	extraFlags := []string{"--output=starlark", "--starlark:file=" + absolutePath(cqueryFileRelpath)}
-	if Bool(config.productVariables.ClangCoverage) {
-		extraFlags = append(extraFlags, "--collect_code_coverage")
-	}
-
-	cqueryCmdRequest := context.createBazelCommand(config, bazel.CqueryBuildRootRunName, cqueryCmd, extraFlags...)
-	cqueryOutput, cqueryErrorMessage, cqueryErr := context.issueBazelCommand(cqueryCmdRequest, context.paths, eventHandler)
-	if cqueryErr != nil {
-		return cqueryErr
-	}
-	cqueryCommandPrint := fmt.Sprintf("cquery command line:\n  %s \n\n\n", context.printableCqueryCommand(cqueryCmdRequest))
-	if err := os.WriteFile(filepath.Join(soongInjectionPath, "cquery.out"), []byte(cqueryCommandPrint+cqueryOutput), 0666); err != nil {
-		return err
-	}
-	cqueryResults := map[string]string{}
-	for _, outputLine := range strings.Split(cqueryOutput, "\n") {
-		if strings.Contains(outputLine, ">>") {
-			splitLine := strings.SplitN(outputLine, ">>", 2)
-			cqueryResults[splitLine[0]] = splitLine[1]
-		}
-	}
-	for _, val := range context.requests {
-		if cqueryResult, ok := cqueryResults[getCqueryId(val)]; ok {
-			context.results[val] = cqueryResult
-		} else {
-			return fmt.Errorf("missing result for bazel target %s. query output: [%s], cquery err: [%s]",
-				getCqueryId(val), cqueryOutput, cqueryErrorMessage)
-		}
-	}
-	return nil
-}
-
-func writeFileBytesIfChanged(path string, contents []byte, perm os.FileMode) error {
-	oldContents, err := os.ReadFile(path)
-	if err != nil || !bytes.Equal(contents, oldContents) {
-		err = os.WriteFile(path, contents, perm)
-	}
-	return nil
-}
-
-func (context *mixedBuildBazelContext) runAquery(config Config, ctx invokeBazelContext) error {
-	eventHandler := ctx.GetEventHandler()
-	eventHandler.Begin("aquery")
-	defer eventHandler.End("aquery")
-	// Issue an aquery command to retrieve action information about the bazel build tree.
-	//
-	// Use jsonproto instead of proto; actual proto parsing would require a dependency on Bazel's
-	// proto sources, which would add a number of unnecessary dependencies.
-	extraFlags := []string{"--output=proto", "--include_file_write_contents"}
-	if Bool(config.productVariables.ClangCoverage) {
-		extraFlags = append(extraFlags, "--collect_code_coverage")
-		paths := make([]string, 0, 2)
-		if p := config.productVariables.NativeCoveragePaths; len(p) > 0 {
-			for i := range p {
-				// TODO(b/259404593) convert path wildcard to regex values
-				if p[i] == "*" {
-					p[i] = ".*"
-				}
-			}
-			paths = append(paths, JoinWithPrefixAndSeparator(p, "+", ","))
-		}
-		if p := config.productVariables.NativeCoverageExcludePaths; len(p) > 0 {
-			paths = append(paths, JoinWithPrefixAndSeparator(p, "-", ","))
-		}
-		if len(paths) > 0 {
-			extraFlags = append(extraFlags, "--instrumentation_filter="+strings.Join(paths, ","))
-		}
-	}
-	aqueryOutput, _, err := context.issueBazelCommand(context.createBazelCommand(config, bazel.AqueryBuildRootRunName, aqueryCmd,
-		extraFlags...), context.paths, eventHandler)
-	if err != nil {
-		return err
-	}
-	context.buildStatements, context.depsets, err = bazel.AqueryBuildStatements([]byte(aqueryOutput), eventHandler)
-	return err
-}
-
-func (context *mixedBuildBazelContext) generateBazelSymlinks(config Config, ctx invokeBazelContext) error {
-	eventHandler := ctx.GetEventHandler()
-	eventHandler.Begin("symlinks")
-	defer eventHandler.End("symlinks")
-	// Issue a build command of the phony root to generate symlink forests for dependencies of the
-	// Bazel build. This is necessary because aquery invocations do not generate this symlink forest,
-	// but some of symlinks may be required to resolve source dependencies of the build.
-	_, _, err := context.issueBazelCommand(context.createBazelCommand(config, bazel.BazelBuildPhonyRootRunName, buildCmd), context.paths, eventHandler)
-	return err
-}
-
-func (context *mixedBuildBazelContext) BuildStatementsToRegister() []*bazel.BuildStatement {
-	return context.buildStatements
-}
-
-func (context *mixedBuildBazelContext) AqueryDepsets() []bazel.AqueryDepset {
-	return context.depsets
-}
-
-func (context *mixedBuildBazelContext) OutputBase() string {
-	return context.paths.outputBase
-}
-
-// Singleton used for registering BUILD file ninja dependencies (needed
-// for correctness of builds which use Bazel.
-func BazelSingleton() Singleton {
-	return &bazelSingleton{}
-}
-
-type bazelSingleton struct{}
-
-func (c *bazelSingleton) GenerateBuildActions(ctx SingletonContext) {
-	// bazelSingleton is a no-op if mixed-soong-bazel-builds are disabled.
-	if !ctx.Config().IsMixedBuildsEnabled() {
-		return
-	}
-
-	// Add ninja file dependencies for files which all bazel invocations require.
-	bazelBuildList := absolutePath(filepath.Join(
-		filepath.Dir(ctx.Config().moduleListFile), "bazel.list"))
-	ctx.AddNinjaFileDeps(bazelBuildList)
-
-	data, err := os.ReadFile(bazelBuildList)
-	if err != nil {
-		ctx.Errorf(err.Error())
-	}
-	files := strings.Split(strings.TrimSpace(string(data)), "\n")
-	for _, file := range files {
-		ctx.AddNinjaFileDeps(file)
-	}
-
-	depsetHashToDepset := map[string]bazel.AqueryDepset{}
-
-	for _, depset := range ctx.Config().BazelContext.AqueryDepsets() {
-		depsetHashToDepset[depset.ContentHash] = depset
-
-		var outputs []Path
-		var orderOnlies []Path
-		for _, depsetDepHash := range depset.TransitiveDepSetHashes {
-			otherDepsetName := bazelDepsetName(depsetDepHash)
-			outputs = append(outputs, PathForPhony(ctx, otherDepsetName))
-		}
-		for _, artifactPath := range depset.DirectArtifacts {
-			pathInBazelOut := PathForBazelOut(ctx, artifactPath)
-			if artifactPath == "bazel-out/volatile-status.txt" {
-				// See https://bazel.build/docs/user-manual#workspace-status
-				orderOnlies = append(orderOnlies, pathInBazelOut)
-			} else {
-				outputs = append(outputs, pathInBazelOut)
-			}
-		}
-		thisDepsetName := bazelDepsetName(depset.ContentHash)
-		ctx.Build(pctx, BuildParams{
-			Rule:      blueprint.Phony,
-			Outputs:   []WritablePath{PathForPhony(ctx, thisDepsetName)},
-			Implicits: outputs,
-			OrderOnly: orderOnlies,
-		})
-	}
-
-	executionRoot := path.Join(ctx.Config().BazelContext.OutputBase(), "execroot", "__main__")
-	bazelOutDir := path.Join(executionRoot, "bazel-out")
-	rel, err := filepath.Rel(ctx.Config().OutDir(), executionRoot)
-	if err != nil {
-		ctx.Errorf("%s", err.Error())
-	}
-	dotdotsToOutRoot := strings.Repeat("../", strings.Count(rel, "/")+1)
-	for index, buildStatement := range ctx.Config().BazelContext.BuildStatementsToRegister() {
-		// nil build statements are a valid case where we do not create an action because it is
-		// unnecessary or handled by other processing
-		if buildStatement == nil {
-			continue
-		}
-		if len(buildStatement.Command) > 0 {
-			rule := NewRuleBuilder(pctx, ctx)
-			intermediateDir, intermediateDirHash := intermediatePathForSboxMixedBuildAction(ctx, buildStatement)
-			if buildStatement.ShouldRunInSbox {
-				// Create a rule to build the output inside a sandbox
-				// This will create two changes of working directory
-				// 1. From ANDROID_BUILD_TOP to sbox top
-				// 2. From sbox top to a a synthetic mixed build execution root relative to it
-				// Finally, the outputs will be copied to intermediateDir
-				rule.Sbox(intermediateDir,
-					PathForOutput(ctx, "mixed_build_sbox_intermediates", intermediateDirHash+".textproto")).
-					SandboxInputs().
-					// Since we will cd to mixed build execution root, set sbox's out subdir to empty
-					// Without this, we will try to copy from $SBOX_SANDBOX_DIR/out/out/bazel/output/execroot/__main__/...
-					SetSboxOutDirDirAsEmpty()
-
-				// Create another set of rules to copy files from the intermediate dir to mixed build execution root
-				for _, outputPath := range buildStatement.OutputPaths {
-					ctx.Build(pctx, BuildParams{
-						Rule:   CpIfChanged,
-						Input:  intermediateDir.Join(ctx, executionRoot, outputPath),
-						Output: PathForBazelOut(ctx, outputPath),
-					})
-				}
-			}
-			createCommand(rule.Command(), buildStatement, executionRoot, bazelOutDir, ctx, depsetHashToDepset, dotdotsToOutRoot)
-
-			desc := fmt.Sprintf("%s: %s", buildStatement.Mnemonic, buildStatement.OutputPaths)
-			rule.Build(fmt.Sprintf("bazel %d", index), desc)
-			continue
-		}
-		// Certain actions returned by aquery (for instance FileWrite) do not contain a command
-		// and thus require special treatment. If BuildStatement were an interface implementing
-		// buildRule(ctx) function, the code here would just call it.
-		// Unfortunately, the BuildStatement is defined in
-		// the 'bazel' package, which cannot depend on 'android' package where ctx is defined,
-		// because this would cause circular dependency. So, until we move aquery processing
-		// to the 'android' package, we need to handle special cases here.
-		switch buildStatement.Mnemonic {
-		case "RepoMappingManifest":
-			// It appears RepoMappingManifest files currently have
-			// non-deterministic content. Just emit empty files for
-			// now because they're unused.
-			out := PathForBazelOut(ctx, buildStatement.OutputPaths[0])
-			WriteFileRuleVerbatim(ctx, out, "")
-		case "FileWrite", "SourceSymlinkManifest":
-			out := PathForBazelOut(ctx, buildStatement.OutputPaths[0])
-			if buildStatement.IsExecutable {
-				WriteExecutableFileRuleVerbatim(ctx, out, buildStatement.FileContents)
-			} else {
-				WriteFileRuleVerbatim(ctx, out, buildStatement.FileContents)
-			}
-		case "SymlinkTree":
-			// build-runfiles arguments are the manifest file and the target directory
-			// where it creates the symlink tree according to this manifest (and then
-			// writes the MANIFEST file to it).
-			outManifest := PathForBazelOut(ctx, buildStatement.OutputPaths[0])
-			outManifestPath := outManifest.String()
-			if !strings.HasSuffix(outManifestPath, "MANIFEST") {
-				panic("the base name of the symlink tree action should be MANIFEST, got " + outManifestPath)
-			}
-			outDir := filepath.Dir(outManifestPath)
-			ctx.Build(pctx, BuildParams{
-				Rule:        buildRunfilesRule,
-				Output:      outManifest,
-				Inputs:      []Path{PathForBazelOut(ctx, buildStatement.InputPaths[0])},
-				Description: "symlink tree for " + outDir,
-				Args: map[string]string{
-					"outDir": outDir,
-				},
-			})
-		default:
-			panic(fmt.Sprintf("unhandled build statement: %v", buildStatement))
-		}
-	}
-
-	// Create phony targets for all the bazel sandwich output files
-	requests, err := GetBazelSandwichCqueryRequests(ctx.Config())
-	if err != nil {
-		ctx.Errorf(err.Error())
-	}
-	for _, request := range requests {
-		files, err := ctx.Config().BazelContext.GetOutputFiles(request.label, request.configKey)
-		if err != nil {
-			ctx.Errorf(err.Error())
-		}
-		filesAsPaths := make([]Path, 0, len(files))
-		for _, file := range files {
-			filesAsPaths = append(filesAsPaths, PathForBazelOut(ctx, file))
-		}
-		ctx.Phony("bazel_sandwich", filesAsPaths...)
-	}
-	ctx.Phony("checkbuild", PathForPhony(ctx, "bazel_sandwich"))
-}
-
-// Returns a out dir path for a sandboxed mixed build action
-func intermediatePathForSboxMixedBuildAction(ctx PathContext, statement *bazel.BuildStatement) (OutputPath, string) {
-	// An artifact can be generated by a single buildstatement.
-	// Use the hash of the first artifact to create a unique path
-	uniqueDir := sha1.New()
-	uniqueDir.Write([]byte(statement.OutputPaths[0]))
-	uniqueDirHashString := hex.EncodeToString(uniqueDir.Sum(nil))
-	return PathForOutput(ctx, "mixed_build_sbox_intermediates", uniqueDirHashString), uniqueDirHashString
-}
-
-// Register bazel-owned build statements (obtained from the aquery invocation).
-func createCommand(cmd *RuleBuilderCommand, buildStatement *bazel.BuildStatement, executionRoot string, bazelOutDir string, ctx BuilderContext, depsetHashToDepset map[string]bazel.AqueryDepset, dotdotsToOutRoot string) {
-	// executionRoot is the action cwd.
-	if buildStatement.ShouldRunInSbox {
-		// mkdir -p ensures that the directory exists when run via sbox
-		cmd.Text(fmt.Sprintf("mkdir -p '%s' && cd '%s' &&", executionRoot, executionRoot))
-	} else {
-		cmd.Text(fmt.Sprintf("cd '%s' &&", executionRoot))
-	}
-
-	// Remove old outputs, as some actions might not rerun if the outputs are detected.
-	if len(buildStatement.OutputPaths) > 0 {
-		cmd.Text("rm -rf") // -r because outputs can be Bazel dir/tree artifacts.
-		for _, outputPath := range buildStatement.OutputPaths {
-			cmd.Text(fmt.Sprintf("'%s'", outputPath))
-		}
-		cmd.Text("&&")
-	}
-
-	for _, pair := range buildStatement.Env {
-		// Set per-action env variables, if any.
-		cmd.Flag(pair.Key + "=" + pair.Value)
-	}
-
-	command := buildStatement.Command
-	command = strings.ReplaceAll(command, "{DOTDOTS_TO_OUTPUT_ROOT}", dotdotsToOutRoot)
-
-	// The actual Bazel action.
-	if len(command) > 16*1024 {
-		commandFile := PathForBazelOut(ctx, buildStatement.OutputPaths[0]+".sh")
-		WriteFileRule(ctx, commandFile, command)
-
-		cmd.Text("bash").Text(buildStatement.OutputPaths[0] + ".sh").Implicit(commandFile)
-	} else {
-		cmd.Text(command)
-	}
-
-	for _, outputPath := range buildStatement.OutputPaths {
-		if buildStatement.ShouldRunInSbox {
-			// The full path has three components that get joined together
-			// 1. intermediate output dir that `sbox` will place the artifacts at
-			// 2. mixed build execution root
-			// 3. artifact path returned by aquery
-			intermediateDir, _ := intermediatePathForSboxMixedBuildAction(ctx, buildStatement)
-			cmd.ImplicitOutput(intermediateDir.Join(ctx, executionRoot, outputPath))
-		} else {
-			cmd.ImplicitOutput(PathForBazelOut(ctx, outputPath))
-		}
-	}
-	for _, inputPath := range buildStatement.InputPaths {
-		cmd.Implicit(PathForBazelOut(ctx, inputPath))
-	}
-	for _, inputDepsetHash := range buildStatement.InputDepsetHashes {
-		if buildStatement.ShouldRunInSbox {
-			// Bazel depsets are phony targets that are used to group files.
-			// We need to copy the grouped files into the sandbox
-			ds, _ := depsetHashToDepset[inputDepsetHash]
-			cmd.Implicits(PathsForBazelOut(ctx, ds.DirectArtifacts))
-		} else {
-			otherDepsetName := bazelDepsetName(inputDepsetHash)
-			cmd.Implicit(PathForPhony(ctx, otherDepsetName))
-		}
-	}
-	for _, implicitPath := range buildStatement.ImplicitDeps {
-		cmd.Implicit(PathForArbitraryOutput(ctx, implicitPath))
-	}
-
-	if depfile := buildStatement.Depfile; depfile != nil {
-		// The paths in depfile are relative to `executionRoot`.
-		// Hence, they need to be corrected by replacing "bazel-out"
-		// with the full `bazelOutDir`.
-		// Otherwise, implicit outputs and implicit inputs under "bazel-out/"
-		// would be deemed missing.
-		// (Note: The regexp uses a capture group because the version of sed
-		//  does not support a look-behind pattern.)
-		replacement := fmt.Sprintf(`&& sed -i'' -E 's@(^|\s|")bazel-out/@\1%s/@g' '%s'`,
-			bazelOutDir, *depfile)
-		cmd.Text(replacement)
-		cmd.ImplicitDepFile(PathForBazelOut(ctx, *depfile))
-	}
-
-	for _, symlinkPath := range buildStatement.SymlinkPaths {
-		cmd.ImplicitSymlinkOutput(PathForBazelOut(ctx, symlinkPath))
-	}
-}
-
-func getCqueryId(key cqueryKey) string {
-	return key.label + "|" + getConfigString(key)
-}
-
-func getConfigString(key cqueryKey) string {
-	arch := key.configKey.arch
-	if len(arch) == 0 || arch == "common" {
-		if key.configKey.osType.Class == Device {
-			// For the generic Android, the expected result is "target|android", which
-			// corresponds to the product_variable_config named "android_target" in
-			// build/bazel/platforms/BUILD.bazel.
-			arch = "target"
-		} else {
-			// Use host platform, which is currently hardcoded to be x86_64.
-			arch = "x86_64"
-		}
-	}
-	osName := key.configKey.osType.Name
-	if len(osName) == 0 || osName == "common_os" || osName == "linux_glibc" || osName == "linux_musl" {
-		// Use host OS, which is currently hardcoded to be linux.
-		osName = "linux"
-	}
-	keyString := arch + "|" + osName
-	if key.configKey.apexKey.WithinApex {
-		keyString += "|" + withinApexToString(key.configKey.apexKey.WithinApex)
-	}
-
-	if len(key.configKey.apexKey.ApexSdkVersion) > 0 {
-		keyString += "|" + key.configKey.apexKey.ApexSdkVersion
-	}
-
-	if len(key.configKey.apexKey.ApiDomain) > 0 {
-		keyString += "|" + key.configKey.apexKey.ApiDomain
-	}
-
-	return keyString
-}
-
-func GetConfigKey(ctx BaseModuleContext) configKey {
-	return configKey{
-		// use string because Arch is not a valid key in go
-		arch:   ctx.Arch().String(),
-		osType: ctx.Os(),
-	}
-}
-
-func GetConfigKeyApexVariant(ctx BaseModuleContext, apexKey *ApexConfigKey) configKey {
-	configKey := GetConfigKey(ctx)
-
-	if apexKey != nil {
-		configKey.apexKey = ApexConfigKey{
-			WithinApex:     apexKey.WithinApex,
-			ApexSdkVersion: apexKey.ApexSdkVersion,
-			ApiDomain:      apexKey.ApiDomain,
-		}
-	}
-
-	return configKey
-}
-
-func bazelDepsetName(contentHash string) string {
-	return fmt.Sprintf("bazel_depset_%s", contentHash)
-}
diff --git a/android/bazel_handler_test.go b/android/bazel_handler_test.go
deleted file mode 100644
index 9a3c8fc..0000000
--- a/android/bazel_handler_test.go
+++ /dev/null
@@ -1,426 +0,0 @@
-package android
-
-import (
-	"encoding/json"
-	"os"
-	"path/filepath"
-	"reflect"
-	"strings"
-	"testing"
-
-	"android/soong/bazel"
-	"android/soong/bazel/cquery"
-	analysis_v2_proto "prebuilts/bazel/common/proto/analysis_v2"
-
-	"github.com/google/blueprint/metrics"
-	"google.golang.org/protobuf/proto"
-)
-
-var testConfig = TestConfig("out", nil, "", nil)
-
-type testInvokeBazelContext struct{}
-
-type mockBazelRunner struct {
-	testHelper *testing.T
-	// Stores mock behavior. If an issueBazelCommand request is made for command
-	// k, and {k:v} is present in this map, then the mock will return v.
-	bazelCommandResults map[bazelCommand]string
-	// Requests actually made of the mockBazelRunner with issueBazelCommand,
-	// keyed by the command they represent.
-	bazelCommandRequests map[bazelCommand]bazel.CmdRequest
-}
-
-func (r *mockBazelRunner) bazelCommandForRequest(cmdRequest bazel.CmdRequest) bazelCommand {
-	for _, arg := range cmdRequest.Argv {
-		for _, cmdType := range allBazelCommands {
-			if arg == cmdType.command {
-				return cmdType
-			}
-		}
-	}
-	r.testHelper.Fatalf("Unrecognized bazel request: %s", cmdRequest)
-	return cqueryCmd
-}
-
-func (r *mockBazelRunner) issueBazelCommand(cmdRequest bazel.CmdRequest, paths *bazelPaths, eventHandler *metrics.EventHandler) (string, string, error) {
-	command := r.bazelCommandForRequest(cmdRequest)
-	r.bazelCommandRequests[command] = cmdRequest
-	return r.bazelCommandResults[command], "", nil
-}
-
-func (t *testInvokeBazelContext) GetEventHandler() *metrics.EventHandler {
-	return &metrics.EventHandler{}
-}
-
-func TestRequestResultsAfterInvokeBazel(t *testing.T) {
-	label_foo := "@//foo:foo"
-	label_bar := "@//foo:bar"
-	apexKey := ApexConfigKey{
-		WithinApex:     true,
-		ApexSdkVersion: "29",
-		ApiDomain:      "myapex",
-	}
-	cfg_foo := configKey{"arm64_armv8-a", Android, apexKey}
-	cfg_bar := configKey{arch: "arm64_armv8-a", osType: Android}
-	cmd_results := []string{
-		`@//foo:foo|arm64_armv8-a|android|within_apex|29|myapex>>out/foo/foo.txt`,
-		`@//foo:bar|arm64_armv8-a|android>>out/foo/bar.txt`,
-	}
-	bazelContext, _ := testBazelContext(t, map[bazelCommand]string{cqueryCmd: strings.Join(cmd_results, "\n")})
-
-	bazelContext.QueueBazelRequest(label_foo, cquery.GetOutputFiles, cfg_foo)
-	bazelContext.QueueBazelRequest(label_bar, cquery.GetOutputFiles, cfg_bar)
-	err := bazelContext.InvokeBazel(testConfig, &testInvokeBazelContext{})
-	if err != nil {
-		t.Fatalf("Did not expect error invoking Bazel, but got %s", err)
-	}
-	verifyCqueryResult(t, bazelContext, label_foo, cfg_foo, "out/foo/foo.txt")
-	verifyCqueryResult(t, bazelContext, label_bar, cfg_bar, "out/foo/bar.txt")
-}
-
-func verifyCqueryResult(t *testing.T, ctx *mixedBuildBazelContext, label string, cfg configKey, result string) {
-	g, err := ctx.GetOutputFiles(label, cfg)
-	if err != nil {
-		t.Errorf("Expected cquery results after running InvokeBazel(), but got err %v", err)
-	} else if w := []string{result}; !reflect.DeepEqual(w, g) {
-		t.Errorf("Expected output %s, got %s", w, g)
-	}
-}
-
-func TestInvokeBazelWritesBazelFiles(t *testing.T) {
-	bazelContext, baseDir := testBazelContext(t, map[bazelCommand]string{})
-	err := bazelContext.InvokeBazel(testConfig, &testInvokeBazelContext{})
-	if err != nil {
-		t.Fatalf("Did not expect error invoking Bazel, but got %s", err)
-	}
-	if _, err := os.Stat(filepath.Join(baseDir, "soong_injection", "mixed_builds", "main.bzl")); os.IsNotExist(err) {
-		t.Errorf("Expected main.bzl to exist, but it does not")
-	} else if err != nil {
-		t.Errorf("Unexpected error stating main.bzl %s", err)
-	}
-
-	if _, err := os.Stat(filepath.Join(baseDir, "soong_injection", "mixed_builds", "BUILD.bazel")); os.IsNotExist(err) {
-		t.Errorf("Expected BUILD.bazel to exist, but it does not")
-	} else if err != nil {
-		t.Errorf("Unexpected error stating BUILD.bazel %s", err)
-	}
-
-	if _, err := os.Stat(filepath.Join(baseDir, "soong_injection", "WORKSPACE.bazel")); os.IsNotExist(err) {
-		t.Errorf("Expected WORKSPACE.bazel to exist, but it does not")
-	} else if err != nil {
-		t.Errorf("Unexpected error stating WORKSPACE.bazel %s", err)
-	}
-}
-
-func TestInvokeBazelPopulatesBuildStatements(t *testing.T) {
-	type testCase struct {
-		input   string
-		command string
-	}
-
-	var testCases = []testCase{
-		{`
-{
- "artifacts": [
-   { "id": 1, "path_fragment_id": 1 },
-   { "id": 2, "path_fragment_id": 2 }],
- "actions": [{
-   "target_Id": 1,
-   "action_Key": "x",
-   "mnemonic": "x",
-   "arguments": ["touch", "foo"],
-   "input_dep_set_ids": [1],
-   "output_Ids": [1],
-   "primary_output_id": 1
- }],
- "dep_set_of_files": [
-   { "id": 1, "direct_artifact_ids": [1, 2] }],
- "path_fragments": [
-   { "id": 1, "label": "one" },
-   { "id": 2, "label": "two" }]
-}`,
-			"cd 'test/exec_root' && rm -rf 'one' && touch foo",
-		}, {`
-{
- "artifacts": [
-   { "id": 1, "path_fragment_id": 10 },
-   { "id": 2, "path_fragment_id": 20 }],
- "actions": [{
-   "target_Id": 100,
-   "action_Key": "x",
-   "mnemonic": "x",
-   "arguments": ["bogus", "command"],
-   "output_Ids": [1, 2],
-   "primary_output_id": 1
- }],
- "path_fragments": [
-   { "id": 10, "label": "one", "parent_id": 30 },
-   { "id": 20, "label": "one.d", "parent_id": 30 },
-   { "id": 30, "label": "parent" }]
-}`,
-			`cd 'test/exec_root' && rm -rf 'parent/one' && bogus command && sed -i'' -E 's@(^|\s|")bazel-out/@\1test/bazel_out/@g' 'parent/one.d'`,
-		},
-	}
-
-	for i, testCase := range testCases {
-		data, err := JsonToActionGraphContainer(testCase.input)
-		if err != nil {
-			t.Error(err)
-		}
-		bazelContext, _ := testBazelContext(t, map[bazelCommand]string{aqueryCmd: string(data)})
-
-		err = bazelContext.InvokeBazel(testConfig, &testInvokeBazelContext{})
-		if err != nil {
-			t.Fatalf("testCase #%d: did not expect error invoking Bazel, but got %s", i+1, err)
-		}
-
-		got := bazelContext.BuildStatementsToRegister()
-		if want := 1; len(got) != want {
-			t.Fatalf("expected %d registered build statements, but got %#v", want, got)
-		}
-
-		cmd := RuleBuilderCommand{}
-		ctx := builderContextForTests{PathContextForTesting(TestConfig("out", nil, "", nil))}
-		createCommand(&cmd, got[0], "test/exec_root", "test/bazel_out", ctx, map[string]bazel.AqueryDepset{}, "")
-		if actual, expected := cmd.buf.String(), testCase.command; expected != actual {
-			t.Errorf("expected: [%s], actual: [%s]", expected, actual)
-		}
-	}
-}
-
-func TestMixedBuildSandboxedAction(t *testing.T) {
-	input := `{
- "artifacts": [
-   { "id": 1, "path_fragment_id": 1 },
-   { "id": 2, "path_fragment_id": 2 }],
- "actions": [{
-   "target_Id": 1,
-   "action_Key": "x",
-   "mnemonic": "x",
-   "arguments": ["touch", "foo"],
-   "input_dep_set_ids": [1],
-   "output_Ids": [1],
-   "primary_output_id": 1
- }],
- "dep_set_of_files": [
-   { "id": 1, "direct_artifact_ids": [1, 2] }],
- "path_fragments": [
-   { "id": 1, "label": "one" },
-   { "id": 2, "label": "two" }]
-}`
-	data, err := JsonToActionGraphContainer(input)
-	if err != nil {
-		t.Error(err)
-	}
-	bazelContext, _ := testBazelContext(t, map[bazelCommand]string{aqueryCmd: string(data)})
-
-	err = bazelContext.InvokeBazel(testConfig, &testInvokeBazelContext{})
-	if err != nil {
-		t.Fatalf("TestMixedBuildSandboxedAction did not expect error invoking Bazel, but got %s", err)
-	}
-
-	statement := bazelContext.BuildStatementsToRegister()[0]
-	statement.ShouldRunInSbox = true
-
-	cmd := RuleBuilderCommand{}
-	ctx := builderContextForTests{PathContextForTesting(TestConfig("out", nil, "", nil))}
-	createCommand(&cmd, statement, "test/exec_root", "test/bazel_out", ctx, map[string]bazel.AqueryDepset{}, "")
-	// Assert that the output is generated in an intermediate directory
-	// fe05bcdcdc4928012781a5f1a2a77cbb5398e106 is the sha1 checksum of "one"
-	if actual, expected := cmd.outputs[0].String(), "out/soong/mixed_build_sbox_intermediates/fe05bcdcdc4928012781a5f1a2a77cbb5398e106/test/exec_root/one"; expected != actual {
-		t.Errorf("expected: [%s], actual: [%s]", expected, actual)
-	}
-
-	// Assert the actual command remains unchanged inside the sandbox
-	if actual, expected := cmd.buf.String(), "mkdir -p 'test/exec_root' && cd 'test/exec_root' && rm -rf 'one' && touch foo"; expected != actual {
-		t.Errorf("expected: [%s], actual: [%s]", expected, actual)
-	}
-}
-
-func TestCoverageFlagsAfterInvokeBazel(t *testing.T) {
-	testConfig.productVariables.ClangCoverage = boolPtr(true)
-
-	testConfig.productVariables.NativeCoveragePaths = []string{"foo1", "foo2"}
-	testConfig.productVariables.NativeCoverageExcludePaths = []string{"bar1", "bar2"}
-	verifyAqueryContainsFlags(t, testConfig, "--collect_code_coverage", "--instrumentation_filter=+foo1,+foo2,-bar1,-bar2")
-
-	testConfig.productVariables.NativeCoveragePaths = []string{"foo1"}
-	testConfig.productVariables.NativeCoverageExcludePaths = []string{"bar1"}
-	verifyAqueryContainsFlags(t, testConfig, "--collect_code_coverage", "--instrumentation_filter=+foo1,-bar1")
-
-	testConfig.productVariables.NativeCoveragePaths = []string{"foo1"}
-	testConfig.productVariables.NativeCoverageExcludePaths = nil
-	verifyAqueryContainsFlags(t, testConfig, "--collect_code_coverage", "--instrumentation_filter=+foo1")
-
-	testConfig.productVariables.NativeCoveragePaths = nil
-	testConfig.productVariables.NativeCoverageExcludePaths = []string{"bar1"}
-	verifyAqueryContainsFlags(t, testConfig, "--collect_code_coverage", "--instrumentation_filter=-bar1")
-
-	testConfig.productVariables.NativeCoveragePaths = []string{"*"}
-	testConfig.productVariables.NativeCoverageExcludePaths = nil
-	verifyAqueryContainsFlags(t, testConfig, "--collect_code_coverage", "--instrumentation_filter=+.*")
-
-	testConfig.productVariables.ClangCoverage = boolPtr(false)
-	verifyAqueryDoesNotContainSubstrings(t, testConfig, "collect_code_coverage", "instrumentation_filter")
-}
-
-func TestBazelRequestsSorted(t *testing.T) {
-	bazelContext, _ := testBazelContext(t, map[bazelCommand]string{})
-
-	cfgKeyArm64Android := configKey{arch: "arm64_armv8-a", osType: Android}
-	cfgKeyArm64Linux := configKey{arch: "arm64_armv8-a", osType: Linux}
-	cfgKeyOtherAndroid := configKey{arch: "otherarch", osType: Android}
-
-	bazelContext.QueueBazelRequest("zzz", cquery.GetOutputFiles, cfgKeyArm64Android)
-	bazelContext.QueueBazelRequest("ccc", cquery.GetApexInfo, cfgKeyArm64Android)
-	bazelContext.QueueBazelRequest("duplicate", cquery.GetOutputFiles, cfgKeyArm64Android)
-	bazelContext.QueueBazelRequest("duplicate", cquery.GetOutputFiles, cfgKeyArm64Android)
-	bazelContext.QueueBazelRequest("xxx", cquery.GetOutputFiles, cfgKeyArm64Linux)
-	bazelContext.QueueBazelRequest("aaa", cquery.GetOutputFiles, cfgKeyArm64Android)
-	bazelContext.QueueBazelRequest("aaa", cquery.GetOutputFiles, cfgKeyOtherAndroid)
-	bazelContext.QueueBazelRequest("bbb", cquery.GetOutputFiles, cfgKeyOtherAndroid)
-
-	if len(bazelContext.requests) != 7 {
-		t.Error("Expected 7 request elements, but got", len(bazelContext.requests))
-	}
-
-	lastString := ""
-	for _, val := range bazelContext.requests {
-		thisString := val.String()
-		if thisString <= lastString {
-			t.Errorf("Requests are not ordered correctly. '%s' came before '%s'", lastString, thisString)
-		}
-		lastString = thisString
-	}
-}
-
-func TestIsModuleNameAllowed(t *testing.T) {
-	libDisabled := "lib_disabled"
-	libEnabled := "lib_enabled"
-	libDclaWithinApex := "lib_dcla_within_apex"
-	libDclaNonApex := "lib_dcla_non_apex"
-	libNotConverted := "lib_not_converted"
-
-	disabledModules := map[string]bool{
-		libDisabled: true,
-	}
-	enabledModules := map[string]bool{
-		libEnabled: true,
-	}
-	dclaEnabledModules := map[string]bool{
-		libDclaWithinApex: true,
-		libDclaNonApex:    true,
-	}
-
-	bazelContext := &mixedBuildBazelContext{
-		bazelEnabledModules:     enabledModules,
-		bazelDisabledModules:    disabledModules,
-		bazelDclaEnabledModules: dclaEnabledModules,
-	}
-
-	if bazelContext.IsModuleNameAllowed(libDisabled, true) {
-		t.Fatalf("%s shouldn't be allowed for mixed build", libDisabled)
-	}
-
-	if !bazelContext.IsModuleNameAllowed(libEnabled, true) {
-		t.Fatalf("%s should be allowed for mixed build", libEnabled)
-	}
-
-	if !bazelContext.IsModuleNameAllowed(libDclaWithinApex, true) {
-		t.Fatalf("%s should be allowed for mixed build", libDclaWithinApex)
-	}
-
-	if bazelContext.IsModuleNameAllowed(libDclaNonApex, false) {
-		t.Fatalf("%s shouldn't be allowed for mixed build", libDclaNonApex)
-	}
-
-	if bazelContext.IsModuleNameAllowed(libNotConverted, true) {
-		t.Fatalf("%s shouldn't be allowed for mixed build", libNotConverted)
-	}
-}
-
-func verifyAqueryContainsFlags(t *testing.T, config Config, expected ...string) {
-	t.Helper()
-	bazelContext, _ := testBazelContext(t, map[bazelCommand]string{})
-
-	err := bazelContext.InvokeBazel(config, &testInvokeBazelContext{})
-	if err != nil {
-		t.Fatalf("Did not expect error invoking Bazel, but got %s", err)
-	}
-
-	sliceContains := func(slice []string, x string) bool {
-		for _, s := range slice {
-			if s == x {
-				return true
-			}
-		}
-		return false
-	}
-
-	aqueryArgv := bazelContext.bazelRunner.(*mockBazelRunner).bazelCommandRequests[aqueryCmd].Argv
-
-	for _, expectedFlag := range expected {
-		if !sliceContains(aqueryArgv, expectedFlag) {
-			t.Errorf("aquery does not contain expected flag %#v. Argv was: %#v", expectedFlag, aqueryArgv)
-		}
-	}
-}
-
-func verifyAqueryDoesNotContainSubstrings(t *testing.T, config Config, substrings ...string) {
-	t.Helper()
-	bazelContext, _ := testBazelContext(t, map[bazelCommand]string{})
-
-	err := bazelContext.InvokeBazel(config, &testInvokeBazelContext{})
-	if err != nil {
-		t.Fatalf("Did not expect error invoking Bazel, but got %s", err)
-	}
-
-	sliceContainsSubstring := func(slice []string, substring string) bool {
-		for _, s := range slice {
-			if strings.Contains(s, substring) {
-				return true
-			}
-		}
-		return false
-	}
-
-	aqueryArgv := bazelContext.bazelRunner.(*mockBazelRunner).bazelCommandRequests[aqueryCmd].Argv
-
-	for _, substring := range substrings {
-		if sliceContainsSubstring(aqueryArgv, substring) {
-			t.Errorf("aquery contains unexpected substring %#v. Argv was: %#v", substring, aqueryArgv)
-		}
-	}
-}
-
-func testBazelContext(t *testing.T, bazelCommandResults map[bazelCommand]string) (*mixedBuildBazelContext, string) {
-	t.Helper()
-	p := bazelPaths{
-		soongOutDir:  t.TempDir(),
-		outputBase:   "outputbase",
-		workspaceDir: "workspace_dir",
-	}
-	if _, exists := bazelCommandResults[aqueryCmd]; !exists {
-		bazelCommandResults[aqueryCmd] = ""
-	}
-	runner := &mockBazelRunner{
-		testHelper:           t,
-		bazelCommandResults:  bazelCommandResults,
-		bazelCommandRequests: map[bazelCommand]bazel.CmdRequest{},
-	}
-	return &mixedBuildBazelContext{
-		bazelRunner: runner,
-		paths:       &p,
-	}, p.soongOutDir
-}
-
-// Transform the json format to ActionGraphContainer
-func JsonToActionGraphContainer(inputString string) ([]byte, error) {
-	var aqueryProtoResult analysis_v2_proto.ActionGraphContainer
-	err := json.Unmarshal([]byte(inputString), &aqueryProtoResult)
-	if err != nil {
-		return []byte(""), err
-	}
-	data, _ := proto.Marshal(&aqueryProtoResult)
-	return data, err
-}
diff --git a/android/bazel_paths.go b/android/bazel_paths.go
deleted file mode 100644
index f25803c..0000000
--- a/android/bazel_paths.go
+++ /dev/null
@@ -1,675 +0,0 @@
-// Copyright 2015 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package android
-
-import (
-	"fmt"
-	"os"
-	"path/filepath"
-	"strings"
-
-	"android/soong/bazel"
-
-	"github.com/google/blueprint"
-	"github.com/google/blueprint/pathtools"
-)
-
-// bazel_paths contains methods to:
-//   * resolve Soong path and module references into bazel.LabelList
-//   * resolve Bazel path references into Soong-compatible paths
-//
-// There is often a similar method for Bazel as there is for Soong path handling and should be used
-// in similar circumstances
-//
-//   Bazel                                Soong
-//   ==============================================================
-//   BazelLabelForModuleSrc               PathForModuleSrc
-//   BazelLabelForModuleSrcExcludes       PathForModuleSrcExcludes
-//   BazelLabelForModuleDeps              n/a
-//   tbd                                  PathForSource
-//   tbd                                  ExistentPathsForSources
-//   PathForBazelOut                      PathForModuleOut
-//
-// Use cases:
-//  * Module contains a property (often tagged `android:"path"`) that expects paths *relative to the
-//    module directory*:
-//     * BazelLabelForModuleSrcExcludes, if the module also contains an excludes_<propname> property
-//     * BazelLabelForModuleSrc, otherwise
-//  * Converting references to other modules to Bazel Labels:
-//     BazelLabelForModuleDeps
-//  * Converting a path obtained from bazel_handler cquery results:
-//     PathForBazelOut
-//
-// NOTE: all Soong globs are expanded within Soong rather than being converted to a Bazel glob
-//       syntax. This occurs because Soong does not have a concept of crossing package boundaries,
-//       so the glob as computed by Soong may contain paths that cross package-boundaries. These
-//       would be unknowingly omitted if the glob were handled by Bazel. By expanding globs within
-//       Soong, we support identification and detection (within Bazel) use of paths that cross
-//       package boundaries.
-//
-// Path resolution:
-// * filepath/globs: resolves as itself or is converted to an absolute Bazel label (e.g.
-//   //path/to/dir:<filepath>) if path exists in a separate package or subpackage.
-// * references to other modules (using the ":name{.tag}" syntax). These resolve as a Bazel label
-//   for a target. If the Bazel target is in the local module directory, it will be returned
-//   relative to the current package (e.g.  ":<target>"). Otherwise, it will be returned as an
-//   absolute Bazel label (e.g.  "//path/to/dir:<target>"). If the reference to another module
-//   cannot be resolved,the function will panic. This is often due to the dependency not being added
-//   via an AddDependency* method.
-
-// BazelConversionContext is a minimal context interface to check if a module should be converted by bp2build,
-// with functions containing information to match against allowlists and denylists.
-// If a module is deemed to be convertible by bp2build, then it should rely on a
-// BazelConversionPathContext for more functions for dep/path features.
-type BazelConversionContext interface {
-	Config() Config
-
-	Module() Module
-	OtherModuleType(m blueprint.Module) string
-	OtherModuleName(m blueprint.Module) string
-	OtherModuleDir(m blueprint.Module) string
-	ModuleErrorf(format string, args ...interface{})
-}
-
-// A subset of the ModuleContext methods which are sufficient to resolve references to paths/deps in
-// order to form a Bazel-compatible label for conversion.
-type BazelConversionPathContext interface {
-	EarlyModulePathContext
-	BazelConversionContext
-
-	ModuleName() string
-	ModuleType() string
-	ModuleErrorf(fmt string, args ...interface{})
-	PropertyErrorf(property, fmt string, args ...interface{})
-	GetDirectDep(name string) (blueprint.Module, blueprint.DependencyTag)
-	ModuleFromName(name string) (blueprint.Module, bool)
-	AddUnconvertedBp2buildDep(string)
-	AddMissingBp2buildDep(dep string)
-}
-
-// BazelLabelForModuleDeps expects a list of reference to other modules, ("<module>"
-// or ":<module>") and returns a Bazel-compatible label which corresponds to dependencies on the
-// module within the given ctx.
-func BazelLabelForModuleDeps(ctx Bp2buildMutatorContext, modules []string) bazel.LabelList {
-	return BazelLabelForModuleDepsWithFn(ctx, modules, BazelModuleLabel, true)
-}
-
-// BazelLabelForModuleWholeDepsExcludes expects two lists: modules (containing modules to include in
-// the list), and excludes (modules to exclude from the list). Both of these should contain
-// references to other modules, ("<module>" or ":<module>"). It returns a Bazel-compatible label
-// list which corresponds to dependencies on the module within the given ctx, and the excluded
-// dependencies.  Prebuilt dependencies will be appended with _alwayslink so they can be handled as
-// whole static libraries.
-func BazelLabelForModuleDepsExcludes(ctx Bp2buildMutatorContext, modules, excludes []string) bazel.LabelList {
-	return BazelLabelForModuleDepsExcludesWithFn(ctx, modules, excludes, BazelModuleLabel)
-}
-
-// BazelLabelForModuleDepsWithFn expects a list of reference to other modules, ("<module>"
-// or ":<module>") and applies moduleToLabelFn to determine and return a Bazel-compatible label
-// which corresponds to dependencies on the module within the given ctx.
-func BazelLabelForModuleDepsWithFn(ctx Bp2buildMutatorContext, modules []string,
-	moduleToLabelFn func(BazelConversionPathContext, blueprint.Module) string,
-	markAsDeps bool) bazel.LabelList {
-	var labels bazel.LabelList
-	// In some cases, a nil string list is different than an explicitly empty list.
-	if len(modules) == 0 && modules != nil {
-		labels.Includes = []bazel.Label{}
-		return labels
-	}
-	modules = FirstUniqueStrings(modules)
-	for _, module := range modules {
-		bpText := module
-		if m := SrcIsModule(module); m == "" {
-			module = ":" + module
-		}
-		if m, t := SrcIsModuleWithTag(module); m != "" {
-			l := getOtherModuleLabel(ctx, m, t, moduleToLabelFn, markAsDeps)
-			if l != nil {
-				l.OriginalModuleName = bpText
-				labels.Includes = append(labels.Includes, *l)
-			}
-		} else {
-			ctx.ModuleErrorf("%q, is not a module reference", module)
-		}
-	}
-	return labels
-}
-
-// BazelLabelForModuleDepsExcludesWithFn expects two lists: modules (containing modules to include in the
-// list), and excludes (modules to exclude from the list). Both of these should contain references
-// to other modules, ("<module>" or ":<module>"). It applies moduleToLabelFn to determine and return a
-// Bazel-compatible label list which corresponds to dependencies on the module within the given ctx, and
-// the excluded dependencies.
-func BazelLabelForModuleDepsExcludesWithFn(ctx Bp2buildMutatorContext, modules, excludes []string,
-	moduleToLabelFn func(BazelConversionPathContext, blueprint.Module) string) bazel.LabelList {
-	moduleLabels := BazelLabelForModuleDepsWithFn(ctx, RemoveListFromList(modules, excludes), moduleToLabelFn, true)
-	if len(excludes) == 0 {
-		return moduleLabels
-	}
-	excludeLabels := BazelLabelForModuleDepsWithFn(ctx, excludes, moduleToLabelFn, false)
-	return bazel.LabelList{
-		Includes: moduleLabels.Includes,
-		Excludes: excludeLabels.Includes,
-	}
-}
-
-func BazelLabelForModuleSrcSingle(ctx Bp2buildMutatorContext, path string) bazel.Label {
-	if srcs := BazelLabelForModuleSrcExcludes(ctx, []string{path}, []string(nil)).Includes; len(srcs) > 0 {
-		return srcs[0]
-	}
-	return bazel.Label{}
-}
-
-func BazelLabelForModuleDepSingle(ctx Bp2buildMutatorContext, path string) bazel.Label {
-	if srcs := BazelLabelForModuleDepsExcludes(ctx, []string{path}, []string(nil)).Includes; len(srcs) > 0 {
-		return srcs[0]
-	}
-	return bazel.Label{}
-}
-
-// BazelLabelForModuleSrc expects a list of path (relative to local module directory) and module
-// references (":<module>") and returns a bazel.LabelList{} containing the resolved references in
-// paths, relative to the local module, or Bazel-labels (absolute if in a different package or
-// relative if within the same package).
-// Properties must have been annotated with struct tag `android:"path"` so that dependencies modules
-// will have already been handled by the pathdeps mutator.
-func BazelLabelForModuleSrc(ctx Bp2buildMutatorContext, paths []string) bazel.LabelList {
-	return BazelLabelForModuleSrcExcludes(ctx, paths, []string(nil))
-}
-
-// BazelLabelForModuleSrc expects lists of path and excludes (relative to local module directory)
-// and module references (":<module>") and returns a bazel.LabelList{} containing the resolved
-// references in paths, minus those in excludes, relative to the local module, or Bazel-labels
-// (absolute if in a different package or relative if within the same package).
-// Properties must have been annotated with struct tag `android:"path"` so that dependencies modules
-// will have already been handled by the pathdeps mutator.
-func BazelLabelForModuleSrcExcludes(ctx Bp2buildMutatorContext, paths, excludes []string) bazel.LabelList {
-	excludeLabels := expandSrcsForBazel(ctx, excludes, []string(nil), false)
-	excluded := make([]string, 0, len(excludeLabels.Includes))
-	for _, e := range excludeLabels.Includes {
-		excluded = append(excluded, e.Label)
-	}
-	labels := expandSrcsForBazel(ctx, paths, excluded, true)
-	labels.Excludes = excludeLabels.Includes
-	labels = TransformSubpackagePaths(ctx.Config(), ctx.ModuleDir(), labels)
-	return labels
-}
-
-func BazelLabelForSrcPatternExcludes(ctx BazelConversionPathContext, dir, pattern string, excludes []string) bazel.LabelList {
-	topRelPaths, err := ctx.GlobWithDeps(filepath.Join(dir, pattern), excludes)
-	if err != nil {
-		ctx.ModuleErrorf("Could not search dir: %s for pattern %s due to %v\n", dir, pattern, err)
-	}
-	// An intermediate list of labels relative to `dir` that assumes that there no subpacakges beneath `dir`
-	dirRelLabels := []bazel.Label{}
-	for _, topRelPath := range topRelPaths {
-		dirRelPath := Rel(ctx, dir, topRelPath)
-		dirRelLabels = append(dirRelLabels, bazel.Label{Label: "./" + dirRelPath})
-	}
-	// Return the package boudary resolved labels
-	return TransformSubpackagePaths(ctx.Config(), dir, bazel.MakeLabelList(dirRelLabels))
-}
-
-// Returns true if a prefix + components[:i] is a package boundary.
-//
-// A package boundary is determined by a BUILD file in the directory. This can happen in 2 cases:
-//
-//  1. An Android.bp exists, which bp2build will always convert to a sibling BUILD file.
-//  2. An Android.bp doesn't exist, but a checked-in BUILD/BUILD.bazel file exists, and that file
-//     is allowlisted by the bp2build configuration to be merged into the symlink forest workspace.
-func isPackageBoundary(config Config, prefix string, components []string, componentIndex int) bool {
-	isSymlink := func(c Config, path string) bool {
-		f, err := c.fs.Lstat(path)
-		if err != nil {
-			// The file does not exist
-			return false
-		}
-		return f.Mode()&os.ModeSymlink == os.ModeSymlink
-	}
-	prefix = filepath.Join(prefix, filepath.Join(components[:componentIndex+1]...))
-	if exists, _, _ := config.fs.Exists(filepath.Join(prefix, "Android.bp")); exists {
-		return true
-	} else if config.Bp2buildPackageConfig.ShouldKeepExistingBuildFileForDir(prefix) || isSymlink(config, prefix) {
-		if exists, _, _ := config.fs.Exists(filepath.Join(prefix, "BUILD")); exists {
-			return true
-		} else if exists, _, _ := config.fs.Exists(filepath.Join(prefix, "BUILD.bazel")); exists {
-			return true
-		}
-	}
-
-	return false
-}
-
-// Transform a path (if necessary) to acknowledge package boundaries
-//
-// e.g. something like
-//
-//	async_safe/include/async_safe/CHECK.h
-//
-// might become
-//
-//	//bionic/libc/async_safe:include/async_safe/CHECK.h
-//
-// if the "async_safe" directory is actually a package and not just a directory.
-//
-// In particular, paths that extend into packages are transformed into absolute labels beginning with //.
-func transformSubpackagePath(cfg Config, dir string, path bazel.Label) bazel.Label {
-	var newPath bazel.Label
-
-	// Don't transform OriginalModuleName
-	newPath.OriginalModuleName = path.OriginalModuleName
-	// if it wasn't a module, store the original path. We may need the original path to replace
-	// references if it is actually in another package
-	if path.OriginalModuleName == "" {
-		newPath.OriginalModuleName = path.Label
-	}
-
-	if strings.HasPrefix(path.Label, "//") {
-		// Assume absolute labels are already correct (e.g. //path/to/some/package:foo.h)
-		newPath.Label = path.Label
-		return newPath
-	}
-	if strings.HasPrefix(path.Label, "./") {
-		// Drop "./" for consistent handling of paths.
-		// Specifically, to not let "." be considered a package boundary.
-		// Say `inputPath` is `x/Android.bp` and that file has some module
-		// with `srcs=["y/a.c", "z/b.c"]`.
-		// And say the directory tree is:
-		//     x
-		//     ├── Android.bp
-		//     ├── y
-		//     │   ├── a.c
-		//     │   └── Android.bp
-		//     └── z
-		//         └── b.c
-		// Then bazel equivalent labels in srcs should be:
-		//   //x/y:a.c, x/z/b.c
-		// The above should still be the case if `x/Android.bp` had
-		//   srcs=["./y/a.c", "./z/b.c"]
-		// However, if we didn't strip "./", we'd get
-		//   //x/./y:a.c, //x/.:z/b.c
-		path.Label = strings.TrimPrefix(path.Label, "./")
-	}
-	pathComponents := strings.Split(path.Label, "/")
-	newLabel := ""
-	foundPackageBoundary := false
-	// Check the deepest subdirectory first and work upwards
-	for i := len(pathComponents) - 1; i >= 0; i-- {
-		pathComponent := pathComponents[i]
-		var sep string
-		if !foundPackageBoundary && isPackageBoundary(cfg, dir, pathComponents, i) {
-			sep = ":"
-			foundPackageBoundary = true
-		} else {
-			sep = "/"
-		}
-		if newLabel == "" {
-			newLabel = pathComponent
-		} else {
-			newLabel = pathComponent + sep + newLabel
-		}
-	}
-	if foundPackageBoundary {
-		// Ensure paths end up looking like //bionic/... instead of //./bionic/...
-		moduleDir := dir
-		if strings.HasPrefix(moduleDir, ".") {
-			moduleDir = moduleDir[1:]
-		}
-		// Make the path into an absolute label (e.g. //bionic/libc/foo:bar.h instead of just foo:bar.h)
-		if moduleDir == "" {
-			newLabel = "//" + newLabel
-		} else {
-			newLabel = "//" + moduleDir + "/" + newLabel
-		}
-	}
-	newPath.Label = newLabel
-
-	return newPath
-}
-
-// Transform paths to acknowledge package boundaries
-// See transformSubpackagePath() for more information
-func TransformSubpackagePaths(cfg Config, dir string, paths bazel.LabelList) bazel.LabelList {
-	var newPaths bazel.LabelList
-	for _, include := range paths.Includes {
-		newPaths.Includes = append(newPaths.Includes, transformSubpackagePath(cfg, dir, include))
-	}
-	for _, exclude := range paths.Excludes {
-		newPaths.Excludes = append(newPaths.Excludes, transformSubpackagePath(cfg, dir, exclude))
-	}
-	return newPaths
-}
-
-// Converts root-relative Paths to a list of bazel.Label relative to the module in ctx.
-func RootToModuleRelativePaths(ctx BazelConversionPathContext, paths Paths) []bazel.Label {
-	var newPaths []bazel.Label
-	for _, path := range PathsWithModuleSrcSubDir(ctx, paths, "") {
-		s := path.Rel()
-		newPaths = append(newPaths, bazel.Label{Label: s})
-	}
-	return newPaths
-}
-
-var Bp2buildDepTag bp2buildDepTag
-
-type bp2buildDepTag struct {
-	blueprint.BaseDependencyTag
-}
-
-// expandSrcsForBazel returns bazel.LabelList with paths rooted from the module's local source
-// directory and Bazel target labels, excluding those included in the excludes argument (which
-// should already be expanded to resolve references to Soong-modules). Valid elements of paths
-// include:
-//   - filepath, relative to local module directory, resolves as a filepath relative to the local
-//     source directory
-//   - glob, relative to the local module directory, resolves as filepath(s), relative to the local
-//     module directory. Because Soong does not have a concept of crossing package boundaries, the
-//     glob as computed by Soong may contain paths that cross package-boundaries that would be
-//     unknowingly omitted if the glob were handled by Bazel. To allow identification and detect
-//     (within Bazel) use of paths that cross package boundaries, we expand globs within Soong rather
-//     than converting Soong glob syntax to Bazel glob syntax. **Invalid for excludes.**
-//   - other modules using the ":name{.tag}" syntax. These modules must implement SourceFileProducer
-//     or OutputFileProducer. These resolve as a Bazel label for a target. If the Bazel target is in
-//     the local module directory, it will be returned relative to the current package (e.g.
-//     ":<target>"). Otherwise, it will be returned as an absolute Bazel label (e.g.
-//     "//path/to/dir:<target>"). If the reference to another module cannot be resolved,the function
-//     will panic.
-//
-// Properties passed as the paths or excludes argument must have been annotated with struct tag
-// `android:"path"` so that dependencies on other modules will have already been handled by the
-// pathdeps mutator.
-func expandSrcsForBazel(ctx Bp2buildMutatorContext, paths, expandedExcludes []string, markAsDeps bool) bazel.LabelList {
-	if paths == nil {
-		return bazel.LabelList{}
-	}
-	labels := bazel.LabelList{
-		Includes: []bazel.Label{},
-	}
-
-	// expandedExcludes contain module-dir relative paths, but root-relative paths
-	// are needed for GlobFiles later.
-	var rootRelativeExpandedExcludes []string
-	for _, e := range expandedExcludes {
-		rootRelativeExpandedExcludes = append(rootRelativeExpandedExcludes, filepath.Join(ctx.ModuleDir(), e))
-	}
-
-	for _, p := range paths {
-		if m, tag := SrcIsModuleWithTag(p); m != "" {
-			l := getOtherModuleLabel(ctx, m, tag, BazelModuleLabel, markAsDeps)
-			if l != nil && !InList(l.Label, expandedExcludes) {
-				if strings.HasPrefix(m, "//") {
-					// this is a module in a soong namespace
-					// It appears as //<namespace>:<module_name> in srcs, and not ://<namespace>:<module_name>
-					l.OriginalModuleName = m
-				} else {
-					l.OriginalModuleName = fmt.Sprintf(":%s", m)
-				}
-				labels.Includes = append(labels.Includes, *l)
-			}
-		} else {
-			var expandedPaths []bazel.Label
-			if pathtools.IsGlob(p) {
-				// e.g. turn "math/*.c" in
-				// external/arm-optimized-routines to external/arm-optimized-routines/math/*.c
-				rootRelativeGlobPath := pathForModuleSrc(ctx, p).String()
-				expandedPaths = RootToModuleRelativePaths(ctx, GlobFiles(ctx, rootRelativeGlobPath, rootRelativeExpandedExcludes))
-			} else {
-				if !InList(p, expandedExcludes) {
-					expandedPaths = append(expandedPaths, bazel.Label{Label: p})
-				}
-			}
-			labels.Includes = append(labels.Includes, expandedPaths...)
-		}
-	}
-	return labels
-}
-
-// getOtherModuleLabel returns a bazel.Label for the given dependency/tag combination for the
-// module. The label will be relative to the current directory if appropriate. The dependency must
-// already be resolved by either deps mutator or path deps mutator.
-func getOtherModuleLabel(ctx Bp2buildMutatorContext, dep, tag string,
-	labelFromModule func(BazelConversionPathContext, blueprint.Module) string,
-	markAsDep bool) *bazel.Label {
-	m, _ := ctx.ModuleFromName(dep)
-	// The module was not found in an Android.bp file, this is often due to:
-	//		* a limited manifest
-	//		* a required module not being converted from Android.mk
-	if m == nil {
-		ctx.AddMissingBp2buildDep(dep)
-		return &bazel.Label{
-			Label: ":" + dep + "__BP2BUILD__MISSING__DEP",
-		}
-	}
-	// Returns true if a dependency from the current module to the target module
-	// should be skipped; doing so is a hack to circumvent certain problematic
-	// scenarios that will be addressed in the future.
-	shouldSkipDep := func(dep string) bool {
-		// Don't count dependencies of "libc". This is a hack to circumvent the
-		// fact that, in a variantless build graph, "libc" has a dependency on itself.
-		if ctx.ModuleName() == "libc" {
-			return true
-		}
-
-		// TODO: b/303307672: Dependencies on this module happen to "work" because
-		// there is a source file with the same name as this module in the
-		// same directory. We should remove this hack and enforce the underlying
-		// module of this name is the actual one used.
-		if dep == "mke2fs.conf" {
-			return true
-		}
-
-		// TODO: b/303310285: Remove this special-casing once all dependencies of
-		// crtbegin_dynamic are convertible
-		if ctx.ModuleName() == "crtbegin_dynamic" {
-			return true
-		}
-
-		return false
-	}
-	if markAsDep && !shouldSkipDep(dep) {
-		ctx.AddDependency(ctx.Module(), Bp2buildDepTag, dep)
-	}
-	if !convertedToBazel(ctx, m) {
-		ctx.AddUnconvertedBp2buildDep(dep)
-	}
-	label := BazelModuleLabel(ctx, ctx.Module())
-	otherLabel := labelFromModule(ctx, m)
-
-	// TODO(b/165114590): Convert tag (":name{.tag}") to corresponding Bazel implicit output targets.
-	if (tag != "" && m.Name() == "framework-res") ||
-		(tag == ".generated_srcjars" && ctx.OtherModuleType(m) == "java_aconfig_library") {
-		otherLabel += tag
-	}
-
-	if samePackage(label, otherLabel) {
-		otherLabel = bazelShortLabel(otherLabel)
-	}
-
-	return &bazel.Label{
-		Label: otherLabel,
-	}
-}
-
-func BazelModuleLabel(ctx BazelConversionPathContext, module blueprint.Module) string {
-	// TODO(b/165114590): Convert tag (":name{.tag}") to corresponding Bazel implicit output targets.
-	if !convertedToBazel(ctx, module) || isGoModule(module) {
-		return bp2buildModuleLabel(ctx, module)
-	}
-	b, _ := module.(Bazelable)
-	return b.GetBazelLabel(ctx, module)
-}
-
-func bazelShortLabel(label string) string {
-	i := strings.Index(label, ":")
-	if i == -1 {
-		panic(fmt.Errorf("Could not find the ':' character in '%s', expected a fully qualified label.", label))
-	}
-	return label[i:]
-}
-
-func bazelPackage(label string) string {
-	i := strings.Index(label, ":")
-	if i == -1 {
-		panic(fmt.Errorf("Could not find the ':' character in '%s', expected a fully qualified label.", label))
-	}
-	return label[0:i]
-}
-
-func samePackage(label1, label2 string) bool {
-	return bazelPackage(label1) == bazelPackage(label2)
-}
-
-func bp2buildModuleLabel(ctx BazelConversionContext, module blueprint.Module) string {
-	moduleName := moduleNameWithPossibleOverride(ctx, module, ctx.OtherModuleName(module))
-	moduleDir := moduleDirWithPossibleOverride(ctx, module, ctx.OtherModuleDir(module))
-	if moduleDir == Bp2BuildTopLevel {
-		moduleDir = ""
-	}
-	if a, ok := module.(Module); ok && IsModulePrebuilt(a) {
-		moduleName = RemoveOptionalPrebuiltPrefix(moduleName)
-	}
-	return fmt.Sprintf("//%s:%s", moduleDir, moduleName)
-}
-
-// BazelOutPath is a Bazel output path compatible to be used for mixed builds within Soong/Ninja.
-type BazelOutPath struct {
-	OutputPath
-}
-
-// ensure BazelOutPath implements Path
-var _ Path = BazelOutPath{}
-
-// ensure BazelOutPath implements genPathProvider
-var _ genPathProvider = BazelOutPath{}
-
-// ensure BazelOutPath implements objPathProvider
-var _ objPathProvider = BazelOutPath{}
-
-func (p BazelOutPath) genPathWithExt(ctx ModuleOutPathContext, subdir, ext string) ModuleGenPath {
-	return PathForModuleGen(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
-}
-
-func (p BazelOutPath) objPathWithExt(ctx ModuleOutPathContext, subdir, ext string) ModuleObjPath {
-	return PathForModuleObj(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
-}
-
-// PathForBazelOutRelative returns a BazelOutPath representing the path under an output directory dedicated to
-// bazel-owned outputs. Calling .Rel() on the result will give the input path as relative to the given
-// relativeRoot.
-func PathForBazelOutRelative(ctx PathContext, relativeRoot string, path string) BazelOutPath {
-	validatedPath, err := validatePath(filepath.Join("execroot", "__main__", path))
-	if err != nil {
-		reportPathError(ctx, err)
-	}
-	var relativeRootPath string
-	if pathComponents := strings.SplitN(path, "/", 4); len(pathComponents) >= 3 &&
-		pathComponents[0] == "bazel-out" && pathComponents[2] == "bin" {
-		// If the path starts with something like: bazel-out/linux_x86_64-fastbuild-ST-b4ef1c4402f9/bin/
-		// make it relative to that folder. bazel-out/volatile-status.txt is an example
-		// of something that starts with bazel-out but is not relative to the bin folder
-		relativeRootPath = filepath.Join("execroot", "__main__", pathComponents[0], pathComponents[1], pathComponents[2], relativeRoot)
-	} else {
-		relativeRootPath = filepath.Join("execroot", "__main__", relativeRoot)
-	}
-
-	var relPath string
-	if relPath, err = filepath.Rel(relativeRootPath, validatedPath); err != nil || strings.HasPrefix(relPath, "../") {
-		// We failed to make this path relative to execroot/__main__, fall back to a non-relative path
-		// One case where this happens is when path is ../bazel_tools/something
-		relativeRootPath = ""
-		relPath = validatedPath
-	}
-
-	outputPath := OutputPath{
-		basePath{"", ""},
-		ctx.Config().soongOutDir,
-		ctx.Config().BazelContext.OutputBase(),
-	}
-
-	return BazelOutPath{
-		// .withRel() appends its argument onto the current path, and only the most
-		// recently appended part is returned by outputPath.rel().
-		// So outputPath.rel() will return relPath.
-		OutputPath: outputPath.withRel(relativeRootPath).withRel(relPath),
-	}
-}
-
-// PathForBazelOut returns a BazelOutPath representing the path under an output directory dedicated to
-// bazel-owned outputs.
-func PathForBazelOut(ctx PathContext, path string) BazelOutPath {
-	return PathForBazelOutRelative(ctx, "", path)
-}
-
-// PathsForBazelOut returns a list of paths representing the paths under an output directory
-// dedicated to Bazel-owned outputs.
-func PathsForBazelOut(ctx PathContext, paths []string) Paths {
-	outs := make(Paths, 0, len(paths))
-	for _, p := range paths {
-		outs = append(outs, PathForBazelOut(ctx, p))
-	}
-	return outs
-}
-
-// BazelStringOrLabelFromProp splits a Soong module property that can be
-// either a string literal, path (with android:path tag) or a module reference
-// into separate bazel string or label attributes. Bazel treats string and label
-// attributes as distinct types, so this function categorizes a string property
-// into either one of them.
-//
-// e.g. apex.private_key = "foo.pem" can either refer to:
-//
-// 1. "foo.pem" in the current directory -> file target
-// 2. "foo.pem" module -> rule target
-// 3. "foo.pem" file in a different directory, prefixed by a product variable handled
-// in a bazel macro. -> string literal
-//
-// For the first two cases, they are defined using the label attribute. For the third case,
-// it's defined with the string attribute.
-func BazelStringOrLabelFromProp(
-	ctx Bp2buildMutatorContext,
-	propToDistinguish *string) (bazel.LabelAttribute, bazel.StringAttribute) {
-
-	var labelAttr bazel.LabelAttribute
-	var strAttr bazel.StringAttribute
-
-	if propToDistinguish == nil {
-		// nil pointer
-		return labelAttr, strAttr
-	}
-
-	prop := String(propToDistinguish)
-	if SrcIsModule(prop) != "" {
-		// If it's a module (SrcIsModule will return the module name), set the
-		// resolved label to the label attribute.
-		labelAttr.SetValue(BazelLabelForModuleDepSingle(ctx, prop))
-	} else {
-		// Not a module name. This could be a string literal or a file target in
-		// the current dir. Check if the path exists:
-		path := ExistentPathForSource(ctx, ctx.ModuleDir(), prop)
-
-		if path.Valid() && parentDir(path.String()) == ctx.ModuleDir() {
-			// If it exists and the path is relative to the current dir, resolve the bazel label
-			// for the _file target_ and set it to the label attribute.
-			//
-			// Resolution is necessary because this could be a file in a subpackage.
-			labelAttr.SetValue(BazelLabelForModuleSrcSingle(ctx, prop))
-		} else {
-			// Otherwise, treat it as a string literal and assign to the string attribute.
-			strAttr.Value = propToDistinguish
-		}
-	}
-
-	return labelAttr, strAttr
-}
diff --git a/android/bazel_paths_test.go b/android/bazel_paths_test.go
deleted file mode 100644
index bed719c..0000000
--- a/android/bazel_paths_test.go
+++ /dev/null
@@ -1,240 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package android
-
-import (
-	"fmt"
-	"path/filepath"
-	"testing"
-
-	"android/soong/bazel"
-
-	"github.com/google/blueprint"
-	"github.com/google/blueprint/pathtools"
-)
-
-type TestBazelPathContext struct{}
-
-func (*TestBazelPathContext) Config() Config {
-	cfg := NullConfig("out", "out/soong")
-	cfg.BazelContext = MockBazelContext{
-		OutputBaseDir: "out/bazel",
-	}
-	return cfg
-}
-
-func (*TestBazelPathContext) AddNinjaFileDeps(...string) {
-	panic("Unimplemented")
-}
-
-func TestPathForBazelOut(t *testing.T) {
-	ctx := &TestBazelPathContext{}
-	out := PathForBazelOut(ctx, "foo/bar/baz/boq.txt")
-	expectedPath := filepath.Join(ctx.Config().BazelContext.OutputBase(), "execroot/__main__/foo/bar/baz/boq.txt")
-	if out.String() != expectedPath {
-		t.Errorf("incorrect OutputPath: expected %q, got %q", expectedPath, out.String())
-	}
-
-	expectedRelPath := "foo/bar/baz/boq.txt"
-	if out.Rel() != expectedRelPath {
-		t.Errorf("incorrect OutputPath.Rel(): expected %q, got %q", expectedRelPath, out.Rel())
-	}
-}
-
-func TestPathForBazelOutRelative(t *testing.T) {
-	ctx := &TestBazelPathContext{}
-	out := PathForBazelOutRelative(ctx, "foo/bar", "foo/bar/baz/boq.txt")
-
-	expectedPath := filepath.Join(ctx.Config().BazelContext.OutputBase(), "execroot/__main__/foo/bar/baz/boq.txt")
-	if out.String() != expectedPath {
-		t.Errorf("incorrect OutputPath: expected %q, got %q", expectedPath, out.String())
-	}
-
-	expectedRelPath := "baz/boq.txt"
-	if out.Rel() != expectedRelPath {
-		t.Errorf("incorrect OutputPath.Rel(): expected %q, got %q", expectedRelPath, out.Rel())
-	}
-}
-
-func TestPathForBazelOutRelativeUnderBinFolder(t *testing.T) {
-	ctx := &TestBazelPathContext{}
-	out := PathForBazelOutRelative(ctx, "foo/bar", "bazel-out/linux_x86_64-fastbuild-ST-b4ef1c4402f9/bin/foo/bar/baz/boq.txt")
-
-	expectedPath := filepath.Join(ctx.Config().BazelContext.OutputBase(), "execroot/__main__/bazel-out/linux_x86_64-fastbuild-ST-b4ef1c4402f9/bin/foo/bar/baz/boq.txt")
-	if out.String() != expectedPath {
-		t.Errorf("incorrect OutputPath: expected %q, got %q", expectedPath, out.String())
-	}
-
-	expectedRelPath := "baz/boq.txt"
-	if out.Rel() != expectedRelPath {
-		t.Errorf("incorrect OutputPath.Rel(): expected %q, got %q", expectedRelPath, out.Rel())
-	}
-}
-
-func TestPathForBazelOutOutsideOfExecroot(t *testing.T) {
-	ctx := &TestBazelPathContext{}
-	out := PathForBazelOut(ctx, "../bazel_tools/linux_x86_64-fastbuild/bin/tools/android/java_base_extras.jar")
-
-	expectedPath := filepath.Join(ctx.Config().BazelContext.OutputBase(), "execroot/bazel_tools/linux_x86_64-fastbuild/bin/tools/android/java_base_extras.jar")
-	if out.String() != expectedPath {
-		t.Errorf("incorrect OutputPath: expected %q, got %q", expectedPath, out.String())
-	}
-
-	expectedRelPath := "execroot/bazel_tools/linux_x86_64-fastbuild/bin/tools/android/java_base_extras.jar"
-	if out.Rel() != expectedRelPath {
-		t.Errorf("incorrect OutputPath.Rel(): expected %q, got %q", expectedRelPath, out.Rel())
-	}
-}
-
-func TestPathForBazelOutRelativeWithParentDirectoryRoot(t *testing.T) {
-	ctx := &TestBazelPathContext{}
-	out := PathForBazelOutRelative(ctx, "../bazel_tools", "../bazel_tools/foo/bar/baz.sh")
-
-	expectedPath := filepath.Join(ctx.Config().BazelContext.OutputBase(), "execroot/bazel_tools/foo/bar/baz.sh")
-	if out.String() != expectedPath {
-		t.Errorf("incorrect OutputPath: expected %q, got %q", expectedPath, out.String())
-	}
-
-	expectedRelPath := "foo/bar/baz.sh"
-	if out.Rel() != expectedRelPath {
-		t.Errorf("incorrect OutputPath.Rel(): expected %q, got %q", expectedRelPath, out.Rel())
-	}
-}
-
-type TestBazelConversionPathContext struct {
-	TestBazelConversionContext
-	moduleDir       string
-	cfg             Config
-	mockGlobResults *[]string
-}
-
-func (ctx *TestBazelConversionPathContext) AddNinjaFileDeps(...string) {
-	panic("Unimplemented")
-}
-
-func (ctx *TestBazelConversionPathContext) GlobWithDeps(string, []string) ([]string, error) {
-	if ctx.mockGlobResults == nil {
-		return []string{}, fmt.Errorf("Set mock glob results first")
-	}
-	return *ctx.mockGlobResults, nil
-}
-
-func (ctx *TestBazelConversionPathContext) PropertyErrorf(string, string, ...interface{}) {
-	panic("Unimplemented")
-}
-
-func (ctx *TestBazelConversionPathContext) GetDirectDep(string) (blueprint.Module, blueprint.DependencyTag) {
-	panic("Unimplemented")
-}
-
-func (ctx *TestBazelConversionPathContext) ModuleFromName(string) (blueprint.Module, bool) {
-	panic("Unimplemented")
-}
-
-func (ctx *TestBazelConversionPathContext) AddUnconvertedBp2buildDep(string) {
-	panic("Unimplemented")
-}
-
-func (ctx *TestBazelConversionPathContext) AddMissingBp2buildDep(string) {
-	panic("Unimplemented")
-}
-
-func (ctx *TestBazelConversionPathContext) Module() Module {
-	panic("Unimplemented")
-}
-
-func (ctx *TestBazelConversionPathContext) Config() Config {
-	return ctx.cfg
-}
-
-func (ctx *TestBazelConversionPathContext) ModuleDir() string {
-	return ctx.moduleDir
-}
-
-func (ctx *TestBazelConversionPathContext) ModuleName() string {
-	panic("Unimplemented")
-}
-
-func (ctx *TestBazelConversionPathContext) ModuleType() string {
-	panic("Unimplemented")
-}
-
-func TestTransformSubpackagePath(t *testing.T) {
-	cfg := NullConfig("out", "out/soong")
-	cfg.fs = pathtools.MockFs(map[string][]byte{
-		"x/Android.bp":   nil,
-		"x/y/Android.bp": nil,
-	})
-
-	var ctx BazelConversionPathContext = &TestBazelConversionPathContext{
-		moduleDir: "x",
-		cfg:       cfg,
-	}
-	pairs := map[string]string{
-		"y/a.c":   "//x/y:a.c",
-		"./y/a.c": "//x/y:a.c",
-		"z/b.c":   "z/b.c",
-		"./z/b.c": "z/b.c",
-	}
-	for in, out := range pairs {
-		actual := transformSubpackagePath(ctx.Config(), ctx.ModuleDir(), bazel.Label{Label: in}).Label
-		if actual != out {
-			t.Errorf("expected:\n%v\nactual:\n%v", out, actual)
-		}
-	}
-}
-
-// Check that the files in a specific directory are returned with labels that respect package boundaries
-// Since the test uses a mock for GlobWithDeps, the params passed to BazelLabelForSrcPatternExcludes are no-ops
-func TestBazelLabelForSrcPatternExcludes(t *testing.T) {
-	cfg := NullConfig("out", "out/soong")
-	cfg.fs = pathtools.MockFs(map[string][]byte{
-		"x/Android.bp":   nil,
-		"x/y/Android.bp": nil,
-		// .proto files
-		"foo.proto":     nil,
-		"x/bar.proto":   nil,
-		"x/baz.proto":   nil,
-		"x/y/qux.proto": nil,
-	})
-
-	var ctx BazelConversionPathContext = &TestBazelConversionPathContext{
-		cfg: cfg,
-	}
-
-	// Root dir
-	ctx.(*TestBazelConversionPathContext).mockGlobResults = &[]string{"foo.proto", "x/bar.proto", "x/baz.proto", "x/y/qux.proto"}
-	actualLabelsFromRoot := BazelLabelForSrcPatternExcludes(ctx, ".", "**/*.proto", []string{})
-	expectedLabelsAsString := []string{"foo.proto", "//x:bar.proto", "//x:baz.proto", "//x/y:qux.proto"}
-	for i, actual := range actualLabelsFromRoot.Includes {
-		AssertStringEquals(t, "Error in finding src labels relative to root directory", expectedLabelsAsString[i], actual.Label)
-	}
-
-	// x dir
-	ctx.(*TestBazelConversionPathContext).mockGlobResults = &[]string{"x/bar.proto", "x/baz.proto", "x/y/qux.proto"}
-	actualLabelsFromRoot = BazelLabelForSrcPatternExcludes(ctx, "x", "**/*.proto", []string{})
-	expectedLabelsAsString = []string{"bar.proto", "baz.proto", "//x/y:qux.proto"}
-	for i, actual := range actualLabelsFromRoot.Includes {
-		AssertStringEquals(t, "Error in finding src labels relative to x directory", expectedLabelsAsString[i], actual.Label)
-	}
-
-	// y dir
-	ctx.(*TestBazelConversionPathContext).mockGlobResults = &[]string{"x/y/qux.proto"}
-	actualLabelsFromRoot = BazelLabelForSrcPatternExcludes(ctx, "x/y", "**/*.proto", []string{})
-	expectedLabelsAsString = []string{"qux.proto"}
-	for i, actual := range actualLabelsFromRoot.Includes {
-		AssertStringEquals(t, "Error in finding src labels relative to x/y directory", expectedLabelsAsString[i], actual.Label)
-	}
-}
diff --git a/android/bazel_test.go b/android/bazel_test.go
deleted file mode 100644
index e0145b5..0000000
--- a/android/bazel_test.go
+++ /dev/null
@@ -1,592 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//	http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package android
-
-import (
-	"fmt"
-	"testing"
-
-	"android/soong/android/allowlists"
-	"android/soong/bazel"
-
-	"github.com/google/blueprint"
-	"github.com/google/blueprint/proptools"
-)
-
-func TestConvertAllModulesInPackage(t *testing.T) {
-	testCases := []struct {
-		prefixes   allowlists.Bp2BuildConfig
-		packageDir string
-	}{
-		{
-			prefixes: allowlists.Bp2BuildConfig{
-				"a": allowlists.Bp2BuildDefaultTrueRecursively,
-			},
-			packageDir: "a",
-		},
-		{
-			prefixes: allowlists.Bp2BuildConfig{
-				"a/b": allowlists.Bp2BuildDefaultTrueRecursively,
-			},
-			packageDir: "a/b",
-		},
-		{
-			prefixes: allowlists.Bp2BuildConfig{
-				"a/b":   allowlists.Bp2BuildDefaultTrueRecursively,
-				"a/b/c": allowlists.Bp2BuildDefaultTrueRecursively,
-			},
-			packageDir: "a/b",
-		},
-		{
-			prefixes: allowlists.Bp2BuildConfig{
-				"a":     allowlists.Bp2BuildDefaultTrueRecursively,
-				"d/e/f": allowlists.Bp2BuildDefaultTrueRecursively,
-			},
-			packageDir: "a/b",
-		},
-		{
-			prefixes: allowlists.Bp2BuildConfig{
-				"a":     allowlists.Bp2BuildDefaultFalse,
-				"a/b":   allowlists.Bp2BuildDefaultTrueRecursively,
-				"a/b/c": allowlists.Bp2BuildDefaultFalse,
-			},
-			packageDir: "a/b",
-		},
-		{
-			prefixes: allowlists.Bp2BuildConfig{
-				"a":     allowlists.Bp2BuildDefaultTrueRecursively,
-				"a/b":   allowlists.Bp2BuildDefaultFalse,
-				"a/b/c": allowlists.Bp2BuildDefaultTrueRecursively,
-			},
-			packageDir: "a",
-		},
-		{
-			prefixes: allowlists.Bp2BuildConfig{
-				"a":   allowlists.Bp2BuildDefaultFalseRecursively,
-				"a/b": allowlists.Bp2BuildDefaultTrue,
-			},
-			packageDir: "a/b",
-		},
-		{
-			prefixes: allowlists.Bp2BuildConfig{
-				"a":   allowlists.Bp2BuildDefaultFalseRecursively,
-				"a/b": allowlists.Bp2BuildDefaultTrueRecursively,
-			},
-			packageDir: "a/b/c",
-		},
-	}
-
-	for _, test := range testCases {
-		if ok, _ := bp2buildDefaultTrueRecursively(test.packageDir, test.prefixes); !ok {
-			t.Errorf("Expected to convert all modules in %s based on %v, but failed.", test.packageDir, test.prefixes)
-		}
-	}
-}
-
-func TestModuleOptIn(t *testing.T) {
-	testCases := []struct {
-		prefixes   allowlists.Bp2BuildConfig
-		packageDir string
-	}{
-		{
-			prefixes: allowlists.Bp2BuildConfig{
-				"a/b": allowlists.Bp2BuildDefaultFalse,
-			},
-			packageDir: "a/b",
-		},
-		{
-			prefixes: allowlists.Bp2BuildConfig{
-				"a":   allowlists.Bp2BuildDefaultFalse,
-				"a/b": allowlists.Bp2BuildDefaultTrueRecursively,
-			},
-			packageDir: "a",
-		},
-		{
-			prefixes: allowlists.Bp2BuildConfig{
-				"a/b": allowlists.Bp2BuildDefaultTrueRecursively,
-			},
-			packageDir: "a", // opt-in by default
-		},
-		{
-			prefixes: allowlists.Bp2BuildConfig{
-				"a/b/c": allowlists.Bp2BuildDefaultTrueRecursively,
-			},
-			packageDir: "a/b",
-		},
-		{
-			prefixes: allowlists.Bp2BuildConfig{
-				"a":     allowlists.Bp2BuildDefaultTrueRecursively,
-				"d/e/f": allowlists.Bp2BuildDefaultTrueRecursively,
-			},
-			packageDir: "foo/bar",
-		},
-		{
-			prefixes: allowlists.Bp2BuildConfig{
-				"a":     allowlists.Bp2BuildDefaultTrueRecursively,
-				"a/b":   allowlists.Bp2BuildDefaultFalse,
-				"a/b/c": allowlists.Bp2BuildDefaultTrueRecursively,
-			},
-			packageDir: "a/b",
-		},
-		{
-			prefixes: allowlists.Bp2BuildConfig{
-				"a":     allowlists.Bp2BuildDefaultFalse,
-				"a/b":   allowlists.Bp2BuildDefaultTrueRecursively,
-				"a/b/c": allowlists.Bp2BuildDefaultFalse,
-			},
-			packageDir: "a",
-		},
-		{
-			prefixes: allowlists.Bp2BuildConfig{
-				"a":   allowlists.Bp2BuildDefaultFalseRecursively,
-				"a/b": allowlists.Bp2BuildDefaultTrue,
-			},
-			packageDir: "a/b/c",
-		},
-		{
-			prefixes: allowlists.Bp2BuildConfig{
-				"a":   allowlists.Bp2BuildDefaultTrueRecursively,
-				"a/b": allowlists.Bp2BuildDefaultFalseRecursively,
-			},
-			packageDir: "a/b/c",
-		},
-	}
-
-	for _, test := range testCases {
-		if ok, _ := bp2buildDefaultTrueRecursively(test.packageDir, test.prefixes); ok {
-			t.Errorf("Expected to allow module opt-in in %s based on %v, but failed.", test.packageDir, test.prefixes)
-		}
-	}
-}
-
-type TestBazelModule struct {
-	bazel.TestModuleInfo
-	BazelModuleBase
-}
-
-var _ blueprint.Module = TestBazelModule{}
-
-func (m TestBazelModule) Name() string {
-	return m.TestModuleInfo.ModuleName
-}
-
-func (m TestBazelModule) GenerateBuildActions(blueprint.ModuleContext) {
-}
-
-type TestBazelConversionContext struct {
-	omc       bazel.OtherModuleTestContext
-	allowlist Bp2BuildConversionAllowlist
-	errors    []string
-}
-
-var _ bazelOtherModuleContext = &TestBazelConversionContext{}
-
-func (bcc *TestBazelConversionContext) OtherModuleType(m blueprint.Module) string {
-	return bcc.omc.OtherModuleType(m)
-}
-
-func (bcc *TestBazelConversionContext) OtherModuleName(m blueprint.Module) string {
-	return bcc.omc.OtherModuleName(m)
-}
-
-func (bcc *TestBazelConversionContext) OtherModuleDir(m blueprint.Module) string {
-	return bcc.omc.OtherModuleDir(m)
-}
-
-func (bcc *TestBazelConversionContext) ModuleErrorf(format string, args ...interface{}) {
-	bcc.errors = append(bcc.errors, fmt.Sprintf(format, args...))
-}
-
-func (bcc *TestBazelConversionContext) Config() Config {
-	return Config{
-		&config{
-			Bp2buildPackageConfig: bcc.allowlist,
-		},
-	}
-}
-
-var bazelableBazelModuleBase = BazelModuleBase{
-	bazelProperties: properties{
-		Bazel_module: BazelModuleProperties{
-			CanConvertToBazel: true,
-		},
-	},
-}
-
-func TestBp2BuildAllowlist(t *testing.T) {
-	testCases := []struct {
-		description    string
-		shouldConvert  bool
-		expectedErrors []string
-		module         TestBazelModule
-		allowlist      Bp2BuildConversionAllowlist
-	}{
-		{
-			description:   "allowlist enables module",
-			shouldConvert: true,
-			module: TestBazelModule{
-				TestModuleInfo: bazel.TestModuleInfo{
-					ModuleName: "foo",
-					Typ:        "rule1",
-					Dir:        "dir1",
-				},
-				BazelModuleBase: bazelableBazelModuleBase,
-			},
-			allowlist: Bp2BuildConversionAllowlist{
-				moduleAlwaysConvert: map[string]bool{
-					"foo": true,
-				},
-			},
-		},
-		{
-			description:    "module in name allowlist and type allowlist fails",
-			shouldConvert:  false,
-			expectedErrors: []string{"A module \"foo\" of type \"rule1\" cannot be in moduleAlwaysConvert and also be in moduleTypeAlwaysConvert"},
-			module: TestBazelModule{
-				TestModuleInfo: bazel.TestModuleInfo{
-					ModuleName: "foo",
-					Typ:        "rule1",
-					Dir:        "dir1",
-				},
-				BazelModuleBase: bazelableBazelModuleBase,
-			},
-			allowlist: Bp2BuildConversionAllowlist{
-				moduleAlwaysConvert: map[string]bool{
-					"foo": true,
-				},
-				moduleTypeAlwaysConvert: map[string]bool{
-					"rule1": true,
-				},
-			},
-		},
-		{
-			description:    "module in allowlist and denylist fails",
-			shouldConvert:  false,
-			expectedErrors: []string{"a module \"foo\" cannot be in moduleDoNotConvert and also be in moduleAlwaysConvert"},
-			module: TestBazelModule{
-				TestModuleInfo: bazel.TestModuleInfo{
-					ModuleName: "foo",
-					Typ:        "rule1",
-					Dir:        "dir1",
-				},
-				BazelModuleBase: bazelableBazelModuleBase,
-			},
-			allowlist: Bp2BuildConversionAllowlist{
-				moduleAlwaysConvert: map[string]bool{
-					"foo": true,
-				},
-				moduleDoNotConvert: map[string]bool{
-					"foo": true,
-				},
-			},
-		},
-		{
-			description:    "module allowlist and enabled directory",
-			shouldConvert:  false,
-			expectedErrors: []string{"A module cannot be in a directory marked Bp2BuildDefaultTrue or Bp2BuildDefaultTrueRecursively and also be in moduleAlwaysConvert. Directory: 'existing/build/dir' Module: 'foo'"},
-			module: TestBazelModule{
-				TestModuleInfo: bazel.TestModuleInfo{
-					ModuleName: "foo",
-					Typ:        "rule1",
-					Dir:        "existing/build/dir",
-				},
-				BazelModuleBase: bazelableBazelModuleBase,
-			},
-			allowlist: Bp2BuildConversionAllowlist{
-				moduleAlwaysConvert: map[string]bool{
-					"foo": true,
-				},
-				defaultConfig: allowlists.Bp2BuildConfig{
-					"existing/build/dir": allowlists.Bp2BuildDefaultTrue,
-				},
-			},
-		},
-		{
-			description:    "module allowlist and enabled subdirectory",
-			shouldConvert:  false,
-			expectedErrors: []string{"A module cannot be in a directory marked Bp2BuildDefaultTrue or Bp2BuildDefaultTrueRecursively and also be in moduleAlwaysConvert. Directory: 'existing/build/dir' Module: 'foo'"},
-			module: TestBazelModule{
-				TestModuleInfo: bazel.TestModuleInfo{
-					ModuleName: "foo",
-					Typ:        "rule1",
-					Dir:        "existing/build/dir/subdir",
-				},
-				BazelModuleBase: bazelableBazelModuleBase,
-			},
-			allowlist: Bp2BuildConversionAllowlist{
-				moduleAlwaysConvert: map[string]bool{
-					"foo": true,
-				},
-				defaultConfig: allowlists.Bp2BuildConfig{
-					"existing/build/dir": allowlists.Bp2BuildDefaultTrueRecursively,
-				},
-			},
-		},
-		{
-			description:   "module enabled in unit test short-circuits other allowlists",
-			shouldConvert: true,
-			module: TestBazelModule{
-				TestModuleInfo: bazel.TestModuleInfo{
-					ModuleName: "foo",
-					Typ:        "rule1",
-					Dir:        ".",
-				},
-				BazelModuleBase: BazelModuleBase{
-					bazelProperties: properties{
-						Bazel_module: BazelModuleProperties{
-							CanConvertToBazel:  true,
-							Bp2build_available: proptools.BoolPtr(true),
-						},
-					},
-				},
-			},
-			allowlist: Bp2BuildConversionAllowlist{
-				moduleAlwaysConvert: map[string]bool{
-					"foo": true,
-				},
-				moduleDoNotConvert: map[string]bool{
-					"foo": true,
-				},
-			},
-		},
-	}
-
-	for _, test := range testCases {
-		t.Run(test.description, func(t *testing.T) {
-			bcc := &TestBazelConversionContext{
-				omc: bazel.OtherModuleTestContext{
-					Modules: []bazel.TestModuleInfo{
-						test.module.TestModuleInfo,
-					},
-				},
-				allowlist: test.allowlist,
-			}
-
-			shouldConvert := test.module.shouldConvertWithBp2build(bcc,
-				shouldConvertParams{
-					module:     test.module.TestModuleInfo,
-					moduleDir:  test.module.TestModuleInfo.Dir,
-					moduleType: test.module.TestModuleInfo.Typ,
-					moduleName: test.module.TestModuleInfo.ModuleName,
-				},
-			)
-			if test.shouldConvert != shouldConvert {
-				t.Errorf("Module shouldConvert expected to be: %v, but was: %v", test.shouldConvert, shouldConvert)
-			}
-
-			errorsMatch := true
-			if len(test.expectedErrors) != len(bcc.errors) {
-				errorsMatch = false
-			} else {
-				for i, err := range test.expectedErrors {
-					if err != bcc.errors[i] {
-						errorsMatch = false
-					}
-				}
-			}
-			if !errorsMatch {
-				t.Errorf("Expected errors to be: %v, but were: %v", test.expectedErrors, bcc.errors)
-			}
-		})
-	}
-}
-
-func TestBp2buildAllowList(t *testing.T) {
-	allowlist := GetBp2BuildAllowList()
-	for k, v := range allowlists.Bp2buildDefaultConfig {
-		if allowlist.defaultConfig[k] != v {
-			t.Errorf("bp2build default config of %s: expected: %v, got: %v", k, v, allowlist.defaultConfig[k])
-		}
-	}
-	for k, v := range allowlists.Bp2buildKeepExistingBuildFile {
-		if allowlist.keepExistingBuildFile[k] != v {
-			t.Errorf("bp2build keep existing build file of %s: expected: %v, got: %v", k, v, allowlist.keepExistingBuildFile[k])
-		}
-	}
-	for _, k := range allowlists.Bp2buildModuleTypeAlwaysConvertList {
-		if !allowlist.moduleTypeAlwaysConvert[k] {
-			t.Errorf("bp2build module type always convert of %s: expected: true, got: %v", k, allowlist.moduleTypeAlwaysConvert[k])
-		}
-	}
-	for _, k := range allowlists.Bp2buildModuleDoNotConvertList {
-		if !allowlist.moduleDoNotConvert[k] {
-			t.Errorf("bp2build module do not convert of %s: expected: true, got: %v", k, allowlist.moduleDoNotConvert[k])
-		}
-	}
-}
-
-func TestShouldKeepExistingBuildFileForDir(t *testing.T) {
-	allowlist := NewBp2BuildAllowlist()
-	// entry "a/b2/c2" is moot because of its parent "a/b2"
-	allowlist.SetKeepExistingBuildFile(map[string]bool{"a": false, "a/b1": false, "a/b2": true, "a/b1/c1": true, "a/b2/c2": false})
-	truths := []string{"a", "a/b1", "a/b2", "a/b1/c1", "a/b2/c", "a/b2/c2", "a/b2/c2/d"}
-	falsities := []string{"a1", "a/b", "a/b1/c"}
-	for _, dir := range truths {
-		if !allowlist.ShouldKeepExistingBuildFileForDir(dir) {
-			t.Errorf("%s expected TRUE but was FALSE", dir)
-		}
-	}
-	for _, dir := range falsities {
-		if allowlist.ShouldKeepExistingBuildFileForDir(dir) {
-			t.Errorf("%s expected FALSE but was TRUE", dir)
-		}
-	}
-}
-
-type mixedBuildModule struct {
-	ModuleBase
-	BazelModuleBase
-	props struct {
-		Deps                     []string
-		Mixed_build_incompatible *bool
-		QueuedBazelCall          bool `blueprint:"mutated"`
-	}
-}
-
-type mixedBuildModuleInfo struct {
-	QueuedBazelCall bool
-}
-
-var mixedBuildModuleProvider = blueprint.NewProvider(mixedBuildModuleInfo{})
-
-func mixedBuildModuleFactory() Module {
-	m := &mixedBuildModule{}
-	m.AddProperties(&m.props)
-	InitAndroidArchModule(m, HostAndDeviceDefault, MultilibBoth)
-	InitBazelModule(m)
-
-	return m
-}
-
-func (m *mixedBuildModule) ConvertWithBp2build(ctx Bp2buildMutatorContext) {
-}
-
-func (m *mixedBuildModule) DepsMutator(ctx BottomUpMutatorContext) {
-	ctx.AddDependency(ctx.Module(), installDepTag{}, m.props.Deps...)
-}
-
-func (m *mixedBuildModule) GenerateAndroidBuildActions(ctx ModuleContext) {
-}
-
-func (m *mixedBuildModule) IsMixedBuildSupported(ctx BaseModuleContext) bool {
-	return !proptools.Bool(m.props.Mixed_build_incompatible)
-}
-
-func (m *mixedBuildModule) QueueBazelCall(ctx BaseModuleContext) {
-	m.props.QueuedBazelCall = true
-}
-
-func (m *mixedBuildModule) ProcessBazelQueryResponse(ctx ModuleContext) {
-	ctx.SetProvider(mixedBuildModuleProvider, mixedBuildModuleInfo{
-		QueuedBazelCall: m.props.QueuedBazelCall,
-	})
-}
-
-var prepareForMixedBuildTests = FixtureRegisterWithContext(func(ctx RegistrationContext) {
-	ctx.RegisterModuleType("deps", mixedBuildModuleFactory)
-	RegisterMixedBuildsMutator(ctx)
-})
-
-func TestMixedBuildsEnabledForType(t *testing.T) {
-	baseBp := `
-	deps {
-		name: "foo",
-		deps: ["bar"],
-		target: { windows: { enabled: true } },
-		%s
-	}
-`
-	depBp := `
-	deps {
-		name: "bar",
-		target: {
-			windows: {
-				enabled: true,
-			},
-		},
-	}
-`
-	testCases := []struct {
-		desc               string
-		variant            *string
-		missingDeps        bool
-		extraBpInfo        string
-		mixedBuildsEnabled bool
-	}{
-		{
-			desc:               "mixed builds works",
-			mixedBuildsEnabled: true,
-			extraBpInfo:        `bazel_module: { bp2build_available: true },`,
-		},
-		{
-			desc:               "missing deps",
-			missingDeps:        true,
-			mixedBuildsEnabled: false,
-			extraBpInfo:        `bazel_module: { bp2build_available: true },`,
-		},
-		{
-			desc:               "windows no mixed builds",
-			mixedBuildsEnabled: false,
-			variant:            proptools.StringPtr("windows_x86"),
-			extraBpInfo:        `bazel_module: { bp2build_available: true },`,
-		},
-		{
-			desc:               "mixed builds disabled by type",
-			mixedBuildsEnabled: false,
-			extraBpInfo: `mixed_build_incompatible: true,
-		bazel_module: { bp2build_available: true },`,
-		},
-		{
-			desc:               "mixed builds not bp2build available",
-			mixedBuildsEnabled: false,
-			extraBpInfo:        `bazel_module: { bp2build_available: false },`,
-		},
-	}
-
-	for _, tc := range testCases {
-		t.Run(tc.desc, func(t *testing.T) {
-			handlers := GroupFixturePreparers(
-				prepareForMixedBuildTests,
-				PrepareForTestWithArchMutator,
-				FixtureModifyConfig(func(config Config) {
-					config.BazelContext = MockBazelContext{
-						OutputBaseDir: "base",
-					}
-					config.Targets[Windows] = []Target{
-						{Windows, Arch{ArchType: X86_64}, NativeBridgeDisabled, "", "", true},
-						{Windows, Arch{ArchType: X86}, NativeBridgeDisabled, "", "", true},
-					}
-				}),
-			)
-			bp := fmt.Sprintf(baseBp, tc.extraBpInfo)
-			if tc.missingDeps {
-				handlers = GroupFixturePreparers(
-					handlers,
-					PrepareForTestWithAllowMissingDependencies,
-				)
-			} else {
-				bp += depBp
-			}
-			result := handlers.RunTestWithBp(t, bp)
-
-			variant := proptools.StringDefault(tc.variant, "android_arm64_armv8-a")
-
-			m := result.ModuleForTests("foo", variant)
-			mixedBuildModuleInfo := result.TestContext.ModuleProvider(m.Module(), mixedBuildModuleProvider).(mixedBuildModuleInfo)
-			if w, g := tc.mixedBuildsEnabled, mixedBuildModuleInfo.QueuedBazelCall; w != g {
-				t.Errorf("Expected mixed builds enabled %t, got mixed builds enabled %t", w, g)
-			}
-		})
-	}
-}
diff --git a/android/config.go b/android/config.go
index a69adc3..312a5da 100644
--- a/android/config.go
+++ b/android/config.go
@@ -84,21 +84,13 @@
 	SoongOutDir    string
 	SoongVariables string
 
-	SymlinkForestMarker string
-	Bp2buildMarker      string
-	BazelQueryViewDir   string
-	ModuleGraphFile     string
-	ModuleActionsFile   string
-	DocFile             string
+	BazelQueryViewDir string
+	ModuleGraphFile   string
+	ModuleActionsFile string
+	DocFile           string
 
 	MultitreeBuild bool
 
-	BazelMode                bool
-	BazelModeStaging         bool
-	BazelForceEnabledModules string
-
-	UseBazelProxy bool
-
 	BuildFromSourceStub bool
 
 	EnsureAllowlistIntegrity bool
@@ -109,12 +101,6 @@
 	// Don't use bazel at all during module analysis.
 	AnalysisNoBazel SoongBuildMode = iota
 
-	// Symlink fores mode: merge two directory trees into a symlink forest
-	SymlinkForest
-
-	// Bp2build mode: Generate BUILD files from blueprint files and exit.
-	Bp2build
-
 	// Generate BUILD files which faithfully represent the dependency graph of
 	// blueprint modules. Individual BUILD targets will not, however, faitfhully
 	// express build semantics.
@@ -125,15 +111,6 @@
 
 	// Generate a documentation file for module type definitions and exit.
 	GenerateDocFile
-
-	// Use bazel during analysis of a few allowlisted build modules. The allowlist
-	// is considered "staging, as these are modules being prepared to be released
-	// into prod mode shortly after.
-	BazelStagingMode
-
-	// Use bazel during analysis of build modules from an allowlist carefully
-	// curated by the build team to be proven stable.
-	BazelProdMode
 )
 
 // SoongOutDir returns the build output directory for the configuration.
@@ -195,10 +172,12 @@
 	return String(c.config.productVariables.DeviceMaxPageSizeSupported)
 }
 
-// PageSizeAgnostic returns true when AOSP is page size agnostic,
-// othersise it returns false.
-func (c Config) PageSizeAgnostic() bool {
-	return Bool(c.config.productVariables.DevicePageSizeAgnostic)
+// NoBionicPageSizeMacro returns true when AOSP is page size agnostic.
+// This means that the bionic's macro PAGE_SIZE won't be defined.
+// Returns false when AOSP is NOT page size agnostic.
+// This means that bionic's macro PAGE_SIZE is defined.
+func (c Config) NoBionicPageSizeMacro() bool {
+	return Bool(c.config.productVariables.DeviceNoBionicPageSizeMacro)
 }
 
 // The release version passed to aconfig, derived from RELEASE_VERSION
@@ -208,22 +187,7 @@
 
 // The aconfig value set passed to aconfig, derived from RELEASE_VERSION
 func (c Config) ReleaseAconfigValueSets() []string {
-	// This logic to handle both Soong module name and bazel target is temporary in order to
-	// provide backward compatibility where aosp and internal both have the release
-	// aconfig value set but can't be updated at the same time to use bazel target
-	var valueSets []string
-	for _, valueSet := range c.config.productVariables.ReleaseAconfigValueSets {
-		value := strings.Split(valueSet, ":")
-		valueLen := len(value)
-		if valueLen > 2 {
-			// This shouldn't happen as this should be either a module name or a bazel target path.
-			panic(fmt.Errorf("config file: invalid value for release aconfig value sets: %s", valueSet))
-		}
-		if valueLen > 0 {
-			valueSets = append(valueSets, value[valueLen-1])
-		}
-	}
-	return valueSets
+	return c.config.productVariables.ReleaseAconfigValueSets
 }
 
 // The flag default permission value passed to aconfig
@@ -239,6 +203,11 @@
 		Bool(c.config.productVariables.ReleaseDefaultModuleBuildFromSource)
 }
 
+// Enables ABI monitoring of NDK libraries
+func (c Config) ReleaseNdkAbiMonitored() bool {
+	return c.config.productVariables.GetBuildFlagBool("RELEASE_NDK_ABI_MONITORED")
+}
+
 // A DeviceConfig object represents the configuration for a particular device
 // being built. For now there will only be one of these, but in the future there
 // may be multiple devices being built.
@@ -258,10 +227,6 @@
 	// Only available on configs created by TestConfig
 	TestProductVariables *ProductVariables
 
-	// A specialized context object for Bazel/Soong mixed builds and migration
-	// purposes.
-	BazelContext BazelContext
-
 	ProductVariablesFileName string
 
 	// BuildOS stores the OsType for the OS that the build is running on.
@@ -303,9 +268,7 @@
 	fs         pathtools.FileSystem
 	mockBpList string
 
-	BuildMode                      SoongBuildMode
-	Bp2buildPackageConfig          Bp2BuildConversionAllowlist
-	Bp2buildSoongConfigDefinitions soongconfig.Bp2BuildSoongConfigDefinitions
+	BuildMode SoongBuildMode
 
 	// If MultitreeBuild is true then this is one inner tree of a multitree
 	// build directed by the multitree orchestrator.
@@ -321,29 +284,6 @@
 
 	OncePer
 
-	// These fields are only used for metrics collection. A module should be added
-	// to these maps only if its implementation supports Bazel handling in mixed
-	// builds. A module being in the "enabled" list indicates that there is a
-	// variant of that module for which bazel-handling actually took place.
-	// A module being in the "disabled" list indicates that there is a variant of
-	// that module for which bazel-handling was denied.
-	mixedBuildsLock           sync.Mutex
-	mixedBuildEnabledModules  map[string]struct{}
-	mixedBuildDisabledModules map[string]struct{}
-
-	// These are modules to be built with Bazel beyond the allowlisted/build-mode
-	// specified modules. They are passed via the command-line flag
-	// "--bazel-force-enabled-modules"
-	bazelForceEnabledModules map[string]struct{}
-
-	// Names of Bazel targets as defined by BUILD files in the source tree,
-	// keyed by the directory in which they are defined.
-	bazelTargetsByDir map[string][]string
-
-	// If true, for any requests to Bazel, communicate with a Bazel proxy using
-	// unix sockets, instead of spawning Bazel as a subprocess.
-	UseBazelProxy bool
-
 	// If buildFromSourceStub is true then the Java API stubs are
 	// built from the source Java files, not the signature text files.
 	buildFromSourceStub bool
@@ -554,14 +494,10 @@
 		runGoTests:        cmdArgs.RunGoTests,
 		multilibConflicts: make(map[ArchType]bool),
 
-		moduleListFile:            cmdArgs.ModuleListFile,
-		fs:                        pathtools.NewOsFs(absSrcDir),
-		mixedBuildDisabledModules: make(map[string]struct{}),
-		mixedBuildEnabledModules:  make(map[string]struct{}),
-		bazelForceEnabledModules:  make(map[string]struct{}),
+		moduleListFile: cmdArgs.ModuleListFile,
+		fs:             pathtools.NewOsFs(absSrcDir),
 
 		MultitreeBuild: cmdArgs.MultitreeBuild,
-		UseBazelProxy:  cmdArgs.UseBazelProxy,
 
 		buildFromSourceStub: cmdArgs.BuildFromSourceStub,
 	}
@@ -654,28 +590,9 @@
 			config.BuildMode = mode
 		}
 	}
-	setBazelMode := func(arg bool, argName string, mode SoongBuildMode) {
-		if arg {
-			if config.BuildMode != AnalysisNoBazel {
-				fmt.Fprintf(os.Stderr, "buildMode is already set, illegal argument: %s", argName)
-				os.Exit(1)
-			}
-			config.BuildMode = mode
-		}
-	}
-	setBuildMode(cmdArgs.SymlinkForestMarker, SymlinkForest)
-	setBuildMode(cmdArgs.Bp2buildMarker, Bp2build)
 	setBuildMode(cmdArgs.BazelQueryViewDir, GenerateQueryView)
 	setBuildMode(cmdArgs.ModuleGraphFile, GenerateModuleGraph)
 	setBuildMode(cmdArgs.DocFile, GenerateDocFile)
-	setBazelMode(cmdArgs.BazelMode, "--bazel-mode", BazelProdMode)
-	setBazelMode(cmdArgs.BazelModeStaging, "--bazel-mode-staging", BazelStagingMode)
-
-	for _, module := range getForceEnabledModulesFromFlag(cmdArgs.BazelForceEnabledModules) {
-		config.bazelForceEnabledModules[module] = struct{}{}
-	}
-	config.BazelContext, err = NewBazelContext(config)
-	config.Bp2buildPackageConfig = GetBp2BuildAllowList()
 
 	// TODO(b/276958307): Replace the hardcoded list to a sdk_library local prop.
 	config.apiLibraries = map[string]struct{}{
@@ -691,6 +608,7 @@
 		"framework-location":                {},
 		"framework-media":                   {},
 		"framework-mediaprovider":           {},
+		"framework-nfc":                     {},
 		"framework-ondevicepersonalization": {},
 		"framework-pdf":                     {},
 		"framework-permission":              {},
@@ -711,13 +629,6 @@
 	return Config{config}, err
 }
 
-func getForceEnabledModulesFromFlag(forceEnabledFlag string) []string {
-	if forceEnabledFlag == "" {
-		return []string{}
-	}
-	return strings.Split(forceEnabledFlag, ",")
-}
-
 // mockFileSystem replaces all reads with accesses to the provided map of
 // filenames to contents stored as a byte slice.
 func (c *config) mockFileSystem(bp string, fs map[string][]byte) {
@@ -748,41 +659,6 @@
 	c.mockBpList = blueprint.MockModuleListFile
 }
 
-// TODO(b/265062549): Add a field to our collected (and uploaded) metrics which
-// describes a reason that we fell back to non-mixed builds.
-// Returns true if "Bazel builds" is enabled. In this mode, part of build
-// analysis is handled by Bazel.
-func (c *config) IsMixedBuildsEnabled() bool {
-	globalMixedBuildsSupport := c.Once(OnceKey{"globalMixedBuildsSupport"}, func() interface{} {
-		if c.productVariables.DeviceArch != nil && *c.productVariables.DeviceArch == "riscv64" {
-			return false
-		}
-		// Disable Bazel when Kythe is running
-		if c.EmitXrefRules() {
-			return false
-		}
-		if c.IsEnvTrue("GLOBAL_THINLTO") {
-			return false
-		}
-		if len(c.productVariables.SanitizeHost) > 0 {
-			return false
-		}
-		if len(c.productVariables.SanitizeDevice) > 0 {
-			return false
-		}
-		if len(c.productVariables.SanitizeDeviceDiag) > 0 {
-			return false
-		}
-		if len(c.productVariables.SanitizeDeviceArch) > 0 {
-			return false
-		}
-		return true
-	}).(bool)
-
-	bazelModeEnabled := c.BuildMode == BazelProdMode || c.BuildMode == BazelStagingMode
-	return globalMixedBuildsSupport && bazelModeEnabled
-}
-
 func (c *config) SetAllowMissingDependencies() {
 	c.productVariables.Allow_missing_dependencies = proptools.BoolPtr(true)
 }
@@ -1058,8 +934,6 @@
 // DefaultAppTargetSdk returns the API level that platform apps are targeting.
 // This converts a codename to the exact ApiLevel it represents.
 func (c *config) DefaultAppTargetSdk(ctx EarlyModuleContext) ApiLevel {
-	// This logic is replicated in starlark, if changing logic here update starlark code too
-	// https://cs.android.com/android/platform/superproject/+/master:build/bazel/rules/common/api.bzl;l=72;drc=231c7e8c8038fd478a79eb68aa5b9f5c64e0e061
 	if Bool(c.productVariables.Platform_sdk_final) {
 		return c.PlatformSdkVersion()
 	}
@@ -1417,14 +1291,14 @@
 	return String(c.productVariables.PrebuiltHiddenApiDir)
 }
 
-func (c *config) BazelModulesForceEnabledByFlag() map[string]struct{} {
-	return c.bazelForceEnabledModules
-}
-
 func (c *config) IsVndkDeprecated() bool {
 	return !Bool(c.productVariables.KeepVndk)
 }
 
+func (c *config) VendorApiLevel() string {
+	return String(c.productVariables.VendorApiLevel)
+}
+
 func (c *deviceConfig) Arches() []Arch {
 	var arches []Arch
 	for _, target := range c.config.Targets[Android] {
@@ -2029,38 +1903,6 @@
 	return Bool(c.productVariables.HostMusl)
 }
 
-func (c *config) GetMixedBuildsEnabledModules() map[string]struct{} {
-	return c.mixedBuildEnabledModules
-}
-
-func (c *config) GetMixedBuildsDisabledModules() map[string]struct{} {
-	return c.mixedBuildDisabledModules
-}
-
-func (c *config) LogMixedBuild(ctx BaseModuleContext, useBazel bool) {
-	moduleName := ctx.Module().Name()
-	c.mixedBuildsLock.Lock()
-	defer c.mixedBuildsLock.Unlock()
-	if useBazel {
-		c.mixedBuildEnabledModules[moduleName] = struct{}{}
-	} else {
-		c.mixedBuildDisabledModules[moduleName] = struct{}{}
-	}
-}
-
-func (c *config) HasBazelBuildTargetInSource(dir string, target string) bool {
-	for _, existingTarget := range c.bazelTargetsByDir[dir] {
-		if target == existingTarget {
-			return true
-		}
-	}
-	return false
-}
-
-func (c *config) SetBazelBuildFileTargets(bazelTargetsByDir map[string][]string) {
-	c.bazelTargetsByDir = bazelTargetsByDir
-}
-
 // ApiSurfaces directory returns the source path inside the api_surfaces repo
 // (relative to workspace root).
 func (c *config) ApiSurfacesDir(s ApiSurface, version string) string {
@@ -2094,12 +1936,6 @@
 	c.productVariables.Build_from_text_stub = boolPtr(b)
 }
 
-func (c *config) AddForceEnabledModules(forceEnabled []string) {
-	for _, forceEnabledModule := range forceEnabled {
-		c.bazelForceEnabledModules[forceEnabledModule] = struct{}{}
-	}
-}
-
 func (c *config) SetApiLibraries(libs []string) {
 	c.apiLibraries = make(map[string]struct{})
 	for _, lib := range libs {
@@ -2111,11 +1947,6 @@
 	return c.apiLibraries
 }
 
-// Bp2buildMode indicates whether the config is for bp2build mode of Soong
-func (c *config) Bp2buildMode() bool {
-	return c.BuildMode == Bp2build
-}
-
 func (c *deviceConfig) CheckVendorSeappViolations() bool {
 	return Bool(c.config.productVariables.CheckVendorSeappViolations)
 }
diff --git a/android/defaults.go b/android/defaults.go
index cc723f7..ff79002 100644
--- a/android/defaults.go
+++ b/android/defaults.go
@@ -17,7 +17,6 @@
 import (
 	"reflect"
 
-	"android/soong/ui/metrics/bp2build_metrics_proto"
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/proptools"
 )
@@ -118,11 +117,6 @@
 
 type DefaultsModuleBase struct {
 	DefaultableModuleBase
-
-	// Included to support setting bazel_module.label for multiple Soong modules to the same Bazel
-	// target. This is primarily useful for modules that were architecture specific and instead are
-	// handled in Bazel as a select().
-	BazelModuleBase
 }
 
 // The common pattern for defaults modules is to register separate instances of
@@ -165,7 +159,6 @@
 type DefaultsModule interface {
 	Module
 	Defaults
-	Bazelable
 }
 
 func (d *DefaultsModuleBase) properties() []interface{} {
@@ -178,13 +171,6 @@
 
 func (d *DefaultsModuleBase) GenerateAndroidBuildActions(ctx ModuleContext) {}
 
-// ConvertWithBp2build to fulfill Bazelable interface; however, at this time defaults module are
-// *NOT* converted with bp2build
-func (defaultable *DefaultsModuleBase) ConvertWithBp2build(ctx Bp2buildMutatorContext) {
-	// Defaults types are never convertible.
-	ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_TYPE_UNSUPPORTED, "")
-}
-
 func InitDefaultsModule(module DefaultsModule) {
 	commonProperties := &commonProperties{}
 
@@ -194,8 +180,6 @@
 		&ApexProperties{},
 		&distProperties{})
 
-	// Bazel module must be initialized _before_ Defaults to be included in cc_defaults module.
-	InitBazelModule(module)
 	initAndroidModuleBase(module)
 	initProductVariableModule(module)
 	initArchModule(module)
@@ -225,60 +209,10 @@
 
 var _ Defaults = (*DefaultsModuleBase)(nil)
 
-// applyNamespacedVariableDefaults only runs in bp2build mode for
-// defaultable/defaults modules. Its purpose is to merge namespaced product
-// variable props from defaults deps, even if those defaults are custom module
-// types created from soong_config_module_type, e.g. one that's wrapping a
-// cc_defaults or java_defaults.
-func applyNamespacedVariableDefaults(defaultDep Defaults, ctx TopDownMutatorContext) {
-	var dep, b Bazelable
-
-	dep, ok := defaultDep.(Bazelable)
-	if !ok {
-		if depMod, ok := defaultDep.(Module); ok {
-			// Track that this dependency hasn't been converted to bp2build yet.
-			ctx.AddUnconvertedBp2buildDep(depMod.Name())
-			return
-		} else {
-			panic("Expected default dep to be a Module.")
-		}
-	}
-
-	b, ok = ctx.Module().(Bazelable)
-	if !ok {
-		return
-	}
-
-	// namespacedVariableProps is a map from namespaces (e.g. acme, android,
-	// vendor_foo) to a slice of soong_config_variable struct pointers,
-	// containing properties for that particular module.
-	src := dep.namespacedVariableProps()
-	dst := b.namespacedVariableProps()
-	if dst == nil {
-		dst = make(namespacedVariableProperties)
-	}
-
-	// Propagate all soong_config_variable structs from the dep. We'll merge the
-	// actual property values later in variable.go.
-	for namespace := range src {
-		if dst[namespace] == nil {
-			dst[namespace] = []interface{}{}
-		}
-		for _, i := range src[namespace] {
-			dst[namespace] = append(dst[namespace], i)
-		}
-	}
-
-	b.setNamespacedVariableProps(dst)
-}
-
 func (defaultable *DefaultableModuleBase) applyDefaults(ctx TopDownMutatorContext,
 	defaultsList []Defaults) {
 
 	for _, defaults := range defaultsList {
-		if ctx.Config().BuildMode == Bp2build {
-			applyNamespacedVariableDefaults(defaults, ctx)
-		}
 		for _, prop := range defaultable.defaultableProperties {
 			if prop == defaultable.defaultableVariableProperties {
 				defaultable.applyDefaultVariableProperties(ctx, defaults, prop)
diff --git a/android/defs.go b/android/defs.go
index b28d2fa..03968c1 100644
--- a/android/defs.go
+++ b/android/defs.go
@@ -232,7 +232,7 @@
 
 // ContentFromFileRuleForTests returns the content that was passed to a WriteFileRule for use
 // in tests.
-func ContentFromFileRuleForTests(t *testing.T, params TestingBuildParams) string {
+func ContentFromFileRuleForTests(t *testing.T, ctx *TestContext, params TestingBuildParams) string {
 	t.Helper()
 	if g, w := params.Rule, writeFile; g != w {
 		t.Errorf("expected params.Rule to be %q, was %q", w, g)
diff --git a/android/filegroup.go b/android/filegroup.go
index 856c50e..04bd8a8 100644
--- a/android/filegroup.go
+++ b/android/filegroup.go
@@ -15,15 +15,9 @@
 package android
 
 import (
-	"path/filepath"
-	"regexp"
 	"strings"
 
-	"android/soong/bazel"
-	"android/soong/bazel/cquery"
-	"android/soong/ui/metrics/bp2build_metrics_proto"
 	"github.com/google/blueprint"
-	"github.com/google/blueprint/proptools"
 )
 
 func init() {
@@ -39,181 +33,6 @@
 	ctx.RegisterModuleType("filegroup_defaults", FileGroupDefaultsFactory)
 }
 
-var convertedProtoLibrarySuffix = "_bp2build_converted"
-
-// IsFilegroup checks that a module is a filegroup type
-func IsFilegroup(ctx bazel.OtherModuleContext, m blueprint.Module) bool {
-	return ctx.OtherModuleType(m) == "filegroup"
-}
-
-var (
-	// ignoring case, checks for proto or protos as an independent word in the name, whether at the
-	// beginning, end, or middle. e.g. "proto.foo", "bar-protos", "baz_proto_srcs" would all match
-	filegroupLikelyProtoPattern = regexp.MustCompile("(?i)(^|[^a-z])proto(s)?([^a-z]|$)")
-	filegroupLikelyAidlPattern  = regexp.MustCompile("(?i)(^|[^a-z])aidl(s)?([^a-z]|$)")
-
-	ProtoSrcLabelPartition = bazel.LabelPartition{
-		Extensions:  []string{".proto"},
-		LabelMapper: isFilegroupWithPattern(filegroupLikelyProtoPattern),
-	}
-	AidlSrcLabelPartition = bazel.LabelPartition{
-		Extensions:  []string{".aidl"},
-		LabelMapper: isFilegroupWithPattern(filegroupLikelyAidlPattern),
-	}
-)
-
-func isFilegroupWithPattern(pattern *regexp.Regexp) bazel.LabelMapper {
-	return func(ctx bazel.OtherModuleContext, label bazel.Label) (string, bool) {
-		m, exists := ctx.ModuleFromName(label.OriginalModuleName)
-		labelStr := label.Label
-		if !exists || !IsFilegroup(ctx, m) {
-			return labelStr, false
-		}
-		likelyMatched := pattern.MatchString(label.OriginalModuleName)
-		return labelStr, likelyMatched
-	}
-}
-
-// https://docs.bazel.build/versions/master/be/general.html#filegroup
-type bazelFilegroupAttributes struct {
-	Srcs                bazel.LabelListAttribute
-	Applicable_licenses bazel.LabelListAttribute
-}
-
-type bazelAidlLibraryAttributes struct {
-	Srcs                bazel.LabelListAttribute
-	Strip_import_prefix *string
-}
-
-// ConvertWithBp2build performs bp2build conversion of filegroup
-func (fg *fileGroup) ConvertWithBp2build(ctx Bp2buildMutatorContext) {
-	srcs := bazel.MakeLabelListAttribute(
-		BazelLabelForModuleSrcExcludes(ctx, fg.properties.Srcs, fg.properties.Exclude_srcs))
-
-	// For Bazel compatibility, don't generate the filegroup if there is only 1
-	// source file, and that the source file is named the same as the module
-	// itself. In Bazel, eponymous filegroups like this would be an error.
-	//
-	// Instead, dependents on this single-file filegroup can just depend
-	// on the file target, instead of rule target, directly.
-	//
-	// You may ask: what if a filegroup has multiple files, and one of them
-	// shares the name? The answer: we haven't seen that in the wild, and
-	// should lock Soong itself down to prevent the behavior. For now,
-	// we raise an error if bp2build sees this problem.
-	for _, f := range srcs.Value.Includes {
-		if f.Label == fg.Name() {
-			if len(srcs.Value.Includes) > 1 {
-				ctx.ModuleErrorf("filegroup '%s' cannot contain a file with the same name", fg.Name())
-				ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_SRC_NAME_COLLISION, "")
-			} else {
-				panic("This situation should have been handled by FileGroupFactory's call to InitBazelModuleAsHandcrafted")
-			}
-			return
-		}
-	}
-
-	// Convert module that has only AIDL files to aidl_library
-	// If the module has a mixed bag of AIDL and non-AIDL files, split the filegroup manually
-	// and then convert
-	if fg.ShouldConvertToAidlLibrary(ctx) {
-		tags := []string{"apex_available=//apex_available:anyapex"}
-		attrs := &bazelAidlLibraryAttributes{
-			Srcs:                srcs,
-			Strip_import_prefix: fg.properties.Path,
-		}
-
-		props := bazel.BazelTargetModuleProperties{
-			Rule_class:        "aidl_library",
-			Bzl_load_location: "//build/bazel/rules/aidl:aidl_library.bzl",
-		}
-
-		ctx.CreateBazelTargetModule(
-			props,
-			CommonAttributes{
-				Name: fg.Name(),
-				Tags: bazel.MakeStringListAttribute(tags),
-			},
-			attrs)
-	} else {
-		if fg.ShouldConvertToProtoLibrary(ctx) {
-			pkgToSrcs := partitionSrcsByPackage(ctx.ModuleDir(), bazel.MakeLabelList(srcs.Value.Includes))
-			if len(pkgToSrcs) > 1 {
-				ctx.ModuleErrorf("TODO: Add bp2build support for multiple package .protosrcs in filegroup")
-				return
-			}
-			pkg := SortedKeys(pkgToSrcs)[0]
-			attrs := &ProtoAttrs{
-				Srcs:                bazel.MakeLabelListAttribute(pkgToSrcs[pkg]),
-				Strip_import_prefix: fg.properties.Path,
-			}
-
-			tags := []string{
-				"apex_available=//apex_available:anyapex",
-				// TODO(b/246997908): we can remove this tag if we could figure out a solution for this bug.
-				"manual",
-			}
-			if pkg != ctx.ModuleDir() {
-				// Since we are creating the proto_library in a subpackage, create an import_prefix relative to the current package
-				if rel, err := filepath.Rel(ctx.ModuleDir(), pkg); err != nil {
-					ctx.ModuleErrorf("Could not get relative path for %v %v", pkg, err)
-				} else if rel != "." {
-					attrs.Import_prefix = &rel
-					// Strip the package prefix
-					attrs.Strip_import_prefix = proptools.StringPtr("")
-				}
-			}
-
-			ctx.CreateBazelTargetModule(
-				bazel.BazelTargetModuleProperties{Rule_class: "proto_library"},
-				CommonAttributes{
-					Name: fg.Name() + "_proto",
-					Dir:  proptools.StringPtr(pkg),
-					Tags: bazel.MakeStringListAttribute(tags),
-				},
-				attrs)
-
-			// Create an alias in the current dir. The actual target might exist in a different package, but rdeps
-			// can reliabily use this alias
-			ctx.CreateBazelTargetModule(
-				bazel.BazelTargetModuleProperties{Rule_class: "alias"},
-				CommonAttributes{
-					Name: fg.Name() + convertedProtoLibrarySuffix,
-					// TODO(b/246997908): we can remove this tag if we could figure out a solution for this bug.
-					Tags: bazel.MakeStringListAttribute(tags),
-				},
-				&bazelAliasAttributes{
-					Actual: bazel.MakeLabelAttribute("//" + pkg + ":" + fg.Name() + "_proto"),
-				},
-			)
-		}
-
-		// TODO(b/242847534): Still convert to a filegroup because other unconverted
-		// modules may depend on the filegroup
-		attrs := &bazelFilegroupAttributes{
-			Srcs: srcs,
-		}
-
-		props := bazel.BazelTargetModuleProperties{
-			Rule_class:        "filegroup",
-			Bzl_load_location: "//build/bazel/rules:filegroup.bzl",
-		}
-
-		ctx.CreateBazelTargetModule(props, CommonAttributes{Name: fg.Name()}, attrs)
-	}
-}
-
-type FileGroupPath interface {
-	GetPath(ctx Bp2buildMutatorContext) string
-}
-
-func (fg *fileGroup) GetPath(ctx Bp2buildMutatorContext) string {
-	if fg.properties.Path != nil {
-		return *fg.properties.Path
-	}
-	return ""
-}
-
 type fileGroupProperties struct {
 	// srcs lists files that will be included in this filegroup
 	Srcs []string `android:"path"`
@@ -233,18 +52,12 @@
 
 type fileGroup struct {
 	ModuleBase
-	BazelModuleBase
 	DefaultableModuleBase
-	FileGroupAsLibrary
-	FileGroupPath
 	properties fileGroupProperties
 	srcs       Paths
 }
 
-var _ MixedBuildBuildable = (*fileGroup)(nil)
 var _ SourceFileProducer = (*fileGroup)(nil)
-var _ FileGroupAsLibrary = (*fileGroup)(nil)
-var _ FileGroupPath = (*fileGroup)(nil)
 
 // filegroup contains a list of files that are referenced by other modules
 // properties (such as "srcs") using the syntax ":<name>". filegroup are
@@ -253,17 +66,6 @@
 	module := &fileGroup{}
 	module.AddProperties(&module.properties)
 	InitAndroidModule(module)
-	InitBazelModule(module)
-	AddBazelHandcraftedHook(module, func(ctx LoadHookContext) string {
-		// If there is a single src with the same name as the filegroup module name,
-		// then don't generate this filegroup. It will be OK for other targets
-		// to depend on this source file by name directly.
-		fg := ctx.Module().(*fileGroup)
-		if len(fg.properties.Srcs) == 1 && fg.Name() == fg.properties.Srcs[0] {
-			return fg.Name()
-		}
-		return ""
-	})
 	InitDefaultableModule(module)
 	return module
 }
@@ -290,6 +92,7 @@
 	if fg.properties.Path != nil {
 		fg.srcs = PathsWithModuleSrcSubDir(ctx, fg.srcs, String(fg.properties.Path))
 	}
+	ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: fg.srcs.Strings()})
 }
 
 func (fg *fileGroup) Srcs() Paths {
@@ -302,101 +105,6 @@
 	}
 }
 
-func (fg *fileGroup) QueueBazelCall(ctx BaseModuleContext) {
-	bazelCtx := ctx.Config().BazelContext
-
-	bazelCtx.QueueBazelRequest(
-		fg.GetBazelLabel(ctx, fg),
-		cquery.GetOutputFiles,
-		configKey{arch: Common.String(), osType: CommonOS})
-}
-
-func (fg *fileGroup) IsMixedBuildSupported(ctx BaseModuleContext) bool {
-	// TODO(b/247782695), TODO(b/242847534) Fix mixed builds for filegroups
-	return false
-}
-
-func (fg *fileGroup) ProcessBazelQueryResponse(ctx ModuleContext) {
-	bazelCtx := ctx.Config().BazelContext
-	// This is a short-term solution because we rely on info from Android.bp to handle
-	// a converted module. This will block when we want to remove Android.bp for all
-	// converted modules at some point.
-	// TODO(b/242847534): Implement a long-term solution in which we don't need to rely
-	// on info form Android.bp for modules that are already converted to Bazel
-	relativeRoot := ctx.ModuleDir()
-	if fg.properties.Path != nil {
-		relativeRoot = filepath.Join(relativeRoot, *fg.properties.Path)
-	}
-
-	filePaths, err := bazelCtx.GetOutputFiles(fg.GetBazelLabel(ctx, fg), configKey{arch: Common.String(), osType: CommonOS})
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-
-	bazelOuts := make(Paths, 0, len(filePaths))
-	for _, p := range filePaths {
-		bazelOuts = append(bazelOuts, PathForBazelOutRelative(ctx, relativeRoot, p))
-	}
-	fg.srcs = bazelOuts
-}
-
-func (fg *fileGroup) ShouldConvertToAidlLibrary(ctx BazelConversionPathContext) bool {
-	return fg.shouldConvertToLibrary(ctx, ".aidl")
-}
-
-func (fg *fileGroup) ShouldConvertToProtoLibrary(ctx BazelConversionPathContext) bool {
-	return fg.shouldConvertToLibrary(ctx, ".proto")
-}
-
-func (fg *fileGroup) shouldConvertToLibrary(ctx BazelConversionPathContext, suffix string) bool {
-	if len(fg.properties.Srcs) == 0 || !fg.ShouldConvertWithBp2build(ctx) {
-		return false
-	}
-	for _, src := range fg.properties.Srcs {
-		if !strings.HasSuffix(src, suffix) {
-			return false
-		}
-	}
-	return true
-}
-
-func (fg *fileGroup) GetAidlLibraryLabel(ctx BazelConversionPathContext) string {
-	return fg.getFileGroupAsLibraryLabel(ctx)
-}
-
-func (fg *fileGroup) GetProtoLibraryLabel(ctx BazelConversionPathContext) string {
-	return fg.getFileGroupAsLibraryLabel(ctx) + convertedProtoLibrarySuffix
-}
-
-func (fg *fileGroup) getFileGroupAsLibraryLabel(ctx BazelConversionPathContext) string {
-	if ctx.OtherModuleDir(fg.module) == ctx.ModuleDir() {
-		return ":" + fg.Name()
-	} else {
-		return fg.GetBazelLabel(ctx, fg)
-	}
-}
-
-// Given a name in srcs prop, check to see if the name references a filegroup
-// and the filegroup is converted to aidl_library
-func IsConvertedToAidlLibrary(ctx BazelConversionPathContext, name string) bool {
-	if fg, ok := ToFileGroupAsLibrary(ctx, name); ok {
-		return fg.ShouldConvertToAidlLibrary(ctx)
-	}
-	return false
-}
-
-func ToFileGroupAsLibrary(ctx BazelConversionPathContext, name string) (FileGroupAsLibrary, bool) {
-	if module, ok := ctx.ModuleFromName(name); ok {
-		if IsFilegroup(ctx, module) {
-			if fg, ok := module.(FileGroupAsLibrary); ok {
-				return fg, true
-			}
-		}
-	}
-	return nil, false
-}
-
 // Defaults
 type FileGroupDefaults struct {
 	ModuleBase
diff --git a/android/filegroup_test.go b/android/filegroup_test.go
index 893da57..14e9368 100644
--- a/android/filegroup_test.go
+++ b/android/filegroup_test.go
@@ -40,17 +40,8 @@
 	}
 
 	for _, testCase := range testCases {
-		outBaseDir := "outputbase"
 		result := GroupFixturePreparers(
 			PrepareForTestWithFilegroup,
-			FixtureModifyConfig(func(config Config) {
-				config.BazelContext = MockBazelContext{
-					OutputBaseDir: outBaseDir,
-					LabelToOutputFiles: map[string][]string{
-						"//:baz": []string{"a/b/c/d/test.aidl"},
-					},
-				}
-			}),
 		).RunTestWithBp(t, testCase.bp)
 
 		fg := result.Module("baz", "").(*fileGroup)
diff --git a/android/license.go b/android/license.go
index 76f5115..5bffc25 100644
--- a/android/license.go
+++ b/android/license.go
@@ -15,12 +15,7 @@
 package android
 
 import (
-	"fmt"
-	"os"
-
 	"github.com/google/blueprint"
-
-	"android/soong/bazel"
 )
 
 type licenseKindDependencyTag struct {
@@ -53,54 +48,13 @@
 	Visibility []string
 }
 
-var _ Bazelable = &licenseModule{}
-
 type licenseModule struct {
 	ModuleBase
 	DefaultableModuleBase
-	BazelModuleBase
 
 	properties licenseProperties
 }
 
-type bazelLicenseAttributes struct {
-	License_kinds    []string
-	Copyright_notice *string
-	License_text     bazel.LabelAttribute
-	Package_name     *string
-	Visibility       []string
-}
-
-func (m *licenseModule) ConvertWithBp2build(ctx Bp2buildMutatorContext) {
-	attrs := &bazelLicenseAttributes{
-		License_kinds:    m.properties.License_kinds,
-		Copyright_notice: m.properties.Copyright_notice,
-		Package_name:     m.properties.Package_name,
-		Visibility:       m.properties.Visibility,
-	}
-
-	// TODO(asmundak): Soong supports multiple license texts while Bazel's license
-	// rule does not. Have android_license create a genrule to concatenate multiple
-	// license texts.
-	if len(m.properties.License_text) > 1 && ctx.Config().IsEnvTrue("BP2BUILD_VERBOSE") {
-		fmt.Fprintf(os.Stderr, "warning: using only the first license_text item from //%s:%s\n",
-			ctx.ModuleDir(), m.Name())
-	}
-	if len(m.properties.License_text) >= 1 {
-		attrs.License_text.SetValue(BazelLabelForModuleSrcSingle(ctx, m.properties.License_text[0]))
-	}
-
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "android_license",
-			Bzl_load_location: "//build/bazel/rules/license:license.bzl",
-		},
-		CommonAttributes{
-			Name: m.Name(),
-		},
-		attrs)
-}
-
 func (m *licenseModule) DepsMutator(ctx BottomUpMutatorContext) {
 	for i, license := range m.properties.License_kinds {
 		for j := i + 1; j < len(m.properties.License_kinds); j++ {
@@ -131,14 +85,13 @@
 	module := &licenseModule{}
 
 	base := module.base()
-	module.AddProperties(&base.nameProperties, &module.properties, &base.commonProperties.BazelConversionStatus)
+	module.AddProperties(&base.nameProperties, &module.properties)
 
 	// The visibility property needs to be checked and parsed by the visibility module.
 	setPrimaryVisibilityProperty(module, "visibility", &module.properties.Visibility)
 
 	initAndroidModuleBase(module)
 	InitDefaultableModule(module)
-	InitBazelModule(module)
 
 	return module
 }
diff --git a/android/license_kind.go b/android/license_kind.go
index 78df938..838dedd 100644
--- a/android/license_kind.go
+++ b/android/license_kind.go
@@ -14,8 +14,6 @@
 
 package android
 
-import "android/soong/bazel"
-
 func init() {
 	RegisterLicenseKindBuildComponents(InitRegistrationContext)
 }
@@ -34,39 +32,13 @@
 	Visibility []string
 }
 
-var _ Bazelable = &licenseKindModule{}
-
 type licenseKindModule struct {
 	ModuleBase
 	DefaultableModuleBase
-	BazelModuleBase
 
 	properties licenseKindProperties
 }
 
-type bazelLicenseKindAttributes struct {
-	Conditions []string
-	Url        string
-	Visibility []string
-}
-
-func (m *licenseKindModule) ConvertWithBp2build(ctx Bp2buildMutatorContext) {
-	attrs := &bazelLicenseKindAttributes{
-		Conditions: m.properties.Conditions,
-		Url:        m.properties.Url,
-		Visibility: m.properties.Visibility,
-	}
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "license_kind",
-			Bzl_load_location: "@rules_license//rules:license_kind.bzl",
-		},
-		CommonAttributes{
-			Name: m.Name(),
-		},
-		attrs)
-}
-
 func (m *licenseKindModule) DepsMutator(ctx BottomUpMutatorContext) {
 	// Nothing to do.
 }
@@ -79,14 +51,13 @@
 	module := &licenseKindModule{}
 
 	base := module.base()
-	module.AddProperties(&base.nameProperties, &module.properties, &base.commonProperties.BazelConversionStatus)
+	module.AddProperties(&base.nameProperties, &module.properties)
 
 	// The visibility property needs to be checked and parsed by the visibility module.
 	setPrimaryVisibilityProperty(module, "visibility", &module.properties.Visibility)
 
 	initAndroidModuleBase(module)
 	InitDefaultableModule(module)
-	InitBazelModule(module)
 
 	return module
 }
diff --git a/android/license_metadata.go b/android/license_metadata.go
index 8933bd5..609ca79 100644
--- a/android/license_metadata.go
+++ b/android/license_metadata.go
@@ -50,7 +50,14 @@
 		outputFiles = PathsIfNonNil(outputFiles...)
 	}
 
-	isContainer := isContainerFromFileExtensions(base.installFiles, outputFiles)
+	// Only pass the last installed file to isContainerFromFileExtensions so a *.zip file in test data
+	// doesn't mark the whole module as a container.
+	var installFiles InstallPaths
+	if len(base.installFiles) > 0 {
+		installFiles = InstallPaths{base.installFiles[len(base.installFiles)-1]}
+	}
+
+	isContainer := isContainerFromFileExtensions(installFiles, outputFiles)
 
 	var allDepMetadataFiles Paths
 	var allDepMetadataArgs []string
diff --git a/android/metrics.go b/android/metrics.go
index 3571272..6834b1b 100644
--- a/android/metrics.go
+++ b/android/metrics.go
@@ -19,7 +19,6 @@
 	"io/ioutil"
 	"os"
 	"runtime"
-	"sort"
 	"strconv"
 	"time"
 
@@ -93,23 +92,6 @@
 		}
 		metrics.Events = append(metrics.Events, &perfInfo)
 	}
-	mixedBuildsInfo := soong_metrics_proto.MixedBuildsInfo{}
-	mixedBuildEnabledModules := make([]string, 0, len(config.mixedBuildEnabledModules))
-	for module, _ := range config.mixedBuildEnabledModules {
-		mixedBuildEnabledModules = append(mixedBuildEnabledModules, module)
-	}
-
-	mixedBuildDisabledModules := make([]string, 0, len(config.mixedBuildDisabledModules))
-	for module, _ := range config.mixedBuildDisabledModules {
-		mixedBuildDisabledModules = append(mixedBuildDisabledModules, module)
-	}
-	// Sorted for deterministic output.
-	sort.Strings(mixedBuildEnabledModules)
-	sort.Strings(mixedBuildDisabledModules)
-
-	mixedBuildsInfo.MixedBuildEnabledModules = mixedBuildEnabledModules
-	mixedBuildsInfo.MixedBuildDisabledModules = mixedBuildDisabledModules
-	metrics.MixedBuildsInfo = &mixedBuildsInfo
 
 	return metrics
 }
diff --git a/android/module.go b/android/module.go
index af69a1b..f571157 100644
--- a/android/module.go
+++ b/android/module.go
@@ -16,7 +16,6 @@
 
 import (
 	"android/soong/bazel"
-	"android/soong/ui/metrics/bp2build_metrics_proto"
 	"crypto/md5"
 	"encoding/hex"
 	"encoding/json"
@@ -96,16 +95,6 @@
 	AddProperties(props ...interface{})
 	GetProperties() []interface{}
 
-	// If this module should not have bazel BUILD definitions generated by bp2build,
-	// GetUnconvertedReason returns a reason this is the case.
-	GetUnconvertedReason() *UnconvertedReason
-
-	// Bp2buildTargets returns the target(s) generated for Bazel via bp2build for this module
-	Bp2buildTargets() []bp2buildInfo
-	GetUnconvertedBp2buildDeps() []string
-	GetMissingBp2buildDeps() []string
-	GetPartitionForBp2build() string
-
 	BuildParamsForTests() []BuildParams
 	RuleParamsForTests() map[blueprint.Rule]blueprint.RuleParams
 	VariablesForTests() map[string]string
@@ -520,9 +509,6 @@
 	// constants in image.go, but can also be set to a custom value by individual module types.
 	ImageVariation string `blueprint:"mutated"`
 
-	// Bazel conversion status
-	BazelConversionStatus BazelConversionStatus `blueprint:"mutated"`
-
 	// SoongConfigTrace records accesses to VendorVars (soong_config). The trace will be hashed
 	// and used as a subdir of PathForModuleOut.  Note that we mainly focus on incremental
 	// builds among similar products (e.g. aosp_cf_x86_64_phone and aosp_cf_x86_64_foldable),
@@ -532,41 +518,6 @@
 	SoongConfigTraceHash string           `blueprint:"mutated"`
 }
 
-// CommonAttributes represents the common Bazel attributes from which properties
-// in `commonProperties` are translated/mapped; such properties are annotated in
-// a list their corresponding attribute. It is embedded within `bp2buildInfo`.
-type CommonAttributes struct {
-	// Soong nameProperties -> Bazel name
-	Name string
-
-	// Data mapped from: Required
-	Data bazel.LabelListAttribute
-
-	// SkipData is neither a Soong nor Bazel target attribute
-	// If true, this will not fill the data attribute automatically
-	// This is useful for Soong modules that have 1:many Bazel targets
-	// Some of the generated Bazel targets might not have a data attribute
-	SkipData *bool
-
-	Tags bazel.StringListAttribute
-
-	Applicable_licenses bazel.LabelListAttribute
-
-	Testonly *bool
-
-	// Dir is neither a Soong nor Bazel target attribute
-	// If set, the bazel target will be created in this directory
-	// If unset, the bazel target will default to be created in the directory of the visited soong module
-	Dir *string
-}
-
-// constraintAttributes represents Bazel attributes pertaining to build constraints,
-// which make restrict building a Bazel target for some set of platforms.
-type constraintAttributes struct {
-	// Constraint values this target can be built for.
-	Target_compatible_with bazel.LabelListAttribute
-}
-
 type distProperties struct {
 	// configuration to distribute output files from this module to the distribution
 	// directory (default: $OUT/dist, configurable with $DIST_DIR)
@@ -804,234 +755,6 @@
 	m.base().commonProperties.CreateCommonOSVariant = true
 }
 
-func (attrs *CommonAttributes) getRequiredWithoutCycles(ctx *bottomUpMutatorContext, props *commonProperties) []string {
-	// Treat `required` as if it's empty if data should be skipped for this target,
-	// as `required` is only used for the `data` attribute at this time, and we want
-	// to avoid lookups of labels that won't actually be dependencies of this target.
-	// TODO: b/202299295 - Refactor this to use `required` dependencies, once they
-	// are handled other than passing to `data`.
-	if proptools.Bool(attrs.SkipData) {
-		return []string{}
-	}
-	// The required property can contain the module itself. This causes a cycle
-	// when generated as the 'data' label list attribute in Bazel. Remove it if
-	// it exists. See b/247985196.
-	_, requiredWithoutCycles := RemoveFromList(ctx.ModuleName(), props.Required)
-	return FirstUniqueStrings(requiredWithoutCycles)
-}
-
-func (attrs *CommonAttributes) fillCommonBp2BuildModuleAttrs(ctx *bottomUpMutatorContext,
-	enabledPropertyOverrides bazel.BoolAttribute) constraintAttributes {
-
-	mod := ctx.Module().base()
-	// Assert passed-in attributes include Name
-	if len(attrs.Name) == 0 {
-		if ctx.ModuleType() != "package" {
-			ctx.ModuleErrorf("CommonAttributes in fillCommonBp2BuildModuleAttrs expects a `.Name`!")
-		}
-	}
-
-	depsToLabelList := func(deps []string) bazel.LabelListAttribute {
-		return bazel.MakeLabelListAttribute(BazelLabelForModuleDeps(ctx, deps))
-	}
-
-	var enabledProperty bazel.BoolAttribute
-
-	onlyAndroid := false
-	neitherHostNorDevice := false
-
-	osSupport := map[string]bool{}
-
-	// if the target is enabled and supports arch variance, determine the defaults based on the module
-	// type's host or device property and host_supported/device_supported properties
-	if mod.commonProperties.ArchSpecific {
-		moduleSupportsDevice := mod.DeviceSupported()
-		moduleSupportsHost := mod.HostSupported()
-		if moduleSupportsHost && !moduleSupportsDevice {
-			// for host only, we specify as unsupported on android rather than listing all host osSupport
-			// TODO(b/220874839): consider replacing this with a constraint that covers all host osSupport
-			// instead
-			enabledProperty.SetSelectValue(bazel.OsConfigurationAxis, Android.Name, proptools.BoolPtr(false))
-		} else if moduleSupportsDevice && !moduleSupportsHost {
-			enabledProperty.SetSelectValue(bazel.OsConfigurationAxis, Android.Name, proptools.BoolPtr(true))
-			// specify as a positive to ensure any target-specific enabled can be resolved
-			// also save that a target is only android, as if there is only the positive restriction on
-			// android, it'll be dropped, so we may need to add it back later
-			onlyAndroid = true
-		} else if !moduleSupportsHost && !moduleSupportsDevice {
-			neitherHostNorDevice = true
-		}
-
-		for _, osType := range OsTypeList() {
-			if osType.Class == Host {
-				osSupport[osType.Name] = moduleSupportsHost
-			} else if osType.Class == Device {
-				osSupport[osType.Name] = moduleSupportsDevice
-			}
-		}
-	}
-
-	if neitherHostNorDevice {
-		// we can't build this, disable
-		enabledProperty.Value = proptools.BoolPtr(false)
-	} else if mod.commonProperties.Enabled != nil {
-		enabledProperty.SetValue(mod.commonProperties.Enabled)
-		if !*mod.commonProperties.Enabled {
-			for oss, enabled := range osSupport {
-				if val := enabledProperty.SelectValue(bazel.OsConfigurationAxis, oss); enabled && val != nil && *val {
-					// if this should be disabled by default, clear out any enabling we've done
-					enabledProperty.SetSelectValue(bazel.OsConfigurationAxis, oss, nil)
-				}
-			}
-		}
-	}
-
-	attrs.Applicable_licenses = bazel.MakeLabelListAttribute(BazelLabelForModuleDeps(ctx, mod.commonProperties.Licenses))
-
-	requiredWithoutCycles := attrs.getRequiredWithoutCycles(ctx, &mod.commonProperties)
-	required := depsToLabelList(requiredWithoutCycles)
-	archVariantProps := mod.GetArchVariantProperties(ctx, &commonProperties{})
-	for axis, configToProps := range archVariantProps {
-		for config, _props := range configToProps {
-			if archProps, ok := _props.(*commonProperties); ok {
-				requiredWithoutCycles := attrs.getRequiredWithoutCycles(ctx, archProps)
-				required.SetSelectValue(axis, config, depsToLabelList(requiredWithoutCycles).Value)
-				if !neitherHostNorDevice {
-					if archProps.Enabled != nil {
-						if axis != bazel.OsConfigurationAxis || osSupport[config] {
-							enabledProperty.SetSelectValue(axis, config, archProps.Enabled)
-						}
-					}
-				}
-			}
-		}
-	}
-
-	if !neitherHostNorDevice {
-		if enabledPropertyOverrides.Value != nil {
-			enabledProperty.Value = enabledPropertyOverrides.Value
-		}
-		for _, axis := range enabledPropertyOverrides.SortedConfigurationAxes() {
-			configToBools := enabledPropertyOverrides.ConfigurableValues[axis]
-			for cfg, val := range configToBools {
-				if axis != bazel.OsConfigurationAxis || osSupport[cfg] || val /*If enabled is explicitly requested via overrides */ {
-					enabledProperty.SetSelectValue(axis, cfg, &val)
-				}
-			}
-		}
-	}
-
-	productConfigEnabledAttribute := bazel.LabelListAttribute{}
-	// TODO(b/234497586): Soong config variables and product variables have different overriding behavior, we
-	// should handle it correctly
-	if !proptools.BoolDefault(enabledProperty.Value, true) && !neitherHostNorDevice {
-		// If the module is not enabled by default, then we can check if a
-		// product variable enables it
-		productConfigEnabledAttribute = productVariableConfigEnableAttribute(ctx)
-
-		if len(productConfigEnabledAttribute.ConfigurableValues) > 0 {
-			// In this case, an existing product variable configuration overrides any
-			// module-level `enable: false` definition
-			newValue := true
-			enabledProperty.Value = &newValue
-		}
-	}
-
-	platformEnabledAttribute, err := enabledProperty.ToLabelListAttribute(
-		bazel.LabelList{[]bazel.Label{{Label: "@platforms//:incompatible"}}, nil},
-		bazel.LabelList{[]bazel.Label{}, nil})
-	if err != nil {
-		ctx.ModuleErrorf("Error processing platform enabled attribute: %s", err)
-	}
-
-	// if android is the only arch/os enabled, then add a restriction to only be compatible with android
-	if platformEnabledAttribute.IsNil() && onlyAndroid {
-		l := bazel.LabelAttribute{}
-		l.SetValue(bazel.Label{Label: bazel.OsConfigurationAxis.SelectKey(Android.Name)})
-		platformEnabledAttribute.Add(&l)
-	}
-
-	attrs.Data.Append(required)
-
-	// SkipData is not an attribute of any Bazel target
-	// Set this to nil so that it does not appear in the generated build file
-	attrs.SkipData = nil
-
-	moduleEnableConstraints := bazel.LabelListAttribute{}
-	moduleEnableConstraints.Append(platformEnabledAttribute)
-	moduleEnableConstraints.Append(productConfigEnabledAttribute)
-	addCompatibilityConstraintForCompileMultilib(ctx, &moduleEnableConstraints)
-
-	return constraintAttributes{Target_compatible_with: moduleEnableConstraints}
-}
-
-var (
-	incompatible = bazel.LabelList{[]bazel.Label{{Label: "@platforms//:incompatible"}}, nil}
-)
-
-// If compile_mulitilib is set to
-// 1. 32: Add an incompatibility constraint for non-32 arches
-// 1. 64: Add an incompatibility constraint for non-64 arches
-func addCompatibilityConstraintForCompileMultilib(ctx *bottomUpMutatorContext, enabled *bazel.LabelListAttribute) {
-	mod := ctx.Module().base()
-	multilib, _ := decodeMultilib(mod, mod.commonProperties.CompileOS, ctx.Config().IgnorePrefer32OnDevice())
-
-	switch multilib {
-	case "32":
-		// Add an incompatibility constraint for all known 64-bit arches
-		enabled.SetSelectValue(bazel.ArchConfigurationAxis, "arm64", incompatible)
-		enabled.SetSelectValue(bazel.ArchConfigurationAxis, "x86_64", incompatible)
-		enabled.SetSelectValue(bazel.ArchConfigurationAxis, "riscv64", incompatible)
-	case "64":
-		// Add an incompatibility constraint for all known 32-bit arches
-		enabled.SetSelectValue(bazel.ArchConfigurationAxis, "arm", incompatible)
-		enabled.SetSelectValue(bazel.ArchConfigurationAxis, "x86", incompatible)
-	case "both":
-		// Do nothing: "both" is trivially compatible with 32-bit and 64-bit
-		// The top level rule (e.g. apex/partition) will be responsible for building this module in both variants via an
-		// outgoing_transition.
-	default: // e.g. first, common
-		// TODO - b/299135307: Add bp2build support for these properties.
-	}
-
-}
-
-// Check product variables for `enabled: true` flag override.
-// Returns a list of the constraint_value targets who enable this override.
-func productVariableConfigEnableAttribute(ctx *bottomUpMutatorContext) bazel.LabelListAttribute {
-	result := bazel.LabelListAttribute{}
-	productVariableProps, errs := ProductVariableProperties(ctx, ctx.Module())
-	for _, err := range errs {
-		ctx.ModuleErrorf("ProductVariableProperties error: %s", err)
-	}
-	if productConfigProps, exists := productVariableProps["Enabled"]; exists {
-		for productConfigProp, prop := range productConfigProps {
-			flag, ok := prop.(*bool)
-			if !ok {
-				ctx.ModuleErrorf("Could not convert product variable enabled property")
-			}
-
-			if flag == nil {
-				// soong config var is not used to set `enabled`. nothing to do.
-				continue
-			} else if *flag {
-				axis := productConfigProp.ConfigurationAxis()
-				result.SetSelectValue(axis, bazel.ConditionsDefaultConfigKey, bazel.MakeLabelList([]bazel.Label{{Label: "@platforms//:incompatible"}}))
-				result.SetSelectValue(axis, productConfigProp.SelectKey(), bazel.LabelList{Includes: []bazel.Label{}})
-			} else if scp, isSoongConfigProperty := productConfigProp.(SoongConfigProperty); isSoongConfigProperty && scp.value == bazel.ConditionsDefaultConfigKey {
-				// productVariableConfigEnableAttribute runs only if `enabled: false` is set at the top-level outside soong_config_variables
-				// conditions_default { enabled: false} is a no-op in this case
-				continue
-			} else {
-				// TODO(b/210546943): handle negative case where `enabled: false`
-				ctx.ModuleErrorf("`enabled: false` is not currently supported for configuration variables. See b/210546943")
-			}
-		}
-	}
-
-	return result
-}
-
 // A ModuleBase object contains the properties that are common to all Android
 // modules.  It should be included as an anonymous field in every module
 // struct definition.  InitAndroidModule should then be called from the module's
@@ -1115,6 +838,7 @@
 	// to Make to convert to ninja rules so that Make can add additional dependencies.
 	katiInstalls katiInstalls
 	katiSymlinks katiInstalls
+	testData     []DataPath
 
 	// The files to copy to the dist as explicitly specified in the .bp file.
 	distFiles TaggedDistFiles
@@ -1145,81 +869,6 @@
 	licenseMetadataFile WritablePath
 }
 
-// A struct containing all relevant information about a Bazel target converted via bp2build.
-type bp2buildInfo struct {
-	Dir             string
-	BazelProps      bazel.BazelTargetModuleProperties
-	CommonAttrs     CommonAttributes
-	ConstraintAttrs constraintAttributes
-	Attrs           interface{}
-}
-
-// TargetName returns the Bazel target name of a bp2build converted target.
-func (b bp2buildInfo) TargetName() string {
-	return b.CommonAttrs.Name
-}
-
-// TargetPackage returns the Bazel package of a bp2build converted target.
-func (b bp2buildInfo) TargetPackage() string {
-	return b.Dir
-}
-
-// BazelRuleClass returns the Bazel rule class of a bp2build converted target.
-func (b bp2buildInfo) BazelRuleClass() string {
-	return b.BazelProps.Rule_class
-}
-
-// BazelRuleLoadLocation returns the location of the  Bazel rule of a bp2build converted target.
-// This may be empty as native Bazel rules do not need to be loaded.
-func (b bp2buildInfo) BazelRuleLoadLocation() string {
-	return b.BazelProps.Bzl_load_location
-}
-
-// BazelAttributes returns the Bazel attributes of a bp2build converted target.
-func (b bp2buildInfo) BazelAttributes() []interface{} {
-	return []interface{}{&b.CommonAttrs, &b.ConstraintAttrs, b.Attrs}
-}
-
-func (m *ModuleBase) addBp2buildInfo(info bp2buildInfo) {
-	m.commonProperties.BazelConversionStatus.Bp2buildInfo = append(m.commonProperties.BazelConversionStatus.Bp2buildInfo, info)
-}
-
-func (m *ModuleBase) setPartitionForBp2build(partition string) {
-	m.commonProperties.BazelConversionStatus.Partition = partition
-}
-
-func (m *ModuleBase) setBp2buildUnconvertible(reasonType bp2build_metrics_proto.UnconvertedReasonType, detail string) {
-	m.commonProperties.BazelConversionStatus.UnconvertedReason = &UnconvertedReason{
-		ReasonType: int(reasonType),
-		Detail:     detail,
-	}
-}
-
-func (m *ModuleBase) GetUnconvertedReason() *UnconvertedReason {
-	return m.commonProperties.BazelConversionStatus.UnconvertedReason
-}
-
-// Bp2buildTargets returns the Bazel targets bp2build generated for this module.
-func (m *ModuleBase) Bp2buildTargets() []bp2buildInfo {
-	return m.commonProperties.BazelConversionStatus.Bp2buildInfo
-}
-
-// Bp2buildTargets returns the Bazel targets bp2build generated for this module.
-func (m *ModuleBase) GetPartitionForBp2build() string {
-	return m.commonProperties.BazelConversionStatus.Partition
-}
-
-// GetUnconvertedBp2buildDeps returns the list of module names of this module's direct dependencies that
-// were not converted to Bazel.
-func (m *ModuleBase) GetUnconvertedBp2buildDeps() []string {
-	return FirstUniqueStrings(m.commonProperties.BazelConversionStatus.UnconvertedDeps)
-}
-
-// GetMissingBp2buildDeps returns the list of module names that were not found in Android.bp files.
-func (m *ModuleBase) GetMissingBp2buildDeps() []string {
-	return FirstUniqueStrings(m.commonProperties.BazelConversionStatus.MissingDeps)
-}
-
 func (m *ModuleBase) AddJSONData(d *map[string]interface{}) {
 	(*d)["Android"] = map[string]interface{}{
 		// Properties set in Blueprint or in blueprint of a defaults modules
@@ -2030,11 +1679,7 @@
 			return
 		}
 
-		if mixedBuildMod, handled := m.isHandledByBazel(ctx); handled {
-			mixedBuildMod.ProcessBazelQueryResponse(ctx)
-		} else {
-			m.module.GenerateAndroidBuildActions(ctx)
-		}
+		m.module.GenerateAndroidBuildActions(ctx)
 		if ctx.Failed() {
 			return
 		}
@@ -2065,6 +1710,7 @@
 		m.packagingSpecs = append(m.packagingSpecs, ctx.packagingSpecs...)
 		m.katiInstalls = append(m.katiInstalls, ctx.katiInstalls...)
 		m.katiSymlinks = append(m.katiSymlinks, ctx.katiSymlinks...)
+		m.testData = append(m.testData, ctx.testData...)
 	} else if ctx.Config().AllowMissingDependencies() {
 		// If the module is not enabled it will not create any build rules, nothing will call
 		// ctx.GetMissingDependencies(), and blueprint will consider the missing dependencies to be unhandled
@@ -2090,15 +1736,6 @@
 	m.variables = ctx.variables
 }
 
-func (m *ModuleBase) isHandledByBazel(ctx ModuleContext) (MixedBuildBuildable, bool) {
-	if mixedBuildMod, ok := m.module.(MixedBuildBuildable); ok {
-		if mixedBuildMod.IsMixedBuildSupported(ctx) && (MixedBuildsEnabled(ctx) == MixedBuildEnabled) {
-			return mixedBuildMod, true
-		}
-	}
-	return nil, false
-}
-
 // Check the supplied dist structure to make sure that it is valid.
 //
 // property - the base property, e.g. dist or dists[1], which is combined with the
@@ -2191,6 +1828,18 @@
 	return proptools.Bool(m.commonProperties.Native_bridge_supported)
 }
 
+// ModuleNameWithPossibleOverride returns the name of the OverrideModule that overrides the current
+// variant of this OverridableModule, or ctx.ModuleName() if this module is not an OverridableModule
+// or if this variant is not overridden.
+func ModuleNameWithPossibleOverride(ctx BaseModuleContext) string {
+	if overridable, ok := ctx.Module().(OverridableModule); ok {
+		if o := overridable.GetOverriddenBy(); o != "" {
+			return o
+		}
+	}
+	return ctx.ModuleName()
+}
+
 // SrcIsModule decodes module references in the format ":unqualified-name" or "//namespace:name"
 // into the module name, or empty string if the input was not a module reference.
 func SrcIsModule(s string) (module string) {
@@ -2613,36 +2262,3 @@
 	WriteFileRule(ctx, outFile, string(j))
 	ctx.Phony("soong_config_trace", outFile)
 }
-
-// Interface implemented by xsd_config which has 1:many mappings in bp2build workspace
-// This interface exists because we want to
-// 1. Determine the name of the additional targets generated by the primary soong module
-// 2. Enable distinguishing an xsd_config module from other Soong modules using type assertion
-type XsdConfigBp2buildTargets interface {
-	CppBp2buildTargetName() string
-	JavaBp2buildTargetName() string
-}
-
-// XsdModuleToTargetName is a function that takes an XsdConfigBp2buildTarget
-type XsdModuleToTargetName func(xsd XsdConfigBp2buildTargets) string
-
-// XsdLabelMapper returns a bazel.LabelMapper for partitioning XSD sources/headers given an
-// XsdModuleToTargetName function.
-func XsdLabelMapper(targetName XsdModuleToTargetName) bazel.LabelMapper {
-	return func(ctx bazel.OtherModuleContext, label bazel.Label) (string, bool) {
-		mod, exists := ctx.ModuleFromName(label.OriginalModuleName)
-		if !exists {
-			return label.Label, false
-		}
-		xsdMod, isXsd := mod.(XsdConfigBp2buildTargets)
-		if !isXsd {
-			return label.Label, false
-		}
-
-		// Remove the base module name
-		ret := strings.TrimSuffix(label.Label, mod.Name())
-		// Append the language specific target name
-		ret += targetName(xsdMod)
-		return ret, true
-	}
-}
diff --git a/android/module_context.go b/android/module_context.go
index a0a4104..39986df 100644
--- a/android/module_context.go
+++ b/android/module_context.go
@@ -153,6 +153,15 @@
 	// for which IsInstallDepNeeded returns true.
 	InstallAbsoluteSymlink(installPath InstallPath, name string, absPath string) InstallPath
 
+	// InstallTestData creates rules to install test data (e.g. data files used during a test) into
+	// the installPath directory.
+	//
+	// The installed files will be returned by FilesToInstall(), and the PackagingSpec for the
+	// installed files will be returned by PackagingSpecs() on this module or by
+	// TransitivePackagingSpecs() on modules that depend on this module through dependency tags
+	// for which IsInstallDepNeeded returns true.
+	InstallTestData(installPath InstallPath, data []DataPath) InstallPaths
+
 	// PackageFile creates a PackagingSpec as if InstallFile was called, but without creating
 	// the rule to copy the file.  This is useful to define how a module would be packaged
 	// without installing it into the global installation directories.
@@ -213,6 +222,8 @@
 	katiInstalls []katiInstall
 	katiSymlinks []katiInstall
 
+	testData []DataPath
+
 	// For tests
 	buildParams []BuildParams
 	ruleParams  map[blueprint.Rule]blueprint.RuleParams
@@ -452,17 +463,17 @@
 
 func (m *moduleContext) InstallFile(installPath InstallPath, name string, srcPath Path,
 	deps ...InstallPath) InstallPath {
-	return m.installFile(installPath, name, srcPath, deps, false, nil)
+	return m.installFile(installPath, name, srcPath, deps, false, true, nil)
 }
 
 func (m *moduleContext) InstallExecutable(installPath InstallPath, name string, srcPath Path,
 	deps ...InstallPath) InstallPath {
-	return m.installFile(installPath, name, srcPath, deps, true, nil)
+	return m.installFile(installPath, name, srcPath, deps, true, true, nil)
 }
 
 func (m *moduleContext) InstallFileWithExtraFilesZip(installPath InstallPath, name string, srcPath Path,
 	extraZip Path, deps ...InstallPath) InstallPath {
-	return m.installFile(installPath, name, srcPath, deps, false, &extraFilesZip{
+	return m.installFile(installPath, name, srcPath, deps, false, true, &extraFilesZip{
 		zip: extraZip,
 		dir: installPath,
 	})
@@ -488,10 +499,12 @@
 }
 
 func (m *moduleContext) installFile(installPath InstallPath, name string, srcPath Path, deps []InstallPath,
-	executable bool, extraZip *extraFilesZip) InstallPath {
+	executable bool, hooks bool, extraZip *extraFilesZip) InstallPath {
 
 	fullInstallPath := installPath.Join(m, name)
-	m.module.base().hooks.runInstallHooks(m, srcPath, fullInstallPath, false)
+	if hooks {
+		m.module.base().hooks.runInstallHooks(m, srcPath, fullInstallPath, false)
+	}
 
 	if !m.skipInstall() {
 		deps = append(deps, InstallPaths(m.module.base().installFilesDepSet.ToList())...)
@@ -647,6 +660,19 @@
 	return fullInstallPath
 }
 
+func (m *moduleContext) InstallTestData(installPath InstallPath, data []DataPath) InstallPaths {
+	m.testData = append(m.testData, data...)
+
+	ret := make(InstallPaths, 0, len(data))
+	for _, d := range data {
+		relPath := d.ToRelativeInstallPath()
+		installed := m.installFile(installPath, relPath, d.SrcPath, nil, false, false, nil)
+		ret = append(ret, installed)
+	}
+
+	return ret
+}
+
 func (m *moduleContext) CheckbuildFile(srcPath Path) {
 	m.checkbuildFiles = append(m.checkbuildFiles, srcPath)
 }
diff --git a/android/mutator.go b/android/mutator.go
index 3ff9e61..0d391a4 100644
--- a/android/mutator.go
+++ b/android/mutator.go
@@ -15,11 +15,6 @@
 package android
 
 import (
-	"path/filepath"
-
-	"android/soong/bazel"
-	"android/soong/ui/metrics/bp2build_metrics_proto"
-
 	"github.com/google/blueprint"
 )
 
@@ -32,40 +27,9 @@
 //   run FinalDeps mutators (CreateVariations disallowed in this phase)
 //   continue on to GenerateAndroidBuildActions
 
-// RegisterMutatorsForBazelConversion is a alternate registration pipeline for bp2build. Exported for testing.
-func RegisterMutatorsForBazelConversion(ctx *Context, preArchMutators []RegisterMutatorFunc) {
-	bp2buildMutators := append(preArchMutators, registerBp2buildConversionMutator)
-	registerMutatorsForBazelConversion(ctx, bp2buildMutators)
-}
-
-func registerMutatorsForBazelConversion(ctx *Context, bp2buildMutators []RegisterMutatorFunc) {
-	mctx := &registerMutatorsContext{
-		bazelConversionMode: true,
-	}
-
-	allMutators := append([]RegisterMutatorFunc{
-		RegisterNamespaceMutator,
-		RegisterDefaultsPreArchMutators,
-		// TODO(b/165114590): this is required to resolve deps that are only prebuilts, but we should
-		// evaluate the impact on conversion.
-		RegisterPrebuiltsPreArchMutators,
-		RegisterPrebuiltsPostDepsMutators,
-	},
-		bp2buildMutators...)
-
-	// Register bp2build mutators
-	for _, f := range allMutators {
-		f(mctx)
-	}
-
-	mctx.mutators.registerAll(ctx)
-}
-
 // collateGloballyRegisteredMutators constructs the list of mutators that have been registered
 // with the InitRegistrationContext and will be used at runtime.
 func collateGloballyRegisteredMutators() sortableComponents {
-	// ensure mixed builds mutator is the last mutator
-	finalDeps = append(finalDeps, registerMixedBuildsMutator)
 	return collateRegisteredMutators(preArch, preDeps, postDeps, finalDeps)
 }
 
@@ -94,9 +58,8 @@
 }
 
 type registerMutatorsContext struct {
-	mutators            sortableComponents
-	finalPhase          bool
-	bazelConversionMode bool
+	mutators   sortableComponents
+	finalPhase bool
 }
 
 type RegisterMutatorsContext interface {
@@ -219,58 +182,6 @@
 	finalDeps = append(finalDeps, f)
 }
 
-var bp2buildPreArchMutators = []RegisterMutatorFunc{}
-
-// A minimal context for Bp2build conversion
-type Bp2buildMutatorContext interface {
-	BazelConversionPathContext
-	BaseMutatorContext
-
-	// AddDependency adds a dependency to the given module.  It returns a slice of modules for each
-	// dependency (some entries may be nil).
-	//
-	// If the mutator is parallel (see MutatorHandle.Parallel), this method will pause until the
-	// new dependencies have had the current mutator called on them.  If the mutator is not
-	// parallel this method does not affect the ordering of the current mutator pass, but will
-	// be ordered correctly for all future mutator passes.
-	AddDependency(module blueprint.Module, tag blueprint.DependencyTag, name ...string) []blueprint.Module
-
-	// CreateBazelTargetModule creates a BazelTargetModule by calling the
-	// factory method, just like in CreateModule, but also requires
-	// BazelTargetModuleProperties containing additional metadata for the
-	// bp2build codegenerator.
-	CreateBazelTargetModule(bazel.BazelTargetModuleProperties, CommonAttributes, interface{})
-
-	// CreateBazelTargetModuleWithRestrictions creates a BazelTargetModule by calling the
-	// factory method, just like in CreateModule, but also requires
-	// BazelTargetModuleProperties containing additional metadata for the
-	// bp2build codegenerator. The generated target is restricted to only be buildable for certain
-	// platforms, as dictated by a given bool attribute: the target will not be buildable in
-	// any platform for which this bool attribute is false.
-	CreateBazelTargetModuleWithRestrictions(bazel.BazelTargetModuleProperties, CommonAttributes, interface{}, bazel.BoolAttribute)
-
-	// MarkBp2buildUnconvertible registers the current module as "unconvertible to bp2build" for the
-	// given reason.
-	MarkBp2buildUnconvertible(reasonType bp2build_metrics_proto.UnconvertedReasonType, detail string)
-
-	// CreateBazelTargetAliasInDir creates an alias definition in `dir` directory.
-	// This function can be used to create alias definitions in a directory that is different
-	// from the directory of the visited Soong module.
-	CreateBazelTargetAliasInDir(dir string, name string, actual bazel.Label)
-
-	// CreateBazelConfigSetting creates a config_setting in <dir>/BUILD.bazel
-	// build/bazel has several static config_setting(s) that are used in Bazel builds.
-	// This function can be used to createa additional config_setting(s) based on the build graph
-	// (e.g. a config_setting specific to an apex variant)
-	CreateBazelConfigSetting(csa bazel.ConfigSettingAttributes, ca CommonAttributes, dir string)
-}
-
-// PreArchBp2BuildMutators adds mutators to be register for converting Android Blueprint modules
-// into Bazel BUILD targets that should run prior to deps and conversion.
-func PreArchBp2BuildMutators(f RegisterMutatorFunc) {
-	bp2buildPreArchMutators = append(bp2buildPreArchMutators, f)
-}
-
 type BaseMutatorContext interface {
 	BaseModuleContext
 
@@ -301,7 +212,15 @@
 
 type BottomUpMutatorContext interface {
 	BaseMutatorContext
-	Bp2buildMutatorContext
+
+	// AddDependency adds a dependency to the given module.  It returns a slice of modules for each
+	// dependency (some entries may be nil).
+	//
+	// If the mutator is parallel (see MutatorHandle.Parallel), this method will pause until the
+	// new dependencies have had the current mutator called on them.  If the mutator is not
+	// parallel this method does not affect the ordering of the current mutator pass, but will
+	// be ordered correctly for all future mutator passes.
+	AddDependency(module blueprint.Module, tag blueprint.DependencyTag, name ...string) []blueprint.Module
 
 	// AddReverseDependency adds a dependency from the destination to the given module.
 	// Does not affect the ordering of the current mutator pass, but will be ordered
@@ -416,10 +335,9 @@
 }
 
 func bottomUpMutatorContextFactory(ctx blueprint.BottomUpMutatorContext, a Module,
-	finalPhase, bazelConversionMode bool) BottomUpMutatorContext {
+	finalPhase bool) BottomUpMutatorContext {
 
 	moduleContext := a.base().baseModuleContextFactory(ctx)
-	moduleContext.bazelConversionMode = bazelConversionMode
 
 	return &bottomUpMutatorContext{
 		bp:                ctx,
@@ -430,10 +348,9 @@
 
 func (x *registerMutatorsContext) BottomUp(name string, m BottomUpMutator) MutatorHandle {
 	finalPhase := x.finalPhase
-	bazelConversionMode := x.bazelConversionMode
 	f := func(ctx blueprint.BottomUpMutatorContext) {
 		if a, ok := ctx.Module().(Module); ok {
-			m(bottomUpMutatorContextFactory(ctx, a, finalPhase, bazelConversionMode))
+			m(bottomUpMutatorContextFactory(ctx, a, finalPhase))
 		}
 	}
 	mutator := &mutator{name: x.mutatorName(name), bottomUpMutator: f}
@@ -550,15 +467,13 @@
 }
 
 type androidTransitionMutator struct {
-	finalPhase          bool
-	bazelConversionMode bool
-	mutator             TransitionMutator
+	finalPhase bool
+	mutator    TransitionMutator
 }
 
 func (a *androidTransitionMutator) Split(ctx blueprint.BaseModuleContext) []string {
 	if m, ok := ctx.Module().(Module); ok {
 		moduleContext := m.base().baseModuleContextFactory(ctx)
-		moduleContext.bazelConversionMode = a.bazelConversionMode
 		return a.mutator.Split(&moduleContext)
 	} else {
 		return []string{""}
@@ -607,15 +522,14 @@
 
 func (a *androidTransitionMutator) Mutate(ctx blueprint.BottomUpMutatorContext, variation string) {
 	if am, ok := ctx.Module().(Module); ok {
-		a.mutator.Mutate(bottomUpMutatorContextFactory(ctx, am, a.finalPhase, a.bazelConversionMode), variation)
+		a.mutator.Mutate(bottomUpMutatorContextFactory(ctx, am, a.finalPhase), variation)
 	}
 }
 
 func (x *registerMutatorsContext) Transition(name string, m TransitionMutator) {
 	atm := &androidTransitionMutator{
-		finalPhase:          x.finalPhase,
-		bazelConversionMode: x.bazelConversionMode,
-		mutator:             m,
+		finalPhase: x.finalPhase,
+		mutator:    m,
 	}
 	mutator := &mutator{
 		name:              name,
@@ -624,9 +538,6 @@
 }
 
 func (x *registerMutatorsContext) mutatorName(name string) string {
-	if x.bazelConversionMode {
-		return name + "_bp2build"
-	}
 	return name
 }
 
@@ -634,7 +545,6 @@
 	f := func(ctx blueprint.TopDownMutatorContext) {
 		if a, ok := ctx.Module().(Module); ok {
 			moduleContext := a.base().baseModuleContextFactory(ctx)
-			moduleContext.bazelConversionMode = x.bazelConversionMode
 			actx := &topDownMutatorContext{
 				bp:                ctx,
 				baseModuleContext: moduleContext,
@@ -698,179 +608,6 @@
 	ctx.BottomUp("deps", depsMutator).Parallel()
 }
 
-func (t *bottomUpMutatorContext) CreateBazelTargetModule(
-	bazelProps bazel.BazelTargetModuleProperties,
-	commonAttrs CommonAttributes,
-	attrs interface{}) {
-	t.createBazelTargetModule(bazelProps, commonAttrs, attrs, bazel.BoolAttribute{})
-}
-
-func (t *bottomUpMutatorContext) CreateBazelTargetModuleWithRestrictions(
-	bazelProps bazel.BazelTargetModuleProperties,
-	commonAttrs CommonAttributes,
-	attrs interface{},
-	enabledProperty bazel.BoolAttribute) {
-	t.createBazelTargetModule(bazelProps, commonAttrs, attrs, enabledProperty)
-}
-
-func (t *bottomUpMutatorContext) MarkBp2buildUnconvertible(
-	reasonType bp2build_metrics_proto.UnconvertedReasonType, detail string) {
-	mod := t.Module()
-	mod.base().setBp2buildUnconvertible(reasonType, detail)
-}
-
-var (
-	bazelAliasModuleProperties = bazel.BazelTargetModuleProperties{
-		Rule_class: "alias",
-	}
-)
-
-type bazelAliasAttributes struct {
-	Actual *bazel.LabelAttribute
-}
-
-func (t *bottomUpMutatorContext) CreateBazelTargetAliasInDir(
-	dir string,
-	name string,
-	actual bazel.Label) {
-	mod := t.Module()
-	attrs := &bazelAliasAttributes{
-		Actual: bazel.MakeLabelAttribute(actual.Label),
-	}
-	info := bp2buildInfo{
-		Dir:             dir,
-		BazelProps:      bazelAliasModuleProperties,
-		CommonAttrs:     CommonAttributes{Name: name},
-		ConstraintAttrs: constraintAttributes{},
-		Attrs:           attrs,
-	}
-	mod.base().addBp2buildInfo(info)
-}
-
-// Returns the directory in which the bazel target will be generated
-// If ca.Dir is not nil, use that
-// Otherwise default to the directory of the soong module
-func dirForBazelTargetGeneration(t *bottomUpMutatorContext, ca *CommonAttributes) string {
-	dir := t.OtherModuleDir(t.Module())
-	if ca.Dir != nil {
-		dir = *ca.Dir
-		// Restrict its use to dirs that contain an Android.bp file.
-		// There are several places in bp2build where we use the existence of Android.bp/BUILD on the filesystem
-		// to curate a compatible label for src files (e.g. headers for cc).
-		// If we arbritrarily create BUILD files, then it might render those curated labels incompatible.
-		if exists, _, _ := t.Config().fs.Exists(filepath.Join(dir, "Android.bp")); !exists {
-			t.ModuleErrorf("Cannot use ca.Dir to create a BazelTarget in dir: %v since it does not contain an Android.bp file", dir)
-		}
-
-		// Set ca.Dir to nil so that it does not get emitted to the BUILD files
-		ca.Dir = nil
-	}
-	return dir
-}
-
-func (t *bottomUpMutatorContext) CreateBazelConfigSetting(
-	csa bazel.ConfigSettingAttributes,
-	ca CommonAttributes,
-	dir string) {
-	mod := t.Module()
-	info := bp2buildInfo{
-		Dir: dir,
-		BazelProps: bazel.BazelTargetModuleProperties{
-			Rule_class: "config_setting",
-		},
-		CommonAttrs:     ca,
-		ConstraintAttrs: constraintAttributes{},
-		Attrs:           &csa,
-	}
-	mod.base().addBp2buildInfo(info)
-}
-
-// ApexAvailableTags converts the apex_available property value of an ApexModule
-// module and returns it as a list of keyed tags.
-func ApexAvailableTags(mod Module) bazel.StringListAttribute {
-	attr := bazel.StringListAttribute{}
-	// Transform specific attributes into tags.
-	if am, ok := mod.(ApexModule); ok {
-		// TODO(b/218841706): hidl_interface has the apex_available prop, but it's
-		// defined directly as a prop and not via ApexModule, so this doesn't
-		// pick those props up.
-		apexAvailable := am.apexModuleBase().ApexAvailable()
-		// If a user does not specify apex_available in Android.bp, then soong provides a default.
-		// To avoid verbosity of BUILD files, remove this default from user-facing BUILD files.
-		if len(am.apexModuleBase().ApexProperties.Apex_available) == 0 {
-			apexAvailable = []string{}
-		}
-		attr.Value = ConvertApexAvailableToTags(apexAvailable)
-	}
-	return attr
-}
-
-func ApexAvailableTagsWithoutTestApexes(ctx BaseModuleContext, mod Module) bazel.StringListAttribute {
-	attr := bazel.StringListAttribute{}
-	if am, ok := mod.(ApexModule); ok {
-		apexAvailableWithoutTestApexes := removeTestApexes(ctx, am.apexModuleBase().ApexAvailable())
-		// If a user does not specify apex_available in Android.bp, then soong provides a default.
-		// To avoid verbosity of BUILD files, remove this default from user-facing BUILD files.
-		if len(am.apexModuleBase().ApexProperties.Apex_available) == 0 {
-			apexAvailableWithoutTestApexes = []string{}
-		}
-		attr.Value = ConvertApexAvailableToTags(apexAvailableWithoutTestApexes)
-	}
-	return attr
-}
-
-func removeTestApexes(ctx BaseModuleContext, apex_available []string) []string {
-	testApexes := []string{}
-	for _, aa := range apex_available {
-		// ignore the wildcards
-		if InList(aa, AvailableToRecognziedWildcards) {
-			continue
-		}
-		mod, _ := ctx.ModuleFromName(aa)
-		if apex, ok := mod.(ApexTestInterface); ok && apex.IsTestApex() {
-			testApexes = append(testApexes, aa)
-		}
-	}
-	return RemoveListFromList(CopyOf(apex_available), testApexes)
-}
-
-func ConvertApexAvailableToTags(apexAvailable []string) []string {
-	if len(apexAvailable) == 0 {
-		// We need nil specifically to make bp2build not add the tags property at all,
-		// instead of adding it with an empty list
-		return nil
-	}
-	result := make([]string, 0, len(apexAvailable))
-	for _, a := range apexAvailable {
-		result = append(result, "apex_available="+a)
-	}
-	return result
-}
-
-// ConvertApexAvailableToTagsWithoutTestApexes converts a list of apex names to a list of bazel tags
-// This function drops any test apexes from the input.
-func ConvertApexAvailableToTagsWithoutTestApexes(ctx BaseModuleContext, apexAvailable []string) []string {
-	noTestApexes := removeTestApexes(ctx, apexAvailable)
-	return ConvertApexAvailableToTags(noTestApexes)
-}
-
-func (t *bottomUpMutatorContext) createBazelTargetModule(
-	bazelProps bazel.BazelTargetModuleProperties,
-	commonAttrs CommonAttributes,
-	attrs interface{},
-	enabledProperty bazel.BoolAttribute) {
-	constraintAttributes := commonAttrs.fillCommonBp2BuildModuleAttrs(t, enabledProperty)
-	mod := t.Module()
-	info := bp2buildInfo{
-		Dir:             dirForBazelTargetGeneration(t, &commonAttrs),
-		BazelProps:      bazelProps,
-		CommonAttrs:     commonAttrs,
-		ConstraintAttrs: constraintAttributes,
-		Attrs:           attrs,
-	}
-	mod.base().addBp2buildInfo(info)
-}
-
 // android.topDownMutatorContext either has to embed blueprint.TopDownMutatorContext, in which case every method that
 // has an overridden version in android.BaseModuleContext has to be manually forwarded to BaseModuleContext to avoid
 // ambiguous method errors, or it has to store a blueprint.TopDownMutatorContext non-embedded, in which case every
diff --git a/android/mutator_test.go b/android/mutator_test.go
index dbdfa33..21eebd2 100644
--- a/android/mutator_test.go
+++ b/android/mutator_test.go
@@ -16,7 +16,6 @@
 
 import (
 	"fmt"
-	"reflect"
 	"strings"
 	"testing"
 
@@ -268,22 +267,3 @@
 		FixtureWithRootAndroidBp(`test {name: "foo"}`),
 	).RunTest(t)
 }
-
-func TestConvertApexAvailableToTags(t *testing.T) {
-	input := []string{
-		"com.android.adbd",
-		"//apex_available:platform",
-	}
-	actual := ConvertApexAvailableToTags(input)
-	expected := []string{
-		"apex_available=com.android.adbd",
-		"apex_available=//apex_available:platform",
-	}
-	if !reflect.DeepEqual(actual, expected) {
-		t.Errorf("Expected: %v, actual: %v", expected, actual)
-	}
-
-	if ConvertApexAvailableToTags(nil) != nil {
-		t.Errorf("Expected providing nil to return nil")
-	}
-}
diff --git a/android/override_module.go b/android/override_module.go
index 9e0de6f..1341f53 100644
--- a/android/override_module.go
+++ b/android/override_module.go
@@ -214,17 +214,6 @@
 	}
 	b.overridableModuleProperties.OverriddenBy = o.Name()
 	b.overridableModuleProperties.OverriddenByModuleDir = o.ModuleDir()
-
-	if oBazelable, ok := o.base().module.(Bazelable); ok {
-		if bBazelable, ok := m.(Bazelable); ok {
-			oProps := oBazelable.bazelProps()
-			bProps := bBazelable.bazelProps()
-			bProps.Bazel_module.Bp2build_available = oProps.Bazel_module.Bp2build_available
-			bProps.Bazel_module.Label = oProps.Bazel_module.Label
-		} else {
-			ctx.ModuleErrorf("Override type cannot be Bazelable if original module type is not Bazelable %v %v.", o.Name(), m.Name())
-		}
-	}
 }
 
 // GetOverriddenBy returns the name of the override module that has overridden this module.
@@ -348,31 +337,3 @@
 		}
 	}
 }
-
-// ModuleNameWithPossibleOverride returns the name of the OverrideModule that overrides the current
-// variant of this OverridableModule, or ctx.ModuleName() if this module is not an OverridableModule
-// or if this variant is not overridden.
-func ModuleNameWithPossibleOverride(ctx BazelConversionContext) string {
-	return moduleNameWithPossibleOverride(ctx, ctx.Module(), ctx.OtherModuleName(ctx.Module()))
-}
-
-func moduleNameWithPossibleOverride(ctx shouldConvertModuleContext, module blueprint.Module, name string) string {
-	if overridable, ok := module.(OverridableModule); ok {
-		if o := overridable.GetOverriddenBy(); o != "" {
-			return o
-		}
-	}
-	return name
-}
-
-// moduleDirWithPossibleOverride returns the dir of the OverrideModule that overrides the current
-// variant of the given OverridableModule, or ctx.OtherModuleName() if the module is not an
-// OverridableModule or if the variant is not overridden.
-func moduleDirWithPossibleOverride(ctx shouldConvertModuleContext, module blueprint.Module, dir string) string {
-	if overridable, ok := module.(OverridableModule); ok {
-		if o := overridable.GetOverriddenByModuleDir(); o != "" {
-			return o
-		}
-	}
-	return dir
-}
diff --git a/android/package.go b/android/package.go
index ce0b150..878e4c4 100644
--- a/android/package.go
+++ b/android/package.go
@@ -15,9 +15,6 @@
 package android
 
 import (
-	"path/filepath"
-
-	"android/soong/bazel"
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/proptools"
 )
@@ -40,52 +37,12 @@
 	Default_applicable_licenses []string
 }
 
-type bazelPackageAttributes struct {
-	Default_visibility       []string
-	Default_package_metadata bazel.LabelListAttribute
-}
-
 type packageModule struct {
 	ModuleBase
-	BazelModuleBase
 
 	properties packageProperties
 }
 
-var _ Bazelable = &packageModule{}
-
-func (p *packageModule) ConvertWithBp2build(ctx Bp2buildMutatorContext) {
-	defaultPackageMetadata := bazel.MakeLabelListAttribute(BazelLabelForModuleDeps(ctx, p.properties.Default_applicable_licenses))
-	// If METADATA file exists in the package, add it to package(default_package_metadata=) using a
-	// filegroup(name="default_metadata_file") which can be accessed later on each module in Bazel
-	// using attribute "applicable_licenses".
-	// Attribute applicable_licenses of filegroup "default_metadata_file" has to be set to [],
-	// otherwise Bazel reports cyclic reference error.
-	if existed, _, _ := ctx.Config().fs.Exists(filepath.Join(ctx.ModuleDir(), "METADATA")); existed {
-		ctx.CreateBazelTargetModule(
-			bazel.BazelTargetModuleProperties{
-				Rule_class: "filegroup",
-			},
-			CommonAttributes{Name: "default_metadata_file"},
-			&bazelFilegroupAttributes{
-				Srcs:                bazel.MakeLabelListAttribute(BazelLabelForModuleSrc(ctx, []string{"METADATA"})),
-				Applicable_licenses: bazel.LabelListAttribute{Value: bazel.LabelList{Includes: []bazel.Label{}}, EmitEmptyList: true},
-			})
-		defaultPackageMetadata.Value.Add(&bazel.Label{Label: ":default_metadata_file"})
-	}
-
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class: "package",
-		},
-		CommonAttributes{},
-		&bazelPackageAttributes{
-			Default_package_metadata: defaultPackageMetadata,
-			// FIXME(asmundak): once b/221436821 is resolved
-			Default_visibility: []string{"//visibility:public"},
-		})
-}
-
 func (p *packageModule) GenerateAndroidBuildActions(ModuleContext) {
 	// Nothing to do.
 }
@@ -102,7 +59,7 @@
 func PackageFactory() Module {
 	module := &packageModule{}
 
-	module.AddProperties(&module.properties, &module.commonProperties.BazelConversionStatus)
+	module.AddProperties(&module.properties)
 
 	// The name is the relative path from build root to the directory containing this
 	// module. Set that name at the earliest possible moment that information is available
@@ -119,7 +76,5 @@
 	// its checking and parsing phases so make it the primary licenses property.
 	setPrimaryLicensesProperty(module, "default_applicable_licenses", &module.properties.Default_applicable_licenses)
 
-	InitBazelModule(module)
-
 	return module
 }
diff --git a/android/paths.go b/android/paths.go
index 37504b6..3f35449 100644
--- a/android/paths.go
+++ b/android/paths.go
@@ -2208,10 +2208,15 @@
 	SrcPath Path
 	// The install path of the data file, relative to the install root.
 	RelativeInstallPath string
+	// If WithoutRel is true, use SrcPath.Base() instead of SrcPath.Rel() as the filename.
+	WithoutRel bool
 }
 
 func (d *DataPath) ToRelativeInstallPath() string {
 	relPath := d.SrcPath.Rel()
+	if d.WithoutRel {
+		relPath = d.SrcPath.Base()
+	}
 	if d.RelativeInstallPath != "" {
 		relPath = filepath.Join(d.RelativeInstallPath, relPath)
 	}
diff --git a/android/prebuilt.go b/android/prebuilt.go
index 91c0aa1..a32a37d 100644
--- a/android/prebuilt.go
+++ b/android/prebuilt.go
@@ -461,10 +461,6 @@
 		// Propagate the provider received from `all_apex_contributions`
 		// to the source module
 		ctx.VisitDirectDepsWithTag(acDepTag, func(am Module) {
-			if ctx.Config().Bp2buildMode() {
-				// This provider key is not applicable in bp2build
-				return
-			}
 			psi := ctx.OtherModuleProvider(am, PrebuiltSelectionInfoProvider).(PrebuiltSelectionInfoMap)
 			ctx.SetProvider(PrebuiltSelectionInfoProvider, psi)
 		})
@@ -570,55 +566,20 @@
 	// fall back to the existing source vs prebuilt selection.
 	// TODO: Drop the fallback mechanisms
 
-	if !ctx.Config().Bp2buildMode() {
-		if p.srcsSupplier != nil && len(p.srcsSupplier(ctx, prebuilt)) == 0 {
-			return false
-		}
+	if p.srcsSupplier != nil && len(p.srcsSupplier(ctx, prebuilt)) == 0 {
+		return false
+	}
 
-		// Skip prebuilt modules under unexported namespaces so that we won't
-		// end up shadowing non-prebuilt module when prebuilt module under same
-		// name happens to have a `Prefer` property set to true.
-		if ctx.Config().KatiEnabled() && !prebuilt.ExportedToMake() {
-			return false
-		}
+	// Skip prebuilt modules under unexported namespaces so that we won't
+	// end up shadowing non-prebuilt module when prebuilt module under same
+	// name happens to have a `Prefer` property set to true.
+	if ctx.Config().KatiEnabled() && !prebuilt.ExportedToMake() {
+		return false
 	}
 
 	// If source is not available or is disabled then always use the prebuilt.
 	if source == nil || !source.Enabled() {
-		// If in bp2build mode, we need to check product variables & Soong config variables, which may
-		// have overridden the "enabled" property but have not been merged into the property value as
-		// they would in a non-bp2build mode invocation
-		if ctx.Config().Bp2buildMode() && source != nil {
-			productVariableProps, errs := ProductVariableProperties(ctx, source)
-			if productConfigProps, exists := productVariableProps["Enabled"]; len(errs) == 0 && exists && len(productConfigProps) == 1 {
-				var prop ProductConfigOrSoongConfigProperty
-				var value bool
-				for p, v := range productConfigProps {
-					prop = p
-					actual, ok := v.(*bool)
-					if ok {
-						value = proptools.Bool(actual)
-					}
-				}
-				if scv, ok := prop.(SoongConfigProperty); ok {
-					// If the product config var is enabled but the value of enabled is false still, the
-					// prebuilt is preferred. Otherwise, check if the prebulit is explicitly preferred
-					if ctx.Config().VendorConfig(scv.namespace).Bool(strings.ToLower(scv.name)) && !value {
-						return true
-					}
-				} else {
-					// TODO: b/300998219 - handle product vars
-					// We don't handle product variables yet, so return based on the non-product specific
-					// value of enabled
-					return true
-				}
-			} else {
-				// No "enabled" property override, return true since this module isn't enabled
-				return true
-			}
-		} else {
-			return true
-		}
+		return true
 	}
 
 	// If the use_source_config_var property is set then it overrides the prefer property setting.
diff --git a/android/proto.go b/android/proto.go
index c449a87..0d8e097 100644
--- a/android/proto.go
+++ b/android/proto.go
@@ -15,11 +15,7 @@
 package android
 
 import (
-	"path/filepath"
 	"strings"
-	"sync"
-
-	"android/soong/bazel"
 
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/proptools"
@@ -154,278 +150,3 @@
 	rule.Command().
 		BuiltTool("dep_fixer").Flag(depFile.String())
 }
-
-// Bp2buildProtoInfo contains information necessary to pass on to language specific conversion.
-type Bp2buildProtoInfo struct {
-	Type                  *string
-	Proto_libs            bazel.LabelList
-	Transitive_proto_libs bazel.LabelList
-}
-
-type ProtoAttrs struct {
-	Srcs                bazel.LabelListAttribute
-	Import_prefix       *string
-	Strip_import_prefix *string
-	Deps                bazel.LabelListAttribute
-}
-
-// For each package in the include_dirs property a proto_library target should
-// be added to the BUILD file in that package and a mapping should be added here
-var includeDirsToProtoDeps = map[string]string{
-	"external/protobuf/src": "//external/protobuf:libprotobuf-proto",
-}
-
-// Partitions srcs by the pkg it is in
-// srcs has been created using `TransformSubpackagePaths`
-// This function uses existence of Android.bp/BUILD files to create a label that is compatible with the package structure of bp2build workspace
-func partitionSrcsByPackage(currentDir string, srcs bazel.LabelList) map[string]bazel.LabelList {
-	getPackageFromLabel := func(label string) string {
-		// Remove any preceding //
-		label = strings.TrimPrefix(label, "//")
-		split := strings.Split(label, ":")
-		if len(split) == 1 {
-			// e.g. foo.proto
-			return currentDir
-		} else if split[0] == "" {
-			// e.g. :foo.proto
-			return currentDir
-		} else {
-			return split[0]
-		}
-	}
-
-	pkgToSrcs := map[string]bazel.LabelList{}
-	for _, src := range srcs.Includes {
-		pkg := getPackageFromLabel(src.Label)
-		list := pkgToSrcs[pkg]
-		list.Add(&src)
-		pkgToSrcs[pkg] = list
-	}
-	return pkgToSrcs
-}
-
-// Bp2buildProtoProperties converts proto properties, creating a proto_library and returning the
-// information necessary for language-specific handling.
-func Bp2buildProtoProperties(ctx Bp2buildMutatorContext, m *ModuleBase, srcs bazel.LabelListAttribute) (Bp2buildProtoInfo, bool) {
-	var info Bp2buildProtoInfo
-	if srcs.IsEmpty() {
-		return info, false
-	}
-
-	var protoLibraries bazel.LabelList
-	var transitiveProtoLibraries bazel.LabelList
-	var directProtoSrcs bazel.LabelList
-
-	// For filegroups that should be converted to proto_library just collect the
-	// labels of converted proto_library targets.
-	for _, protoSrc := range srcs.Value.Includes {
-		src := protoSrc.OriginalModuleName
-		if fg, ok := ToFileGroupAsLibrary(ctx, src); ok &&
-			fg.ShouldConvertToProtoLibrary(ctx) {
-			protoLibraries.Add(&bazel.Label{
-				Label: fg.GetProtoLibraryLabel(ctx),
-			})
-		} else {
-			directProtoSrcs.Add(&protoSrc)
-		}
-	}
-
-	name := m.Name() + "_proto"
-
-	depsFromFilegroup := protoLibraries
-	var canonicalPathFromRoot bool
-
-	if len(directProtoSrcs.Includes) > 0 {
-		pkgToSrcs := partitionSrcsByPackage(ctx.ModuleDir(), directProtoSrcs)
-		protoIncludeDirs := []string{}
-		for _, pkg := range SortedStringKeys(pkgToSrcs) {
-			srcs := pkgToSrcs[pkg]
-			attrs := ProtoAttrs{
-				Srcs: bazel.MakeLabelListAttribute(srcs),
-			}
-			attrs.Deps.Append(bazel.MakeLabelListAttribute(depsFromFilegroup))
-
-			for axis, configToProps := range m.GetArchVariantProperties(ctx, &ProtoProperties{}) {
-				for _, rawProps := range configToProps {
-					var props *ProtoProperties
-					var ok bool
-					if props, ok = rawProps.(*ProtoProperties); !ok {
-						ctx.ModuleErrorf("Could not cast ProtoProperties to expected type")
-					}
-					if axis == bazel.NoConfigAxis {
-						info.Type = props.Proto.Type
-
-						canonicalPathFromRoot = proptools.BoolDefault(props.Proto.Canonical_path_from_root, canonicalPathFromRootDefault)
-						if !canonicalPathFromRoot {
-							// an empty string indicates to strips the package path
-							path := ""
-							attrs.Strip_import_prefix = &path
-						}
-
-						for _, dir := range props.Proto.Include_dirs {
-							if dep, ok := includeDirsToProtoDeps[dir]; ok {
-								attrs.Deps.Add(bazel.MakeLabelAttribute(dep))
-							} else {
-								protoIncludeDirs = append(protoIncludeDirs, dir)
-							}
-						}
-
-						// proto.local_include_dirs are similar to proto.include_dirs, except that it is relative to the module directory
-						for _, dir := range props.Proto.Local_include_dirs {
-							relativeToTop := pathForModuleSrc(ctx, dir).String()
-							protoIncludeDirs = append(protoIncludeDirs, relativeToTop)
-						}
-
-					} else if props.Proto.Type != info.Type && props.Proto.Type != nil {
-						ctx.ModuleErrorf("Cannot handle arch-variant types for protos at this time.")
-					}
-				}
-			}
-
-			if p, ok := m.module.(PkgPathInterface); ok && p.PkgPath(ctx) != nil {
-				// python_library with pkg_path
-				// proto_library for this module should have the pkg_path as the import_prefix
-				attrs.Import_prefix = p.PkgPath(ctx)
-				attrs.Strip_import_prefix = proptools.StringPtr("")
-			}
-
-			tags := ApexAvailableTagsWithoutTestApexes(ctx, ctx.Module())
-
-			moduleDir := ctx.ModuleDir()
-			if !canonicalPathFromRoot {
-				// Since we are creating the proto_library in a subpackage, set the import_prefix relative to the current package
-				if rel, err := filepath.Rel(moduleDir, pkg); err != nil {
-					ctx.ModuleErrorf("Could not get relative path for %v %v", pkg, err)
-				} else if rel != "." {
-					attrs.Import_prefix = &rel
-				}
-			}
-
-			// TODO - b/246997908: Handle potential orphaned proto_library targets
-			// To create proto_library targets in the same package, we split the .proto files
-			// This means that if a proto_library in a subpackage imports another proto_library from the parent package
-			// (or a different subpackage), it will not find it.
-			// The CcProtoGen action itself runs fine because we construct the correct ProtoInfo,
-			// but the FileDescriptorSet of each proto_library might not be compile-able
-			//
-			// Add manual tag if either
-			// 1. .proto files are in more than one package
-			// 2. proto.include_dirs is not empty
-			if len(SortedStringKeys(pkgToSrcs)) > 1 || len(protoIncludeDirs) > 0 {
-				tags.Append(bazel.MakeStringListAttribute([]string{"manual"}))
-			}
-
-			ctx.CreateBazelTargetModule(
-				bazel.BazelTargetModuleProperties{Rule_class: "proto_library"},
-				CommonAttributes{Name: name, Dir: proptools.StringPtr(pkg), Tags: tags},
-				&attrs,
-			)
-
-			l := ""
-			if pkg == moduleDir { // same package that the original module lives in
-				l = ":" + name
-			} else {
-				l = "//" + pkg + ":" + name
-			}
-			protoLibraries.Add(&bazel.Label{
-				Label: l,
-			})
-		}
-		// Partitioning by packages can create dupes of protoIncludeDirs, so dedupe it first.
-		protoLibrariesInIncludeDir := createProtoLibraryTargetsForIncludeDirs(ctx, SortedUniqueStrings(protoIncludeDirs))
-		transitiveProtoLibraries.Append(protoLibrariesInIncludeDir)
-	}
-
-	info.Proto_libs = protoLibraries
-	info.Transitive_proto_libs = transitiveProtoLibraries
-
-	return info, true
-}
-
-// PkgPathInterface is used as a type assertion in bp2build to get pkg_path property of python_library_host
-type PkgPathInterface interface {
-	PkgPath(ctx BazelConversionContext) *string
-}
-
-var (
-	protoIncludeDirGeneratedSuffix = ".include_dir_bp2build_generated_proto"
-	protoIncludeDirsBp2buildKey    = NewOnceKey("protoIncludeDirsBp2build")
-)
-
-func getProtoIncludeDirsBp2build(config Config) *sync.Map {
-	return config.Once(protoIncludeDirsBp2buildKey, func() interface{} {
-		return &sync.Map{}
-	}).(*sync.Map)
-}
-
-// key for dynamically creating proto_library per proto.include_dirs
-type protoIncludeDirKey struct {
-	dir            string
-	subpackgeInDir string
-}
-
-// createProtoLibraryTargetsForIncludeDirs creates additional proto_library targets for .proto files in includeDirs
-// Since Bazel imposes a constratint that the proto_library must be in the same package as the .proto file, this function
-// might create the targets in a subdirectory of `includeDir`
-// Returns the labels of the proto_library targets
-func createProtoLibraryTargetsForIncludeDirs(ctx Bp2buildMutatorContext, includeDirs []string) bazel.LabelList {
-	var ret bazel.LabelList
-	for _, dir := range includeDirs {
-		if exists, _, _ := ctx.Config().fs.Exists(filepath.Join(dir, "Android.bp")); !exists {
-			ctx.ModuleErrorf("TODO: Add support for proto.include_dir: %v. This directory does not contain an Android.bp file", dir)
-		}
-		dirMap := getProtoIncludeDirsBp2build(ctx.Config())
-		// Find all proto file targets in this dir
-		protoLabelsInDir := BazelLabelForSrcPatternExcludes(ctx, dir, "**/*.proto", []string{})
-		// Partition the labels by package and subpackage(s)
-		protoLabelelsPartitionedByPkg := partitionSrcsByPackage(dir, protoLabelsInDir)
-		for _, pkg := range SortedStringKeys(protoLabelelsPartitionedByPkg) {
-			label := strings.ReplaceAll(dir, "/", ".") + protoIncludeDirGeneratedSuffix
-			ret.Add(&bazel.Label{
-				Label: "//" + pkg + ":" + label,
-			})
-			key := protoIncludeDirKey{dir: dir, subpackgeInDir: pkg}
-			if _, exists := dirMap.LoadOrStore(key, true); exists {
-				// A proto_library has already been created for this package relative to this include dir
-				continue
-			}
-			srcs := protoLabelelsPartitionedByPkg[pkg]
-			rel, err := filepath.Rel(dir, pkg)
-			if err != nil {
-				ctx.ModuleErrorf("Could not create a proto_library in pkg %v due to %v\n", pkg, err)
-			}
-			// Create proto_library
-			attrs := ProtoAttrs{
-				Srcs:                bazel.MakeLabelListAttribute(srcs),
-				Strip_import_prefix: proptools.StringPtr(""),
-			}
-			if rel != "." {
-				attrs.Import_prefix = proptools.StringPtr(rel)
-			}
-
-			// If a specific directory is listed in proto.include_dirs of two separate modules (one host-specific and another device-specific),
-			// we do not want to create the proto_library with target_compatible_with of the first visited of these two modules
-			// As a workarounds, delete `target_compatible_with`
-			alwaysEnabled := bazel.BoolAttribute{}
-			alwaysEnabled.Value = proptools.BoolPtr(true)
-			// Add android and linux explicitly so that fillcommonbp2buildmoduleattrs can override these configs
-			// When we extend b support for other os'es (darwin/windows), we should add those configs here as well
-			alwaysEnabled.SetSelectValue(bazel.OsConfigurationAxis, bazel.OsAndroid, proptools.BoolPtr(true))
-			alwaysEnabled.SetSelectValue(bazel.OsConfigurationAxis, bazel.OsLinux, proptools.BoolPtr(true))
-
-			ctx.CreateBazelTargetModuleWithRestrictions(
-				bazel.BazelTargetModuleProperties{Rule_class: "proto_library"},
-				CommonAttributes{
-					Name: label,
-					Dir:  proptools.StringPtr(pkg),
-					// This proto_library is used to construct a ProtoInfo
-					// But it might not be buildable on its own
-					Tags: bazel.MakeStringListAttribute([]string{"manual"}),
-				},
-				&attrs,
-				alwaysEnabled,
-			)
-		}
-	}
-	return ret
-}
diff --git a/android/register.go b/android/register.go
index de31353..cd968cd 100644
--- a/android/register.go
+++ b/android/register.go
@@ -15,15 +15,9 @@
 package android
 
 import (
-	"bufio"
 	"fmt"
-	"path/filepath"
-	"reflect"
-	"regexp"
-
-	"android/soong/shared"
-
 	"github.com/google/blueprint"
+	"reflect"
 )
 
 // A sortable component is one whose registration order affects the order in which it is executed
@@ -166,75 +160,6 @@
 	return ctx
 }
 
-// Helper function to register the module types used in bp2build.
-func registerModuleTypes(ctx *Context) {
-	for _, t := range moduleTypes {
-		t.register(ctx)
-	}
-	// Required for SingletonModule types, even though we are not using them.
-	for _, t := range singletons {
-		t.register(ctx)
-	}
-}
-
-// RegisterForBazelConversion registers an alternate shadow pipeline of
-// singletons, module types and mutators to register for converting Blueprint
-// files to semantically equivalent BUILD files.
-func (ctx *Context) RegisterForBazelConversion() {
-	registerModuleTypes(ctx)
-	RegisterMutatorsForBazelConversion(ctx, bp2buildPreArchMutators)
-}
-
-// RegisterExistingBazelTargets reads Bazel BUILD.bazel and BUILD files under
-// the workspace, and returns a map containing names of Bazel targets defined in
-// these BUILD files.
-// For example, maps "//foo/bar" to ["baz", "qux"] if `//foo/bar:{baz,qux}` exist.
-func (c *Context) RegisterExistingBazelTargets(topDir string, existingBazelFiles []string) error {
-	result := map[string][]string{}
-
-	// Search for instances of `name = "$NAME"` (with arbitrary spacing).
-	targetNameRegex := regexp.MustCompile(`(?m)^\s*name\s*=\s*\"([^\"]+)\"`)
-
-	parseBuildFile := func(path string) error {
-		fullPath := shared.JoinPath(topDir, path)
-		sourceDir := filepath.Dir(path)
-
-		fileInfo, err := c.Config().fs.Stat(fullPath)
-		if err != nil {
-			return fmt.Errorf("Error accessing Bazel file '%s': %s", path, err)
-		}
-		if !fileInfo.IsDir() &&
-			(fileInfo.Name() == "BUILD" || fileInfo.Name() == "BUILD.bazel") {
-			f, err := c.Config().fs.Open(fullPath)
-			if err != nil {
-				return fmt.Errorf("Error reading Bazel file '%s': %s", path, err)
-			}
-			defer f.Close()
-			scanner := bufio.NewScanner(f)
-			for scanner.Scan() {
-				line := scanner.Text()
-				matches := targetNameRegex.FindAllStringSubmatch(line, -1)
-				for _, match := range matches {
-					result[sourceDir] = append(result[sourceDir], match[1])
-				}
-			}
-		}
-		return nil
-	}
-
-	for _, path := range existingBazelFiles {
-		if !c.Config().Bp2buildPackageConfig.ShouldKeepExistingBuildFileForDir(filepath.Dir(path)) {
-			continue
-		}
-		err := parseBuildFile(path)
-		if err != nil {
-			return err
-		}
-	}
-	c.Config().SetBazelBuildFileTargets(result)
-	return nil
-}
-
 // Register the pipeline of singletons, module types, and mutators for
 // generating build.ninja and other files for Kati, from Android.bp files.
 func (ctx *Context) Register() {
@@ -260,8 +185,6 @@
 func collateGloballyRegisteredSingletons() sortableComponents {
 	allSingletons := append(sortableComponents(nil), singletons...)
 	allSingletons = append(allSingletons,
-		singleton{parallel: true, name: "bazeldeps", factory: BazelSingleton},
-
 		// Register phony just before makevars so it can write out its phony rules as Make rules
 		singleton{parallel: false, name: "phony", factory: phonySingletonFactory},
 
diff --git a/android/rule_builder.go b/android/rule_builder.go
index 5c6dffe..1a491f7 100644
--- a/android/rule_builder.go
+++ b/android/rule_builder.go
@@ -1341,9 +1341,9 @@
 
 // RuleBuilderSboxProtoForTests takes the BuildParams for the manifest passed to RuleBuilder.Sbox()
 // and returns sbox testproto generated by the RuleBuilder.
-func RuleBuilderSboxProtoForTests(t *testing.T, params TestingBuildParams) *sbox_proto.Manifest {
+func RuleBuilderSboxProtoForTests(t *testing.T, ctx *TestContext, params TestingBuildParams) *sbox_proto.Manifest {
 	t.Helper()
-	content := ContentFromFileRuleForTests(t, params)
+	content := ContentFromFileRuleForTests(t, ctx, params)
 	manifest := sbox_proto.Manifest{}
 	err := prototext.Unmarshal([]byte(content), &manifest)
 	if err != nil {
diff --git a/android/rule_builder_test.go b/android/rule_builder_test.go
index a6b3a27..63c3527 100644
--- a/android/rule_builder_test.go
+++ b/android/rule_builder_test.go
@@ -683,7 +683,7 @@
 			t.Errorf("want Deps = %q, got %q", blueprint.DepsGCC, params.Deps)
 		}
 
-		rspFile2Content := ContentFromFileRuleForTests(t, rspFile2Params)
+		rspFile2Content := ContentFromFileRuleForTests(t, result.TestContext, rspFile2Params)
 		AssertStringEquals(t, "rspFile2 content", "rsp_in2\n", rspFile2Content)
 	}
 
@@ -797,7 +797,7 @@
 		t.Run(test.name, func(t *testing.T) {
 			t.Run("sbox", func(t *testing.T) {
 				gen := result.ModuleForTests(test.name+"_sbox", "")
-				manifest := RuleBuilderSboxProtoForTests(t, gen.Output("sbox.textproto"))
+				manifest := RuleBuilderSboxProtoForTests(t, result.TestContext, gen.Output("sbox.textproto"))
 				hash := manifest.Commands[0].GetInputHash()
 
 				AssertStringEquals(t, "hash", test.expectedHash, hash)
diff --git a/android/soong_config_modules.go b/android/soong_config_modules.go
index 0246a08..ec0edfd 100644
--- a/android/soong_config_modules.go
+++ b/android/soong_config_modules.go
@@ -187,7 +187,6 @@
 
 type soongConfigModuleTypeModule struct {
 	ModuleBase
-	BazelModuleBase
 	properties soongconfig.ModuleTypeProperties
 }
 
@@ -395,10 +394,6 @@
 			return (map[string]blueprint.ModuleFactory)(nil)
 		}
 
-		if ctx.Config().BuildMode == Bp2build {
-			ctx.Config().Bp2buildSoongConfigDefinitions.AddVars(mtDef)
-		}
-
 		globalModuleTypes := ctx.moduleFactories()
 
 		factories := make(map[string]blueprint.ModuleFactory)
@@ -406,7 +401,7 @@
 		for name, moduleType := range mtDef.ModuleTypes {
 			factory := globalModuleTypes[moduleType.BaseModuleType]
 			if factory != nil {
-				factories[name] = configModuleFactory(factory, moduleType, ctx.Config().BuildMode == Bp2build)
+				factories[name] = configModuleFactory(factory, moduleType)
 			} else {
 				reportErrors(ctx, from,
 					fmt.Errorf("missing global module type factory for %q", moduleType.BaseModuleType))
@@ -474,7 +469,7 @@
 
 // configModuleFactory takes an existing soongConfigModuleFactory and a
 // ModuleType to create a new ModuleFactory that uses a custom loadhook.
-func configModuleFactory(factory blueprint.ModuleFactory, moduleType *soongconfig.ModuleType, bp2build bool) blueprint.ModuleFactory {
+func configModuleFactory(factory blueprint.ModuleFactory, moduleType *soongconfig.ModuleType) blueprint.ModuleFactory {
 	// Defer creation of conditional properties struct until the first call from the factory
 	// method. That avoids having to make a special call to the factory to create the properties
 	// structs from which the conditional properties struct is created. This is needed in order to
@@ -515,40 +510,22 @@
 		conditionalProps := proptools.CloneEmptyProperties(conditionalFactoryProps)
 		props = append(props, conditionalProps.Interface())
 
-		if bp2build {
-			// The loadhook is different for bp2build, since we don't want to set a specific
-			// set of property values based on a vendor var -- we want __all of them__ to
-			// generate select statements, so we put the entire soong_config_variables
-			// struct, together with the namespace representing those variables, while
-			// creating the custom module with the factory.
-			AddLoadHook(module, func(ctx LoadHookContext) {
-				if m, ok := module.(Bazelable); ok {
-					m.SetBaseModuleType(moduleType.BaseModuleType)
-					// Instead of applying all properties, keep the entire conditionalProps struct as
-					// part of the custom module so dependent modules can create the selects accordingly
-					m.setNamespacedVariableProps(namespacedVariableProperties{
-						moduleType.ConfigNamespace: []interface{}{conditionalProps.Interface()},
-					})
-				}
-			})
-		} else {
-			// Regular Soong operation wraps the existing module factory with a
-			// conditional on Soong config variables by reading the product
-			// config variables from Make.
-			AddLoadHook(module, func(ctx LoadHookContext) {
-				tracingConfig := newTracingConfig(ctx.Config().VendorConfig(moduleType.ConfigNamespace))
-				newProps, err := soongconfig.PropertiesToApply(moduleType, conditionalProps, tracingConfig)
-				if err != nil {
-					ctx.ModuleErrorf("%s", err)
-					return
-				}
-				for _, ps := range newProps {
-					ctx.AppendProperties(ps)
-				}
+		// Regular Soong operation wraps the existing module factory with a
+		// conditional on Soong config variables by reading the product
+		// config variables from Make.
+		AddLoadHook(module, func(ctx LoadHookContext) {
+			tracingConfig := newTracingConfig(ctx.Config().VendorConfig(moduleType.ConfigNamespace))
+			newProps, err := soongconfig.PropertiesToApply(moduleType, conditionalProps, tracingConfig)
+			if err != nil {
+				ctx.ModuleErrorf("%s", err)
+				return
+			}
+			for _, ps := range newProps {
+				ctx.AppendProperties(ps)
+			}
 
-				module.(Module).base().commonProperties.SoongConfigTrace = tracingConfig.getTrace()
-			})
-		}
+			module.(Module).base().commonProperties.SoongConfigTrace = tracingConfig.getTrace()
+		})
 		return module, props
 	}
 }
diff --git a/android/test_config.go b/android/test_config.go
index 2a59d92..9e1ac70 100644
--- a/android/test_config.go
+++ b/android/test_config.go
@@ -61,11 +61,7 @@
 		// passed to PathForSource or PathForModuleSrc.
 		TestAllowNonExistentPaths: true,
 
-		BazelContext:              noopBazelContext{},
-		BuildMode:                 BazelProdMode,
-		mixedBuildDisabledModules: make(map[string]struct{}),
-		mixedBuildEnabledModules:  make(map[string]struct{}),
-		bazelForceEnabledModules:  make(map[string]struct{}),
+		BuildMode: AnalysisNoBazel,
 	}
 	config.deviceConfig = &deviceConfig{
 		config: config,
diff --git a/android/testing.go b/android/testing.go
index da3b75a..fa4dffd 100644
--- a/android/testing.go
+++ b/android/testing.go
@@ -219,10 +219,6 @@
 	ctx.finalDeps = append(ctx.finalDeps, f)
 }
 
-func (ctx *TestContext) RegisterBp2BuildConfig(config Bp2BuildConversionAllowlist) {
-	ctx.config.Bp2buildPackageConfig = config
-}
-
 // PreArchBp2BuildMutators adds mutators to be register for converting Android Blueprint modules
 // into Bazel BUILD targets that should run prior to deps and conversion.
 func (ctx *TestContext) PreArchBp2BuildMutators(f RegisterMutatorFunc) {
@@ -449,12 +445,6 @@
 	ctx.singletonOrder = componentsToNames(singletons)
 }
 
-// RegisterForBazelConversion prepares a test context for bp2build conversion.
-func (ctx *TestContext) RegisterForBazelConversion() {
-	ctx.config.BuildMode = Bp2build
-	RegisterMutatorsForBazelConversion(ctx.Context, ctx.bp2buildPreArch)
-}
-
 func (ctx *TestContext) ParseFileList(rootDir string, filePaths []string) (deps []string, errs []error) {
 	// This function adapts the old style ParseFileList calls that are spread throughout the tests
 	// to the new style that takes a config.
@@ -1293,3 +1283,10 @@
 func StringsRelativeToTop(config Config, command []string) []string {
 	return normalizeStringArrayRelativeToTop(config, command)
 }
+
+func EnsureListContainsSuffix(t *testing.T, result []string, expected string) {
+	t.Helper()
+	if !SuffixInList(result, expected) {
+		t.Errorf("%q is not found in %v", expected, result)
+	}
+}
diff --git a/android/util.go b/android/util.go
index f687bca..ae1c657 100644
--- a/android/util.go
+++ b/android/util.go
@@ -591,3 +591,9 @@
 	}
 	return "", false
 }
+
+func AddToStringSet(set map[string]bool, items []string) {
+	for _, item := range items {
+		set[item] = true
+	}
+}
diff --git a/android/variable.go b/android/variable.go
index 307deaf..fa4cfc1 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -20,7 +20,6 @@
 	"runtime"
 	"strings"
 
-	"android/soong/android/soongconfig"
 	"android/soong/bazel"
 
 	"github.com/google/blueprint/proptools"
@@ -224,7 +223,9 @@
 	DeviceCurrentApiLevelForVendorModules *string  `json:",omitempty"`
 	DeviceSystemSdkVersions               []string `json:",omitempty"`
 	DeviceMaxPageSizeSupported            *string  `json:",omitempty"`
-	DevicePageSizeAgnostic                *bool    `json:",omitempty"`
+	DeviceNoBionicPageSizeMacro           *bool    `json:",omitempty"`
+
+	VendorApiLevel *string `json:",omitempty"`
 
 	RecoverySnapshotVersion *string `json:",omitempty"`
 
@@ -580,20 +581,20 @@
 		Platform_version_all_preview_codenames: []string{"S"},
 		Platform_vndk_version:                  stringPtr("S"),
 
-		HostArch:                   stringPtr("x86_64"),
-		HostSecondaryArch:          stringPtr("x86"),
-		DeviceName:                 stringPtr("generic_arm64"),
-		DeviceProduct:              stringPtr("aosp_arm-eng"),
-		DeviceArch:                 stringPtr("arm64"),
-		DeviceArchVariant:          stringPtr("armv8-a"),
-		DeviceCpuVariant:           stringPtr("generic"),
-		DeviceAbi:                  []string{"arm64-v8a"},
-		DeviceSecondaryArch:        stringPtr("arm"),
-		DeviceSecondaryArchVariant: stringPtr("armv8-a"),
-		DeviceSecondaryCpuVariant:  stringPtr("generic"),
-		DeviceSecondaryAbi:         []string{"armeabi-v7a", "armeabi"},
-		DeviceMaxPageSizeSupported: stringPtr("4096"),
-		DevicePageSizeAgnostic:     boolPtr(false),
+		HostArch:                    stringPtr("x86_64"),
+		HostSecondaryArch:           stringPtr("x86"),
+		DeviceName:                  stringPtr("generic_arm64"),
+		DeviceProduct:               stringPtr("aosp_arm-eng"),
+		DeviceArch:                  stringPtr("arm64"),
+		DeviceArchVariant:           stringPtr("armv8-a"),
+		DeviceCpuVariant:            stringPtr("generic"),
+		DeviceAbi:                   []string{"arm64-v8a"},
+		DeviceSecondaryArch:         stringPtr("arm"),
+		DeviceSecondaryArchVariant:  stringPtr("armv8-a"),
+		DeviceSecondaryCpuVariant:   stringPtr("generic"),
+		DeviceSecondaryAbi:          []string{"armeabi-v7a", "armeabi"},
+		DeviceMaxPageSizeSupported:  stringPtr("4096"),
+		DeviceNoBionicPageSizeMacro: boolPtr(false),
 
 		AAPTConfig:          []string{"normal", "large", "xlarge", "hdpi", "xhdpi", "xxhdpi"},
 		AAPTPreferredConfig: stringPtr("xhdpi"),
@@ -618,6 +619,14 @@
 	}
 }
 
+func (this *ProductVariables) GetBuildFlagBool(flag string) bool {
+	val, ok := this.BuildFlags[flag]
+	if !ok {
+		return false
+	}
+	return val == "true"
+}
+
 // ProductConfigContext requires the access to the Module to get product config properties.
 type ProductConfigContext interface {
 	Module() Module
@@ -736,44 +745,6 @@
 // property, like ["-DDEFINES"] for cflags.
 type ProductConfigProperties map[string]map[ProductConfigOrSoongConfigProperty]interface{}
 
-// ProductVariableProperties returns a ProductConfigProperties containing only the properties which
-// have been set for the given module.
-func ProductVariableProperties(ctx ArchVariantContext, module Module) (ProductConfigProperties, []error) {
-	var errs []error
-	moduleBase := module.base()
-
-	productConfigProperties := ProductConfigProperties{}
-
-	if moduleBase.variableProperties != nil {
-		productVariablesProperty := proptools.FieldNameForProperty("product_variables")
-		if moduleBase.ArchSpecific() {
-			for /* axis */ _, configToProps := range moduleBase.GetArchVariantProperties(ctx, moduleBase.variableProperties) {
-				for config, props := range configToProps {
-					variableValues := reflect.ValueOf(props).Elem().FieldByName(productVariablesProperty)
-					productConfigProperties.AddProductConfigProperties(variableValues, config)
-				}
-			}
-		} else {
-			variableValues := reflect.ValueOf(moduleBase.variableProperties).Elem().FieldByName(productVariablesProperty)
-			productConfigProperties.AddProductConfigProperties(variableValues, "")
-		}
-	}
-
-	if m, ok := module.(Bazelable); ok && m.namespacedVariableProps() != nil {
-		for namespace, namespacedVariableProps := range m.namespacedVariableProps() {
-			for _, namespacedVariableProp := range namespacedVariableProps {
-				variableValues := reflect.ValueOf(namespacedVariableProp).Elem().FieldByName(soongconfig.SoongConfigProperty)
-				err := productConfigProperties.AddSoongConfigProperties(namespace, variableValues)
-				if err != nil {
-					errs = append(errs, err)
-				}
-			}
-		}
-	}
-
-	return productConfigProperties, errs
-}
-
 func (p *ProductConfigProperties) AddProductConfigProperty(
 	propertyName, productVariableName, arch string, propertyValue interface{}) {
 
@@ -823,10 +794,6 @@
 	}
 }
 
-var (
-	conditionsDefaultField string = proptools.FieldNameForProperty(bazel.ConditionsDefaultConfigKey)
-)
-
 // maybeExtractConfigVarProp attempts to read this value as a config var struct
 // wrapped by interfaces and ptrs. If it's not the right type, the second return
 // value is false.
diff --git a/android_sdk/sdk_repo_host.go b/android_sdk/sdk_repo_host.go
index 7212a07..373e883 100644
--- a/android_sdk/sdk_repo_host.go
+++ b/android_sdk/sdk_repo_host.go
@@ -165,10 +165,11 @@
 				Flag(dir.Join(ctx, strip).String())
 		}
 	} else {
+		llvmObjCopy := config.ClangPath(ctx, "bin/llvm-objcopy")
 		llvmStrip := config.ClangPath(ctx, "bin/llvm-strip")
 		llvmLib := config.ClangPath(ctx, "lib/x86_64-unknown-linux-gnu/libc++.so")
 		for _, strip := range s.properties.Strip_files {
-			cmd := builder.Command().Tool(llvmStrip).ImplicitTool(llvmLib)
+			cmd := builder.Command().Tool(llvmStrip).ImplicitTool(llvmLib).ImplicitTool(llvmObjCopy)
 			if !ctx.Windows() {
 				cmd.Flag("-x")
 			}
diff --git a/apex/Android.bp b/apex/Android.bp
index 0791497..27017ae 100644
--- a/apex/Android.bp
+++ b/apex/Android.bp
@@ -8,8 +8,9 @@
     deps: [
         "blueprint",
         "soong",
+        "soong-aconfig",
+        "soong-aconfig-codegen",
         "soong-android",
-        "soong-bazel",
         "soong-bpf",
         "soong-cc",
         "soong-filesystem",
@@ -26,7 +27,6 @@
         "apex_sdk_member.go",
         "apex_singleton.go",
         "builder.go",
-        "bp2build.go",
         "deapexer.go",
         "key.go",
         "prebuilt.go",
diff --git a/apex/androidmk.go b/apex/androidmk.go
index 4e968ea..bc68ad3 100644
--- a/apex/androidmk.go
+++ b/apex/androidmk.go
@@ -139,9 +139,6 @@
 				archStr := fi.module.Target().Arch.ArchType.String()
 				fmt.Fprintln(w, "LOCAL_MODULE_TARGET_ARCH :=", archStr)
 			}
-		} else if fi.isBazelPrebuilt && fi.arch != "" {
-			// This apexFile comes from Bazel
-			fmt.Fprintln(w, "LOCAL_MODULE_TARGET_ARCH :=", fi.arch)
 		}
 		if fi.jacocoReportClassesFile != nil {
 			fmt.Fprintln(w, "LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR :=", fi.jacocoReportClassesFile.String())
@@ -185,21 +182,17 @@
 			fmt.Fprintln(w, "include $(BUILD_SYSTEM)/soong_android_app_set.mk")
 		case nativeSharedLib, nativeExecutable, nativeTest:
 			fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", fi.stem())
-			if fi.isBazelPrebuilt {
-				fmt.Fprintln(w, "LOCAL_SOONG_UNSTRIPPED_BINARY :=", fi.unstrippedBuiltFile)
-			} else {
-				if ccMod, ok := fi.module.(*cc.Module); ok {
-					if ccMod.UnstrippedOutputFile() != nil {
-						fmt.Fprintln(w, "LOCAL_SOONG_UNSTRIPPED_BINARY :=", ccMod.UnstrippedOutputFile().String())
-					}
-					ccMod.AndroidMkWriteAdditionalDependenciesForSourceAbiDiff(w)
-					if ccMod.CoverageOutputFile().Valid() {
-						fmt.Fprintln(w, "LOCAL_PREBUILT_COVERAGE_ARCHIVE :=", ccMod.CoverageOutputFile().String())
-					}
-				} else if rustMod, ok := fi.module.(*rust.Module); ok {
-					if rustMod.UnstrippedOutputFile() != nil {
-						fmt.Fprintln(w, "LOCAL_SOONG_UNSTRIPPED_BINARY :=", rustMod.UnstrippedOutputFile().String())
-					}
+			if ccMod, ok := fi.module.(*cc.Module); ok {
+				if ccMod.UnstrippedOutputFile() != nil {
+					fmt.Fprintln(w, "LOCAL_SOONG_UNSTRIPPED_BINARY :=", ccMod.UnstrippedOutputFile().String())
+				}
+				ccMod.AndroidMkWriteAdditionalDependenciesForSourceAbiDiff(w)
+				if ccMod.CoverageOutputFile().Valid() {
+					fmt.Fprintln(w, "LOCAL_PREBUILT_COVERAGE_ARCHIVE :=", ccMod.CoverageOutputFile().String())
+				}
+			} else if rustMod, ok := fi.module.(*rust.Module); ok {
+				if rustMod.UnstrippedOutputFile() != nil {
+					fmt.Fprintln(w, "LOCAL_SOONG_UNSTRIPPED_BINARY :=", rustMod.UnstrippedOutputFile().String())
 				}
 			}
 			fmt.Fprintln(w, "include $(BUILD_SYSTEM)/soong_cc_rust_prebuilt.mk")
diff --git a/apex/apex.go b/apex/apex.go
index ecc794b..38a166e 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -24,13 +24,11 @@
 	"sort"
 	"strings"
 
-	"android/soong/bazel/cquery"
-
+	"android/soong/aconfig"
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/proptools"
 
 	"android/soong/android"
-	"android/soong/bazel"
 	"android/soong/bpf"
 	"android/soong/cc"
 	prebuilt_etc "android/soong/etc"
@@ -388,7 +386,6 @@
 	android.ModuleBase
 	android.DefaultableModuleBase
 	android.OverridableModuleBase
-	android.BazelModuleBase
 	multitree.ExportableModuleBase
 
 	// Properties
@@ -482,6 +479,8 @@
 	nativeApisUsedByModuleFile   android.ModuleOutPath
 	nativeApisBackedByModuleFile android.ModuleOutPath
 	javaApisUsedByModuleFile     android.ModuleOutPath
+
+	aconfigFiles []android.Path
 }
 
 // apexFileClass represents a type of file that can be included in APEX.
@@ -544,10 +543,6 @@
 
 	multilib string
 
-	isBazelPrebuilt     bool
-	unstrippedBuiltFile android.Path
-	arch                string
-
 	// TODO(jiyong): remove this
 	module android.Module
 }
@@ -1818,119 +1813,6 @@
 	}
 }
 
-var _ android.MixedBuildBuildable = (*apexBundle)(nil)
-
-func (a *apexBundle) IsMixedBuildSupported(ctx android.BaseModuleContext) bool {
-	return true
-}
-
-func (a *apexBundle) QueueBazelCall(ctx android.BaseModuleContext) {
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(a.GetBazelLabel(ctx, a), cquery.GetApexInfo, android.GetConfigKey(ctx))
-}
-
-// GetBazelLabel returns the bazel label of this apexBundle, or the label of the
-// override_apex module overriding this apexBundle. An apexBundle can be
-// overridden by different override_apex modules (e.g. Google or Go variants),
-// which is handled by the overrides mutators.
-func (a *apexBundle) GetBazelLabel(ctx android.BazelConversionPathContext, module blueprint.Module) string {
-	return a.BazelModuleBase.GetBazelLabel(ctx, a)
-}
-
-func (a *apexBundle) ProcessBazelQueryResponse(ctx android.ModuleContext) {
-	if !a.commonBuildActions(ctx) {
-		return
-	}
-
-	a.setPayloadFsType(ctx)
-	a.setSystemLibLink(ctx)
-	a.compatSymlinks = makeCompatSymlinks(a.BaseModuleName(), ctx)
-
-	bazelCtx := ctx.Config().BazelContext
-	outputs, err := bazelCtx.GetApexInfo(a.GetBazelLabel(ctx, a), android.GetConfigKey(ctx))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-	a.installDir = android.PathForModuleInstall(ctx, "apex")
-
-	// Set the output file to .apex or .capex depending on the compression configuration.
-	a.setCompression(ctx)
-	if a.isCompressed {
-		a.outputApexFile = android.PathForBazelOutRelative(ctx, ctx.ModuleDir(), outputs.SignedCompressedOutput)
-	} else {
-		a.outputApexFile = android.PathForBazelOutRelative(ctx, ctx.ModuleDir(), outputs.SignedOutput)
-	}
-	a.outputFile = a.outputApexFile
-
-	if len(outputs.TidyFiles) > 0 {
-		tidyFiles := android.PathsForBazelOut(ctx, outputs.TidyFiles)
-		a.outputFile = android.AttachValidationActions(ctx, a.outputFile, tidyFiles)
-	}
-
-	// TODO(b/257829940): These are used by the apex_keys_text singleton; would probably be a clearer
-	// interface if these were set in a provider rather than the module itself
-	a.publicKeyFile = android.PathForBazelOut(ctx, outputs.BundleKeyInfo[0])
-	a.privateKeyFile = android.PathForBazelOut(ctx, outputs.BundleKeyInfo[1])
-	a.containerCertificateFile = android.PathForBazelOut(ctx, outputs.ContainerKeyInfo[0])
-	a.containerPrivateKeyFile = android.PathForBazelOut(ctx, outputs.ContainerKeyInfo[1])
-
-	// Ensure ApexMkInfo.install_to_system make module names are installed as
-	// part of a bundled build.
-	a.makeModulesToInstall = append(a.makeModulesToInstall, outputs.MakeModulesToInstall...)
-
-	a.bundleModuleFile = android.PathForBazelOut(ctx, outputs.BundleFile)
-	a.nativeApisUsedByModuleFile = android.ModuleOutPath(android.PathForBazelOut(ctx, outputs.SymbolsUsedByApex))
-	a.nativeApisBackedByModuleFile = android.ModuleOutPath(android.PathForBazelOut(ctx, outputs.BackingLibs))
-	// TODO(b/239084755): Generate the java api using.xml file from Bazel.
-	a.javaApisUsedByModuleFile = android.ModuleOutPath(android.PathForBazelOut(ctx, outputs.JavaSymbolsUsedByApex))
-	a.installedFilesFile = android.ModuleOutPath(android.PathForBazelOut(ctx, outputs.InstalledFiles))
-	installSuffix := imageApexSuffix
-	if a.isCompressed {
-		installSuffix = imageCapexSuffix
-	}
-	a.installedFile = ctx.InstallFile(a.installDir, a.Name()+installSuffix, a.outputFile,
-		a.compatSymlinks...)
-
-	// filesInfo in mixed mode must retrieve all information about the apex's
-	// contents completely from the Starlark providers. It should never rely on
-	// Android.bp information, as they might not exist for fully migrated
-	// dependencies.
-	//
-	// Prevent accidental writes to filesInfo in the earlier parts Soong by
-	// asserting it to be nil.
-	if a.filesInfo != nil {
-		panic(
-			fmt.Errorf("internal error: filesInfo must be nil for an apex handled by Bazel. " +
-				"Did something else set filesInfo before this line of code?"))
-	}
-	for _, f := range outputs.PayloadFilesInfo {
-		fileInfo := apexFile{
-			isBazelPrebuilt: true,
-
-			builtFile:           android.PathForBazelOut(ctx, f["built_file"]),
-			unstrippedBuiltFile: android.PathForBazelOut(ctx, f["unstripped_built_file"]),
-			androidMkModuleName: f["make_module_name"],
-			installDir:          f["install_dir"],
-			class:               classes[f["class"]],
-			customStem:          f["basename"],
-			moduleDir:           f["package"],
-		}
-
-		arch := f["arch"]
-		fileInfo.arch = arch
-		if len(arch) > 0 {
-			fileInfo.multilib = "lib32"
-			if strings.HasSuffix(arch, "64") {
-				fileInfo.multilib = "lib64"
-			}
-		}
-
-		a.filesInfo = append(a.filesInfo, fileInfo)
-	}
-	a.apexKeysPath = writeApexKeys(ctx, a)
-}
-
 func (a *apexBundle) setCompression(ctx android.ModuleContext) {
 	if a.testOnlyShouldForceCompression() {
 		a.isCompressed = true
@@ -2008,6 +1890,8 @@
 
 	// visitor skips these from this list of module names
 	unwantedTransitiveDeps []string
+
+	aconfigFiles []android.Path
 }
 
 func (vctx *visitorContext) normalizeFileInfo(mctx android.ModuleContext) {
@@ -2062,11 +1946,19 @@
 		switch depTag {
 		case sharedLibTag, jniLibTag:
 			isJniLib := depTag == jniLibTag
+			propertyName := "native_shared_libs"
+			if isJniLib {
+				propertyName = "jni_libs"
+			}
 			switch ch := child.(type) {
 			case *cc.Module:
+				if ch.IsStubs() {
+					ctx.PropertyErrorf(propertyName, "%q is a stub. Remove it from the list.", depName)
+				}
 				fi := apexFileForNativeLibrary(ctx, ch, vctx.handleSpecialLibs)
 				fi.isJniLib = isJniLib
 				vctx.filesInfo = append(vctx.filesInfo, fi)
+				addAconfigFiles(vctx, ctx, child)
 				// Collect the list of stub-providing libs except:
 				// - VNDK libs are only for vendors
 				// - bootstrap bionic libs are treated as provided by system
@@ -2078,21 +1970,20 @@
 				fi := apexFileForRustLibrary(ctx, ch)
 				fi.isJniLib = isJniLib
 				vctx.filesInfo = append(vctx.filesInfo, fi)
+				addAconfigFiles(vctx, ctx, child)
 				return true // track transitive dependencies
 			default:
-				propertyName := "native_shared_libs"
-				if isJniLib {
-					propertyName = "jni_libs"
-				}
 				ctx.PropertyErrorf(propertyName, "%q is not a cc_library or cc_library_shared module", depName)
 			}
 		case executableTag:
 			switch ch := child.(type) {
 			case *cc.Module:
 				vctx.filesInfo = append(vctx.filesInfo, apexFileForExecutable(ctx, ch))
+				addAconfigFiles(vctx, ctx, child)
 				return true // track transitive dependencies
 			case *rust.Module:
 				vctx.filesInfo = append(vctx.filesInfo, apexFileForRustExecutable(ctx, ch))
+				addAconfigFiles(vctx, ctx, child)
 				return true // track transitive dependencies
 			default:
 				ctx.PropertyErrorf("binaries",
@@ -2132,6 +2023,7 @@
 					return false
 				}
 				vctx.filesInfo = append(vctx.filesInfo, af)
+				addAconfigFiles(vctx, ctx, child)
 				return true // track transitive dependencies
 			default:
 				ctx.PropertyErrorf("java_libs", "%q of type %q is not supported", depName, ctx.OtherModuleType(child))
@@ -2140,6 +2032,7 @@
 			switch ap := child.(type) {
 			case *java.AndroidApp:
 				vctx.filesInfo = append(vctx.filesInfo, apexFilesForAndroidApp(ctx, ap)...)
+				addAconfigFiles(vctx, ctx, child)
 				return true // track transitive dependencies
 			case *java.AndroidAppImport:
 				vctx.filesInfo = append(vctx.filesInfo, apexFilesForAndroidApp(ctx, ap)...)
@@ -2378,6 +2271,13 @@
 	return false
 }
 
+func addAconfigFiles(vctx *visitorContext, ctx android.ModuleContext, module blueprint.Module) {
+	dep := ctx.OtherModuleProvider(module, aconfig.TransitiveDeclarationsInfoProvider).(aconfig.TransitiveDeclarationsInfo)
+	if len(dep.AconfigFiles) > 0 && dep.AconfigFiles[ctx.ModuleName()] != nil {
+		vctx.aconfigFiles = append(vctx.aconfigFiles, dep.AconfigFiles[ctx.ModuleName()]...)
+	}
+}
+
 func (a *apexBundle) shouldCheckDuplicate(ctx android.ModuleContext) bool {
 	// TODO(b/263308293) remove this
 	if a.properties.IsCoverageVariant {
@@ -2459,6 +2359,7 @@
 	// 3) some fields in apexBundle struct are configured
 	a.installDir = android.PathForModuleInstall(ctx, "apex")
 	a.filesInfo = vctx.filesInfo
+	a.aconfigFiles = android.FirstUniquePaths(vctx.aconfigFiles)
 
 	a.setPayloadFsType(ctx)
 	a.setSystemLibLink(ctx)
@@ -2566,7 +2467,6 @@
 	android.InitAndroidMultiTargetsArchModule(module, android.DeviceSupported, android.MultilibCommon)
 	android.InitDefaultableModule(module)
 	android.InitOverridableModule(module, &module.overridableProperties.Overrides)
-	android.InitBazelModule(module)
 	multitree.InitExportableModule(module)
 	return module
 }
@@ -2614,7 +2514,6 @@
 type OverrideApex struct {
 	android.ModuleBase
 	android.OverrideModuleBase
-	android.BazelModuleBase
 }
 
 func (o *OverrideApex) GenerateAndroidBuildActions(_ android.ModuleContext) {
@@ -2630,104 +2529,9 @@
 
 	android.InitAndroidMultiTargetsArchModule(m, android.DeviceSupported, android.MultilibCommon)
 	android.InitOverrideModule(m)
-	android.InitBazelModule(m)
 	return m
 }
 
-func (o *OverrideApex) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	if ctx.ModuleType() != "override_apex" {
-		return
-	}
-
-	baseApexModuleName := o.OverrideModuleBase.GetOverriddenModuleName()
-	baseModule, baseApexExists := ctx.ModuleFromName(baseApexModuleName)
-	if !baseApexExists {
-		panic(fmt.Errorf("Base apex module doesn't exist: %s", baseApexModuleName))
-	}
-
-	a, baseModuleIsApex := baseModule.(*apexBundle)
-	if !baseModuleIsApex {
-		panic(fmt.Errorf("Base module is not apex module: %s", baseApexModuleName))
-	}
-	attrs, props, commonAttrs := convertWithBp2build(a, ctx)
-
-	// We just want the name, not module reference.
-	baseApexName := strings.TrimPrefix(baseApexModuleName, ":")
-	attrs.Base_apex_name = &baseApexName
-
-	for _, p := range o.GetProperties() {
-		overridableProperties, ok := p.(*overridableProperties)
-		if !ok {
-			continue
-		}
-
-		// Manifest is either empty or a file in the directory of base APEX and is not overridable.
-		// After it is converted in convertWithBp2build(baseApex, ctx),
-		// the attrs.Manifest.Value.Label is the file path relative to the directory
-		// of base apex. So the following code converts it to a label that looks like
-		// <package of base apex>:<path of manifest file> if base apex and override
-		// apex are not in the same package.
-		baseApexPackage := ctx.OtherModuleDir(a)
-		overrideApexPackage := ctx.ModuleDir()
-		if baseApexPackage != overrideApexPackage {
-			attrs.Manifest.Value.Label = "//" + baseApexPackage + ":" + attrs.Manifest.Value.Label
-		}
-
-		// Key
-		if overridableProperties.Key != nil {
-			attrs.Key = bazel.LabelAttribute{}
-			attrs.Key.SetValue(android.BazelLabelForModuleDepSingle(ctx, *overridableProperties.Key))
-		}
-
-		// Certificate
-		if overridableProperties.Certificate == nil {
-			// If overridableProperties.Certificate is nil, clear this out as
-			// well with zeroed structs, so the override_apex does not use the
-			// base apex's certificate.
-			attrs.Certificate = bazel.LabelAttribute{}
-			attrs.Certificate_name = bazel.StringAttribute{}
-		} else {
-			attrs.Certificate, attrs.Certificate_name = android.BazelStringOrLabelFromProp(ctx, overridableProperties.Certificate)
-		}
-
-		// Prebuilts
-		if overridableProperties.Prebuilts != nil {
-			prebuiltsLabelList := android.BazelLabelForModuleDeps(ctx, overridableProperties.Prebuilts)
-			attrs.Prebuilts = bazel.MakeLabelListAttribute(prebuiltsLabelList)
-		}
-
-		// Compressible
-		if overridableProperties.Compressible != nil {
-			attrs.Compressible = bazel.BoolAttribute{Value: overridableProperties.Compressible}
-		}
-
-		// Package name
-		//
-		// e.g. com.android.adbd's package name is com.android.adbd, but
-		// com.google.android.adbd overrides the package name to com.google.android.adbd
-		//
-		// TODO: this can be overridden from the product configuration, see
-		// getOverrideManifestPackageName and
-		// PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES.
-		//
-		// Instead of generating the BUILD files differently based on the product config
-		// at the point of conversion, this should be handled by the BUILD file loading
-		// from the soong_injection's product_vars, so product config is decoupled from bp2build.
-		if overridableProperties.Package_name != "" {
-			attrs.Package_name = &overridableProperties.Package_name
-		}
-
-		// Logging parent
-		if overridableProperties.Logging_parent != "" {
-			attrs.Logging_parent = &overridableProperties.Logging_parent
-		}
-	}
-
-	commonAttrs.Name = o.Name()
-
-	ctx.CreateBazelTargetModule(props, commonAttrs, &attrs)
-}
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // Vality check routines
 //
@@ -3182,306 +2986,6 @@
 	}
 }
 
-// For Bazel / bp2build
-
-type bazelApexBundleAttributes struct {
-	Manifest              bazel.LabelAttribute
-	Android_manifest      bazel.LabelAttribute
-	File_contexts         bazel.LabelAttribute
-	Canned_fs_config      bazel.LabelAttribute
-	Key                   bazel.LabelAttribute
-	Certificate           bazel.LabelAttribute  // used when the certificate prop is a module
-	Certificate_name      bazel.StringAttribute // used when the certificate prop is a string
-	Min_sdk_version       bazel.StringAttribute
-	Updatable             bazel.BoolAttribute
-	Installable           bazel.BoolAttribute
-	Binaries              bazel.LabelListAttribute
-	Prebuilts             bazel.LabelListAttribute
-	Native_shared_libs_32 bazel.LabelListAttribute
-	Native_shared_libs_64 bazel.LabelListAttribute
-	Compressible          bazel.BoolAttribute
-	Package_name          *string
-	Logging_parent        *string
-	Tests                 bazel.LabelListAttribute
-	Base_apex_name        *string
-	Apex_available_name   *string
-	Variant_version       *string
-}
-
-type convertedNativeSharedLibs struct {
-	Native_shared_libs_32 bazel.LabelListAttribute
-	Native_shared_libs_64 bazel.LabelListAttribute
-}
-
-const (
-	minSdkVersionPropName = "Min_sdk_version"
-)
-
-// ConvertWithBp2build performs bp2build conversion of an apex
-func (a *apexBundle) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	// We only convert apex and apex_test modules at this time
-	if ctx.ModuleType() != "apex" && ctx.ModuleType() != "apex_test" {
-		return
-	}
-
-	attrs, props, commonAttrs := convertWithBp2build(a, ctx)
-	commonAttrs.Name = a.Name()
-	ctx.CreateBazelTargetModule(props, commonAttrs, &attrs)
-}
-
-func convertWithBp2build(a *apexBundle, ctx android.Bp2buildMutatorContext) (bazelApexBundleAttributes, bazel.BazelTargetModuleProperties, android.CommonAttributes) {
-	var manifestLabelAttribute bazel.LabelAttribute
-	manifestLabelAttribute.SetValue(android.BazelLabelForModuleSrcSingle(ctx, proptools.StringDefault(a.properties.Manifest, "apex_manifest.json")))
-
-	var androidManifestLabelAttribute bazel.LabelAttribute
-	if a.properties.AndroidManifest != nil {
-		androidManifestLabelAttribute.SetValue(android.BazelLabelForModuleSrcSingle(ctx, *a.properties.AndroidManifest))
-	}
-
-	var fileContextsLabelAttribute bazel.LabelAttribute
-	if a.properties.File_contexts == nil {
-		// See buildFileContexts(), if file_contexts is not specified the default one is used, which is //system/sepolicy/apex:<module name>-file_contexts
-		fileContextsLabelAttribute.SetValue(android.BazelLabelForModuleDepSingle(ctx, a.Name()+"-file_contexts"))
-	} else if strings.HasPrefix(*a.properties.File_contexts, ":") {
-		// File_contexts is a module
-		fileContextsLabelAttribute.SetValue(android.BazelLabelForModuleDepSingle(ctx, *a.properties.File_contexts))
-	} else {
-		// File_contexts is a file
-		fileContextsLabelAttribute.SetValue(android.BazelLabelForModuleSrcSingle(ctx, *a.properties.File_contexts))
-	}
-
-	var cannedFsConfigAttribute bazel.LabelAttribute
-	if a.properties.Canned_fs_config != nil {
-		cannedFsConfigAttribute.SetValue(android.BazelLabelForModuleSrcSingle(ctx, *a.properties.Canned_fs_config))
-	}
-
-	productVariableProps, errs := android.ProductVariableProperties(ctx, a)
-	for _, err := range errs {
-		ctx.ModuleErrorf("ProductVariableProperties error: %s", err)
-	}
-	// TODO(b/219503907) this would need to be set to a.MinSdkVersionValue(ctx) but
-	// given it's coming via config, we probably don't want to put it in here.
-	var minSdkVersion bazel.StringAttribute
-	if a.properties.Min_sdk_version != nil {
-		minSdkVersion.SetValue(*a.properties.Min_sdk_version)
-	}
-	if props, ok := productVariableProps[minSdkVersionPropName]; ok {
-		for c, p := range props {
-			if val, ok := p.(*string); ok {
-				minSdkVersion.SetSelectValue(c.ConfigurationAxis(), c.SelectKey(), val)
-			}
-		}
-	}
-
-	var keyLabelAttribute bazel.LabelAttribute
-	if a.overridableProperties.Key != nil {
-		keyLabelAttribute.SetValue(android.BazelLabelForModuleDepSingle(ctx, *a.overridableProperties.Key))
-	}
-
-	// Certificate
-	certificate, certificateName := android.BazelStringOrLabelFromProp(ctx, a.overridableProperties.Certificate)
-
-	nativeSharedLibs := &convertedNativeSharedLibs{
-		Native_shared_libs_32: bazel.LabelListAttribute{},
-		Native_shared_libs_64: bazel.LabelListAttribute{},
-	}
-
-	// https://cs.android.com/android/platform/superproject/+/master:build/soong/android/arch.go;l=698;drc=f05b0d35d2fbe51be9961ce8ce8031f840295c68
-	// https://cs.android.com/android/platform/superproject/+/master:build/soong/apex/apex.go;l=2549;drc=ec731a83e3e2d80a1254e32fd4ad7ef85e262669
-	// In Soong, decodeMultilib, used to get multilib, return "first" if defaultMultilib is set to "common".
-	// Since apex sets defaultMultilib to be "common", equivalent compileMultilib in bp2build for apex should be "first"
-	compileMultilib := "first"
-	if a.CompileMultilib() != nil {
-		compileMultilib = *a.CompileMultilib()
-	}
-
-	// properties.Native_shared_libs is treated as "both"
-	convertBothLibs(ctx, compileMultilib, a.properties.Native_shared_libs, nativeSharedLibs)
-	convertBothLibs(ctx, compileMultilib, a.properties.Multilib.Both.Native_shared_libs, nativeSharedLibs)
-	convert32Libs(ctx, compileMultilib, a.properties.Multilib.Lib32.Native_shared_libs, nativeSharedLibs)
-	convert64Libs(ctx, compileMultilib, a.properties.Multilib.Lib64.Native_shared_libs, nativeSharedLibs)
-	convertFirstLibs(ctx, compileMultilib, a.properties.Multilib.First.Native_shared_libs, nativeSharedLibs)
-
-	prebuilts := a.overridableProperties.Prebuilts
-	prebuiltsLabelList := android.BazelLabelForModuleDeps(ctx, prebuilts)
-	prebuiltsLabelListAttribute := bazel.MakeLabelListAttribute(prebuiltsLabelList)
-
-	binaries := android.BazelLabelForModuleDeps(ctx, a.properties.ApexNativeDependencies.Binaries)
-	binariesLabelListAttribute := bazel.MakeLabelListAttribute(binaries)
-
-	var testsAttrs bazel.LabelListAttribute
-	if a.testApex && len(a.properties.ApexNativeDependencies.Tests) > 0 {
-		tests := android.BazelLabelForModuleDeps(ctx, a.properties.ApexNativeDependencies.Tests)
-		testsAttrs = bazel.MakeLabelListAttribute(tests)
-	}
-
-	var updatableAttribute bazel.BoolAttribute
-	if a.properties.Updatable != nil {
-		updatableAttribute.Value = a.properties.Updatable
-	}
-
-	var installableAttribute bazel.BoolAttribute
-	if a.properties.Installable != nil {
-		installableAttribute.Value = a.properties.Installable
-	}
-
-	var compressibleAttribute bazel.BoolAttribute
-	if a.overridableProperties.Compressible != nil {
-		compressibleAttribute.Value = a.overridableProperties.Compressible
-	}
-
-	var packageName *string
-	if a.overridableProperties.Package_name != "" {
-		packageName = &a.overridableProperties.Package_name
-	}
-
-	var loggingParent *string
-	if a.overridableProperties.Logging_parent != "" {
-		loggingParent = &a.overridableProperties.Logging_parent
-	}
-
-	attrs := bazelApexBundleAttributes{
-		Manifest:              manifestLabelAttribute,
-		Android_manifest:      androidManifestLabelAttribute,
-		File_contexts:         fileContextsLabelAttribute,
-		Canned_fs_config:      cannedFsConfigAttribute,
-		Min_sdk_version:       minSdkVersion,
-		Key:                   keyLabelAttribute,
-		Certificate:           certificate,
-		Certificate_name:      certificateName,
-		Updatable:             updatableAttribute,
-		Installable:           installableAttribute,
-		Native_shared_libs_32: nativeSharedLibs.Native_shared_libs_32,
-		Native_shared_libs_64: nativeSharedLibs.Native_shared_libs_64,
-		Binaries:              binariesLabelListAttribute,
-		Prebuilts:             prebuiltsLabelListAttribute,
-		Compressible:          compressibleAttribute,
-		Package_name:          packageName,
-		Logging_parent:        loggingParent,
-		Tests:                 testsAttrs,
-		Apex_available_name:   a.properties.Apex_available_name,
-		Variant_version:       a.properties.Variant_version,
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "apex",
-		Bzl_load_location: "//build/bazel/rules/apex:apex.bzl",
-	}
-
-	commonAttrs := android.CommonAttributes{}
-	if a.testApex {
-		commonAttrs.Testonly = proptools.BoolPtr(true)
-		// Set the api_domain of the test apex
-		attrs.Base_apex_name = proptools.StringPtr(cc.GetApiDomain(a.Name()))
-	}
-
-	return attrs, props, commonAttrs
-}
-
-// The following conversions are based on this table where the rows are the compile_multilib
-// values and the columns are the properties.Multilib.*.Native_shared_libs. Each cell
-// represents how the libs should be compiled for a 64-bit/32-bit device: 32 means it
-// should be compiled as 32-bit, 64 means it should be compiled as 64-bit, none means it
-// should not be compiled.
-// multib/compile_multilib, 32,        64,        both,     first
-// 32,                      32/32,     none/none, 32/32,    none/32
-// 64,                      none/none, 64/none,   64/none,  64/none
-// both,                    32/32,     64/none,   32&64/32, 64/32
-// first,                   32/32,     64/none,   64/32,    64/32
-
-func convert32Libs(ctx android.Bp2buildMutatorContext, compileMultilb string,
-	libs []string, nativeSharedLibs *convertedNativeSharedLibs) {
-	libsLabelList := android.BazelLabelForModuleDeps(ctx, libs)
-	switch compileMultilb {
-	case "both", "32":
-		makeNoConfig32SharedLibsAttributes(libsLabelList, nativeSharedLibs)
-	case "first":
-		make32SharedLibsAttributes(libsLabelList, nativeSharedLibs)
-	case "64":
-		// Incompatible, ignore
-	default:
-		invalidCompileMultilib(ctx, compileMultilb)
-	}
-}
-
-func convert64Libs(ctx android.Bp2buildMutatorContext, compileMultilb string,
-	libs []string, nativeSharedLibs *convertedNativeSharedLibs) {
-	libsLabelList := android.BazelLabelForModuleDeps(ctx, libs)
-	switch compileMultilb {
-	case "both", "64", "first":
-		make64SharedLibsAttributes(libsLabelList, nativeSharedLibs)
-	case "32":
-		// Incompatible, ignore
-	default:
-		invalidCompileMultilib(ctx, compileMultilb)
-	}
-}
-
-func convertBothLibs(ctx android.Bp2buildMutatorContext, compileMultilb string,
-	libs []string, nativeSharedLibs *convertedNativeSharedLibs) {
-	libsLabelList := android.BazelLabelForModuleDeps(ctx, libs)
-	switch compileMultilb {
-	case "both":
-		makeNoConfig32SharedLibsAttributes(libsLabelList, nativeSharedLibs)
-		make64SharedLibsAttributes(libsLabelList, nativeSharedLibs)
-	case "first":
-		makeFirstSharedLibsAttributes(libsLabelList, nativeSharedLibs)
-	case "32":
-		makeNoConfig32SharedLibsAttributes(libsLabelList, nativeSharedLibs)
-	case "64":
-		make64SharedLibsAttributes(libsLabelList, nativeSharedLibs)
-	default:
-		invalidCompileMultilib(ctx, compileMultilb)
-	}
-}
-
-func convertFirstLibs(ctx android.Bp2buildMutatorContext, compileMultilb string,
-	libs []string, nativeSharedLibs *convertedNativeSharedLibs) {
-	libsLabelList := android.BazelLabelForModuleDeps(ctx, libs)
-	switch compileMultilb {
-	case "both", "first":
-		makeFirstSharedLibsAttributes(libsLabelList, nativeSharedLibs)
-	case "32":
-		make32SharedLibsAttributes(libsLabelList, nativeSharedLibs)
-	case "64":
-		make64SharedLibsAttributes(libsLabelList, nativeSharedLibs)
-	default:
-		invalidCompileMultilib(ctx, compileMultilb)
-	}
-}
-
-func makeFirstSharedLibsAttributes(libsLabelList bazel.LabelList, nativeSharedLibs *convertedNativeSharedLibs) {
-	make32SharedLibsAttributes(libsLabelList, nativeSharedLibs)
-	make64SharedLibsAttributes(libsLabelList, nativeSharedLibs)
-}
-
-func makeNoConfig32SharedLibsAttributes(libsLabelList bazel.LabelList, nativeSharedLibs *convertedNativeSharedLibs) {
-	list := bazel.LabelListAttribute{}
-	list.SetSelectValue(bazel.NoConfigAxis, "", libsLabelList)
-	nativeSharedLibs.Native_shared_libs_32.Append(list)
-}
-
-func make32SharedLibsAttributes(libsLabelList bazel.LabelList, nativeSharedLibs *convertedNativeSharedLibs) {
-	makeSharedLibsAttributes("x86", libsLabelList, &nativeSharedLibs.Native_shared_libs_32)
-	makeSharedLibsAttributes("arm", libsLabelList, &nativeSharedLibs.Native_shared_libs_32)
-}
-
-func make64SharedLibsAttributes(libsLabelList bazel.LabelList, nativeSharedLibs *convertedNativeSharedLibs) {
-	makeSharedLibsAttributes("x86_64", libsLabelList, &nativeSharedLibs.Native_shared_libs_64)
-	makeSharedLibsAttributes("arm64", libsLabelList, &nativeSharedLibs.Native_shared_libs_64)
-}
-
-func makeSharedLibsAttributes(config string, libsLabelList bazel.LabelList,
-	labelListAttr *bazel.LabelListAttribute) {
-	list := bazel.LabelListAttribute{}
-	list.SetSelectValue(bazel.ArchConfigurationAxis, config, libsLabelList)
-	labelListAttr.Append(list)
-}
-
-func invalidCompileMultilib(ctx android.Bp2buildMutatorContext, value string) {
-	ctx.PropertyErrorf("compile_multilib", "Invalid value: %s", value)
-}
-
 func (a *apexBundle) IsTestApex() bool {
 	return a.testApex
 }
diff --git a/apex/apex_test.go b/apex/apex_test.go
index ddb9a40..abf6b15 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -25,6 +25,8 @@
 	"strings"
 	"testing"
 
+	"android/soong/aconfig/codegen"
+
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/proptools"
 
@@ -151,6 +153,7 @@
 	prebuilt_etc.PrepareForTestWithPrebuiltEtc,
 	rust.PrepareForTestWithRustDefaultModules,
 	sh.PrepareForTestWithShBuildComponents,
+	codegen.PrepareForTestWithAconfigBuildComponents,
 
 	PrepareForTestWithApexBuildComponents,
 
@@ -595,13 +598,15 @@
 		t.Errorf("Could not find all expected symlinks! foo: %t, foo_link_64: %t. Command was %s", found_foo, found_foo_link_64, copyCmds)
 	}
 
-	fullDepsInfo := strings.Split(ctx.ModuleForTests("myapex", "android_common_myapex").Output("depsinfo/fulllist.txt").Args["content"], "\\n")
+	fullDepsInfo := strings.Split(android.ContentFromFileRuleForTests(t, ctx,
+		ctx.ModuleForTests("myapex", "android_common_myapex").Output("depsinfo/fulllist.txt")), "\n")
 	ensureListContains(t, fullDepsInfo, "  myjar(minSdkVersion:(no version)) <- myapex")
 	ensureListContains(t, fullDepsInfo, "  mylib2(minSdkVersion:(no version)) <- mylib")
 	ensureListContains(t, fullDepsInfo, "  myotherjar(minSdkVersion:(no version)) <- myjar")
 	ensureListContains(t, fullDepsInfo, "  mysharedjar(minSdkVersion:(no version)) (external) <- myjar")
 
-	flatDepsInfo := strings.Split(ctx.ModuleForTests("myapex", "android_common_myapex").Output("depsinfo/flatlist.txt").Args["content"], "\\n")
+	flatDepsInfo := strings.Split(android.ContentFromFileRuleForTests(t, ctx,
+		ctx.ModuleForTests("myapex", "android_common_myapex").Output("depsinfo/flatlist.txt")), "\n")
 	ensureListContains(t, flatDepsInfo, "myjar(minSdkVersion:(no version))")
 	ensureListContains(t, flatDepsInfo, "mylib2(minSdkVersion:(no version))")
 	ensureListContains(t, flatDepsInfo, "myotherjar(minSdkVersion:(no version))")
@@ -956,6 +961,32 @@
 	ensureListContains(t, names(apexManifestRule.Args["requireNativeLibs"]), "libfoo.shared_from_rust.so")
 }
 
+func TestApexShouldNotEmbedStubVariant(t *testing.T) {
+	testApexError(t, `module "myapex" .*: native_shared_libs: "libbar" is a stub`, `
+		apex {
+			name: "myapex",
+			key: "myapex.key",
+			vendor: true,
+			updatable: false,
+			native_shared_libs: ["libbar"], // should not add an LLNDK stub in a vendor apex
+		}
+
+		apex_key {
+			name: "myapex.key",
+			public_key: "testkey.avbpubkey",
+			private_key: "testkey.pem",
+		}
+
+		cc_library {
+			name: "libbar",
+			srcs: ["mylib.cpp"],
+			llndk: {
+				symbol_file: "libbar.map.txt",
+			}
+		}
+	`)
+}
+
 func TestApexCanUsePrivateApis(t *testing.T) {
 	ctx := testApex(t, `
 		apex {
@@ -1281,10 +1312,12 @@
 	// Ensure that libfoo stubs is not linking to libbar (since it is a stubs)
 	ensureNotContains(t, libFooStubsLdFlags, "libbar.so")
 
-	fullDepsInfo := strings.Split(ctx.ModuleForTests("myapex2", "android_common_myapex2").Output("depsinfo/fulllist.txt").Args["content"], "\\n")
+	fullDepsInfo := strings.Split(android.ContentFromFileRuleForTests(t, ctx,
+		ctx.ModuleForTests("myapex2", "android_common_myapex2").Output("depsinfo/fulllist.txt")), "\n")
 	ensureListContains(t, fullDepsInfo, "  libfoo(minSdkVersion:(no version)) (external) <- mylib")
 
-	flatDepsInfo := strings.Split(ctx.ModuleForTests("myapex2", "android_common_myapex2").Output("depsinfo/flatlist.txt").Args["content"], "\\n")
+	flatDepsInfo := strings.Split(android.ContentFromFileRuleForTests(t, ctx,
+		ctx.ModuleForTests("myapex2", "android_common_myapex2").Output("depsinfo/flatlist.txt")), "\n")
 	ensureListContains(t, flatDepsInfo, "libfoo(minSdkVersion:(no version)) (external)")
 }
 
@@ -2030,7 +2063,8 @@
 		"out/soong/.intermediates/myapex2/android_common_myapex2/depsinfo/flatlist.txt")
 
 	myapex := ctx.ModuleForTests("myapex", "android_common_myapex")
-	flatlist := strings.Split(myapex.Output("depsinfo/flatlist.txt").BuildParams.Args["content"], "\\n")
+	flatlist := strings.Split(android.ContentFromFileRuleForTests(t, ctx,
+		myapex.Output("depsinfo/flatlist.txt")), "\n")
 	android.AssertStringListContains(t, "deps with stubs should be tracked in depsinfo as external dep",
 		flatlist, "libbar(minSdkVersion:(no version)) (external)")
 	android.AssertStringListDoesNotContain(t, "do not track if not available for platform",
@@ -4703,6 +4737,72 @@
 	ensureListContains(t, ctx.ModuleVariantsForTests("mylib_common_test"), "android_arm64_armv8-a_shared")
 }
 
+func TestLibzVendorIsntStable(t *testing.T) {
+	ctx := testApex(t, `
+	apex {
+		name: "myapex",
+		key: "myapex.key",
+		updatable: false,
+		binaries: ["mybin"],
+	}
+	apex {
+		name: "myvendorapex",
+		key: "myapex.key",
+		file_contexts: "myvendorapex_file_contexts",
+		vendor: true,
+		updatable: false,
+		binaries: ["mybin"],
+	}
+	apex_key {
+		name: "myapex.key",
+		public_key: "testkey.avbpubkey",
+		private_key: "testkey.pem",
+	}
+	cc_binary {
+		name: "mybin",
+		vendor_available: true,
+		system_shared_libs: [],
+		stl: "none",
+		shared_libs: ["libz"],
+		apex_available: ["//apex_available:anyapex"],
+	}
+	cc_library {
+		name: "libz",
+		vendor_available: true,
+		system_shared_libs: [],
+		stl: "none",
+		stubs: {
+			versions: ["28", "30"],
+		},
+		target: {
+			vendor: {
+				no_stubs: true,
+			},
+		},
+	}
+	`, withFiles(map[string][]byte{
+		"myvendorapex_file_contexts": nil,
+	}))
+
+	// libz provides stubs for core variant.
+	{
+		ensureExactContents(t, ctx, "myapex", "android_common_myapex", []string{
+			"bin/mybin",
+		})
+		apexManifestRule := ctx.ModuleForTests("myapex", "android_common_myapex").Rule("apexManifestRule")
+		android.AssertStringEquals(t, "should require libz", apexManifestRule.Args["requireNativeLibs"], "libz.so")
+	}
+	// libz doesn't provide stubs for vendor variant.
+	{
+		ensureExactContents(t, ctx, "myvendorapex", "android_common_myvendorapex", []string{
+			"bin/mybin",
+			"lib64/libz.so",
+		})
+		apexManifestRule := ctx.ModuleForTests("myvendorapex", "android_common_myvendorapex").Rule("apexManifestRule")
+		android.AssertStringEquals(t, "should not require libz", apexManifestRule.Args["requireNativeLibs"], "")
+	}
+}
+
 func TestApexWithTarget(t *testing.T) {
 	ctx := testApex(t, `
 		apex {
@@ -8154,7 +8254,7 @@
 		`, withManifestPackageNameOverrides([]string{"AppFoo:com.android.foo"}))
 
 	bundleConfigRule := ctx.ModuleForTests("myapex", "android_common_myapex").Output("bundle_config.json")
-	content := bundleConfigRule.Args["content"]
+	content := android.ContentFromFileRuleForTests(t, ctx, bundleConfigRule)
 
 	ensureContains(t, content, `"compression":{"uncompressed_glob":["apex_payload.img","apex_manifest.*"]}`)
 	ensureContains(t, content, `"apex_config":{"apex_embedded_apk_config":[{"package_name":"com.android.foo","path":"app/AppFoo@TEST.BUILD_ID/AppFoo.apk"}]}`)
@@ -8181,7 +8281,7 @@
 		}`)
 	mod := ctx.ModuleForTests("myapex", "android_common_myapex")
 	bundleConfigRule := mod.Output("bundle_config.json")
-	content := bundleConfigRule.Args["content"]
+	content := android.ContentFromFileRuleForTests(t, ctx, bundleConfigRule)
 	ensureContains(t, content, `"compression":{"uncompressed_glob":["apex_payload.img","apex_manifest.*"]}`)
 	s := mod.Rule("apexRule").Args["copy_commands"]
 	copyCmds := regexp.MustCompile(" *&& *").Split(s, -1)
@@ -9126,7 +9226,7 @@
 	`)
 
 	myapex := ctx.ModuleForTests("myapex", "android_common_myapex")
-	content := myapex.Output("apexkeys.txt").BuildParams.Args["content"]
+	content := android.ContentFromFileRuleForTests(t, ctx, myapex.Output("apexkeys.txt"))
 	ensureContains(t, content, `name="myapex.apex" public_key="vendor/foo/devkeys/testkey.avbpubkey" private_key="vendor/foo/devkeys/testkey.pem" container_certificate="vendor/foo/devkeys/test.x509.pem" container_private_key="vendor/foo/devkeys/test.pk8" partition="system" sign_tool="sign_myapex"`)
 }
 
@@ -9166,9 +9266,11 @@
 		}
 	`)
 
-	content := ctx.ModuleForTests("myapex", "android_common_myapex").Output("apexkeys.txt").BuildParams.Args["content"]
+	content := android.ContentFromFileRuleForTests(t, ctx,
+		ctx.ModuleForTests("myapex", "android_common_myapex").Output("apexkeys.txt"))
 	ensureContains(t, content, `name="myapex.apex" public_key="vendor/foo/devkeys/testkey.avbpubkey" private_key="vendor/foo/devkeys/testkey.pem" container_certificate="vendor/foo/devkeys/test.x509.pem" container_private_key="vendor/foo/devkeys/test.pk8" partition="system" sign_tool="sign_myapex"`)
-	content = ctx.ModuleForTests("myapex_set", "android_common_myapex_set").Output("apexkeys.txt").BuildParams.Args["content"]
+	content = android.ContentFromFileRuleForTests(t, ctx,
+		ctx.ModuleForTests("myapex_set", "android_common_myapex_set").Output("apexkeys.txt"))
 	ensureContains(t, content, `name="myapex_set.apex" public_key="PRESIGNED" private_key="PRESIGNED" container_certificate="PRESIGNED" container_private_key="PRESIGNED" partition="system"`)
 }
 
@@ -10756,3 +10858,549 @@
 		inputs.Strings(),
 		"out/soong/.intermediates/libbar/android_arm64_armv8-a_shared/libbar.so")
 }
+
+var apex_default_bp = `
+		apex_key {
+			name: "myapex.key",
+			public_key: "testkey.avbpubkey",
+			private_key: "testkey.pem",
+		}
+
+		filegroup {
+			name: "myapex.manifest",
+			srcs: ["apex_manifest.json"],
+		}
+
+		filegroup {
+			name: "myapex.androidmanifest",
+			srcs: ["AndroidManifest.xml"],
+		}
+`
+
+func TestAconfigFilesJavaDeps(t *testing.T) {
+	ctx := testApex(t, apex_default_bp+`
+		apex {
+			name: "myapex",
+			manifest: ":myapex.manifest",
+			androidManifest: ":myapex.androidmanifest",
+			key: "myapex.key",
+			java_libs: [
+				"my_java_library_foo",
+				"my_java_library_bar",
+			],
+			updatable: false,
+		}
+
+		java_library {
+			name: "my_java_library_foo",
+			srcs: ["foo/bar/MyClass.java"],
+			sdk_version: "none",
+			system_modules: "none",
+			static_libs: ["my_java_aconfig_library_foo"],
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		java_library {
+			name: "my_java_library_bar",
+			srcs: ["foo/bar/MyClass.java"],
+			sdk_version: "none",
+			system_modules: "none",
+			static_libs: ["my_java_aconfig_library_bar"],
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		aconfig_declarations {
+			name: "my_aconfig_declarations_foo",
+			package: "com.example.package",
+			container: "myapex",
+			srcs: ["foo.aconfig"],
+		}
+
+		java_aconfig_library {
+			name: "my_java_aconfig_library_foo",
+			aconfig_declarations: "my_aconfig_declarations_foo",
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		aconfig_declarations {
+			name: "my_aconfig_declarations_bar",
+			package: "com.example.package",
+			container: "myapex",
+			srcs: ["bar.aconfig"],
+		}
+
+		java_aconfig_library {
+			name: "my_java_aconfig_library_bar",
+			aconfig_declarations: "my_aconfig_declarations_bar",
+			apex_available: [
+				"myapex",
+			],
+		}
+	`)
+
+	mod := ctx.ModuleForTests("myapex", "android_common_myapex")
+	s := mod.Rule("apexRule").Args["copy_commands"]
+	copyCmds := regexp.MustCompile(" *&& *").Split(s, -1)
+	if len(copyCmds) != 5 {
+		t.Fatalf("Expected 5 commands, got %d in:\n%s", len(copyCmds), s)
+	}
+
+	ensureMatches(t, copyCmds[4], "^cp -f .*/aconfig_flags.pb .*/image.apex$")
+
+	combineAconfigRule := mod.Rule("All_aconfig_declarations_dump")
+	s = " " + combineAconfigRule.Args["cache_files"]
+	aconfigArgs := regexp.MustCompile(" --cache ").Split(s, -1)[1:]
+	if len(aconfigArgs) != 2 {
+		t.Fatalf("Expected 2 commands, got %d in:\n%s", len(aconfigArgs), s)
+	}
+	android.EnsureListContainsSuffix(t, aconfigArgs, "my_aconfig_declarations_foo/intermediate.pb")
+	android.EnsureListContainsSuffix(t, aconfigArgs, "my_aconfig_declarations_bar/intermediate.pb")
+
+	buildParams := combineAconfigRule.BuildParams
+	android.EnsureListContainsSuffix(t, buildParams.Inputs.Strings(), "my_aconfig_declarations_foo/intermediate.pb")
+	android.EnsureListContainsSuffix(t, buildParams.Inputs.Strings(), "my_aconfig_declarations_bar/intermediate.pb")
+	ensureContains(t, buildParams.Output.String(), "android_common_myapex/aconfig_flags.pb")
+}
+
+func TestAconfigFilesJavaAndCcDeps(t *testing.T) {
+	ctx := testApex(t, apex_default_bp+`
+		apex {
+			name: "myapex",
+			manifest: ":myapex.manifest",
+			androidManifest: ":myapex.androidmanifest",
+			key: "myapex.key",
+			java_libs: [
+				"my_java_library_foo",
+			],
+			native_shared_libs: [
+				"my_cc_library_bar",
+			],
+			binaries: [
+				"my_cc_binary_baz",
+			],
+			updatable: false,
+		}
+
+		java_library {
+			name: "my_java_library_foo",
+			srcs: ["foo/bar/MyClass.java"],
+			sdk_version: "none",
+			system_modules: "none",
+			static_libs: ["my_java_aconfig_library_foo"],
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		cc_library {
+			name: "my_cc_library_bar",
+			srcs: ["foo/bar/MyClass.cc"],
+			static_libs: [
+				"my_cc_aconfig_library_bar",
+				"my_cc_aconfig_library_baz",
+			],
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		cc_binary {
+			name: "my_cc_binary_baz",
+			srcs: ["foo/bar/MyClass.cc"],
+			static_libs: ["my_cc_aconfig_library_baz"],
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		aconfig_declarations {
+			name: "my_aconfig_declarations_foo",
+			package: "com.example.package",
+			container: "myapex",
+			srcs: ["foo.aconfig"],
+		}
+
+		java_aconfig_library {
+			name: "my_java_aconfig_library_foo",
+			aconfig_declarations: "my_aconfig_declarations_foo",
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		aconfig_declarations {
+			name: "my_aconfig_declarations_bar",
+			package: "com.example.package",
+			container: "myapex",
+			srcs: ["bar.aconfig"],
+		}
+
+		cc_aconfig_library {
+			name: "my_cc_aconfig_library_bar",
+			aconfig_declarations: "my_aconfig_declarations_bar",
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		aconfig_declarations {
+			name: "my_aconfig_declarations_baz",
+			package: "com.example.package",
+			container: "myapex",
+			srcs: ["baz.aconfig"],
+		}
+
+		cc_aconfig_library {
+			name: "my_cc_aconfig_library_baz",
+			aconfig_declarations: "my_aconfig_declarations_baz",
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		cc_library {
+			name: "server_configurable_flags",
+			srcs: ["server_configurable_flags.cc"],
+		}
+	`)
+
+	mod := ctx.ModuleForTests("myapex", "android_common_myapex")
+	s := mod.Rule("apexRule").Args["copy_commands"]
+	copyCmds := regexp.MustCompile(" *&& *").Split(s, -1)
+	if len(copyCmds) != 9 {
+		t.Fatalf("Expected 9 commands, got %d in:\n%s", len(copyCmds), s)
+	}
+
+	ensureMatches(t, copyCmds[8], "^cp -f .*/aconfig_flags.pb .*/image.apex$")
+
+	combineAconfigRule := mod.Rule("All_aconfig_declarations_dump")
+	s = " " + combineAconfigRule.Args["cache_files"]
+	aconfigArgs := regexp.MustCompile(" --cache ").Split(s, -1)[1:]
+	if len(aconfigArgs) != 3 {
+		t.Fatalf("Expected 3 commands, got %d in:\n%s", len(aconfigArgs), s)
+	}
+	android.EnsureListContainsSuffix(t, aconfigArgs, "my_aconfig_declarations_foo/intermediate.pb")
+	android.EnsureListContainsSuffix(t, aconfigArgs, "my_cc_library_bar/android_arm64_armv8-a_shared_apex10000/aconfig_merged.pb")
+	android.EnsureListContainsSuffix(t, aconfigArgs, "my_aconfig_declarations_baz/intermediate.pb")
+
+	buildParams := combineAconfigRule.BuildParams
+	if len(buildParams.Inputs) != 3 {
+		t.Fatalf("Expected 3 input, got %d", len(buildParams.Inputs))
+	}
+	android.EnsureListContainsSuffix(t, buildParams.Inputs.Strings(), "my_aconfig_declarations_foo/intermediate.pb")
+	android.EnsureListContainsSuffix(t, buildParams.Inputs.Strings(), "my_cc_library_bar/android_arm64_armv8-a_shared_apex10000/aconfig_merged.pb")
+	android.EnsureListContainsSuffix(t, buildParams.Inputs.Strings(), "my_aconfig_declarations_baz/intermediate.pb")
+	ensureContains(t, buildParams.Output.String(), "android_common_myapex/aconfig_flags.pb")
+}
+
+func TestAconfigFilesRustDeps(t *testing.T) {
+	ctx := testApex(t, apex_default_bp+`
+		apex {
+			name: "myapex",
+			manifest: ":myapex.manifest",
+			androidManifest: ":myapex.androidmanifest",
+			key: "myapex.key",
+			native_shared_libs: [
+				"libmy_rust_library",
+			],
+			binaries: [
+				"my_rust_binary",
+			],
+			rust_dyn_libs: [
+				"libmy_rust_dylib",
+			],
+			updatable: false,
+		}
+
+		rust_library {
+			name: "libflags_rust", // test mock
+			crate_name: "flags_rust",
+			srcs: ["lib.rs"],
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		rust_library {
+			name: "liblazy_static", // test mock
+			crate_name: "lazy_static",
+			srcs: ["src/lib.rs"],
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		rust_ffi_shared {
+			name: "libmy_rust_library",
+			srcs: ["src/lib.rs"],
+			rustlibs: ["libmy_rust_aconfig_library_foo"],
+			crate_name: "my_rust_library",
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		rust_library_dylib {
+			name: "libmy_rust_dylib",
+			srcs: ["foo/bar/MyClass.rs"],
+			rustlibs: ["libmy_rust_aconfig_library_bar"],
+			crate_name: "my_rust_dylib",
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		rust_binary {
+			name: "my_rust_binary",
+			srcs: ["foo/bar/MyClass.rs"],
+			rustlibs: [
+				"libmy_rust_aconfig_library_baz",
+				"libmy_rust_dylib",
+			],
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		aconfig_declarations {
+			name: "my_aconfig_declarations_foo",
+			package: "com.example.package",
+			container: "myapex",
+			srcs: ["foo.aconfig"],
+		}
+
+		aconfig_declarations {
+			name: "my_aconfig_declarations_bar",
+			package: "com.example.package",
+			container: "myapex",
+			srcs: ["bar.aconfig"],
+		}
+
+		aconfig_declarations {
+			name: "my_aconfig_declarations_baz",
+			package: "com.example.package",
+			container: "myapex",
+			srcs: ["baz.aconfig"],
+		}
+
+		rust_aconfig_library {
+			name: "libmy_rust_aconfig_library_foo",
+			aconfig_declarations: "my_aconfig_declarations_foo",
+			crate_name: "my_rust_aconfig_library_foo",
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		rust_aconfig_library {
+			name: "libmy_rust_aconfig_library_bar",
+			aconfig_declarations: "my_aconfig_declarations_bar",
+			crate_name: "my_rust_aconfig_library_bar",
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		rust_aconfig_library {
+			name: "libmy_rust_aconfig_library_baz",
+			aconfig_declarations: "my_aconfig_declarations_baz",
+			crate_name: "my_rust_aconfig_library_baz",
+			apex_available: [
+				"myapex",
+			],
+		}
+	`)
+
+	mod := ctx.ModuleForTests("myapex", "android_common_myapex")
+	s := mod.Rule("apexRule").Args["copy_commands"]
+	copyCmds := regexp.MustCompile(" *&& *").Split(s, -1)
+	if len(copyCmds) != 23 {
+		t.Fatalf("Expected 23 commands, got %d in:\n%s", len(copyCmds), s)
+	}
+
+	ensureMatches(t, copyCmds[22], "^cp -f .*/aconfig_flags.pb .*/image.apex$")
+
+	combineAconfigRule := mod.Rule("All_aconfig_declarations_dump")
+	s = " " + combineAconfigRule.Args["cache_files"]
+	aconfigArgs := regexp.MustCompile(" --cache ").Split(s, -1)[1:]
+	if len(aconfigArgs) != 2 {
+		t.Fatalf("Expected 2 commands, got %d in:\n%s", len(aconfigArgs), s)
+	}
+	android.EnsureListContainsSuffix(t, aconfigArgs, "my_aconfig_declarations_foo/intermediate.pb")
+	android.EnsureListContainsSuffix(t, aconfigArgs, "my_rust_binary/android_arm64_armv8-a_apex10000/aconfig_merged.pb")
+
+	buildParams := combineAconfigRule.BuildParams
+	if len(buildParams.Inputs) != 2 {
+		t.Fatalf("Expected 3 input, got %d", len(buildParams.Inputs))
+	}
+	android.EnsureListContainsSuffix(t, buildParams.Inputs.Strings(), "my_aconfig_declarations_foo/intermediate.pb")
+	android.EnsureListContainsSuffix(t, buildParams.Inputs.Strings(), "my_rust_binary/android_arm64_armv8-a_apex10000/aconfig_merged.pb")
+	ensureContains(t, buildParams.Output.String(), "android_common_myapex/aconfig_flags.pb")
+}
+
+func TestAconfigFilesOnlyMatchCurrentApex(t *testing.T) {
+	ctx := testApex(t, apex_default_bp+`
+		apex {
+			name: "myapex",
+			manifest: ":myapex.manifest",
+			androidManifest: ":myapex.androidmanifest",
+			key: "myapex.key",
+			java_libs: [
+				"my_java_library_foo",
+				"other_java_library_bar",
+			],
+			updatable: false,
+		}
+
+		java_library {
+			name: "my_java_library_foo",
+			srcs: ["foo/bar/MyClass.java"],
+			sdk_version: "none",
+			system_modules: "none",
+			static_libs: ["my_java_aconfig_library_foo"],
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		java_library {
+			name: "other_java_library_bar",
+			srcs: ["foo/bar/MyClass.java"],
+			sdk_version: "none",
+			system_modules: "none",
+			static_libs: ["other_java_aconfig_library_bar"],
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		aconfig_declarations {
+			name: "my_aconfig_declarations_foo",
+			package: "com.example.package",
+			container: "myapex",
+			srcs: ["foo.aconfig"],
+		}
+
+		java_aconfig_library {
+			name: "my_java_aconfig_library_foo",
+			aconfig_declarations: "my_aconfig_declarations_foo",
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		aconfig_declarations {
+			name: "other_aconfig_declarations_bar",
+			package: "com.example.package",
+			container: "otherapex",
+			srcs: ["bar.aconfig"],
+		}
+
+		java_aconfig_library {
+			name: "other_java_aconfig_library_bar",
+			aconfig_declarations: "other_aconfig_declarations_bar",
+			apex_available: [
+				"myapex",
+			],
+		}
+	`)
+
+	mod := ctx.ModuleForTests("myapex", "android_common_myapex")
+	combineAconfigRule := mod.Rule("All_aconfig_declarations_dump")
+	s := " " + combineAconfigRule.Args["cache_files"]
+	aconfigArgs := regexp.MustCompile(" --cache ").Split(s, -1)[1:]
+	if len(aconfigArgs) != 1 {
+		t.Fatalf("Expected 1 commands, got %d in:\n%s", len(aconfigArgs), s)
+	}
+	android.EnsureListContainsSuffix(t, aconfigArgs, "my_aconfig_declarations_foo/intermediate.pb")
+
+	buildParams := combineAconfigRule.BuildParams
+	if len(buildParams.Inputs) != 1 {
+		t.Fatalf("Expected 1 input, got %d", len(buildParams.Inputs))
+	}
+	android.EnsureListContainsSuffix(t, buildParams.Inputs.Strings(), "my_aconfig_declarations_foo/intermediate.pb")
+	ensureContains(t, buildParams.Output.String(), "android_common_myapex/aconfig_flags.pb")
+}
+
+func TestAconfigFilesRemoveDuplicates(t *testing.T) {
+	ctx := testApex(t, apex_default_bp+`
+		apex {
+			name: "myapex",
+			manifest: ":myapex.manifest",
+			androidManifest: ":myapex.androidmanifest",
+			key: "myapex.key",
+			java_libs: [
+				"my_java_library_foo",
+				"my_java_library_bar",
+			],
+			updatable: false,
+		}
+
+		java_library {
+			name: "my_java_library_foo",
+			srcs: ["foo/bar/MyClass.java"],
+			sdk_version: "none",
+			system_modules: "none",
+			static_libs: ["my_java_aconfig_library_foo"],
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		java_library {
+			name: "my_java_library_bar",
+			srcs: ["foo/bar/MyClass.java"],
+			sdk_version: "none",
+			system_modules: "none",
+			static_libs: ["my_java_aconfig_library_bar"],
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		aconfig_declarations {
+			name: "my_aconfig_declarations_foo",
+			package: "com.example.package",
+			container: "myapex",
+			srcs: ["foo.aconfig"],
+		}
+
+		java_aconfig_library {
+			name: "my_java_aconfig_library_foo",
+			aconfig_declarations: "my_aconfig_declarations_foo",
+			apex_available: [
+				"myapex",
+			],
+		}
+
+		java_aconfig_library {
+			name: "my_java_aconfig_library_bar",
+			aconfig_declarations: "my_aconfig_declarations_foo",
+			apex_available: [
+				"myapex",
+			],
+		}
+	`)
+
+	mod := ctx.ModuleForTests("myapex", "android_common_myapex")
+	combineAconfigRule := mod.Rule("All_aconfig_declarations_dump")
+	s := " " + combineAconfigRule.Args["cache_files"]
+	aconfigArgs := regexp.MustCompile(" --cache ").Split(s, -1)[1:]
+	if len(aconfigArgs) != 1 {
+		t.Fatalf("Expected 1 commands, got %d in:\n%s", len(aconfigArgs), s)
+	}
+	android.EnsureListContainsSuffix(t, aconfigArgs, "my_aconfig_declarations_foo/intermediate.pb")
+
+	buildParams := combineAconfigRule.BuildParams
+	if len(buildParams.Inputs) != 1 {
+		t.Fatalf("Expected 1 input, got %d", len(buildParams.Inputs))
+	}
+	android.EnsureListContainsSuffix(t, buildParams.Inputs.Strings(), "my_aconfig_declarations_foo/intermediate.pb")
+	ensureContains(t, buildParams.Output.String(), "android_common_myapex/aconfig_flags.pb")
+}
diff --git a/apex/bp2build.go b/apex/bp2build.go
deleted file mode 100644
index a3dda83..0000000
--- a/apex/bp2build.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (C) 2022 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//	http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package apex
-
-import (
-	"android/soong/android"
-	"encoding/json"
-	"strings"
-)
-
-// This file contains the bp2build integration for the apex package.
-
-// Export constants as Starlark using bp2build to Bazel.
-func BazelApexToolchainVars() (string, error) {
-	marshalled, err := json.Marshal(apexAvailBaseline)
-	if err != nil {
-		return "", err
-	}
-	content := []string{
-		"# GENERATED BY SOONG. DO NOT EDIT.",
-		"default_manifest_version = " + android.DefaultUpdatableModuleVersion, // constants.go is different in every branch.
-		"apex_available_baseline = json.decode('''" + string(marshalled) + "''')",
-	}
-	return strings.Join(content, "\n"), nil
-}
diff --git a/apex/bp2build_test.go b/apex/bp2build_test.go
deleted file mode 100644
index 6bab67d..0000000
--- a/apex/bp2build_test.go
+++ /dev/null
@@ -1,545 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//	http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package apex
-
-import (
-	"android/soong/android"
-	"android/soong/android/allowlists"
-	"android/soong/bazel/cquery"
-	"fmt"
-	"path/filepath"
-	"strings"
-	"testing"
-)
-
-func TestApexImageInMixedBuilds(t *testing.T) {
-	bp := `
-apex_key{
-	name: "foo_key",
-}
-
-apex {
-	name: "foo",
-	key: "foo_key",
-	updatable: true,
-	min_sdk_version: "31",
-	file_contexts: ":myapex-file_contexts",
-	bazel_module: { label: "//:foo" },
-}`
-
-	outputBaseDir := "out/bazel"
-	result := android.GroupFixturePreparers(
-		prepareForApexTest,
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: outputBaseDir,
-				LabelToApexInfo: map[string]cquery.ApexInfo{
-					"//:foo": cquery.ApexInfo{
-						// ApexInfo Starlark provider.
-						SignedOutput:           "signed_out.apex",
-						SignedCompressedOutput: "signed_out.capex",
-						UnsignedOutput:         "unsigned_out.apex",
-						BundleKeyInfo:          []string{"public_key", "private_key"},
-						ContainerKeyInfo:       []string{"container_cert", "container_private"},
-						SymbolsUsedByApex:      "foo_using.txt",
-						JavaSymbolsUsedByApex:  "foo_using.xml",
-						BundleFile:             "apex_bundle.zip",
-						InstalledFiles:         "installed-files.txt",
-						RequiresLibs:           []string{"//path/c:c", "//path/d:d"},
-
-						// unused
-						PackageName:  "pkg_name",
-						ProvidesLibs: []string{"a", "b"},
-
-						// ApexMkInfo Starlark provider
-						PayloadFilesInfo: []map[string]string{
-							{
-								"built_file":       "bazel-out/adbd",
-								"install_dir":      "bin",
-								"class":            "nativeExecutable",
-								"make_module_name": "adbd",
-								"basename":         "adbd",
-								"package":          "foo",
-							},
-						},
-						MakeModulesToInstall: []string{"c"}, // d deliberately omitted
-					},
-				},
-			}
-		}),
-	).RunTestWithBp(t, bp)
-
-	m := result.ModuleForTests("foo", "android_common_foo").Module()
-	ab, ok := m.(*apexBundle)
-
-	if !ok {
-		t.Fatalf("Expected module to be an apexBundle, was not")
-	}
-
-	// TODO: refactor to android.AssertStringEquals
-	if w, g := "out/bazel/execroot/__main__/public_key", ab.publicKeyFile.String(); w != g {
-		t.Errorf("Expected public key %q, got %q", w, g)
-	}
-
-	if w, g := "out/bazel/execroot/__main__/private_key", ab.privateKeyFile.String(); w != g {
-		t.Errorf("Expected private key %q, got %q", w, g)
-	}
-
-	if w, g := "out/bazel/execroot/__main__/container_cert", ab.containerCertificateFile.String(); w != g {
-		t.Errorf("Expected public container key %q, got %q", w, g)
-	}
-
-	if w, g := "out/bazel/execroot/__main__/container_private", ab.containerPrivateKeyFile.String(); w != g {
-		t.Errorf("Expected private container key %q, got %q", w, g)
-	}
-
-	if w, g := "out/bazel/execroot/__main__/signed_out.apex", ab.outputFile.String(); w != g {
-		t.Errorf("Expected output file %q, got %q", w, g)
-	}
-
-	if w, g := "out/bazel/execroot/__main__/foo_using.txt", ab.nativeApisUsedByModuleFile.String(); w != g {
-		t.Errorf("Expected output file %q, got %q", w, g)
-	}
-
-	if w, g := "out/bazel/execroot/__main__/foo_using.xml", ab.javaApisUsedByModuleFile.String(); w != g {
-		t.Errorf("Expected output file %q, got %q", w, g)
-	}
-
-	if w, g := "out/bazel/execroot/__main__/installed-files.txt", ab.installedFilesFile.String(); w != g {
-		t.Errorf("Expected installed-files.txt %q, got %q", w, g)
-	}
-
-	mkData := android.AndroidMkDataForTest(t, result.TestContext, m)
-	var builder strings.Builder
-	mkData.Custom(&builder, "foo", "BAZEL_TARGET_", "", mkData)
-
-	data := builder.String()
-	if w := "ALL_MODULES.$(my_register_name).BUNDLE := out/bazel/execroot/__main__/apex_bundle.zip"; !strings.Contains(data, w) {
-		t.Errorf("Expected %q in androidmk data, but did not find %q", w, data)
-	}
-	if w := "$(call dist-for-goals,checkbuild,out/bazel/execroot/__main__/installed-files.txt:foo-installed-files.txt)"; !strings.Contains(data, w) {
-		t.Errorf("Expected %q in androidmk data, but did not find %q", w, data)
-	}
-
-	// make modules to be installed to system
-	if len(ab.makeModulesToInstall) != 1 && ab.makeModulesToInstall[0] != "c" {
-		t.Errorf("Expected makeModulesToInstall slice to only contain 'c', got %q", ab.makeModulesToInstall)
-	}
-	if w := "LOCAL_REQUIRED_MODULES := adbd.foo c"; !strings.Contains(data, w) {
-		t.Errorf("Expected %q in androidmk data, but did not find it in %q", w, data)
-	}
-}
-
-func TestApexImageCreatesFilesInfoForMake(t *testing.T) {
-	bp := `
-apex_key{
-	name: "foo_key",
-}
-
-apex {
-	name: "foo",
-	key: "foo_key",
-	updatable: true,
-	min_sdk_version: "31",
-	file_contexts: ":myapex-file_contexts",
-	bazel_module: { label: "//:foo" },
-}`
-
-	outputBaseDir := "out/bazel"
-	result := android.GroupFixturePreparers(
-		prepareForApexTest,
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: outputBaseDir,
-				LabelToApexInfo: map[string]cquery.ApexInfo{
-					"//:foo": {
-						// ApexInfo Starlark provider. Necessary for the test.
-						SignedOutput:     "signed_out.apex",
-						BundleKeyInfo:    []string{"public_key", "private_key"},
-						ContainerKeyInfo: []string{"container_cert", "container_private"},
-
-						// ApexMkInfo Starlark provider
-						PayloadFilesInfo: []map[string]string{
-							{
-								"arch":                  "arm64",
-								"basename":              "libcrypto.so",
-								"built_file":            "bazel-out/64/libcrypto.so",
-								"class":                 "nativeSharedLib",
-								"install_dir":           "lib64",
-								"make_module_name":      "libcrypto",
-								"package":               "foo/bar",
-								"unstripped_built_file": "bazel-out/64/unstripped_libcrypto.so",
-							},
-							{
-								"arch":             "arm",
-								"basename":         "libcrypto.so",
-								"built_file":       "bazel-out/32/libcrypto.so",
-								"class":            "nativeSharedLib",
-								"install_dir":      "lib",
-								"make_module_name": "libcrypto",
-								"package":          "foo/bar",
-							},
-							{
-								"arch":             "arm64",
-								"basename":         "adbd",
-								"built_file":       "bazel-out/adbd",
-								"class":            "nativeExecutable",
-								"install_dir":      "bin",
-								"make_module_name": "adbd",
-								"package":          "foo",
-							},
-						},
-					},
-				},
-			}
-		}),
-	).RunTestWithBp(t, bp)
-
-	m := result.ModuleForTests("foo", "android_common_foo").Module()
-	ab, ok := m.(*apexBundle)
-
-	if !ok {
-		t.Fatalf("Expected module to be an apexBundle, was not")
-	}
-
-	expectedFilesInfo := []apexFile{
-		{
-			androidMkModuleName: "libcrypto",
-			builtFile:           android.PathForTesting("out/bazel/execroot/__main__/bazel-out/64/libcrypto.so"),
-			class:               nativeSharedLib,
-			customStem:          "libcrypto.so",
-			installDir:          "lib64",
-			moduleDir:           "foo/bar",
-			arch:                "arm64",
-			unstrippedBuiltFile: android.PathForTesting("out/bazel/execroot/__main__/bazel-out/64/unstripped_libcrypto.so"),
-		},
-		{
-			androidMkModuleName: "libcrypto",
-			builtFile:           android.PathForTesting("out/bazel/execroot/__main__/bazel-out/32/libcrypto.so"),
-			class:               nativeSharedLib,
-			customStem:          "libcrypto.so",
-			installDir:          "lib",
-			moduleDir:           "foo/bar",
-			arch:                "arm",
-		},
-		{
-			androidMkModuleName: "adbd",
-			builtFile:           android.PathForTesting("out/bazel/execroot/__main__/bazel-out/adbd"),
-			class:               nativeExecutable,
-			customStem:          "adbd",
-			installDir:          "bin",
-			moduleDir:           "foo",
-			arch:                "arm64",
-		},
-	}
-
-	if len(ab.filesInfo) != len(expectedFilesInfo) {
-		t.Errorf("Expected %d entries in ab.filesInfo, but got %d", len(ab.filesInfo), len(expectedFilesInfo))
-	}
-
-	for idx, f := range ab.filesInfo {
-		expected := expectedFilesInfo[idx]
-		android.AssertSame(t, "different class", expected.class, f.class)
-		android.AssertStringEquals(t, "different built file", expected.builtFile.String(), f.builtFile.String())
-		android.AssertStringEquals(t, "different custom stem", expected.customStem, f.customStem)
-		android.AssertStringEquals(t, "different install dir", expected.installDir, f.installDir)
-		android.AssertStringEquals(t, "different make module name", expected.androidMkModuleName, f.androidMkModuleName)
-		android.AssertStringEquals(t, "different moduleDir", expected.moduleDir, f.moduleDir)
-		android.AssertStringEquals(t, "different arch", expected.arch, f.arch)
-		if expected.unstrippedBuiltFile != nil {
-			if f.unstrippedBuiltFile == nil {
-				t.Errorf("expected an unstripped built file path.")
-			}
-			android.AssertStringEquals(t, "different unstripped built file", expected.unstrippedBuiltFile.String(), f.unstrippedBuiltFile.String())
-		}
-	}
-}
-
-func TestCompressedApexImageInMixedBuilds(t *testing.T) {
-	bp := `
-apex_key{
-	name: "foo_key",
-}
-apex {
-	name: "foo",
-	key: "foo_key",
-	updatable: true,
-	min_sdk_version: "31",
-	file_contexts: ":myapex-file_contexts",
-	bazel_module: { label: "//:foo" },
-	test_only_force_compression: true, // force compression
-}`
-
-	outputBaseDir := "out/bazel"
-	result := android.GroupFixturePreparers(
-		prepareForApexTest,
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: outputBaseDir,
-				LabelToApexInfo: map[string]cquery.ApexInfo{
-					"//:foo": cquery.ApexInfo{
-						SignedOutput:           "signed_out.apex",
-						SignedCompressedOutput: "signed_out.capex",
-						BundleKeyInfo:          []string{"public_key", "private_key"},
-						ContainerKeyInfo:       []string{"container_cert", "container_private"},
-					},
-				},
-			}
-		}),
-	).RunTestWithBp(t, bp)
-
-	m := result.ModuleForTests("foo", "android_common_foo").Module()
-	ab, ok := m.(*apexBundle)
-	if !ok {
-		t.Fatalf("Expected module to be an apexBundle, was not")
-	}
-
-	if w, g := "out/bazel/execroot/__main__/signed_out.capex", ab.outputFile.String(); w != g {
-		t.Errorf("Expected output file to be compressed apex %q, got %q", w, g)
-	}
-
-	mkData := android.AndroidMkDataForTest(t, result.TestContext, m)
-	var builder strings.Builder
-	mkData.Custom(&builder, "foo", "BAZEL_TARGET_", "", mkData)
-
-	data := builder.String()
-
-	expectedAndroidMk := []string{
-		"LOCAL_PREBUILT_MODULE_FILE := out/bazel/execroot/__main__/signed_out.capex",
-
-		// Check that the source install file is the capex. The dest is not important.
-		"LOCAL_SOONG_INSTALL_PAIRS := out/bazel/execroot/__main__/signed_out.capex:",
-	}
-	for _, androidMk := range expectedAndroidMk {
-		if !strings.Contains(data, androidMk) {
-			t.Errorf("Expected %q in androidmk data, but did not find %q", androidMk, data)
-		}
-	}
-}
-
-func TestOverrideApexImageInMixedBuilds(t *testing.T) {
-	originalBp := `
-apex_key{
-	name: "foo_key",
-}
-apex_key{
-	name: "override_foo_key",
-}
-apex {
-	name: "foo",
-	key: "foo_key",
-	updatable: true,
-	min_sdk_version: "31",
-	package_name: "pkg_name",
-	file_contexts: ":myapex-file_contexts",
-	%s
-}`
-	overrideBp := `
-override_apex {
-	name: "override_foo",
-	key: "override_foo_key",
-	package_name: "override_pkg_name",
-	base: "foo",
-	%s
-}
-`
-
-	originalApexBpDir := "original"
-	originalApexName := "foo"
-	overrideApexBpDir := "override"
-	overrideApexName := "override_foo"
-
-	defaultApexLabel := fmt.Sprintf("//%s:%s", originalApexBpDir, originalApexName)
-	defaultOverrideApexLabel := fmt.Sprintf("//%s:%s", overrideApexBpDir, overrideApexName)
-
-	testCases := []struct {
-		desc                    string
-		bazelModuleProp         string
-		apexLabel               string
-		overrideBazelModuleProp string
-		overrideApexLabel       string
-		bp2buildConfiguration   android.Bp2BuildConversionAllowlist
-	}{
-		{
-			desc:                    "both explicit labels",
-			bazelModuleProp:         `bazel_module: { label: "//:foo" },`,
-			apexLabel:               "//:foo",
-			overrideBazelModuleProp: `bazel_module: { label: "//:override_foo" },`,
-			overrideApexLabel:       "//:override_foo",
-			bp2buildConfiguration:   android.NewBp2BuildAllowlist(),
-		},
-		{
-			desc:                    "both explicitly allowed",
-			bazelModuleProp:         `bazel_module: { bp2build_available: true },`,
-			apexLabel:               defaultApexLabel,
-			overrideBazelModuleProp: `bazel_module: { bp2build_available: true },`,
-			overrideApexLabel:       defaultOverrideApexLabel,
-			bp2buildConfiguration:   android.NewBp2BuildAllowlist(),
-		},
-		{
-			desc:              "original allowed by dir, override allowed by name",
-			apexLabel:         defaultApexLabel,
-			overrideApexLabel: defaultOverrideApexLabel,
-			bp2buildConfiguration: android.NewBp2BuildAllowlist().SetDefaultConfig(
-				map[string]allowlists.BazelConversionConfigEntry{
-					originalApexBpDir: allowlists.Bp2BuildDefaultTrue,
-				}).SetModuleAlwaysConvertList([]string{
-				overrideApexName,
-			}),
-		},
-		{
-			desc:              "both allowed by name",
-			apexLabel:         defaultApexLabel,
-			overrideApexLabel: defaultOverrideApexLabel,
-			bp2buildConfiguration: android.NewBp2BuildAllowlist().SetModuleAlwaysConvertList([]string{
-				originalApexName,
-				overrideApexName,
-			}),
-		},
-		{
-			desc:              "override allowed by name",
-			apexLabel:         defaultApexLabel,
-			overrideApexLabel: defaultOverrideApexLabel,
-			bp2buildConfiguration: android.NewBp2BuildAllowlist().SetModuleAlwaysConvertList([]string{
-				overrideApexName,
-			}),
-		},
-		{
-			desc:              "override allowed by dir",
-			apexLabel:         defaultApexLabel,
-			overrideApexLabel: defaultOverrideApexLabel,
-			bp2buildConfiguration: android.NewBp2BuildAllowlist().SetDefaultConfig(
-				map[string]allowlists.BazelConversionConfigEntry{
-					overrideApexBpDir: allowlists.Bp2BuildDefaultTrue,
-				}).SetModuleAlwaysConvertList([]string{}),
-		},
-	}
-
-	for _, tc := range testCases {
-		t.Run(tc.desc, func(t *testing.T) {
-			outputBaseDir := "out/bazel"
-			result := android.GroupFixturePreparers(
-				prepareForApexTest,
-				android.FixtureAddTextFile(filepath.Join(originalApexBpDir, "Android.bp"), fmt.Sprintf(originalBp, tc.bazelModuleProp)),
-				android.FixtureAddTextFile(filepath.Join(overrideApexBpDir, "Android.bp"), fmt.Sprintf(overrideBp, tc.overrideBazelModuleProp)),
-				android.FixtureModifyContext(func(ctx *android.TestContext) {
-					ctx.RegisterBp2BuildConfig(tc.bp2buildConfiguration)
-				}),
-				android.FixtureModifyConfig(func(config android.Config) {
-					config.BazelContext = android.MockBazelContext{
-						OutputBaseDir: outputBaseDir,
-						LabelToApexInfo: map[string]cquery.ApexInfo{
-							tc.apexLabel: cquery.ApexInfo{
-								// ApexInfo Starlark provider
-								SignedOutput:          "signed_out.apex",
-								UnsignedOutput:        "unsigned_out.apex",
-								BundleKeyInfo:         []string{"public_key", "private_key"},
-								ContainerKeyInfo:      []string{"container_cert", "container_private"},
-								SymbolsUsedByApex:     "foo_using.txt",
-								JavaSymbolsUsedByApex: "foo_using.xml",
-								BundleFile:            "apex_bundle.zip",
-								InstalledFiles:        "installed-files.txt",
-								RequiresLibs:          []string{"//path/c:c", "//path/d:d"},
-
-								// unused
-								PackageName:  "pkg_name",
-								ProvidesLibs: []string{"a", "b"},
-
-								// ApexMkInfo Starlark provider
-								MakeModulesToInstall: []string{"c"}, // d deliberately omitted
-							},
-							tc.overrideApexLabel: cquery.ApexInfo{
-								// ApexInfo Starlark provider
-								SignedOutput:          "override_signed_out.apex",
-								UnsignedOutput:        "override_unsigned_out.apex",
-								BundleKeyInfo:         []string{"override_public_key", "override_private_key"},
-								ContainerKeyInfo:      []string{"override_container_cert", "override_container_private"},
-								SymbolsUsedByApex:     "override_foo_using.txt",
-								JavaSymbolsUsedByApex: "override_foo_using.xml",
-								BundleFile:            "override_apex_bundle.zip",
-								InstalledFiles:        "override_installed-files.txt",
-								RequiresLibs:          []string{"//path/c:c", "//path/d:d"},
-
-								// unused
-								PackageName:  "override_pkg_name",
-								ProvidesLibs: []string{"a", "b"},
-
-								// ApexMkInfo Starlark provider
-								MakeModulesToInstall: []string{"c"}, // d deliberately omitted
-							},
-						},
-					}
-				}),
-			).RunTest(t)
-
-			m := result.ModuleForTests("foo", "android_common_override_foo_foo").Module()
-			ab, ok := m.(*apexBundle)
-			if !ok {
-				t.Fatalf("Expected module to be an apexBundle, was not")
-			}
-
-			if w, g := "out/bazel/execroot/__main__/override_public_key", ab.publicKeyFile.String(); w != g {
-				t.Errorf("Expected public key %q, got %q", w, g)
-			}
-
-			if w, g := "out/bazel/execroot/__main__/override_private_key", ab.privateKeyFile.String(); w != g {
-				t.Errorf("Expected private key %q, got %q", w, g)
-			}
-
-			if w, g := "out/bazel/execroot/__main__/override_container_cert", ab.containerCertificateFile; g != nil && w != g.String() {
-				t.Errorf("Expected public container key %q, got %q", w, g)
-			}
-
-			if w, g := "out/bazel/execroot/__main__/override_container_private", ab.containerPrivateKeyFile; g != nil && w != g.String() {
-				t.Errorf("Expected private container key %q, got %q", w, g)
-			}
-
-			if w, g := "out/bazel/execroot/__main__/override_signed_out.apex", ab.outputFile.String(); w != g {
-				t.Errorf("Expected output file %q, got %q", w, g)
-			}
-
-			if w, g := "out/bazel/execroot/__main__/override_foo_using.txt", ab.nativeApisUsedByModuleFile.String(); w != g {
-				t.Errorf("Expected output file %q, got %q", w, g)
-			}
-
-			if w, g := "out/bazel/execroot/__main__/override_foo_using.xml", ab.javaApisUsedByModuleFile.String(); w != g {
-				t.Errorf("Expected output file %q, got %q", w, g)
-			}
-
-			if w, g := "out/bazel/execroot/__main__/override_installed-files.txt", ab.installedFilesFile.String(); w != g {
-				t.Errorf("Expected installed-files.txt %q, got %q", w, g)
-			}
-
-			mkData := android.AndroidMkDataForTest(t, result.TestContext, m)
-			var builder strings.Builder
-			mkData.Custom(&builder, "override_foo", "BAZEL_TARGET_", "", mkData)
-
-			data := builder.String()
-			if w := "ALL_MODULES.$(my_register_name).BUNDLE := out/bazel/execroot/__main__/override_apex_bundle.zip"; !strings.Contains(data, w) {
-				t.Errorf("Expected %q in androidmk data, but did not find %q", w, data)
-			}
-			if w := "$(call dist-for-goals,checkbuild,out/bazel/execroot/__main__/override_installed-files.txt:override_foo-installed-files.txt)"; !strings.Contains(data, w) {
-				t.Errorf("Expected %q in androidmk data, but did not find %q", w, data)
-			}
-
-			// make modules to be installed to system
-			if len(ab.makeModulesToInstall) != 1 || ab.makeModulesToInstall[0] != "c" {
-				t.Errorf("Expected makeModulestoInstall slice to only contain 'c', got %q", ab.makeModulesToInstall)
-			}
-			if w := "LOCAL_REQUIRED_MODULES := c"; !strings.Contains(data, w) {
-				t.Errorf("Expected %q in androidmk data, but did not find it in %q", w, data)
-			}
-		})
-	}
-}
diff --git a/apex/builder.go b/apex/builder.go
index 3f358ac..3078863 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -24,6 +24,7 @@
 	"strconv"
 	"strings"
 
+	"android/soong/aconfig"
 	"android/soong/android"
 	"android/soong/java"
 
@@ -36,6 +37,7 @@
 )
 
 func init() {
+	pctx.Import("android/soong/aconfig")
 	pctx.Import("android/soong/android")
 	pctx.Import("android/soong/cc/config")
 	pctx.Import("android/soong/java")
@@ -80,6 +82,7 @@
 	pctx.HostBinToolVariable("conv_linker_config", "conv_linker_config")
 	pctx.HostBinToolVariable("assemble_vintf", "assemble_vintf")
 	pctx.HostBinToolVariable("apex_elf_checker", "apex_elf_checker")
+	pctx.HostBinToolVariable("aconfig", "aconfig")
 }
 
 var (
@@ -574,6 +577,7 @@
 
 		installMapSet[installMapPath.String()+":"+fi.installDir+"/"+fi.builtFile.Base()] = true
 	}
+
 	implicitInputs = append(implicitInputs, a.manifestPbOut)
 
 	if len(installMapSet) > 0 {
@@ -628,10 +632,28 @@
 	outHostBinDir := ctx.Config().HostToolPath(ctx, "").String()
 	prebuiltSdkToolsBinDir := filepath.Join("prebuilts", "sdk", "tools", runtime.GOOS, "bin")
 
+	defaultReadOnlyFiles := []string{"apex_manifest.json", "apex_manifest.pb"}
+	if len(a.aconfigFiles) > 0 {
+		apexAconfigFile := android.PathForModuleOut(ctx, "aconfig_flags.pb")
+		ctx.Build(pctx, android.BuildParams{
+			Rule:        aconfig.AllDeclarationsRule,
+			Inputs:      a.aconfigFiles,
+			Output:      apexAconfigFile,
+			Description: "combine_aconfig_declarations",
+			Args: map[string]string{
+				"cache_files": android.JoinPathsWithPrefix(a.aconfigFiles, "--cache "),
+			},
+		})
+
+		copyCommands = append(copyCommands, "cp -f "+apexAconfigFile.String()+" "+imageDir.String())
+		implicitInputs = append(implicitInputs, apexAconfigFile)
+		defaultReadOnlyFiles = append(defaultReadOnlyFiles, apexAconfigFile.Base())
+	}
+
 	////////////////////////////////////////////////////////////////////////////////////
 	// Step 2: create canned_fs_config which encodes filemode,uid,gid of each files
 	// in this APEX. The file will be used by apexer in later steps.
-	cannedFsConfig := a.buildCannedFsConfig(ctx)
+	cannedFsConfig := a.buildCannedFsConfig(ctx, defaultReadOnlyFiles)
 	implicitInputs = append(implicitInputs, cannedFsConfig)
 
 	////////////////////////////////////////////////////////////////////////////////////
@@ -1082,8 +1104,8 @@
 	a.lintReports = java.BuildModuleLintReportZips(ctx, depSetsBuilder.Build())
 }
 
-func (a *apexBundle) buildCannedFsConfig(ctx android.ModuleContext) android.OutputPath {
-	var readOnlyPaths = []string{"apex_manifest.json", "apex_manifest.pb"}
+func (a *apexBundle) buildCannedFsConfig(ctx android.ModuleContext, defaultReadOnlyFiles []string) android.OutputPath {
+	var readOnlyPaths = defaultReadOnlyFiles
 	var executablePaths []string // this also includes dirs
 	var appSetDirs []string
 	appSetFiles := make(map[string]android.Path)
diff --git a/apex/key.go b/apex/key.go
index 2405e98..e4214f0 100644
--- a/apex/key.go
+++ b/apex/key.go
@@ -18,8 +18,6 @@
 	"fmt"
 
 	"android/soong/android"
-	"android/soong/bazel"
-
 	"github.com/google/blueprint/proptools"
 )
 
@@ -35,7 +33,6 @@
 
 type apexKey struct {
 	android.ModuleBase
-	android.BazelModuleBase
 
 	properties apexKeyProperties
 
@@ -58,7 +55,6 @@
 	module := &apexKey{}
 	module.AddProperties(&module.properties)
 	android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibCommon)
-	android.InitBazelModule(module)
 	return module
 }
 
@@ -159,41 +155,3 @@
 	android.WriteFileRuleVerbatim(ctx, path, entry.String())
 	return path
 }
-
-// For Bazel / bp2build
-
-type bazelApexKeyAttributes struct {
-	Public_key      bazel.LabelAttribute
-	Public_key_name bazel.StringAttribute
-
-	Private_key      bazel.LabelAttribute
-	Private_key_name bazel.StringAttribute
-}
-
-// ConvertWithBp2build performs conversion apexKey for bp2build
-func (m *apexKey) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	apexKeyBp2BuildInternal(ctx, m)
-}
-
-func apexKeyBp2BuildInternal(ctx android.Bp2buildMutatorContext, module *apexKey) {
-	privateKeyLabelAttribute, privateKeyNameAttribute :=
-		android.BazelStringOrLabelFromProp(ctx, module.properties.Private_key)
-
-	publicKeyLabelAttribute, publicKeyNameAttribute :=
-		android.BazelStringOrLabelFromProp(ctx, module.properties.Public_key)
-
-	attrs := &bazelApexKeyAttributes{
-		Private_key:      privateKeyLabelAttribute,
-		Private_key_name: privateKeyNameAttribute,
-
-		Public_key:      publicKeyLabelAttribute,
-		Public_key_name: publicKeyNameAttribute,
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "apex_key",
-		Bzl_load_location: "//build/bazel/rules/apex:apex_key.bzl",
-	}
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: module.Name()}, attrs)
-}
diff --git a/bp2build/Android.bp b/bp2build/Android.bp
index 64ee01f..ba12682 100644
--- a/bp2build/Android.bp
+++ b/bp2build/Android.bp
@@ -6,18 +6,12 @@
     name: "soong-bp2build",
     pkgPath: "android/soong/bp2build",
     srcs: [
-        "aconfig_conversion_test.go",
         "androidbp_to_build_templates.go",
-        "bp2build.go",
-        "bp2build_product_config.go",
         "build_conversion.go",
         "bzl_conversion.go",
         "configurability.go",
         "constants.go",
         "conversion.go",
-        "metrics.go",
-        "symlink_forest.go",
-        "testing.go",
     ],
     deps: [
         "blueprint-bootstrap",
@@ -41,63 +35,7 @@
         "soong-ui-metrics",
     ],
     testSrcs: [
-        "go_conversion_test.go",
-        "aar_conversion_test.go",
-        "aidl_library_conversion_test.go",
-        "android_app_certificate_conversion_test.go",
-        "android_app_conversion_test.go",
-        "android_test_conversion_test.go",
-        "apex_conversion_test.go",
-        "apex_key_conversion_test.go",
-        "build_conversion_test.go",
-        "bp2build_product_config_test.go",
-        "bzl_conversion_test.go",
-        "cc_binary_conversion_test.go",
-        "cc_library_conversion_test.go",
-        "cc_library_headers_conversion_test.go",
-        "cc_library_shared_conversion_test.go",
-        "cc_library_static_conversion_test.go",
-        "cc_object_conversion_test.go",
-        "cc_prebuilt_library_conversion_test.go",
-        "cc_prebuilt_library_shared_test.go",
-        "cc_prebuilt_library_static_test.go",
-        "cc_prebuilt_object_conversion_test.go",
-        "cc_test_conversion_test.go",
-        "cc_yasm_conversion_test.go",
         "conversion_test.go",
-        "droiddoc_exported_dir_conversion_test.go",
-        "fdo_profile_conversion_test.go",
-        "filegroup_conversion_test.go",
-        "genrule_conversion_test.go",
-        "gensrcs_conversion_test.go",
-        "java_binary_host_conversion_test.go",
-        "java_host_for_device_conversion_test.go",
-        "java_import_conversion_test.go",
-        "java_library_conversion_test.go",
-        "java_library_host_conversion_test.go",
-        "java_plugin_conversion_test.go",
-        "java_proto_conversion_test.go",
-        "java_sdk_library_conversion_test.go",
-        "java_sdk_library_import_conversion_test.go",
-        "java_test_host_conversion_test.go",
-        "license_conversion_test.go",
-        "license_kind_conversion_test.go",
-        "linker_config_conversion_test.go",
-        "package_conversion_test.go",
-        "performance_test.go",
-        "platform_compat_config_conversion_test.go",
-        "prebuilt_etc_conversion_test.go",
-        "python_binary_conversion_test.go",
-        "python_library_conversion_test.go",
-        "python_test_conversion_test.go",
-        "rust_binary_conversion_test.go",
-        "rust_ffi_conversion_test.go",
-        "rust_library_conversion_test.go",
-        "rust_proc_macro_conversion_test.go",
-        "rust_protobuf_conversion_test.go",
-        "sh_conversion_test.go",
-        "sh_test_conversion_test.go",
-        "soong_config_module_type_conversion_test.go",
     ],
     pluginFor: [
         "soong_build",
diff --git a/bp2build/aar_conversion_test.go b/bp2build/aar_conversion_test.go
deleted file mode 100644
index bdad1f4..0000000
--- a/bp2build/aar_conversion_test.go
+++ /dev/null
@@ -1,249 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/java"
-)
-
-func runAndroidLibraryImportTestWithRegistrationCtxFunc(t *testing.T, registrationCtxFunc func(ctx android.RegistrationContext), tc Bp2buildTestCase) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "android_library_import"
-	(&tc).ModuleTypeUnderTestFactory = java.AARImportFactory
-	RunBp2BuildTestCase(t, registrationCtxFunc, tc)
-}
-
-func runAndroidLibraryImportTest(t *testing.T, tc Bp2buildTestCase) {
-	runAndroidLibraryImportTestWithRegistrationCtxFunc(t, func(ctx android.RegistrationContext) {}, tc)
-}
-
-func TestConvertAndroidLibrary(t *testing.T) {
-	t.Helper()
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, Bp2buildTestCase{
-		Description:                "Android Library - simple example",
-		ModuleTypeUnderTest:        "android_library",
-		ModuleTypeUnderTestFactory: java.AndroidLibraryFactory,
-		Filesystem: map[string]string{
-			"lib.java":                     "",
-			"arm.java":                     "",
-			"x86.java":                     "",
-			"res/res.png":                  "",
-			"manifest/AndroidManifest.xml": "",
-		},
-		StubbedBuildDefinitions: []string{"static_lib_dep"},
-		Blueprint: simpleModule("android_library", "static_lib_dep") + `
-android_library {
-	name: "TestLib",
-	srcs: ["lib.java"],
-	arch: {
-		arm: {
-			srcs: ["arm.java"],
-		},
-		x86: {
-			srcs: ["x86.java"],
-		}
-	},
-	manifest: "manifest/AndroidManifest.xml",
-	static_libs: ["static_lib_dep"],
-	sdk_version: "current",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget(
-				"android_library",
-				"TestLib",
-				AttrNameToString{
-					"srcs": `["lib.java"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["arm.java"],
-        "//build/bazel_common_rules/platforms/arch:x86": ["x86.java"],
-        "//conditions:default": [],
-    })`,
-					"manifest":       `"manifest/AndroidManifest.xml"`,
-					"resource_files": `["res/res.png"]`,
-					"deps":           `[":static_lib_dep"]`,
-					"exports":        `[":static_lib_dep"]`,
-					"sdk_version":    `"current"`, // use as default
-				}),
-			MakeNeverlinkDuplicateTarget("android_library", "TestLib"),
-		}})
-}
-
-func TestConvertAndroidLibraryWithNoSources(t *testing.T) {
-	t.Helper()
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, Bp2buildTestCase{
-		Description:                "Android Library - modules will deps when there are no sources",
-		ModuleTypeUnderTest:        "android_library",
-		ModuleTypeUnderTestFactory: java.AndroidLibraryFactory,
-		Filesystem: map[string]string{
-			"res/res.png":         "",
-			"AndroidManifest.xml": "",
-		},
-		Blueprint: simpleModule("android_library", "lib_dep") + `
-android_library {
-	name: "TestLib",
-	srcs: [],
-	manifest: "AndroidManifest.xml",
-	libs: ["lib_dep"],
-	sdk_version: "current",
-}
-`,
-		StubbedBuildDefinitions: []string{"lib_dep"},
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget(
-				"android_library",
-				"TestLib",
-				AttrNameToString{
-					"manifest":       `"AndroidManifest.xml"`,
-					"resource_files": `["res/res.png"]`,
-					"sdk_version":    `"current"`, // use as default
-				},
-			),
-			MakeNeverlinkDuplicateTarget("android_library", "TestLib"),
-		},
-	})
-}
-
-func TestConvertAndroidLibraryImport(t *testing.T) {
-	runAndroidLibraryImportTestWithRegistrationCtxFunc(t,
-		func(ctx android.RegistrationContext) {
-			ctx.RegisterModuleType("android_library", java.AndroidLibraryFactory)
-		},
-		Bp2buildTestCase{
-			Description:             "Android Library Import",
-			StubbedBuildDefinitions: []string{"static_lib_dep", "static_import_dep", "static_import_dep-neverlink"},
-			// Bazel's aar_import can only export *_import targets, so we expect
-			// only "static_import_dep" in exports, but both "static_lib_dep" and
-			// "static_import_dep" in deps
-			Blueprint: simpleModule("android_library", "static_lib_dep") + `
-android_library_import {
-        name: "TestImport",
-        aars: ["import.aar"],
-        static_libs: ["static_lib_dep", "static_import_dep"],
-    sdk_version: "current",
-}
-
-android_library_import {
-        name: "static_import_dep",
-        aars: ["import.aar"],
-}
-`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget(
-					"aar_import",
-					"TestImport",
-					AttrNameToString{
-						"aar": `"import.aar"`,
-						"deps": `[
-        ":static_lib_dep",
-        ":static_import_dep",
-    ]`,
-						"exports":     `[":static_import_dep"]`,
-						"sdk_version": `"current"`, // use as default
-					},
-				),
-				MakeNeverlinkDuplicateTarget("android_library", "TestImport"),
-			},
-		},
-	)
-}
-
-func TestConvertAndroidLibraryKotlin(t *testing.T) {
-	t.Helper()
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, Bp2buildTestCase{
-		Description:                "Android Library with .kt srcs and common_srcs attribute",
-		ModuleTypeUnderTest:        "android_library",
-		ModuleTypeUnderTestFactory: java.AndroidLibraryFactory,
-		Filesystem: map[string]string{
-			"AndroidManifest.xml": "",
-		},
-		Blueprint: `
-android_library {
-	name: "TestLib",
-	srcs: ["a.java", "b.kt"],
-	common_srcs: ["c.kt"],
-	sdk_version: "current",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget(
-				"android_library",
-				"TestLib",
-				AttrNameToString{
-					"srcs": `[
-        "a.java",
-        "b.kt",
-    ]`,
-					"common_srcs":    `["c.kt"]`,
-					"manifest":       `"AndroidManifest.xml"`,
-					"resource_files": `[]`,
-					"sdk_version":    `"current"`, // use as default
-				}),
-			MakeNeverlinkDuplicateTarget("android_library", "TestLib"),
-		}})
-}
-
-func TestConvertAndroidLibraryKotlinCflags(t *testing.T) {
-	t.Helper()
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, Bp2buildTestCase{
-		Description:                "Android Library with .kt srcs and kotlincflags ",
-		ModuleTypeUnderTest:        "android_library",
-		ModuleTypeUnderTestFactory: java.AndroidLibraryFactory,
-		Filesystem: map[string]string{
-			"AndroidManifest.xml": "",
-		},
-		Blueprint: `
-android_library {
-	name: "TestLib",
-	srcs: ["a.java", "b.kt"],
-	kotlincflags: ["-flag1", "-flag2"],
-	sdk_version: "current",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget(
-				"android_library",
-				"TestLib",
-				AttrNameToString{
-					"srcs": `[
-        "a.java",
-        "b.kt",
-    ]`,
-					"kotlincflags": `[
-        "-flag1",
-        "-flag2",
-    ]`,
-					"manifest":       `"AndroidManifest.xml"`,
-					"resource_files": `[]`,
-					"sdk_version":    `"current"`, // use as default
-				}),
-			MakeNeverlinkDuplicateTarget("android_library", "TestLib"),
-		}})
-}
-
-func TestAarImportFailsToConvertNoAars(t *testing.T) {
-	runAndroidLibraryImportTest(t,
-		Bp2buildTestCase{
-			Description: "Android Library Import with no aars does not convert.",
-			Blueprint: `
-android_library_import {
-        name: "no_aar_import",
-}
-`,
-			ExpectedBazelTargets: []string{},
-		})
-}
diff --git a/bp2build/aconfig_conversion_test.go b/bp2build/aconfig_conversion_test.go
deleted file mode 100644
index d6e20df..0000000
--- a/bp2build/aconfig_conversion_test.go
+++ /dev/null
@@ -1,252 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/aconfig"
-	"android/soong/android"
-	"android/soong/cc"
-	"android/soong/java"
-)
-
-func registerAconfigModuleTypes(ctx android.RegistrationContext) {
-	aconfig.RegisterBuildComponents(ctx)
-	ctx.RegisterModuleType("cc_library", cc.LibraryFactory)
-	ctx.RegisterModuleType("java_library", java.LibraryFactory)
-}
-
-func TestAconfigDeclarations(t *testing.T) {
-	bp := `
-	aconfig_declarations {
-		name: "foo",
-		srcs: [
-			"foo1.aconfig",
-			"test/foo2.aconfig",
-		],
-		package: "com.android.foo",
-	}
-	`
-	expectedBazelTarget := MakeBazelTargetNoRestrictions(
-		"aconfig_declarations",
-		"foo",
-		AttrNameToString{
-			"srcs": `[
-        "foo1.aconfig",
-        "test/foo2.aconfig",
-    ]`,
-			"package": `"com.android.foo"`,
-		},
-	)
-	RunBp2BuildTestCase(t, registerAconfigModuleTypes, Bp2buildTestCase{
-		Blueprint:            bp,
-		ExpectedBazelTargets: []string{expectedBazelTarget},
-	})
-}
-
-func TestAconfigValues(t *testing.T) {
-	bp := `
-	aconfig_values {
-		name: "foo",
-		srcs: [
-			"foo1.textproto",
-		],
-		package: "com.android.foo",
-	}
-	aconfig_value_set {
-    name: "bar",
-    values: [
-        "foo"
-    ]
-	}
-	`
-	expectedBazelTargets := []string{
-		MakeBazelTargetNoRestrictions(
-			"aconfig_values",
-			"foo",
-			AttrNameToString{
-				"srcs":    `["foo1.textproto"]`,
-				"package": `"com.android.foo"`,
-			},
-		),
-		MakeBazelTargetNoRestrictions(
-			"aconfig_value_set",
-			"bar",
-			AttrNameToString{
-				"values": `[":foo"]`,
-			},
-		)}
-	RunBp2BuildTestCase(t, registerAconfigModuleTypes, Bp2buildTestCase{
-		Blueprint:            bp,
-		ExpectedBazelTargets: expectedBazelTargets,
-	})
-}
-
-func TestCcAconfigLibrary(t *testing.T) {
-	bp := `
-	aconfig_declarations {
-		name: "foo_aconfig_declarations",
-		srcs: [
-			"foo1.aconfig",
-		],
-		package: "com.android.foo",
-	}
-	cc_library {
-			name: "server_configurable_flags",
-			srcs: ["bar.cc"],
-	}
-	cc_aconfig_library {
-			name: "foo",
-			aconfig_declarations: "foo_aconfig_declarations",
-	}
-	`
-	expectedBazelTargets := []string{
-		MakeBazelTargetNoRestrictions(
-			"aconfig_declarations",
-			"foo_aconfig_declarations",
-			AttrNameToString{
-				"srcs":    `["foo1.aconfig"]`,
-				"package": `"com.android.foo"`,
-			},
-		),
-		MakeBazelTargetNoRestrictions(
-			"cc_aconfig_library",
-			"foo",
-			AttrNameToString{
-				"aconfig_declarations":   `":foo_aconfig_declarations"`,
-				"dynamic_deps":           `[":server_configurable_flags"]`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-			},
-		)}
-	RunBp2BuildTestCase(t, registerAconfigModuleTypes, Bp2buildTestCase{
-		Blueprint:               bp,
-		ExpectedBazelTargets:    expectedBazelTargets,
-		StubbedBuildDefinitions: []string{"server_configurable_flags"},
-	})
-}
-
-func TestJavaAconfigLibrary(t *testing.T) {
-	bp := `
-	aconfig_declarations {
-		name: "foo_aconfig_declarations",
-		srcs: [
-			"foo1.aconfig",
-		],
-		package: "com.android.foo",
-	}
-	java_library {
-			name: "foo_java_library",
-			srcs: ["foo.java"],
-			sdk_version: "current",
-	}
-	java_aconfig_library {
-			name: "foo",
-			aconfig_declarations: "foo_aconfig_declarations",
-			libs: ["foo_java_library"],
-			mode: "test",
-	}
-	`
-	expectedBazelTargets := []string{
-		MakeBazelTargetNoRestrictions(
-			"aconfig_declarations",
-			"foo_aconfig_declarations",
-			AttrNameToString{
-				"srcs":    `["foo1.aconfig"]`,
-				"package": `"com.android.foo"`,
-			},
-		),
-		MakeBazelTargetNoRestrictions(
-			"java_library",
-			"foo_java_library",
-			AttrNameToString{
-				"srcs":                   `["foo.java"]`,
-				"sdk_version":            `"current"`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-			},
-		),
-		MakeNeverlinkDuplicateTarget("java_library", "foo_java_library"),
-		MakeBazelTargetNoRestrictions(
-			"java_aconfig_library",
-			"foo",
-			AttrNameToString{
-				"aconfig_declarations":   `":foo_aconfig_declarations"`,
-				"libs":                   `[":foo_java_library-neverlink"]`,
-				"sdk_version":            `"system_current"`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-			},
-		)}
-	RunBp2BuildTestCase(t, registerAconfigModuleTypes, Bp2buildTestCase{
-		Blueprint:            bp,
-		ExpectedBazelTargets: expectedBazelTargets,
-	})
-}
-
-func TestJavaAconfigLibraryAsTaggedOutput(t *testing.T) {
-	bp := `
-	aconfig_declarations {
-		name: "foo_aconfig_declarations",
-		srcs: [
-			"foo.aconfig",
-		],
-		package: "com.android.foo",
-	}
-	java_library {
-			name: "foo_library",
-			srcs: [":foo_aconfig_library{.generated_srcjars}"],
-			sdk_version: "current",
-			bazel_module: { bp2build_available: true },
-	}
-	java_aconfig_library {
-			name: "foo_aconfig_library",
-			aconfig_declarations: "foo_aconfig_declarations",
-			mode: "test",
-	}
-	`
-	expectedBazelTargets := []string{
-		MakeBazelTargetNoRestrictions(
-			"aconfig_declarations",
-			"foo_aconfig_declarations",
-			AttrNameToString{
-				"srcs":    `["foo.aconfig"]`,
-				"package": `"com.android.foo"`,
-			},
-		),
-		MakeBazelTargetNoRestrictions(
-			"java_aconfig_library",
-			"foo_aconfig_library",
-			AttrNameToString{
-				"aconfig_declarations":   `":foo_aconfig_declarations"`,
-				"sdk_version":            `"system_current"`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-			},
-		),
-		MakeBazelTargetNoRestrictions(
-			"java_library",
-			"foo_library",
-			AttrNameToString{
-				"srcs":                   `[":foo_aconfig_library.generated_srcjars"]`,
-				"sdk_version":            `"current"`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-			},
-		),
-		MakeNeverlinkDuplicateTarget("java_library", "foo_library"),
-	}
-
-	RunBp2BuildTestCase(t, registerAconfigModuleTypes, Bp2buildTestCase{
-		Blueprint:            bp,
-		ExpectedBazelTargets: expectedBazelTargets,
-	})
-}
diff --git a/bp2build/aidl_library_conversion_test.go b/bp2build/aidl_library_conversion_test.go
deleted file mode 100644
index 0522da4..0000000
--- a/bp2build/aidl_library_conversion_test.go
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/aidl_library"
-	"android/soong/android"
-)
-
-func runAidlLibraryTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "aidl_library"
-	(&tc).ModuleTypeUnderTestFactory = aidl_library.AidlLibraryFactory
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, tc)
-}
-
-func TestAidlLibrary(t *testing.T) {
-	testcases := []struct {
-		name               string
-		bp                 string
-		expectedBazelAttrs AttrNameToString
-	}{
-		{
-			name: "aidl_library with strip_import_prefix",
-			bp: `
-	aidl_library {
-		name: "foo",
-		srcs: ["aidl/foo.aidl"],
-		hdrs: ["aidl/header.aidl"],
-		strip_import_prefix: "aidl",
-	}`,
-			expectedBazelAttrs: AttrNameToString{
-				"srcs":                `["aidl/foo.aidl"]`,
-				"hdrs":                `["aidl/header.aidl"]`,
-				"strip_import_prefix": `"aidl"`,
-				"tags":                `["apex_available=//apex_available:anyapex"]`,
-			},
-		},
-		{
-			name: "aidl_library without strip_import_prefix",
-			bp: `
-	aidl_library {
-		name: "foo",
-		srcs: ["aidl/foo.aidl"],
-		hdrs: ["aidl/header.aidl"],
-	}`,
-			expectedBazelAttrs: AttrNameToString{
-				"srcs": `["aidl/foo.aidl"]`,
-				"hdrs": `["aidl/header.aidl"]`,
-				"tags": `["apex_available=//apex_available:anyapex"]`,
-			},
-		},
-	}
-
-	for _, test := range testcases {
-		t.Run(test.name, func(t *testing.T) {
-			expectedBazelTargets := []string{
-				MakeBazelTargetNoRestrictions("aidl_library", "foo", test.expectedBazelAttrs),
-			}
-			runAidlLibraryTestCase(t, Bp2buildTestCase{
-				Description:          test.name,
-				Blueprint:            test.bp,
-				ExpectedBazelTargets: expectedBazelTargets,
-			})
-		})
-	}
-}
-
-func TestAidlLibraryWithDeps(t *testing.T) {
-	bp := `
-	aidl_library {
-		name: "bar",
-		srcs: ["Bar.aidl"],
-		hdrs: ["aidl/BarHeader.aidl"],
-	}
-	aidl_library {
-		name: "foo",
-		srcs: ["aidl/Foo.aidl"],
-		hdrs: ["aidl/FooHeader.aidl"],
-		strip_import_prefix: "aidl",
-		deps: ["bar"],
-	}`
-
-	t.Run("aidl_library with deps", func(t *testing.T) {
-		expectedBazelTargets := []string{
-			MakeBazelTargetNoRestrictions("aidl_library", "bar", AttrNameToString{
-				"srcs": `["Bar.aidl"]`,
-				"hdrs": `["aidl/BarHeader.aidl"]`,
-				"tags": `["apex_available=//apex_available:anyapex"]`,
-			}),
-			MakeBazelTargetNoRestrictions("aidl_library", "foo", AttrNameToString{
-				"srcs":                `["aidl/Foo.aidl"]`,
-				"hdrs":                `["aidl/FooHeader.aidl"]`,
-				"strip_import_prefix": `"aidl"`,
-				"deps":                `[":bar"]`,
-				"tags":                `["apex_available=//apex_available:anyapex"]`,
-			}),
-		}
-		runAidlLibraryTestCase(t, Bp2buildTestCase{
-			Description:          "aidl_library with deps",
-			Blueprint:            bp,
-			ExpectedBazelTargets: expectedBazelTargets,
-		})
-	})
-}
diff --git a/bp2build/android_app_certificate_conversion_test.go b/bp2build/android_app_certificate_conversion_test.go
deleted file mode 100644
index 0104513..0000000
--- a/bp2build/android_app_certificate_conversion_test.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"android/soong/android"
-	"android/soong/java"
-
-	"testing"
-)
-
-func runAndroidAppCertificateTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, registerAndroidAppCertificateModuleTypes, tc)
-}
-
-func registerAndroidAppCertificateModuleTypes(ctx android.RegistrationContext) {
-}
-
-func TestAndroidAppCertificateSimple(t *testing.T) {
-	runAndroidAppCertificateTestCase(t, Bp2buildTestCase{
-		Description:                "Android app certificate - simple example",
-		ModuleTypeUnderTest:        "android_app_certificate",
-		ModuleTypeUnderTestFactory: java.AndroidAppCertificateFactory,
-		Filesystem:                 map[string]string{},
-		Blueprint: `
-android_app_certificate {
-        name: "com.android.apogee.cert",
-        certificate: "chamber_of_secrets_dir",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTargetNoRestrictions("android_app_certificate", "com.android.apogee.cert", AttrNameToString{
-				"certificate": `"chamber_of_secrets_dir"`,
-			}),
-		}})
-}
diff --git a/bp2build/android_app_conversion_test.go b/bp2build/android_app_conversion_test.go
deleted file mode 100644
index 33d1a04..0000000
--- a/bp2build/android_app_conversion_test.go
+++ /dev/null
@@ -1,518 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"android/soong/android"
-	"android/soong/cc"
-	"android/soong/java"
-
-	"testing"
-)
-
-func runAndroidAppTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, registerAndroidAppModuleTypes, tc)
-}
-
-func registerAndroidAppModuleTypes(ctx android.RegistrationContext) {
-	ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-	ctx.RegisterModuleType("java_library", java.LibraryFactory)
-	ctx.RegisterModuleType("cc_library_shared", cc.LibrarySharedFactory)
-}
-
-func TestMinimalAndroidApp(t *testing.T) {
-	runAndroidAppTestCase(t, Bp2buildTestCase{
-		Description:                "Android app - simple example",
-		ModuleTypeUnderTest:        "android_app",
-		ModuleTypeUnderTestFactory: java.AndroidAppFactory,
-		Filesystem: map[string]string{
-			"app.java":            "",
-			"res/res.png":         "",
-			"AndroidManifest.xml": "",
-			"assets/asset.png":    "",
-		},
-		Blueprint: `
-android_app {
-		name: "TestApp",
-		srcs: ["app.java"],
-		sdk_version: "current",
-		optimize: {
-			shrink: true,
-			optimize: true,
-			obfuscate: true,
-		},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("android_binary", "TestApp", AttrNameToString{
-				"srcs":           `["app.java"]`,
-				"manifest":       `"AndroidManifest.xml"`,
-				"resource_files": `["res/res.png"]`,
-				"sdk_version":    `"current"`,
-				"assets":         `["assets/asset.png"]`,
-				"assets_dir":     `"assets"`,
-			}),
-		}})
-}
-
-func TestAndroidAppAllSupportedFields(t *testing.T) {
-	runAndroidAppTestCase(t, Bp2buildTestCase{
-		Description:                "Android app - all supported fields",
-		ModuleTypeUnderTest:        "android_app",
-		ModuleTypeUnderTestFactory: java.AndroidAppFactory,
-		Filesystem: map[string]string{
-			"app.java":                     "",
-			"resa/res.png":                 "",
-			"resb/res.png":                 "",
-			"manifest/AndroidManifest.xml": "",
-			"assets_/asset.png":            "",
-		},
-		StubbedBuildDefinitions: []string{"static_lib_dep", "jni_lib"},
-		Blueprint: simpleModule("android_app", "static_lib_dep") +
-			simpleModule("cc_library_shared", "jni_lib") + `
-android_app {
-	name: "TestApp",
-	srcs: ["app.java"],
-	sdk_version: "current",
-	package_name: "com.google",
-	resource_dirs: ["resa", "resb"],
-	manifest: "manifest/AndroidManifest.xml",
-	static_libs: ["static_lib_dep"],
-	java_version: "7",
-	certificate: "foocert",
-	required: ["static_lib_dep"],
-	asset_dirs: ["assets_"],
-	optimize: {
-		enabled: true,
-		optimize: false,
-		proguard_flags_files: ["proguard.flags"],
-		shrink: false,
-		obfuscate: false,
-		ignore_warnings: true,
-	},
-	jni_libs: ["jni_lib"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("android_binary", "TestApp", AttrNameToString{
-				"srcs":     `["app.java"]`,
-				"manifest": `"manifest/AndroidManifest.xml"`,
-				"resource_files": `[
-        "resa/res.png",
-        "resb/res.png",
-    ]`,
-				"assets":         `["assets_/asset.png"]`,
-				"assets_dir":     `"assets_"`,
-				"custom_package": `"com.google"`,
-				"deps": `[
-        ":static_lib_dep",
-        ":jni_lib",
-    ]`,
-				"java_version":     `"7"`,
-				"sdk_version":      `"current"`,
-				"certificate_name": `"foocert"`,
-				"proguard_specs": `[
-        "proguard.flags",
-        ":TestApp_proguard_flags",
-    ]`,
-			}),
-			MakeBazelTarget("genrule", "TestApp_proguard_flags", AttrNameToString{
-				"outs": `["TestApp_proguard.flags"]`,
-				"cmd":  `"echo -ignorewarning -dontshrink -dontoptimize -dontobfuscate > $(OUTS)"`,
-			}),
-		}})
-}
-
-func TestAndroidAppArchVariantSrcs(t *testing.T) {
-	runAndroidAppTestCase(t, Bp2buildTestCase{
-		Description:                "Android app - arch variant srcs",
-		ModuleTypeUnderTest:        "android_app",
-		ModuleTypeUnderTestFactory: java.AndroidAppFactory,
-		Filesystem: map[string]string{
-			"arm.java":            "",
-			"x86.java":            "",
-			"res/res.png":         "",
-			"AndroidManifest.xml": "",
-		},
-		Blueprint: `
-android_app {
-	name: "TestApp",
-	sdk_version: "current",
-	arch: {
-		arm: {
-			srcs: ["arm.java"],
-		},
-		x86: {
-			srcs: ["x86.java"],
-		}
-	},
-	optimize: {
-		enabled: false,
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("android_binary", "TestApp", AttrNameToString{
-				"srcs": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["arm.java"],
-        "//build/bazel_common_rules/platforms/arch:x86": ["x86.java"],
-        "//conditions:default": [],
-    })`,
-				"manifest":       `"AndroidManifest.xml"`,
-				"resource_files": `["res/res.png"]`,
-				"sdk_version":    `"current"`,
-				"optimize":       `False`,
-			}),
-		}})
-}
-
-func TestAndroidAppCertIsModule(t *testing.T) {
-	runAndroidAppTestCase(t, Bp2buildTestCase{
-		Description:                "Android app - cert is module",
-		ModuleTypeUnderTest:        "android_app",
-		ModuleTypeUnderTestFactory: java.AndroidAppFactory,
-		Filesystem:                 map[string]string{},
-		StubbedBuildDefinitions:    []string{"foocert"},
-		Blueprint: simpleModule("filegroup", "foocert") + `
-android_app {
-	name: "TestApp",
-	certificate: ":foocert",
-	sdk_version: "current",
-	optimize: {
-		enabled: false,
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("android_binary", "TestApp", AttrNameToString{
-				"certificate":    `":foocert"`,
-				"manifest":       `"AndroidManifest.xml"`,
-				"resource_files": `[]`,
-				"sdk_version":    `"current"`, // use as default
-				"optimize":       `False`,
-			}),
-		}})
-}
-
-func TestAndroidAppCertIsSrcFile(t *testing.T) {
-	runAndroidAppTestCase(t, Bp2buildTestCase{
-		Description:                "Android app - cert is src file",
-		ModuleTypeUnderTest:        "android_app",
-		ModuleTypeUnderTestFactory: java.AndroidAppFactory,
-		Filesystem: map[string]string{
-			"foocert": "",
-		},
-		Blueprint: `
-android_app {
-	name: "TestApp",
-	certificate: "foocert",
-	sdk_version: "current",
-	optimize: {
-		enabled: false,
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("android_binary", "TestApp", AttrNameToString{
-				"certificate":    `"foocert"`,
-				"manifest":       `"AndroidManifest.xml"`,
-				"resource_files": `[]`,
-				"sdk_version":    `"current"`, // use as default
-				"optimize":       `False`,
-			}),
-		}})
-}
-
-func TestAndroidAppCertIsNotSrcOrModule(t *testing.T) {
-	runAndroidAppTestCase(t, Bp2buildTestCase{
-		Description:                "Android app - cert is not src or module",
-		ModuleTypeUnderTest:        "android_app",
-		ModuleTypeUnderTestFactory: java.AndroidAppFactory,
-		Filesystem:                 map[string]string{
-			// deliberate empty
-		},
-		Blueprint: `
-android_app {
-	name: "TestApp",
-	certificate: "foocert",
-	sdk_version: "current",
-	optimize: {
-		enabled: false,
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("android_binary", "TestApp", AttrNameToString{
-				"certificate_name": `"foocert"`,
-				"manifest":         `"AndroidManifest.xml"`,
-				"resource_files":   `[]`,
-				"sdk_version":      `"current"`, // use as default
-				"optimize":         `False`,
-			}),
-		}})
-}
-
-func TestAndroidAppLibs(t *testing.T) {
-	runAndroidAppTestCase(t, Bp2buildTestCase{
-		Description:                "Android app with libs",
-		ModuleTypeUnderTest:        "android_app",
-		ModuleTypeUnderTestFactory: java.AndroidAppFactory,
-		Filesystem:                 map[string]string{},
-		StubbedBuildDefinitions:    []string{"barLib"},
-		Blueprint: simpleModule("java_library", "barLib") + `
-android_app {
-	name: "foo",
-	libs: ["barLib"],
-	sdk_version: "current",
-	optimize: {
-		enabled: false,
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("android_binary", "foo", AttrNameToString{
-				"manifest":       `"AndroidManifest.xml"`,
-				"resource_files": `[]`,
-				"deps":           `[":barLib-neverlink"]`,
-				"sdk_version":    `"current"`, // use as default
-				"optimize":       `False`,
-			}),
-		}})
-}
-
-func TestAndroidAppKotlinSrcs(t *testing.T) {
-	runAndroidAppTestCase(t, Bp2buildTestCase{
-		Description:                "Android app with kotlin sources and common_srcs",
-		ModuleTypeUnderTest:        "android_app",
-		ModuleTypeUnderTestFactory: java.AndroidAppFactory,
-		Filesystem: map[string]string{
-			"res/res.png": "",
-		},
-		StubbedBuildDefinitions: []string{"foocert", "barLib"},
-		Blueprint: simpleModule("filegroup", "foocert") +
-			simpleModule("java_library", "barLib") + `
-android_app {
-	name: "foo",
-	srcs: ["a.java", "b.kt"],
-	certificate: ":foocert",
-	manifest: "fooManifest.xml",
-	libs: ["barLib"],
-	sdk_version: "current",
-	optimize: {
-		enabled: false,
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("android_library", "foo_kt", AttrNameToString{
-				"srcs": `[
-        "a.java",
-        "b.kt",
-    ]`,
-				"manifest":       `"fooManifest.xml"`,
-				"resource_files": `["res/res.png"]`,
-				"deps":           `[":barLib-neverlink"]`,
-				"sdk_version":    `"current"`, // use as default
-			}),
-			MakeBazelTarget("android_binary", "foo", AttrNameToString{
-				"deps":        `[":foo_kt"]`,
-				"certificate": `":foocert"`,
-				"manifest":    `"fooManifest.xml"`,
-				"sdk_version": `"current"`, // use as default
-				"optimize":    `False`,
-			}),
-		}})
-}
-
-func TestAndroidAppCommonSrcs(t *testing.T) {
-	runAndroidAppTestCase(t, Bp2buildTestCase{
-		Description:                "Android app with common_srcs",
-		ModuleTypeUnderTest:        "android_app",
-		ModuleTypeUnderTestFactory: java.AndroidAppFactory,
-		Filesystem: map[string]string{
-			"res/res.png": "",
-		},
-		StubbedBuildDefinitions: []string{"barLib"},
-		Blueprint: `
-android_app {
-	name: "foo",
-	srcs: ["a.java"],
-	common_srcs: ["b.kt"],
-	manifest: "fooManifest.xml",
-	libs:        ["barLib"],
-	sdk_version: "current",
-	optimize: {
-		enabled: false,
-	},
-}
-java_library{
-	name:   "barLib",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("android_library", "foo_kt", AttrNameToString{
-				"srcs":           `["a.java"]`,
-				"common_srcs":    `["b.kt"]`,
-				"manifest":       `"fooManifest.xml"`,
-				"resource_files": `["res/res.png"]`,
-				"deps":           `[":barLib-neverlink"]`,
-				"sdk_version":    `"current"`, // use as default
-			}),
-			MakeBazelTarget("android_binary", "foo", AttrNameToString{
-				"deps":        `[":foo_kt"]`,
-				"manifest":    `"fooManifest.xml"`,
-				"sdk_version": `"current"`, // use as default
-				"optimize":    `False`,
-			}),
-		}})
-}
-
-func TestAndroidAppKotlinCflags(t *testing.T) {
-	runAndroidAppTestCase(t, Bp2buildTestCase{
-		Description:                "Android app with kotlincflags",
-		ModuleTypeUnderTest:        "android_app",
-		ModuleTypeUnderTestFactory: java.AndroidAppFactory,
-		Filesystem: map[string]string{
-			"res/res.png": "",
-		},
-		Blueprint: `
-android_app {
-	name: "foo",
-	srcs: ["a.java", "b.kt"],
-	manifest: "fooManifest.xml",
-	kotlincflags: ["-flag1", "-flag2"],
-	sdk_version: "current",
-	optimize: {
-		enabled: false,
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("android_library", "foo_kt", AttrNameToString{
-				"srcs": `[
-        "a.java",
-        "b.kt",
-    ]`,
-				"manifest":       `"fooManifest.xml"`,
-				"resource_files": `["res/res.png"]`,
-				"kotlincflags": `[
-        "-flag1",
-        "-flag2",
-    ]`,
-				"sdk_version": `"current"`, // use as default
-			}),
-			MakeBazelTarget("android_binary", "foo", AttrNameToString{
-				"deps":        `[":foo_kt"]`,
-				"manifest":    `"fooManifest.xml"`,
-				"sdk_version": `"current"`,
-				"optimize":    `False`,
-			}),
-		}})
-}
-
-func TestAndroidAppManifestSdkVersionsProvided(t *testing.T) {
-	runAndroidAppTestCase(t, Bp2buildTestCase{
-		Description:                "Android app with value for min_sdk_version",
-		ModuleTypeUnderTest:        "android_app",
-		ModuleTypeUnderTestFactory: java.AndroidAppFactory,
-		Filesystem:                 map[string]string{},
-		Blueprint: `
-android_app {
-	name: "foo",
-	sdk_version: "current",
-	min_sdk_version: "24",
-	target_sdk_version: "29",
-	optimize: {
-		enabled: false,
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("android_binary", "foo", AttrNameToString{
-				"manifest":       `"AndroidManifest.xml"`,
-				"resource_files": `[]`,
-				"manifest_values": `{
-        "minSdkVersion": "24",
-        "targetSdkVersion": "29",
-    }`,
-				"sdk_version": `"current"`,
-				"optimize":    `False`,
-			}),
-		}})
-}
-
-func TestAndroidAppMinAndTargetSdkDefaultToSdkVersion(t *testing.T) {
-	runAndroidAppTestCase(t, Bp2buildTestCase{
-		Description:                "Android app with value for sdk_version",
-		ModuleTypeUnderTest:        "android_app",
-		ModuleTypeUnderTestFactory: java.AndroidAppFactory,
-		Filesystem:                 map[string]string{},
-		Blueprint: `
-android_app {
-	name: "foo",
-	sdk_version: "30",
-	optimize: {
-		enabled: false,
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("android_binary", "foo", AttrNameToString{
-				"manifest":       `"AndroidManifest.xml"`,
-				"resource_files": `[]`,
-				"sdk_version":    `"30"`,
-				"optimize":       `False`,
-			}),
-		}})
-}
-
-func TestFrameworkResConversion(t *testing.T) {
-	runAndroidAppTestCase(t, Bp2buildTestCase{
-		Description:                "Framework Res custom conversion",
-		ModuleTypeUnderTest:        "android_app",
-		ModuleTypeUnderTestFactory: java.AndroidAppFactory,
-		Filesystem: map[string]string{
-			"res/values/attrs.xml": "",
-			"resource_zip.zip":     "",
-		},
-		Blueprint: `
-android_app {
-	name: "framework-res",
-	resource_zips: [
-		"resource_zip.zip",
-	],
-	certificate: "platform",
-}
-
-filegroup {
-	name: "framework-res-package-jar",
-	srcs: [":framework-res{.export-package.apk}"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("framework_resources", "framework-res", AttrNameToString{
-				"certificate_name":       `"platform"`,
-				"manifest":               `"AndroidManifest.xml"`,
-				"resource_files":         `["res/values/attrs.xml"]`,
-				"resource_zips":          `["resource_zip.zip"]`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-			}),
-			MakeBazelTargetNoRestrictions("filegroup", "framework-res-package-jar", AttrNameToString{
-				"srcs": `[":framework-res.export-package.apk"]`,
-			}),
-		}})
-
-}
diff --git a/bp2build/android_test_conversion_test.go b/bp2build/android_test_conversion_test.go
deleted file mode 100644
index 486f154..0000000
--- a/bp2build/android_test_conversion_test.go
+++ /dev/null
@@ -1,178 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"android/soong/android"
-	"android/soong/java"
-
-	"testing"
-)
-
-func runAndroidTestTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, registerAndroidTestModuleTypes, tc)
-}
-
-func registerAndroidTestModuleTypes(ctx android.RegistrationContext) {
-	ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-	ctx.RegisterModuleType("java_library", java.LibraryFactory)
-}
-
-func TestMinimalAndroidTest(t *testing.T) {
-	runAndroidAppTestCase(t, Bp2buildTestCase{
-		Description:                "Android test - simple example",
-		ModuleTypeUnderTest:        "android_test",
-		ModuleTypeUnderTestFactory: java.AndroidTestFactory,
-		Filesystem: map[string]string{
-			"app.java":            "",
-			"res/res.png":         "",
-			"AndroidManifest.xml": "",
-			"assets/asset.png":    "",
-		},
-		Blueprint: `
-android_test {
-		name: "TestApp",
-		srcs: ["app.java"],
-		sdk_version: "current",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("android_test", "TestApp", AttrNameToString{
-				"srcs":           `["app.java"]`,
-				"manifest":       `"AndroidManifest.xml"`,
-				"resource_files": `["res/res.png"]`,
-				"sdk_version":    `"current"`,
-				"assets":         `["assets/asset.png"]`,
-				"assets_dir":     `"assets"`,
-				// no need for optimize = False because it's false for
-				// android_test by default
-			}),
-		}})
-}
-
-func TestAndroidTest_OptimizationEnabled(t *testing.T) {
-	runAndroidAppTestCase(t, Bp2buildTestCase{
-		Description:                "Android test - simple example",
-		ModuleTypeUnderTest:        "android_test",
-		ModuleTypeUnderTestFactory: java.AndroidTestFactory,
-		Filesystem: map[string]string{
-			"app.java":            "",
-			"res/res.png":         "",
-			"AndroidManifest.xml": "",
-			"assets/asset.png":    "",
-		},
-		Blueprint: `
-android_test {
-		name: "TestApp",
-		srcs: ["app.java"],
-		sdk_version: "current",
-		optimize: {
-			enabled: true,
-			shrink: true,
-			optimize: true,
-			obfuscate: true,
-		},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("android_test", "TestApp", AttrNameToString{
-				"srcs":           `["app.java"]`,
-				"manifest":       `"AndroidManifest.xml"`,
-				"resource_files": `["res/res.png"]`,
-				"sdk_version":    `"current"`,
-				"assets":         `["assets/asset.png"]`,
-				"assets_dir":     `"assets"`,
-				// optimize = True because it's false for android_test by
-				// default
-				"optimize": `True`,
-			}),
-		}})
-}
-
-func TestMinimalAndroidTestHelperApp(t *testing.T) {
-	runAndroidAppTestCase(t, Bp2buildTestCase{
-		Description:                "Android test helper app - simple example",
-		ModuleTypeUnderTest:        "android_test_helper_app",
-		ModuleTypeUnderTestFactory: java.AndroidTestHelperAppFactory,
-		Filesystem: map[string]string{
-			"app.java":            "",
-			"res/res.png":         "",
-			"AndroidManifest.xml": "",
-			"assets/asset.png":    "",
-		},
-		Blueprint: `
-android_test_helper_app {
-		name: "TestApp",
-		srcs: ["app.java"],
-		sdk_version: "current",
-		optimize: {
-			shrink: true,
-			optimize: true,
-			obfuscate: true,
-		},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("android_binary", "TestApp", AttrNameToString{
-				"srcs":           `["app.java"]`,
-				"manifest":       `"AndroidManifest.xml"`,
-				"resource_files": `["res/res.png"]`,
-				"sdk_version":    `"current"`,
-				"assets":         `["assets/asset.png"]`,
-				"assets_dir":     `"assets"`,
-				"testonly":       `True`,
-				// no need for optimize = True because it's true for
-				// android_test_helper_app by default
-			}),
-		}})
-}
-
-func TestAndroidTestHelperApp_OptimizationDisabled(t *testing.T) {
-	runAndroidAppTestCase(t, Bp2buildTestCase{
-		Description:                "Android test helper app - simple example",
-		ModuleTypeUnderTest:        "android_test_helper_app",
-		ModuleTypeUnderTestFactory: java.AndroidTestHelperAppFactory,
-		Filesystem: map[string]string{
-			"app.java":            "",
-			"res/res.png":         "",
-			"AndroidManifest.xml": "",
-			"assets/asset.png":    "",
-		},
-		Blueprint: `
-android_test_helper_app {
-		name: "TestApp",
-		srcs: ["app.java"],
-		sdk_version: "current",
-		optimize: {
-			enabled: false,
-		},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("android_binary", "TestApp", AttrNameToString{
-				"srcs":           `["app.java"]`,
-				"manifest":       `"AndroidManifest.xml"`,
-				"resource_files": `["res/res.png"]`,
-				"sdk_version":    `"current"`,
-				"assets":         `["assets/asset.png"]`,
-				"assets_dir":     `"assets"`,
-				"testonly":       `True`,
-				// optimize = False because it's true for
-				// android_test_helper_app by default
-				"optimize": `False`,
-			}),
-		}})
-}
diff --git a/bp2build/apex_conversion_test.go b/bp2build/apex_conversion_test.go
deleted file mode 100644
index bdb655b..0000000
--- a/bp2build/apex_conversion_test.go
+++ /dev/null
@@ -1,1562 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"android/soong/android"
-	"android/soong/apex"
-	"android/soong/cc"
-	"android/soong/etc"
-	"android/soong/java"
-	"android/soong/sh"
-
-	"fmt"
-	"testing"
-)
-
-func runApexTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, registerApexModuleTypes, tc)
-}
-
-func registerApexModuleTypes(ctx android.RegistrationContext) {
-	// CC module types needed as they can be APEX dependencies
-	cc.RegisterCCBuildComponents(ctx)
-
-	ctx.RegisterModuleType("sh_binary", sh.ShBinaryFactory)
-	ctx.RegisterModuleType("cc_binary", cc.BinaryFactory)
-	ctx.RegisterModuleType("cc_library", cc.LibraryFactory)
-	ctx.RegisterModuleType("apex_key", apex.ApexKeyFactory)
-	ctx.RegisterModuleType("android_app_certificate", java.AndroidAppCertificateFactory)
-	ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-	ctx.RegisterModuleType("prebuilt_etc", etc.PrebuiltEtcFactory)
-	ctx.RegisterModuleType("cc_test", cc.TestFactory)
-}
-
-func runOverrideApexTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, registerOverrideApexModuleTypes, tc)
-}
-
-func registerOverrideApexModuleTypes(ctx android.RegistrationContext) {
-	// CC module types needed as they can be APEX dependencies
-	cc.RegisterCCBuildComponents(ctx)
-
-	ctx.RegisterModuleType("sh_binary", sh.ShBinaryFactory)
-	ctx.RegisterModuleType("cc_binary", cc.BinaryFactory)
-	ctx.RegisterModuleType("cc_library", cc.LibraryFactory)
-	ctx.RegisterModuleType("apex_key", apex.ApexKeyFactory)
-	ctx.RegisterModuleType("apex_test", apex.TestApexBundleFactory)
-	ctx.RegisterModuleType("android_app_certificate", java.AndroidAppCertificateFactory)
-	ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-	ctx.RegisterModuleType("apex", apex.BundleFactory)
-	ctx.RegisterModuleType("apex_defaults", apex.DefaultsFactory)
-	ctx.RegisterModuleType("prebuilt_etc", etc.PrebuiltEtcFactory)
-	ctx.RegisterModuleType("soong_config_module_type", android.SoongConfigModuleTypeFactory)
-	ctx.RegisterModuleType("soong_config_string_variable", android.SoongConfigStringVariableDummyFactory)
-}
-
-func TestApexBundleSimple(t *testing.T) {
-	runApexTestCase(t, Bp2buildTestCase{
-		Description:                "apex - example with all props, file_context is a module in same Android.bp",
-		ModuleTypeUnderTest:        "apex",
-		ModuleTypeUnderTestFactory: apex.BundleFactory,
-		Filesystem:                 map[string]string{},
-		StubbedBuildDefinitions: []string{"com.android.apogee.key", "com.android.apogee.certificate", "native_shared_lib_1", "native_shared_lib_2",
-			"prebuilt_1", "prebuilt_2", "com.android.apogee-file_contexts", "cc_binary_1", "sh_binary_2"},
-		Blueprint: `
-apex_key {
-	name: "com.android.apogee.key",
-	public_key: "com.android.apogee.avbpubkey",
-	private_key: "com.android.apogee.pem",
-}
-
-android_app_certificate {
-	name: "com.android.apogee.certificate",
-	certificate: "com.android.apogee",
-}
-
-cc_library {
-	name: "native_shared_lib_1",
-}
-
-cc_library {
-	name: "native_shared_lib_2",
-}
-
-prebuilt_etc {
-	name: "prebuilt_1",
-}
-
-prebuilt_etc {
-	name: "prebuilt_2",
-}
-
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [
-		"com.android.apogee-file_contexts",
-	],
-}
-
-cc_binary { name: "cc_binary_1"}
-sh_binary { name: "sh_binary_2", src: "foo.sh"}
-
-apex {
-	name: "com.android.apogee",
-	manifest: "apogee_manifest.json",
-	androidManifest: "ApogeeAndroidManifest.xml",
-	apex_available_name: "apogee_apex_name",
-	file_contexts: ":com.android.apogee-file_contexts",
-	min_sdk_version: "29",
-	key: "com.android.apogee.key",
-	certificate: ":com.android.apogee.certificate",
-	updatable: false,
-	installable: false,
-	compressible: false,
-	native_shared_libs: [
-	    "native_shared_lib_1",
-	    "native_shared_lib_2",
-	],
-	binaries: [
-		"cc_binary_1",
-		"sh_binary_2",
-	],
-	prebuilts: [
-	    "prebuilt_1",
-	    "prebuilt_2",
-	],
-	package_name: "com.android.apogee.test.package",
-	logging_parent: "logging.parent",
-	variant_version: "3",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
-				"android_manifest":    `"ApogeeAndroidManifest.xml"`,
-				"apex_available_name": `"apogee_apex_name"`,
-				"binaries": `[
-        ":cc_binary_1",
-        ":sh_binary_2",
-    ]`,
-				"certificate":     `":com.android.apogee.certificate"`,
-				"file_contexts":   `":com.android.apogee-file_contexts"`,
-				"installable":     "False",
-				"key":             `":com.android.apogee.key"`,
-				"manifest":        `"apogee_manifest.json"`,
-				"min_sdk_version": `"29"`,
-				"native_shared_libs_32": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": [
-            ":native_shared_lib_1",
-            ":native_shared_lib_2",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86": [
-            ":native_shared_lib_1",
-            ":native_shared_lib_2",
-        ],
-        "//conditions:default": [],
-    })`,
-				"native_shared_libs_64": `select({
-        "//build/bazel_common_rules/platforms/arch:arm64": [
-            ":native_shared_lib_1",
-            ":native_shared_lib_2",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86_64": [
-            ":native_shared_lib_1",
-            ":native_shared_lib_2",
-        ],
-        "//conditions:default": [],
-    })`,
-				"prebuilts": `[
-        ":prebuilt_1",
-        ":prebuilt_2",
-    ]`,
-				"updatable":       "False",
-				"compressible":    "False",
-				"package_name":    `"com.android.apogee.test.package"`,
-				"logging_parent":  `"logging.parent"`,
-				"variant_version": `"3"`,
-			}),
-		}})
-}
-
-func TestApexBundleSimple_fileContextsInAnotherAndroidBp(t *testing.T) {
-	runApexTestCase(t, Bp2buildTestCase{
-		Description:                "apex - file contexts is a module in another Android.bp",
-		ModuleTypeUnderTest:        "apex",
-		ModuleTypeUnderTestFactory: apex.BundleFactory,
-		StubbedBuildDefinitions:    []string{"//a/b:com.android.apogee-file_contexts"},
-		Filesystem: map[string]string{
-			"a/b/Android.bp": `
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [
-		"com.android.apogee-file_contexts",
-	],
-}
-`,
-		},
-		Blueprint: `
-apex {
-	name: "com.android.apogee",
-	file_contexts: ":com.android.apogee-file_contexts",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
-				"file_contexts": `"//a/b:com.android.apogee-file_contexts"`,
-				"manifest":      `"apex_manifest.json"`,
-			}),
-		}})
-}
-
-func TestApexBundleSimple_fileContextsIsFile(t *testing.T) {
-	runApexTestCase(t, Bp2buildTestCase{
-		Description:                "apex - file contexts is a file",
-		ModuleTypeUnderTest:        "apex",
-		ModuleTypeUnderTestFactory: apex.BundleFactory,
-		Filesystem:                 map[string]string{},
-		Blueprint: `
-apex {
-	name: "com.android.apogee",
-	file_contexts: "file_contexts_file",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
-				"file_contexts": `"file_contexts_file"`,
-				"manifest":      `"apex_manifest.json"`,
-			}),
-		}})
-}
-
-func TestApexBundleSimple_fileContextsIsNotSpecified(t *testing.T) {
-	runApexTestCase(t, Bp2buildTestCase{
-		Description:                "apex - file contexts is not specified",
-		ModuleTypeUnderTest:        "apex",
-		ModuleTypeUnderTestFactory: apex.BundleFactory,
-		StubbedBuildDefinitions:    []string{"//system/sepolicy/apex:com.android.apogee-file_contexts"},
-		Filesystem: map[string]string{
-			"system/sepolicy/apex/Android.bp": `
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [
-		"com.android.apogee-file_contexts",
-	],
-}
-`,
-		},
-		Blueprint: `
-apex {
-	name: "com.android.apogee",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
-				"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
-				"manifest":      `"apex_manifest.json"`,
-			}),
-		}})
-}
-
-func TestApexBundleCompileMultilibBoth(t *testing.T) {
-	runApexTestCase(t, Bp2buildTestCase{
-		Description:                "apex - example with compile_multilib=both",
-		ModuleTypeUnderTest:        "apex",
-		ModuleTypeUnderTestFactory: apex.BundleFactory,
-		StubbedBuildDefinitions:    append(multilibStubNames(), "//system/sepolicy/apex:com.android.apogee-file_contexts"),
-		Filesystem: map[string]string{
-			"system/sepolicy/apex/Android.bp": `
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [ "apogee-file_contexts", ],
-}
-`,
-		},
-		Blueprint: createMultilibBlueprint(`compile_multilib: "both",`),
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
-				"native_shared_libs_32": `[
-        ":unnested_native_shared_lib",
-        ":native_shared_lib_for_both",
-        ":native_shared_lib_for_lib32",
-    ] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": [":native_shared_lib_for_first"],
-        "//build/bazel_common_rules/platforms/arch:x86": [":native_shared_lib_for_first"],
-        "//conditions:default": [],
-    })`,
-				"native_shared_libs_64": `select({
-        "//build/bazel_common_rules/platforms/arch:arm64": [
-            ":unnested_native_shared_lib",
-            ":native_shared_lib_for_both",
-            ":native_shared_lib_for_lib64",
-            ":native_shared_lib_for_first",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86_64": [
-            ":unnested_native_shared_lib",
-            ":native_shared_lib_for_both",
-            ":native_shared_lib_for_lib64",
-            ":native_shared_lib_for_first",
-        ],
-        "//conditions:default": [],
-    })`,
-				"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
-				"manifest":      `"apex_manifest.json"`,
-			}),
-		}})
-}
-
-func TestApexBundleCompileMultilibFirstAndDefaultValue(t *testing.T) {
-	expectedBazelTargets := []string{
-		MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
-			"native_shared_libs_32": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": [
-            ":unnested_native_shared_lib",
-            ":native_shared_lib_for_both",
-            ":native_shared_lib_for_lib32",
-            ":native_shared_lib_for_first",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86": [
-            ":unnested_native_shared_lib",
-            ":native_shared_lib_for_both",
-            ":native_shared_lib_for_lib32",
-            ":native_shared_lib_for_first",
-        ],
-        "//conditions:default": [],
-    })`,
-			"native_shared_libs_64": `select({
-        "//build/bazel_common_rules/platforms/arch:arm64": [
-            ":unnested_native_shared_lib",
-            ":native_shared_lib_for_both",
-            ":native_shared_lib_for_lib64",
-            ":native_shared_lib_for_first",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86_64": [
-            ":unnested_native_shared_lib",
-            ":native_shared_lib_for_both",
-            ":native_shared_lib_for_lib64",
-            ":native_shared_lib_for_first",
-        ],
-        "//conditions:default": [],
-    })`,
-			"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
-			"manifest":      `"apex_manifest.json"`,
-		}),
-	}
-
-	// "first" is the default value of compile_multilib prop so `compile_multilib_: "first"` and unset compile_multilib
-	// should result to the same bp2build output
-	compileMultiLibPropValues := []string{`compile_multilib: "first",`, ""}
-	for _, compileMultiLibProp := range compileMultiLibPropValues {
-		descriptionSuffix := compileMultiLibProp
-		if descriptionSuffix == "" {
-			descriptionSuffix = "compile_multilib unset"
-		}
-		runApexTestCase(t, Bp2buildTestCase{
-			Description:                "apex - example with " + compileMultiLibProp,
-			ModuleTypeUnderTest:        "apex",
-			ModuleTypeUnderTestFactory: apex.BundleFactory,
-			StubbedBuildDefinitions:    append(multilibStubNames(), "//system/sepolicy/apex:com.android.apogee-file_contexts"),
-			Filesystem: map[string]string{
-				"system/sepolicy/apex/Android.bp": `
-    filegroup {
-        name: "com.android.apogee-file_contexts",
-        srcs: [ "apogee-file_contexts", ],
-    }
-    `,
-			},
-			Blueprint:            createMultilibBlueprint(compileMultiLibProp),
-			ExpectedBazelTargets: expectedBazelTargets,
-		})
-	}
-}
-
-func TestApexBundleCompileMultilib32(t *testing.T) {
-	runApexTestCase(t, Bp2buildTestCase{
-		Description:                "apex - example with compile_multilib=32",
-		ModuleTypeUnderTest:        "apex",
-		ModuleTypeUnderTestFactory: apex.BundleFactory,
-		StubbedBuildDefinitions:    append(multilibStubNames(), "//system/sepolicy/apex:com.android.apogee-file_contexts"),
-		Filesystem: map[string]string{
-			"system/sepolicy/apex/Android.bp": `
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [ "apogee-file_contexts", ],
-}
-`,
-		},
-		Blueprint: createMultilibBlueprint(`compile_multilib: "32",`),
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
-				"native_shared_libs_32": `[
-        ":unnested_native_shared_lib",
-        ":native_shared_lib_for_both",
-        ":native_shared_lib_for_lib32",
-    ] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": [":native_shared_lib_for_first"],
-        "//build/bazel_common_rules/platforms/arch:x86": [":native_shared_lib_for_first"],
-        "//conditions:default": [],
-    })`,
-				"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
-				"manifest":      `"apex_manifest.json"`,
-			}),
-		}})
-}
-
-func TestApexBundleCompileMultilib64(t *testing.T) {
-	runApexTestCase(t, Bp2buildTestCase{
-		Description:                "apex - example with compile_multilib=64",
-		ModuleTypeUnderTest:        "apex",
-		ModuleTypeUnderTestFactory: apex.BundleFactory,
-		StubbedBuildDefinitions:    append(multilibStubNames(), "//system/sepolicy/apex:com.android.apogee-file_contexts"),
-		Filesystem: map[string]string{
-			"system/sepolicy/apex/Android.bp": `
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [ "apogee-file_contexts", ],
-}
-`,
-		},
-		Blueprint: createMultilibBlueprint(`compile_multilib: "64",`),
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
-				"native_shared_libs_64": `select({
-        "//build/bazel_common_rules/platforms/arch:arm64": [
-            ":unnested_native_shared_lib",
-            ":native_shared_lib_for_both",
-            ":native_shared_lib_for_lib64",
-            ":native_shared_lib_for_first",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86_64": [
-            ":unnested_native_shared_lib",
-            ":native_shared_lib_for_both",
-            ":native_shared_lib_for_lib64",
-            ":native_shared_lib_for_first",
-        ],
-        "//conditions:default": [],
-    })`,
-				"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
-				"manifest":      `"apex_manifest.json"`,
-			}),
-		}})
-}
-
-func multilibStubNames() []string {
-	return []string{"native_shared_lib_for_both", "native_shared_lib_for_first", "native_shared_lib_for_lib32", "native_shared_lib_for_lib64",
-		"native_shared_lib_for_lib64", "unnested_native_shared_lib"}
-}
-
-func createMultilibBlueprint(compile_multilib string) string {
-	return fmt.Sprintf(`
-cc_library {
-	name: "native_shared_lib_for_both",
-}
-
-cc_library {
-	name: "native_shared_lib_for_first",
-}
-
-cc_library {
-	name: "native_shared_lib_for_lib32",
-}
-
-cc_library {
-	name: "native_shared_lib_for_lib64",
-}
-
-cc_library {
-	name: "unnested_native_shared_lib",
-}
-
-apex {
-	name: "com.android.apogee",
-	%s
-	native_shared_libs: ["unnested_native_shared_lib"],
-	multilib: {
-		both: {
-			native_shared_libs: [
-				"native_shared_lib_for_both",
-			],
-		},
-		first: {
-			native_shared_libs: [
-				"native_shared_lib_for_first",
-			],
-		},
-		lib32: {
-			native_shared_libs: [
-				"native_shared_lib_for_lib32",
-			],
-		},
-		lib64: {
-			native_shared_libs: [
-				"native_shared_lib_for_lib64",
-			],
-		},
-	},
-}`, compile_multilib)
-}
-
-func TestApexBundleDefaultPropertyValues(t *testing.T) {
-	runApexTestCase(t, Bp2buildTestCase{
-		Description:                "apex - default property values",
-		ModuleTypeUnderTest:        "apex",
-		ModuleTypeUnderTestFactory: apex.BundleFactory,
-		StubbedBuildDefinitions:    []string{"//system/sepolicy/apex:com.android.apogee-file_contexts"},
-		Filesystem: map[string]string{
-			"system/sepolicy/apex/Android.bp": `
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [ "apogee-file_contexts", ],
-}
-`,
-		},
-		Blueprint: `
-apex {
-	name: "com.android.apogee",
-	manifest: "apogee_manifest.json",
-}
-`,
-		ExpectedBazelTargets: []string{MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
-			"manifest":      `"apogee_manifest.json"`,
-			"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
-		}),
-		}})
-}
-
-func TestApexBundleHasBazelModuleProps(t *testing.T) {
-	runApexTestCase(t, Bp2buildTestCase{
-		Description:                "apex - has bazel module props",
-		ModuleTypeUnderTest:        "apex",
-		ModuleTypeUnderTestFactory: apex.BundleFactory,
-		StubbedBuildDefinitions:    []string{"//system/sepolicy/apex:apogee-file_contexts"},
-		Filesystem: map[string]string{
-			"system/sepolicy/apex/Android.bp": `
-filegroup {
-	name: "apogee-file_contexts",
-	srcs: [ "apogee-file_contexts", ],
-}
-`,
-		},
-		Blueprint: `
-apex {
-	name: "apogee",
-	manifest: "manifest.json",
-	bazel_module: { bp2build_available: true },
-}
-`,
-		ExpectedBazelTargets: []string{MakeBazelTarget("apex", "apogee", AttrNameToString{
-			"manifest":      `"manifest.json"`,
-			"file_contexts": `"//system/sepolicy/apex:apogee-file_contexts"`,
-		}),
-		}})
-}
-
-func TestBp2BuildOverrideApex(t *testing.T) {
-	runOverrideApexTestCase(t, Bp2buildTestCase{
-		Description:                "override_apex",
-		ModuleTypeUnderTest:        "override_apex",
-		ModuleTypeUnderTestFactory: apex.OverrideApexFactory,
-		Filesystem:                 map[string]string{},
-		StubbedBuildDefinitions: []string{"com.android.apogee.key", "com.android.apogee.certificate", "native_shared_lib_1",
-			"native_shared_lib_2", "prebuilt_1", "prebuilt_2", "com.android.apogee-file_contexts", "cc_binary_1",
-			"sh_binary_2", "com.android.apogee", "com.google.android.apogee.key", "com.google.android.apogee.certificate"},
-		Blueprint: `
-apex_key {
-	name: "com.android.apogee.key",
-	public_key: "com.android.apogee.avbpubkey",
-	private_key: "com.android.apogee.pem",
-}
-
-android_app_certificate {
-	name: "com.android.apogee.certificate",
-	certificate: "com.android.apogee",
-}
-
-cc_library {
-	name: "native_shared_lib_1",
-}
-
-cc_library {
-	name: "native_shared_lib_2",
-}
-
-prebuilt_etc {
-	name: "prebuilt_1",
-}
-
-prebuilt_etc {
-	name: "prebuilt_2",
-}
-
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [
-		"com.android.apogee-file_contexts",
-	],
-}
-
-cc_binary { name: "cc_binary_1" }
-sh_binary { name: "sh_binary_2", src: "foo.sh"}
-
-apex {
-	name: "com.android.apogee",
-	manifest: "apogee_manifest.json",
-	androidManifest: "ApogeeAndroidManifest.xml",
-	file_contexts: ":com.android.apogee-file_contexts",
-	min_sdk_version: "29",
-	key: "com.android.apogee.key",
-	certificate: ":com.android.apogee.certificate",
-	updatable: false,
-	installable: false,
-	compressible: false,
-	native_shared_libs: [
-	    "native_shared_lib_1",
-	    "native_shared_lib_2",
-	],
-	binaries: [
-		"cc_binary_1",
-		"sh_binary_2",
-	],
-	prebuilts: [
-	    "prebuilt_1",
-	    "prebuilt_2",
-	],
-}
-
-apex_key {
-	name: "com.google.android.apogee.key",
-	public_key: "com.google.android.apogee.avbpubkey",
-	private_key: "com.google.android.apogee.pem",
-}
-
-android_app_certificate {
-	name: "com.google.android.apogee.certificate",
-	certificate: "com.google.android.apogee",
-}
-
-override_apex {
-	name: "com.google.android.apogee",
-	base: ":com.android.apogee",
-	key: "com.google.android.apogee.key",
-	certificate: ":com.google.android.apogee.certificate",
-	prebuilts: [],
-	compressible: true,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
-				"android_manifest": `"ApogeeAndroidManifest.xml"`,
-				"base_apex_name":   `"com.android.apogee"`,
-				"binaries": `[
-        ":cc_binary_1",
-        ":sh_binary_2",
-    ]`,
-				"certificate":     `":com.google.android.apogee.certificate"`,
-				"file_contexts":   `":com.android.apogee-file_contexts"`,
-				"installable":     "False",
-				"key":             `":com.google.android.apogee.key"`,
-				"manifest":        `"apogee_manifest.json"`,
-				"min_sdk_version": `"29"`,
-				"native_shared_libs_32": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": [
-            ":native_shared_lib_1",
-            ":native_shared_lib_2",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86": [
-            ":native_shared_lib_1",
-            ":native_shared_lib_2",
-        ],
-        "//conditions:default": [],
-    })`,
-				"native_shared_libs_64": `select({
-        "//build/bazel_common_rules/platforms/arch:arm64": [
-            ":native_shared_lib_1",
-            ":native_shared_lib_2",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86_64": [
-            ":native_shared_lib_1",
-            ":native_shared_lib_2",
-        ],
-        "//conditions:default": [],
-    })`,
-				"prebuilts":    `[]`,
-				"updatable":    "False",
-				"compressible": "True",
-			}),
-		}})
-}
-
-func TestOverrideApexTest(t *testing.T) {
-	runOverrideApexTestCase(t, Bp2buildTestCase{
-		Description:                "override_apex",
-		ModuleTypeUnderTest:        "override_apex",
-		ModuleTypeUnderTestFactory: apex.OverrideApexFactory,
-		Filesystem:                 map[string]string{},
-		StubbedBuildDefinitions: []string{"com.android.apogee.certificate", "native_shared_lib_1",
-			"prebuilt_1", "com.android.apogee-file_contexts", "cc_binary_1", "sh_binary_2",
-			"com.android.apogee", "com.google.android.apogee.key", "com.google.android.apogee.certificate", "com.android.apogee.key"},
-		Blueprint: `
-apex_key {
-	name: "com.android.apogee.key",
-	public_key: "com.android.apogee.avbpubkey",
-	private_key: "com.android.apogee.pem",
-}
-
-android_app_certificate {
-	name: "com.android.apogee.certificate",
-	certificate: "com.android.apogee",
-}
-
-cc_library {
-	name: "native_shared_lib_1",
-}
-
-prebuilt_etc {
-	name: "prebuilt_1",
-}
-
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [
-		"com.android.apogee-file_contexts",
-	],
-}
-
-cc_binary { name: "cc_binary_1"}
-sh_binary { name: "sh_binary_2", src: "foo.sh"}
-
-apex_test {
-	name: "com.android.apogee",
-	manifest: "apogee_manifest.json",
-	androidManifest: "ApogeeAndroidManifest.xml",
-	file_contexts: ":com.android.apogee-file_contexts",
-	min_sdk_version: "29",
-	key: "com.android.apogee.key",
-	certificate: ":com.android.apogee.certificate",
-	updatable: false,
-	installable: false,
-	compressible: false,
-	native_shared_libs: [
-	    "native_shared_lib_1",
-	],
-	binaries: [
-		"cc_binary_1",
-		"sh_binary_2",
-	],
-	prebuilts: [
-	    "prebuilt_1",
-	],
-}
-
-apex_key {
-	name: "com.google.android.apogee.key",
-	public_key: "com.google.android.apogee.avbpubkey",
-	private_key: "com.google.android.apogee.pem",
-}
-
-android_app_certificate {
-	name: "com.google.android.apogee.certificate",
-	certificate: "com.google.android.apogee",
-}
-
-override_apex {
-	name: "com.google.android.apogee",
-	base: ":com.android.apogee",
-	key: "com.google.android.apogee.key",
-	certificate: ":com.google.android.apogee.certificate",
-	prebuilts: [],
-	compressible: true,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
-				"android_manifest": `"ApogeeAndroidManifest.xml"`,
-				"base_apex_name":   `"com.android.apogee"`,
-				"binaries": `[
-        ":cc_binary_1",
-        ":sh_binary_2",
-    ]`,
-				"certificate":     `":com.google.android.apogee.certificate"`,
-				"file_contexts":   `":com.android.apogee-file_contexts"`,
-				"installable":     "False",
-				"key":             `":com.google.android.apogee.key"`,
-				"manifest":        `"apogee_manifest.json"`,
-				"min_sdk_version": `"29"`,
-				"native_shared_libs_32": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": [":native_shared_lib_1"],
-        "//build/bazel_common_rules/platforms/arch:x86": [":native_shared_lib_1"],
-        "//conditions:default": [],
-    })`,
-				"native_shared_libs_64": `select({
-        "//build/bazel_common_rules/platforms/arch:arm64": [":native_shared_lib_1"],
-        "//build/bazel_common_rules/platforms/arch:x86_64": [":native_shared_lib_1"],
-        "//conditions:default": [],
-    })`,
-				"testonly":     "True",
-				"prebuilts":    `[]`,
-				"updatable":    "False",
-				"compressible": "True",
-			}),
-		}})
-}
-
-func TestApexBundleSimple_manifestIsEmpty_baseApexOverrideApexInDifferentAndroidBp(t *testing.T) {
-	runOverrideApexTestCase(t, Bp2buildTestCase{
-		Description:                "override_apex - manifest of base apex is empty, base apex and override_apex is in different Android.bp",
-		ModuleTypeUnderTest:        "override_apex",
-		ModuleTypeUnderTestFactory: apex.OverrideApexFactory,
-		StubbedBuildDefinitions:    []string{"//a/b:com.android.apogee", "//system/sepolicy/apex:com.android.apogee-file_contexts"},
-		Filesystem: map[string]string{
-			"system/sepolicy/apex/Android.bp": `
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [ "apogee-file_contexts", ],
-}`,
-			"a/b/Android.bp": `
-apex {
-	name: "com.android.apogee",
-}
-`,
-		},
-		Blueprint: `
-override_apex {
-	name: "com.google.android.apogee",
-	base: ":com.android.apogee",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
-				"base_apex_name": `"com.android.apogee"`,
-				"file_contexts":  `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
-				"manifest":       `"//a/b:apex_manifest.json"`,
-			}),
-		}})
-}
-
-func TestApexBundleSimple_manifestIsSet_baseApexOverrideApexInDifferentAndroidBp(t *testing.T) {
-	runOverrideApexTestCase(t, Bp2buildTestCase{
-		Description:                "override_apex - manifest of base apex is set, base apex and override_apex is in different Android.bp",
-		ModuleTypeUnderTest:        "override_apex",
-		ModuleTypeUnderTestFactory: apex.OverrideApexFactory,
-		StubbedBuildDefinitions:    []string{"//a/b:com.android.apogee", "//system/sepolicy/apex:com.android.apogee-file_contexts"},
-		Filesystem: map[string]string{
-			"system/sepolicy/apex/Android.bp": `
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [ "apogee-file_contexts", ],
-}`,
-			"a/b/Android.bp": `
-apex {
-	name: "com.android.apogee",
-  manifest: "apogee_manifest.json",
-}
-`,
-		},
-		Blueprint: `
-override_apex {
-	name: "com.google.android.apogee",
-  base: ":com.android.apogee",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
-				"base_apex_name": `"com.android.apogee"`,
-				"file_contexts":  `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
-				"manifest":       `"//a/b:apogee_manifest.json"`,
-			}),
-		}})
-}
-
-func TestApexBundleSimple_manifestIsEmpty_baseApexOverrideApexInSameAndroidBp(t *testing.T) {
-	runOverrideApexTestCase(t, Bp2buildTestCase{
-		Description:                "override_apex - manifest of base apex is empty, base apex and override_apex is in same Android.bp",
-		ModuleTypeUnderTest:        "override_apex",
-		ModuleTypeUnderTestFactory: apex.OverrideApexFactory,
-		StubbedBuildDefinitions:    []string{"com.android.apogee", "//system/sepolicy/apex:com.android.apogee-file_contexts"},
-		Filesystem: map[string]string{
-			"system/sepolicy/apex/Android.bp": `
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [ "apogee-file_contexts", ],
-}`,
-		},
-		Blueprint: `
-apex {
-	name: "com.android.apogee",
-}
-
-override_apex {
-	name: "com.google.android.apogee",
-  base: ":com.android.apogee",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
-				"base_apex_name": `"com.android.apogee"`,
-				"file_contexts":  `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
-				"manifest":       `"apex_manifest.json"`,
-			}),
-		}})
-}
-
-func TestApexBundleSimple_manifestIsSet_baseApexOverrideApexInSameAndroidBp(t *testing.T) {
-	runOverrideApexTestCase(t, Bp2buildTestCase{
-		Description:                "override_apex - manifest of base apex is set, base apex and override_apex is in same Android.bp",
-		ModuleTypeUnderTest:        "override_apex",
-		ModuleTypeUnderTestFactory: apex.OverrideApexFactory,
-		StubbedBuildDefinitions:    []string{"com.android.apogee", "//system/sepolicy/apex:com.android.apogee-file_contexts"},
-		Filesystem: map[string]string{
-			"system/sepolicy/apex/Android.bp": `
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [ "apogee-file_contexts", ],
-}`,
-		},
-		Blueprint: `
-apex {
-	name: "com.android.apogee",
-  manifest: "apogee_manifest.json",
-}
-
-override_apex {
-	name: "com.google.android.apogee",
-  base: ":com.android.apogee",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
-				"base_apex_name": `"com.android.apogee"`,
-				"file_contexts":  `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
-				"manifest":       `"apogee_manifest.json"`,
-			}),
-		}})
-}
-
-func TestApexBundleSimple_packageNameOverride(t *testing.T) {
-	runOverrideApexTestCase(t, Bp2buildTestCase{
-		Description:                "override_apex - override package name",
-		ModuleTypeUnderTest:        "override_apex",
-		ModuleTypeUnderTestFactory: apex.OverrideApexFactory,
-		StubbedBuildDefinitions:    []string{"com.android.apogee", "//system/sepolicy/apex:com.android.apogee-file_contexts"},
-		Filesystem: map[string]string{
-			"system/sepolicy/apex/Android.bp": `
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [ "apogee-file_contexts", ],
-}`,
-		},
-		Blueprint: `
-apex {
-	name: "com.android.apogee",
-}
-
-override_apex {
-	name: "com.google.android.apogee",
-	base: ":com.android.apogee",
-	package_name: "com.google.android.apogee",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
-				"base_apex_name": `"com.android.apogee"`,
-				"file_contexts":  `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
-				"manifest":       `"apex_manifest.json"`,
-				"package_name":   `"com.google.android.apogee"`,
-			}),
-		}})
-}
-
-func TestApexBundleSimple_NoPrebuiltsOverride(t *testing.T) {
-	runOverrideApexTestCase(t, Bp2buildTestCase{
-		Description:                "override_apex - no override",
-		ModuleTypeUnderTest:        "override_apex",
-		ModuleTypeUnderTestFactory: apex.OverrideApexFactory,
-		StubbedBuildDefinitions:    []string{"prebuilt_file", "com.android.apogee", "//system/sepolicy/apex:com.android.apogee-file_contexts"},
-		Filesystem: map[string]string{
-			"system/sepolicy/apex/Android.bp": `
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [ "apogee-file_contexts", ],
-}`,
-		},
-		Blueprint: `
-prebuilt_etc {
-	name: "prebuilt_file",
-}
-
-apex {
-	name: "com.android.apogee",
-	prebuilts: ["prebuilt_file"]
-}
-
-override_apex {
-	name: "com.google.android.apogee",
-	base: ":com.android.apogee",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
-				"base_apex_name": `"com.android.apogee"`,
-				"file_contexts":  `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
-				"manifest":       `"apex_manifest.json"`,
-				"prebuilts":      `[":prebuilt_file"]`,
-			}),
-		}})
-}
-
-func TestApexBundleSimple_PrebuiltsOverride(t *testing.T) {
-	runOverrideApexTestCase(t, Bp2buildTestCase{
-		Description:                "override_apex - ooverride",
-		ModuleTypeUnderTest:        "override_apex",
-		ModuleTypeUnderTestFactory: apex.OverrideApexFactory,
-		StubbedBuildDefinitions:    []string{"prebuilt_file", "prebuilt_file2", "com.android.apogee", "//system/sepolicy/apex:com.android.apogee-file_contexts"},
-		Filesystem: map[string]string{
-			"system/sepolicy/apex/Android.bp": `
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [ "apogee-file_contexts", ],
-}`,
-		},
-		Blueprint: `
-prebuilt_etc {
-	name: "prebuilt_file",
-}
-
-prebuilt_etc {
-	name: "prebuilt_file2",
-}
-
-apex {
-	name: "com.android.apogee",
-	prebuilts: ["prebuilt_file"]
-}
-
-override_apex {
-	name: "com.google.android.apogee",
-	base: ":com.android.apogee",
-	prebuilts: ["prebuilt_file2"]
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
-				"base_apex_name": `"com.android.apogee"`,
-				"file_contexts":  `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
-				"manifest":       `"apex_manifest.json"`,
-				"prebuilts":      `[":prebuilt_file2"]`,
-			}),
-		}})
-}
-
-func TestApexBundleSimple_PrebuiltsOverrideEmptyList(t *testing.T) {
-	runOverrideApexTestCase(t, Bp2buildTestCase{
-		Description:                "override_apex - override with empty list",
-		ModuleTypeUnderTest:        "override_apex",
-		ModuleTypeUnderTestFactory: apex.OverrideApexFactory,
-		StubbedBuildDefinitions:    []string{"prebuilt_file", "com.android.apogee", "//system/sepolicy/apex:com.android.apogee-file_contexts"},
-		Filesystem: map[string]string{
-			"system/sepolicy/apex/Android.bp": `
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [ "apogee-file_contexts", ],
-}`,
-		},
-		Blueprint: `
-prebuilt_etc {
-	name: "prebuilt_file",
-}
-
-apex {
-	name: "com.android.apogee",
-	prebuilts: ["prebuilt_file"]
-}
-
-override_apex {
-	name: "com.google.android.apogee",
-	base: ":com.android.apogee",
-    prebuilts: [],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
-				"base_apex_name": `"com.android.apogee"`,
-				"file_contexts":  `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
-				"manifest":       `"apex_manifest.json"`,
-				"prebuilts":      `[]`,
-			}),
-		}})
-}
-
-func TestApexBundleSimple_NoLoggingParentOverride(t *testing.T) {
-	runOverrideApexTestCase(t, Bp2buildTestCase{
-		Description:                "override_apex - logging_parent - no override",
-		ModuleTypeUnderTest:        "override_apex",
-		ModuleTypeUnderTestFactory: apex.OverrideApexFactory,
-		StubbedBuildDefinitions:    []string{"com.android.apogee", "//system/sepolicy/apex:com.android.apogee-file_contexts"},
-		Filesystem: map[string]string{
-			"system/sepolicy/apex/Android.bp": `
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [ "apogee-file_contexts", ],
-}`,
-		},
-		Blueprint: `
-apex {
-	name: "com.android.apogee",
-	logging_parent: "foo.bar.baz",
-}
-
-override_apex {
-	name: "com.google.android.apogee",
-	base: ":com.android.apogee",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
-				"base_apex_name": `"com.android.apogee"`,
-				"file_contexts":  `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
-				"manifest":       `"apex_manifest.json"`,
-				"logging_parent": `"foo.bar.baz"`,
-			}),
-		}})
-}
-
-func TestApexBundleSimple_LoggingParentOverride(t *testing.T) {
-	runOverrideApexTestCase(t, Bp2buildTestCase{
-		Description:                "override_apex - logging_parent - override",
-		ModuleTypeUnderTest:        "override_apex",
-		ModuleTypeUnderTestFactory: apex.OverrideApexFactory,
-		StubbedBuildDefinitions:    []string{"com.android.apogee", "//system/sepolicy/apex:com.android.apogee-file_contexts"},
-		Filesystem: map[string]string{
-			"system/sepolicy/apex/Android.bp": `
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [ "apogee-file_contexts", ],
-}`,
-		},
-		Blueprint: `
-apex {
-	name: "com.android.apogee",
-	logging_parent: "foo.bar.baz",
-}
-
-override_apex {
-	name: "com.google.android.apogee",
-	base: ":com.android.apogee",
-	logging_parent: "foo.bar.baz.override",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
-				"base_apex_name": `"com.android.apogee"`,
-				"file_contexts":  `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
-				"manifest":       `"apex_manifest.json"`,
-				"logging_parent": `"foo.bar.baz.override"`,
-			}),
-		}})
-}
-
-func TestBp2BuildOverrideApex_CertificateNil(t *testing.T) {
-	runOverrideApexTestCase(t, Bp2buildTestCase{
-		Description:                "override_apex - don't set default certificate",
-		ModuleTypeUnderTest:        "override_apex",
-		ModuleTypeUnderTestFactory: apex.OverrideApexFactory,
-		Filesystem:                 map[string]string{},
-		StubbedBuildDefinitions:    []string{"com.android.apogee.certificate", "com.android.apogee-file_contexts", "com.android.apogee"},
-		Blueprint: `
-android_app_certificate {
-	name: "com.android.apogee.certificate",
-	certificate: "com.android.apogee",
-}
-
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [
-		"com.android.apogee-file_contexts",
-	],
-}
-
-apex {
-	name: "com.android.apogee",
-	manifest: "apogee_manifest.json",
-	file_contexts: ":com.android.apogee-file_contexts",
-	certificate: ":com.android.apogee.certificate",
-}
-
-override_apex {
-	name: "com.google.android.apogee",
-	base: ":com.android.apogee",
-	// certificate is deliberately omitted, and not converted to bazel,
-	// because the overridden apex shouldn't be using the base apex's cert.
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
-				"base_apex_name": `"com.android.apogee"`,
-				"file_contexts":  `":com.android.apogee-file_contexts"`,
-				"manifest":       `"apogee_manifest.json"`,
-			}),
-		}})
-}
-
-func TestApexCertificateIsModule(t *testing.T) {
-	runApexTestCase(t, Bp2buildTestCase{
-		Description:                "apex - certificate is module",
-		ModuleTypeUnderTest:        "apex",
-		ModuleTypeUnderTestFactory: apex.BundleFactory,
-		Filesystem:                 map[string]string{},
-		StubbedBuildDefinitions:    []string{"com.android.apogee-file_contexts", "com.android.apogee.certificate"},
-		Blueprint: `
-android_app_certificate {
-	name: "com.android.apogee.certificate",
-	certificate: "com.android.apogee",
-}
-
-apex {
-	name: "com.android.apogee",
-	manifest: "apogee_manifest.json",
-	file_contexts: ":com.android.apogee-file_contexts",
-	certificate: ":com.android.apogee.certificate",
-}
-` + simpleModule("filegroup", "com.android.apogee-file_contexts"),
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
-				"certificate":   `":com.android.apogee.certificate"`,
-				"file_contexts": `":com.android.apogee-file_contexts"`,
-				"manifest":      `"apogee_manifest.json"`,
-			}),
-		}})
-}
-
-func TestApexWithStubLib(t *testing.T) {
-	runApexTestCase(t, Bp2buildTestCase{
-		Description:                "apex - static variant of stub lib should not have apex_available tag",
-		ModuleTypeUnderTest:        "apex",
-		ModuleTypeUnderTestFactory: apex.BundleFactory,
-		Filesystem:                 map[string]string{},
-		StubbedBuildDefinitions:    []string{"myapex-file_contexts"},
-		Blueprint: `
-cc_library{
-	name: "foo",
-	stubs: { symbol_file: "foo.map.txt", versions: ["28", "29", "current"] },
-	apex_available: ["myapex"],
-}
-
-cc_binary{
-	name: "bar",
-	static_libs: ["foo"],
-	apex_available: ["myapex"],
-}
-
-apex {
-	name: "myapex",
-	manifest: "myapex_manifest.json",
-	file_contexts: ":myapex-file_contexts",
-	binaries: ["bar"],
-	native_shared_libs: ["foo"],
-}
-` + simpleModule("filegroup", "myapex-file_contexts"),
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_binary", "bar", AttrNameToString{
-				"local_includes": `["."]`,
-				"deps":           `[":foo_bp2build_cc_library_static"]`,
-				"tags":           `["apex_available=myapex"]`,
-			}),
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"local_includes":    `["."]`,
-				"stubs_symbol_file": `"foo.map.txt"`,
-				"tags":              `["apex_available=myapex"]`,
-			}),
-			MakeBazelTarget("cc_stub_suite", "foo_stub_libs", AttrNameToString{
-				"api_surface":          `"module-libapi"`,
-				"soname":               `"foo.so"`,
-				"source_library_label": `"//:foo"`,
-				"symbol_file":          `"foo.map.txt"`,
-				"versions": `[
-        "28",
-        "29",
-        "current",
-    ]`,
-			}),
-			MakeBazelTarget("apex", "myapex", AttrNameToString{
-				"file_contexts": `":myapex-file_contexts"`,
-				"manifest":      `"myapex_manifest.json"`,
-				"binaries":      `[":bar"]`,
-				"native_shared_libs_32": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": [":foo"],
-        "//build/bazel_common_rules/platforms/arch:x86": [":foo"],
-        "//conditions:default": [],
-    })`,
-				"native_shared_libs_64": `select({
-        "//build/bazel_common_rules/platforms/arch:arm64": [":foo"],
-        "//build/bazel_common_rules/platforms/arch:x86_64": [":foo"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestApexCertificateIsSrc(t *testing.T) {
-	runApexTestCase(t, Bp2buildTestCase{
-		Description:                "apex - certificate is src",
-		ModuleTypeUnderTest:        "apex",
-		ModuleTypeUnderTestFactory: apex.BundleFactory,
-		Filesystem:                 map[string]string{},
-		StubbedBuildDefinitions:    []string{"com.android.apogee-file_contexts"},
-		Blueprint: `
-apex {
-	name: "com.android.apogee",
-	manifest: "apogee_manifest.json",
-	file_contexts: ":com.android.apogee-file_contexts",
-	certificate: "com.android.apogee.certificate",
-}
-` + simpleModule("filegroup", "com.android.apogee-file_contexts"),
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
-				"certificate_name": `"com.android.apogee.certificate"`,
-				"file_contexts":    `":com.android.apogee-file_contexts"`,
-				"manifest":         `"apogee_manifest.json"`,
-			}),
-		}})
-}
-
-func TestBp2BuildOverrideApex_CertificateIsModule(t *testing.T) {
-	runOverrideApexTestCase(t, Bp2buildTestCase{
-		Description:                "override_apex - certificate is module",
-		ModuleTypeUnderTest:        "override_apex",
-		ModuleTypeUnderTestFactory: apex.OverrideApexFactory,
-		Filesystem:                 map[string]string{},
-		StubbedBuildDefinitions: []string{"com.android.apogee.certificate", "com.android.apogee-file_contexts",
-			"com.android.apogee", "com.google.android.apogee.certificate"},
-		Blueprint: `
-android_app_certificate {
-	name: "com.android.apogee.certificate",
-	certificate: "com.android.apogee",
-}
-
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [
-		"com.android.apogee-file_contexts",
-	],
-}
-
-apex {
-	name: "com.android.apogee",
-	manifest: "apogee_manifest.json",
-	file_contexts: ":com.android.apogee-file_contexts",
-	certificate: ":com.android.apogee.certificate",
-}
-
-android_app_certificate {
-	name: "com.google.android.apogee.certificate",
-	certificate: "com.google.android.apogee",
-}
-
-override_apex {
-	name: "com.google.android.apogee",
-	base: ":com.android.apogee",
-	certificate: ":com.google.android.apogee.certificate",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
-				"base_apex_name": `"com.android.apogee"`,
-				"file_contexts":  `":com.android.apogee-file_contexts"`,
-				"certificate":    `":com.google.android.apogee.certificate"`,
-				"manifest":       `"apogee_manifest.json"`,
-			}),
-		}})
-}
-
-func TestBp2BuildOverrideApex_CertificateIsSrc(t *testing.T) {
-	runOverrideApexTestCase(t, Bp2buildTestCase{
-		Description:                "override_apex - certificate is src",
-		ModuleTypeUnderTest:        "override_apex",
-		ModuleTypeUnderTestFactory: apex.OverrideApexFactory,
-		Filesystem:                 map[string]string{},
-		StubbedBuildDefinitions:    []string{"com.android.apogee", "com.android.apogee.certificate", "com.android.apogee", "com.android.apogee-file_contexts"},
-		Blueprint: `
-android_app_certificate {
-	name: "com.android.apogee.certificate",
-	certificate: "com.android.apogee",
-}
-
-filegroup {
-	name: "com.android.apogee-file_contexts",
-	srcs: [
-		"com.android.apogee-file_contexts",
-	],
-}
-
-apex {
-	name: "com.android.apogee",
-	manifest: "apogee_manifest.json",
-	file_contexts: ":com.android.apogee-file_contexts",
-	certificate: ":com.android.apogee.certificate",
-}
-
-override_apex {
-	name: "com.google.android.apogee",
-	base: ":com.android.apogee",
-	certificate: "com.google.android.apogee.certificate",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
-				"base_apex_name":   `"com.android.apogee"`,
-				"file_contexts":    `":com.android.apogee-file_contexts"`,
-				"certificate_name": `"com.google.android.apogee.certificate"`,
-				"manifest":         `"apogee_manifest.json"`,
-			}),
-		}})
-}
-
-func TestApexTestBundleSimple(t *testing.T) {
-	runApexTestCase(t, Bp2buildTestCase{
-		Description:                "apex_test - simple",
-		ModuleTypeUnderTest:        "apex_test",
-		ModuleTypeUnderTestFactory: apex.TestApexBundleFactory,
-		Filesystem:                 map[string]string{},
-		StubbedBuildDefinitions:    []string{"cc_test_1"},
-		Blueprint: `
-cc_test { name: "cc_test_1"}
-
-apex_test {
-	name: "test_com.android.apogee",
-	file_contexts: "file_contexts_file",
-	tests: ["cc_test_1"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "test_com.android.apogee", AttrNameToString{
-				"file_contexts":  `"file_contexts_file"`,
-				"base_apex_name": `"com.android.apogee"`,
-				"manifest":       `"apex_manifest.json"`,
-				"testonly":       `True`,
-				"tests":          `[":cc_test_1"]`,
-			}),
-		}})
-}
-
-func TestApexBundle_overridePlusProductVars(t *testing.T) {
-	// Reproduction of b/271424349
-	// Tests that overriding an apex that uses product variables correctly copies the product var
-	// selects over to the override.
-	runOverrideApexTestCase(t, Bp2buildTestCase{
-		Description:                "apex - overriding a module that uses product vars",
-		ModuleTypeUnderTest:        "override_apex",
-		ModuleTypeUnderTestFactory: apex.OverrideApexFactory,
-		StubbedBuildDefinitions:    []string{"foo-file_contexts"},
-		Blueprint: `
-soong_config_string_variable {
-    name: "library_linking_strategy",
-    values: [
-        "prefer_static",
-    ],
-}
-
-soong_config_module_type {
-    name: "library_linking_strategy_apex_defaults",
-    module_type: "apex_defaults",
-    config_namespace: "ANDROID",
-    variables: ["library_linking_strategy"],
-    properties: [
-        "manifest",
-        "min_sdk_version",
-    ],
-}
-
-library_linking_strategy_apex_defaults {
-    name: "higher_min_sdk_when_prefer_static",
-    soong_config_variables: {
-        library_linking_strategy: {
-            // Use the R min_sdk_version
-            prefer_static: {},
-            // Override the R min_sdk_version to min_sdk_version that supports dcla
-            conditions_default: {
-                min_sdk_version: "31",
-            },
-        },
-    },
-}
-
-filegroup {
-	name: "foo-file_contexts",
-	srcs: [
-		"com.android.apogee-file_contexts",
-	],
-}
-
-apex {
-	name: "foo",
-	defaults: ["higher_min_sdk_when_prefer_static"],
-	min_sdk_version: "30",
-	package_name: "pkg_name",
-	file_contexts: ":foo-file_contexts",
-}
-override_apex {
-	name: "override_foo",
-	base: ":foo",
-	package_name: "override_pkg_name",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "foo", AttrNameToString{
-				"file_contexts": `":foo-file_contexts"`,
-				"manifest":      `"apex_manifest.json"`,
-				"min_sdk_version": `select({
-        "//build/bazel/product_config/config_settings:android__library_linking_strategy__prefer_static": "30",
-        "//conditions:default": "31",
-    })`,
-				"package_name": `"pkg_name"`,
-			}), MakeBazelTarget("apex", "override_foo", AttrNameToString{
-				"base_apex_name": `"foo"`,
-				"file_contexts":  `":foo-file_contexts"`,
-				"manifest":       `"apex_manifest.json"`,
-				"min_sdk_version": `select({
-        "//build/bazel/product_config/config_settings:android__library_linking_strategy__prefer_static": "30",
-        "//conditions:default": "31",
-    })`,
-				"package_name": `"override_pkg_name"`,
-			}),
-		}})
-}
-
-func TestApexBundleSimple_customCannedFsConfig(t *testing.T) {
-	runApexTestCase(t, Bp2buildTestCase{
-		Description:                "apex - custom canned_fs_config",
-		ModuleTypeUnderTest:        "apex",
-		ModuleTypeUnderTestFactory: apex.BundleFactory,
-		Filesystem:                 map[string]string{},
-		Blueprint: `
-apex {
-	name: "com.android.apogee",
-	canned_fs_config: "custom.canned_fs_config",
-	file_contexts: "file_contexts_file",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
-				"canned_fs_config": `"custom.canned_fs_config"`,
-				"file_contexts":    `"file_contexts_file"`,
-				"manifest":         `"apex_manifest.json"`,
-			}),
-		}})
-}
diff --git a/bp2build/apex_key_conversion_test.go b/bp2build/apex_key_conversion_test.go
deleted file mode 100644
index 05e2f25..0000000
--- a/bp2build/apex_key_conversion_test.go
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"android/soong/android"
-	"android/soong/apex"
-
-	"testing"
-)
-
-func runApexKeyTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, registerApexKeyModuleTypes, tc)
-}
-
-func registerApexKeyModuleTypes(ctx android.RegistrationContext) {
-	ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-}
-
-func TestApexKeySimple_KeysAreSrcFilesInSameDir(t *testing.T) {
-	runApexKeyTestCase(t, Bp2buildTestCase{
-		Description:                "apex key - keys are src files, use key attributes",
-		ModuleTypeUnderTest:        "apex_key",
-		ModuleTypeUnderTestFactory: apex.ApexKeyFactory,
-		Filesystem: map[string]string{
-			"com.android.apogee.avbpubkey": "",
-			"com.android.apogee.pem":       "",
-		},
-		Blueprint: `
-apex_key {
-        name: "com.android.apogee.key",
-        public_key: "com.android.apogee.avbpubkey",
-        private_key: "com.android.apogee.pem",
-}
-`,
-		ExpectedBazelTargets: []string{MakeBazelTargetNoRestrictions("apex_key", "com.android.apogee.key", AttrNameToString{
-			"private_key":            `"com.android.apogee.pem"`,
-			"public_key":             `"com.android.apogee.avbpubkey"`,
-			"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-		}),
-		}})
-}
-
-func TestApexKeySimple_KeysAreSrcFilesNotInDir(t *testing.T) {
-	runApexKeyTestCase(t, Bp2buildTestCase{
-		Description:                "apex key - keys are not src or module, use key_name attributes",
-		ModuleTypeUnderTest:        "apex_key",
-		ModuleTypeUnderTestFactory: apex.ApexKeyFactory,
-		Filesystem:                 map[string]string{
-			// deliberately left empty
-		},
-		Blueprint: `
-apex_key {
-        name: "com.android.apogee.key",
-        public_key: "com.android.apogee.avbpubkey",
-        private_key: "com.android.apogee.pem",
-}
-`,
-		ExpectedBazelTargets: []string{MakeBazelTargetNoRestrictions("apex_key", "com.android.apogee.key", AttrNameToString{
-			"private_key_name":       `"com.android.apogee.pem"`,
-			"public_key_name":        `"com.android.apogee.avbpubkey"`,
-			"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-		}),
-		}})
-}
-
-func TestApexKey_KeysAreModules(t *testing.T) {
-	runApexKeyTestCase(t, Bp2buildTestCase{
-		Description:                "apex key - keys are modules, use key attributes",
-		ModuleTypeUnderTest:        "apex_key",
-		ModuleTypeUnderTestFactory: apex.ApexKeyFactory,
-		Filesystem:                 map[string]string{},
-		StubbedBuildDefinitions:    []string{"com.android.apogee.avbpubkey", "com.android.apogee.pem"},
-		Blueprint: `
-apex_key {
-        name: "com.android.apogee.key",
-        public_key: ":com.android.apogee.avbpubkey",
-        private_key: ":com.android.apogee.pem",
-}
-` + simpleModule("filegroup", "com.android.apogee.avbpubkey") +
-			simpleModule("filegroup", "com.android.apogee.pem"),
-		ExpectedBazelTargets: []string{MakeBazelTargetNoRestrictions("apex_key", "com.android.apogee.key", AttrNameToString{
-			"private_key":            `":com.android.apogee.pem"`,
-			"public_key":             `":com.android.apogee.avbpubkey"`,
-			"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-		}),
-		}})
-}
diff --git a/bp2build/bp2build.go b/bp2build/bp2build.go
deleted file mode 100644
index 1496ca7..0000000
--- a/bp2build/bp2build.go
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright 2020 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"fmt"
-	"os"
-	"path/filepath"
-	"strings"
-
-	"android/soong/android"
-	"android/soong/bazel"
-	"android/soong/shared"
-	"android/soong/starlark_import"
-)
-
-func deleteFilesExcept(ctx *CodegenContext, rootOutputPath android.OutputPath, except []BazelFile) {
-	// Delete files that should no longer be present.
-	bp2buildDirAbs := shared.JoinPath(ctx.topDir, rootOutputPath.String())
-
-	filesToDelete := make(map[string]struct{})
-	err := filepath.Walk(bp2buildDirAbs,
-		func(path string, info os.FileInfo, err error) error {
-			if err != nil {
-				return err
-			}
-			if !info.IsDir() {
-				relPath, err := filepath.Rel(bp2buildDirAbs, path)
-				if err != nil {
-					return err
-				}
-				filesToDelete[relPath] = struct{}{}
-			}
-			return nil
-		})
-	if err != nil {
-		fmt.Printf("ERROR reading %s: %s", bp2buildDirAbs, err)
-		os.Exit(1)
-	}
-
-	for _, bazelFile := range except {
-		filePath := filepath.Join(bazelFile.Dir, bazelFile.Basename)
-		delete(filesToDelete, filePath)
-	}
-	for f, _ := range filesToDelete {
-		absPath := shared.JoinPath(bp2buildDirAbs, f)
-		if err := os.RemoveAll(absPath); err != nil {
-			fmt.Printf("ERROR deleting %s: %s", absPath, err)
-			os.Exit(1)
-		}
-	}
-}
-
-// Codegen is the backend of bp2build. The code generator is responsible for
-// writing .bzl files that are equivalent to Android.bp files that are capable
-// of being built with Bazel.
-func Codegen(ctx *CodegenContext) *CodegenMetrics {
-	ctx.Context().BeginEvent("Codegen")
-	defer ctx.Context().EndEvent("Codegen")
-	// This directory stores BUILD files that could be eventually checked-in.
-	bp2buildDir := android.PathForOutput(ctx, "bp2build")
-
-	res, errs := GenerateBazelTargets(ctx, true)
-	if len(errs) > 0 {
-		errMsgs := make([]string, len(errs))
-		for i, err := range errs {
-			errMsgs[i] = fmt.Sprintf("%q", err)
-		}
-		fmt.Printf("ERROR: Encountered %d error(s): \nERROR: %s", len(errs), strings.Join(errMsgs, "\n"))
-		os.Exit(1)
-	}
-	var bp2buildFiles []BazelFile
-	productConfig, err := createProductConfigFiles(ctx, res.moduleNameToPartition, res.metrics.convertedModulePathMap)
-	ctx.Context().EventHandler.Do("CreateBazelFile", func() {
-		allTargets := make(map[string]BazelTargets)
-		for k, v := range res.buildFileToTargets {
-			allTargets[k] = append(allTargets[k], v...)
-		}
-		for k, v := range productConfig.bp2buildTargets {
-			allTargets[k] = append(allTargets[k], v...)
-		}
-		bp2buildFiles = CreateBazelFiles(nil, allTargets, ctx.mode)
-	})
-	bp2buildFiles = append(bp2buildFiles, productConfig.bp2buildFiles...)
-	injectionFiles, err := createSoongInjectionDirFiles(ctx, res.metrics)
-	if err != nil {
-		fmt.Printf("%s\n", err.Error())
-		os.Exit(1)
-	}
-	injectionFiles = append(injectionFiles, productConfig.injectionFiles...)
-
-	writeFiles(ctx, bp2buildDir, bp2buildFiles)
-	// Delete files under the bp2build root which weren't just written. An
-	// alternative would have been to delete the whole directory and write these
-	// files. However, this would regenerate files which were otherwise unchanged
-	// since the last bp2build run, which would have negative incremental
-	// performance implications.
-	deleteFilesExcept(ctx, bp2buildDir, bp2buildFiles)
-
-	writeFiles(ctx, android.PathForOutput(ctx, bazel.SoongInjectionDirName), injectionFiles)
-	starlarkDeps, err := starlark_import.GetNinjaDeps()
-	if err != nil {
-		fmt.Fprintf(os.Stderr, "%s\n", err)
-		os.Exit(1)
-	}
-	ctx.AddNinjaFileDeps(starlarkDeps...)
-	return &res.metrics
-}
-
-// Get the output directory and create it if it doesn't exist.
-func getOrCreateOutputDir(outputDir android.OutputPath, ctx android.PathContext, dir string) android.OutputPath {
-	dirPath := outputDir.Join(ctx, dir)
-	if err := android.CreateOutputDirIfNonexistent(dirPath, os.ModePerm); err != nil {
-		fmt.Printf("ERROR: path %s: %s", dirPath, err.Error())
-	}
-	return dirPath
-}
-
-// writeFiles materializes a list of BazelFile rooted at outputDir.
-func writeFiles(ctx android.PathContext, outputDir android.OutputPath, files []BazelFile) {
-	for _, f := range files {
-		p := getOrCreateOutputDir(outputDir, ctx, f.Dir).Join(ctx, f.Basename)
-		if err := writeFile(p, f.Contents); err != nil {
-			panic(fmt.Errorf("Failed to write %q (dir %q) due to %q", f.Basename, f.Dir, err))
-		}
-	}
-}
-
-func writeFile(pathToFile android.OutputPath, content string) error {
-	// These files are made editable to allow users to modify and iterate on them
-	// in the source tree.
-	return android.WriteFileToOutputDir(pathToFile, []byte(content), 0644)
-}
diff --git a/bp2build/bp2build_product_config.go b/bp2build/bp2build_product_config.go
deleted file mode 100644
index 0d1e433..0000000
--- a/bp2build/bp2build_product_config.go
+++ /dev/null
@@ -1,885 +0,0 @@
-package bp2build
-
-import (
-	"encoding/json"
-	"fmt"
-	"path/filepath"
-	"reflect"
-	"sort"
-	"strings"
-
-	"android/soong/android"
-	"android/soong/android/soongconfig"
-	"android/soong/starlark_import"
-
-	"github.com/google/blueprint/proptools"
-	"go.starlark.net/starlark"
-)
-
-type createProductConfigFilesResult struct {
-	injectionFiles  []BazelFile
-	bp2buildFiles   []BazelFile
-	bp2buildTargets map[string]BazelTargets
-}
-
-type bazelLabel struct {
-	repo   string
-	pkg    string
-	target string
-}
-
-const releaseAconfigValueSetsName = "release_aconfig_value_sets"
-
-func (l *bazelLabel) Less(other *bazelLabel) bool {
-	if l.repo < other.repo {
-		return true
-	}
-	if l.repo > other.repo {
-		return false
-	}
-	if l.pkg < other.pkg {
-		return true
-	}
-	if l.pkg > other.pkg {
-		return false
-	}
-	return l.target < other.target
-}
-
-func (l *bazelLabel) String() string {
-	return fmt.Sprintf("@%s//%s:%s", l.repo, l.pkg, l.target)
-}
-
-func createProductConfigFiles(
-	ctx *CodegenContext,
-	moduleNameToPartition map[string]string,
-	convertedModulePathMap map[string]string) (createProductConfigFilesResult, error) {
-	cfg := &ctx.config
-	targetProduct := "unknown"
-	if cfg.HasDeviceProduct() {
-		targetProduct = cfg.DeviceProduct()
-	}
-	targetBuildVariant := "user"
-	if cfg.Eng() {
-		targetBuildVariant = "eng"
-	} else if cfg.Debuggable() {
-		targetBuildVariant = "userdebug"
-	}
-
-	var res createProductConfigFilesResult
-
-	productVariables := ctx.Config().ProductVariables()
-	// TODO(b/306243251): For some reason, using the real value of native_coverage makes some select
-	// statements ambiguous
-	productVariables.Native_coverage = nil
-	productVariablesBytes, err := json.Marshal(productVariables)
-	if err != nil {
-		return res, err
-	}
-
-	currentProductFolder := fmt.Sprintf("build/bazel/products/%s", targetProduct)
-	if len(productVariables.PartitionVarsForBazelMigrationOnlyDoNotUse.ProductDirectory) > 0 {
-		currentProductFolder = fmt.Sprintf("%s%s", productVariables.PartitionVarsForBazelMigrationOnlyDoNotUse.ProductDirectory, targetProduct)
-	}
-
-	productReplacer := strings.NewReplacer(
-		"{PRODUCT}", targetProduct,
-		"{VARIANT}", targetBuildVariant,
-		"{PRODUCT_FOLDER}", currentProductFolder)
-
-	productsForTestingMap, err := starlark_import.GetStarlarkValue[map[string]map[string]starlark.Value]("products_for_testing")
-	if err != nil {
-		return res, err
-	}
-	productsForTesting := android.SortedKeys(productsForTestingMap)
-	for i := range productsForTesting {
-		productsForTesting[i] = fmt.Sprintf("  \"@//build/bazel/tests/products:%s\",", productsForTesting[i])
-	}
-
-	productLabelsToVariables := make(map[bazelLabel]*android.ProductVariables)
-	productLabelsToVariables[bazelLabel{
-		repo:   "",
-		pkg:    currentProductFolder,
-		target: targetProduct,
-	}] = &productVariables
-	for product, productVariablesStarlark := range productsForTestingMap {
-		productVariables, err := starlarkMapToProductVariables(productVariablesStarlark)
-		if err != nil {
-			return res, err
-		}
-		productLabelsToVariables[bazelLabel{
-			repo:   "",
-			pkg:    "build/bazel/tests/products",
-			target: product,
-		}] = &productVariables
-	}
-
-	res.bp2buildTargets = make(map[string]BazelTargets)
-	res.bp2buildTargets[currentProductFolder] = append(res.bp2buildTargets[currentProductFolder], BazelTarget{
-		name:        productReplacer.Replace("{PRODUCT}"),
-		packageName: currentProductFolder,
-		content: productReplacer.Replace(`android_product(
-    name = "{PRODUCT}",
-    soong_variables = _soong_variables,
-)`),
-		ruleClass: "android_product",
-		loads: []BazelLoad{
-			{
-				file: ":soong.variables.bzl",
-				symbols: []BazelLoadSymbol{{
-					symbol: "variables",
-					alias:  "_soong_variables",
-				}},
-			},
-			{
-				file:    "//build/bazel/product_config:android_product.bzl",
-				symbols: []BazelLoadSymbol{{symbol: "android_product"}},
-			},
-		},
-	})
-	createTargets(ctx, productLabelsToVariables, moduleNameToPartition, convertedModulePathMap, res.bp2buildTargets)
-
-	platformMappingContent, err := platformMappingContent(
-		productLabelsToVariables,
-		ctx.Config().Bp2buildSoongConfigDefinitions,
-		convertedModulePathMap)
-	if err != nil {
-		return res, err
-	}
-
-	res.injectionFiles = []BazelFile{
-		newFile(
-			"product_config_platforms",
-			"BUILD.bazel",
-			productReplacer.Replace(`
-package(default_visibility = [
-	"@//build/bazel/product_config:__subpackages__",
-	"@soong_injection//product_config_platforms:__subpackages__",
-])
-
-load("@//{PRODUCT_FOLDER}:soong.variables.bzl", _soong_variables = "variables")
-load("@//build/bazel/product_config:android_product.bzl", "android_product")
-
-# Bazel will qualify its outputs by the platform name. When switching between products, this
-# means that soong-built files that depend on bazel-built files will suddenly get different
-# dependency files, because the path changes, and they will be rebuilt. In order to avoid this
-# extra rebuilding, make mixed builds always use a single platform so that the bazel artifacts
-# are always under the same path.
-android_product(
-    name = "mixed_builds_product",
-    soong_variables = _soong_variables,
-    extra_constraints = ["@//build/bazel/platforms:mixed_builds"],
-)
-`)),
-		newFile(
-			"product_config_platforms",
-			"product_labels.bzl",
-			productReplacer.Replace(`
-# This file keeps a list of all the products in the android source tree, because they're
-# discovered as part of a preprocessing step before bazel runs.
-# TODO: When we start generating the platforms for more than just the
-# currently lunched product, they should all be listed here
-product_labels = [
-  "@soong_injection//product_config_platforms:mixed_builds_product",
-  "@//{PRODUCT_FOLDER}:{PRODUCT}",
-`)+strings.Join(productsForTesting, "\n")+"\n]\n"),
-		newFile(
-			"product_config_platforms",
-			"common.bazelrc",
-			productReplacer.Replace(`
-build --platform_mappings=platform_mappings
-build --platforms @//{PRODUCT_FOLDER}:{PRODUCT}_linux_x86_64
-build --//build/bazel/product_config:target_build_variant={VARIANT}
-
-build:android --platforms=@//{PRODUCT_FOLDER}:{PRODUCT}
-build:linux_x86 --platforms=@//{PRODUCT_FOLDER}:{PRODUCT}_linux_x86
-build:linux_x86_64 --platforms=@//{PRODUCT_FOLDER}:{PRODUCT}_linux_x86_64
-build:linux_bionic_x86_64 --platforms=@//{PRODUCT_FOLDER}:{PRODUCT}_linux_bionic_x86_64
-build:linux_musl_x86 --platforms=@//{PRODUCT_FOLDER}:{PRODUCT}_linux_musl_x86
-build:linux_musl_x86_64 --platforms=@//{PRODUCT_FOLDER}:{PRODUCT}_linux_musl_x86_64
-`)),
-		newFile(
-			"product_config_platforms",
-			"linux.bazelrc",
-			productReplacer.Replace(`
-build --host_platform @//{PRODUCT_FOLDER}:{PRODUCT}_linux_x86_64
-`)),
-		newFile(
-			"product_config_platforms",
-			"darwin.bazelrc",
-			productReplacer.Replace(`
-build --host_platform @//{PRODUCT_FOLDER}:{PRODUCT}_darwin_x86_64
-`)),
-	}
-	res.bp2buildFiles = []BazelFile{
-		newFile(
-			"",
-			"platform_mappings",
-			platformMappingContent),
-		newFile(
-			currentProductFolder,
-			"soong.variables.bzl",
-			`variables = json.decode("""`+strings.ReplaceAll(string(productVariablesBytes), "\\", "\\\\")+`""")`),
-	}
-
-	return res, nil
-}
-
-func platformMappingContent(
-	productLabelToVariables map[bazelLabel]*android.ProductVariables,
-	soongConfigDefinitions soongconfig.Bp2BuildSoongConfigDefinitions,
-	convertedModulePathMap map[string]string) (string, error) {
-	var result strings.Builder
-
-	mergedConvertedModulePathMap := make(map[string]string)
-	for k, v := range convertedModulePathMap {
-		mergedConvertedModulePathMap[k] = v
-	}
-	additionalModuleNamesToPackages, err := starlark_import.GetStarlarkValue[map[string]string]("additional_module_names_to_packages")
-	if err != nil {
-		return "", err
-	}
-	for k, v := range additionalModuleNamesToPackages {
-		mergedConvertedModulePathMap[k] = v
-	}
-
-	productLabels := make([]bazelLabel, 0, len(productLabelToVariables))
-	for k := range productLabelToVariables {
-		productLabels = append(productLabels, k)
-	}
-	sort.Slice(productLabels, func(i, j int) bool {
-		return productLabels[i].Less(&productLabels[j])
-	})
-	result.WriteString("platforms:\n")
-	for _, productLabel := range productLabels {
-		platformMappingSingleProduct(productLabel, productLabelToVariables[productLabel], soongConfigDefinitions, mergedConvertedModulePathMap, &result)
-	}
-	return result.String(), nil
-}
-
-var bazelPlatformSuffixes = []string{
-	"",
-	"_darwin_arm64",
-	"_darwin_x86_64",
-	"_linux_bionic_arm64",
-	"_linux_bionic_x86_64",
-	"_linux_musl_x86",
-	"_linux_musl_x86_64",
-	"_linux_x86",
-	"_linux_x86_64",
-	"_windows_x86",
-	"_windows_x86_64",
-}
-
-func platformMappingSingleProduct(
-	label bazelLabel,
-	productVariables *android.ProductVariables,
-	soongConfigDefinitions soongconfig.Bp2BuildSoongConfigDefinitions,
-	convertedModulePathMap map[string]string,
-	result *strings.Builder) {
-
-	platform_sdk_version := -1
-	if productVariables.Platform_sdk_version != nil {
-		platform_sdk_version = *productVariables.Platform_sdk_version
-	}
-
-	defaultAppCertificateFilegroup := "//build/bazel/utils:empty_filegroup"
-	if proptools.String(productVariables.DefaultAppCertificate) != "" {
-		defaultAppCertificateFilegroup = "@//" + filepath.Dir(proptools.String(productVariables.DefaultAppCertificate)) + ":generated_android_certificate_directory"
-	}
-
-	// TODO: b/301598690 - commas can't be escaped in a string-list passed in a platform mapping,
-	// so commas are switched for ":" here, and must be back-substituted into commas
-	// wherever the AAPTCharacteristics product config variable is used.
-	AAPTConfig := []string{}
-	for _, conf := range productVariables.AAPTConfig {
-		AAPTConfig = append(AAPTConfig, strings.Replace(conf, ",", ":", -1))
-	}
-
-	for _, suffix := range bazelPlatformSuffixes {
-		result.WriteString("  ")
-		result.WriteString(label.String())
-		result.WriteString(suffix)
-		result.WriteString("\n")
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:aapt_characteristics=%s\n", proptools.String(productVariables.AAPTCharacteristics)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:aapt_config=%s\n", strings.Join(AAPTConfig, ",")))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:aapt_preferred_config=%s\n", proptools.String(productVariables.AAPTPreferredConfig)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:always_use_prebuilt_sdks=%t\n", proptools.Bool(productVariables.Always_use_prebuilt_sdks)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:arc=%t\n", proptools.Bool(productVariables.Arc)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:apex_global_min_sdk_version_override=%s\n", proptools.String(productVariables.ApexGlobalMinSdkVersionOverride)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:binder32bit=%t\n", proptools.Bool(productVariables.Binder32bit)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:build_from_text_stub=%t\n", proptools.Bool(productVariables.Build_from_text_stub)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:build_broken_incorrect_partition_images=%t\n", productVariables.BuildBrokenIncorrectPartitionImages))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:build_id=%s\n", proptools.String(productVariables.BuildId)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:build_version_tags=%s\n", strings.Join(productVariables.BuildVersionTags, ",")))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:cfi_exclude_paths=%s\n", strings.Join(productVariables.CFIExcludePaths, ",")))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:cfi_include_paths=%s\n", strings.Join(productVariables.CFIIncludePaths, ",")))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:compressed_apex=%t\n", proptools.Bool(productVariables.CompressedApex)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:default_app_certificate=%s\n", proptools.String(productVariables.DefaultAppCertificate)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:default_app_certificate_filegroup=%s\n", defaultAppCertificateFilegroup))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:device_abi=%s\n", strings.Join(productVariables.DeviceAbi, ",")))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:device_max_page_size_supported=%s\n", proptools.String(productVariables.DeviceMaxPageSizeSupported)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:device_name=%s\n", proptools.String(productVariables.DeviceName)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:device_page_size_agnostic=%t\n", proptools.Bool(productVariables.DevicePageSizeAgnostic)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:device_product=%s\n", proptools.String(productVariables.DeviceProduct)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:device_platform=%s\n", label.String()))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:enable_cfi=%t\n", proptools.BoolDefault(productVariables.EnableCFI, true)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:enforce_vintf_manifest=%t\n", proptools.Bool(productVariables.Enforce_vintf_manifest)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:malloc_not_svelte=%t\n", proptools.Bool(productVariables.Malloc_not_svelte)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:malloc_pattern_fill_contents=%t\n", proptools.Bool(productVariables.Malloc_pattern_fill_contents)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:malloc_zero_contents=%t\n", proptools.Bool(productVariables.Malloc_zero_contents)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:memtag_heap_exclude_paths=%s\n", strings.Join(productVariables.MemtagHeapExcludePaths, ",")))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:memtag_heap_async_include_paths=%s\n", strings.Join(productVariables.MemtagHeapAsyncIncludePaths, ",")))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:memtag_heap_sync_include_paths=%s\n", strings.Join(productVariables.MemtagHeapSyncIncludePaths, ",")))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:manifest_package_name_overrides=%s\n", strings.Join(productVariables.ManifestPackageNameOverrides, ",")))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:native_coverage=%t\n", proptools.Bool(productVariables.Native_coverage)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:platform_sdk_final=%t\n", proptools.Bool(productVariables.Platform_sdk_final)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:platform_security_patch=%s\n", proptools.String(productVariables.Platform_security_patch)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:platform_version_last_stable=%s\n", proptools.String(productVariables.Platform_version_last_stable)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:platform_version_name=%s\n", proptools.String(productVariables.Platform_version_name)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:product_brand=%s\n", productVariables.ProductBrand))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:product_manufacturer=%s\n", productVariables.ProductManufacturer))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:release_aconfig_flag_default_permission=%s\n", productVariables.ReleaseAconfigFlagDefaultPermission))
-		releaseAconfigValueSets := "//build/bazel/product_config:empty_aconfig_value_sets"
-		if len(productVariables.ReleaseAconfigValueSets) > 0 {
-			releaseAconfigValueSets = "@//" + label.pkg + ":" + releaseAconfigValueSetsName + "_" + label.target
-		}
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:release_aconfig_value_sets=%s\n", releaseAconfigValueSets))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:release_version=%s\n", productVariables.ReleaseVersion))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:platform_sdk_version=%d\n", platform_sdk_version))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:safestack=%t\n", proptools.Bool(productVariables.Safestack)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:treble_linker_namespaces=%t\n", proptools.Bool(productVariables.Treble_linker_namespaces)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:tidy_checks=%s\n", proptools.String(productVariables.TidyChecks)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:uml=%t\n", proptools.Bool(productVariables.Uml)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:unbundled_build=%t\n", proptools.Bool(productVariables.Unbundled_build)))
-		result.WriteString(fmt.Sprintf("    --//build/bazel/product_config:unbundled_build_apps=%s\n", strings.Join(productVariables.Unbundled_build_apps, ",")))
-
-		for _, override := range productVariables.CertificateOverrides {
-			parts := strings.SplitN(override, ":", 2)
-			if apexPath, ok := convertedModulePathMap[parts[0]]; ok {
-				if overrideCertPath, ok := convertedModulePathMap[parts[1]]; ok {
-					result.WriteString(fmt.Sprintf("    --%s:%s_certificate_override=%s:%s\n", apexPath, parts[0], overrideCertPath, parts[1]))
-				}
-			}
-		}
-
-		for _, namespace := range android.SortedKeys(productVariables.VendorVars) {
-			for _, variable := range android.SortedKeys(productVariables.VendorVars[namespace]) {
-				value := productVariables.VendorVars[namespace][variable]
-				key := namespace + "__" + variable
-				_, hasBool := soongConfigDefinitions.BoolVars[key]
-				_, hasString := soongConfigDefinitions.StringVars[key]
-				_, hasValue := soongConfigDefinitions.ValueVars[key]
-				if !hasBool && !hasString && !hasValue {
-					// Not all soong config variables are defined in Android.bp files. For example,
-					// prebuilt_bootclasspath_fragment uses soong config variables in a nonstandard
-					// way, that causes them to be present in the soong.variables file but not
-					// defined in an Android.bp file. There's also nothing stopping you from setting
-					// a variable in make that doesn't exist in soong. We only generate build
-					// settings for the ones that exist in soong, so skip all others.
-					continue
-				}
-				if hasBool && hasString || hasBool && hasValue || hasString && hasValue {
-					panic(fmt.Sprintf("Soong config variable %s:%s appears to be of multiple types. bool? %t, string? %t, value? %t", namespace, variable, hasBool, hasString, hasValue))
-				}
-				if hasBool {
-					// Logic copied from soongConfig.Bool()
-					value = strings.ToLower(value)
-					if value == "1" || value == "y" || value == "yes" || value == "on" || value == "true" {
-						value = "true"
-					} else {
-						value = "false"
-					}
-				}
-				result.WriteString(fmt.Sprintf("    --//build/bazel/product_config/soong_config_variables:%s=%s\n", strings.ToLower(key), value))
-			}
-		}
-	}
-}
-
-func starlarkMapToProductVariables(in map[string]starlark.Value) (android.ProductVariables, error) {
-	result := android.ProductVariables{}
-	productVarsReflect := reflect.ValueOf(&result).Elem()
-	for i := 0; i < productVarsReflect.NumField(); i++ {
-		field := productVarsReflect.Field(i)
-		fieldType := productVarsReflect.Type().Field(i)
-		name := fieldType.Name
-		if name == "BootJars" || name == "ApexBootJars" || name == "VendorSnapshotModules" ||
-			name == "RecoverySnapshotModules" {
-			// These variables have more complicated types, and we don't need them right now
-			continue
-		}
-		if _, ok := in[name]; ok {
-			if name == "VendorVars" {
-				vendorVars, err := starlark_import.Unmarshal[map[string]map[string]string](in[name])
-				if err != nil {
-					return result, err
-				}
-				field.Set(reflect.ValueOf(vendorVars))
-				continue
-			}
-			switch field.Type().Kind() {
-			case reflect.Bool:
-				val, err := starlark_import.Unmarshal[bool](in[name])
-				if err != nil {
-					return result, err
-				}
-				field.SetBool(val)
-			case reflect.String:
-				val, err := starlark_import.Unmarshal[string](in[name])
-				if err != nil {
-					return result, err
-				}
-				field.SetString(val)
-			case reflect.Slice:
-				if field.Type().Elem().Kind() != reflect.String {
-					return result, fmt.Errorf("slices of types other than strings are unimplemented")
-				}
-				val, err := starlark_import.UnmarshalReflect(in[name], field.Type())
-				if err != nil {
-					return result, err
-				}
-				field.Set(val)
-			case reflect.Pointer:
-				switch field.Type().Elem().Kind() {
-				case reflect.Bool:
-					val, err := starlark_import.UnmarshalNoneable[bool](in[name])
-					if err != nil {
-						return result, err
-					}
-					field.Set(reflect.ValueOf(val))
-				case reflect.String:
-					val, err := starlark_import.UnmarshalNoneable[string](in[name])
-					if err != nil {
-						return result, err
-					}
-					field.Set(reflect.ValueOf(val))
-				case reflect.Int:
-					val, err := starlark_import.UnmarshalNoneable[int](in[name])
-					if err != nil {
-						return result, err
-					}
-					field.Set(reflect.ValueOf(val))
-				default:
-					return result, fmt.Errorf("pointers of types other than strings/bools are unimplemented: %s", field.Type().Elem().Kind().String())
-				}
-			default:
-				return result, fmt.Errorf("unimplemented type: %s", field.Type().String())
-			}
-		}
-	}
-
-	result.Native_coverage = proptools.BoolPtr(
-		proptools.Bool(result.GcovCoverage) ||
-			proptools.Bool(result.ClangCoverage))
-
-	return result, nil
-}
-
-func createTargets(
-	ctx *CodegenContext,
-	productLabelsToVariables map[bazelLabel]*android.ProductVariables,
-	moduleNameToPartition map[string]string,
-	convertedModulePathMap map[string]string,
-	res map[string]BazelTargets) {
-	createGeneratedAndroidCertificateDirectories(productLabelsToVariables, res)
-	createAvbKeyFilegroups(productLabelsToVariables, res)
-	createReleaseAconfigValueSetsFilegroup(productLabelsToVariables, res)
-	for label, variables := range productLabelsToVariables {
-		createSystemPartition(ctx, label, &variables.PartitionVarsForBazelMigrationOnlyDoNotUse, moduleNameToPartition, convertedModulePathMap, res)
-	}
-}
-
-func createGeneratedAndroidCertificateDirectories(productLabelsToVariables map[bazelLabel]*android.ProductVariables, targets map[string]BazelTargets) {
-	var allDefaultAppCertificateDirs []string
-	for _, productVariables := range productLabelsToVariables {
-		if proptools.String(productVariables.DefaultAppCertificate) != "" {
-			d := filepath.Dir(proptools.String(productVariables.DefaultAppCertificate))
-			if !android.InList(d, allDefaultAppCertificateDirs) {
-				allDefaultAppCertificateDirs = append(allDefaultAppCertificateDirs, d)
-			}
-		}
-	}
-	for _, dir := range allDefaultAppCertificateDirs {
-		content := `filegroup(
-    name = "generated_android_certificate_directory",
-    srcs = glob([
-        "*.pk8",
-        "*.pem",
-        "*.avbpubkey",
-    ]),
-    visibility = ["//visibility:public"],
-)`
-		targets[dir] = append(targets[dir], BazelTarget{
-			name:        "generated_android_certificate_directory",
-			packageName: dir,
-			content:     content,
-			ruleClass:   "filegroup",
-		})
-	}
-}
-
-func createReleaseAconfigValueSetsFilegroup(productLabelsToVariables map[bazelLabel]*android.ProductVariables, targets map[string]BazelTargets) {
-	for label, productVariables := range productLabelsToVariables {
-		if len(productVariables.ReleaseAconfigValueSets) > 0 {
-			key := label.target
-			dir := label.pkg
-			var value_sets strings.Builder
-			for _, value_set := range productVariables.ReleaseAconfigValueSets {
-				value_sets.WriteString("        \"" + value_set + "\",\n")
-			}
-
-			name := releaseAconfigValueSetsName + "_" + key
-			content := "aconfig_value_sets(\n" +
-				"    name = \"" + name + "\",\n" +
-				"    value_sets = [\n" +
-				value_sets.String() +
-				"    ],\n" +
-				"    visibility = [\"//visibility:public\"],\n" +
-				")"
-			targets[dir] = append(targets[dir], BazelTarget{
-				name:        name,
-				packageName: dir,
-				content:     content,
-				ruleClass:   "aconfig_value_sets",
-				loads: []BazelLoad{{
-					file: "//build/bazel/rules/aconfig:aconfig_value_sets.bzl",
-					symbols: []BazelLoadSymbol{{
-						symbol: "aconfig_value_sets",
-					}},
-				}},
-			})
-		}
-	}
-}
-
-func createAvbKeyFilegroups(productLabelsToVariables map[bazelLabel]*android.ProductVariables, targets map[string]BazelTargets) {
-	var allAvbKeys []string
-	for _, productVariables := range productLabelsToVariables {
-		for _, partitionVariables := range productVariables.PartitionVarsForBazelMigrationOnlyDoNotUse.PartitionQualifiedVariables {
-			if partitionVariables.BoardAvbKeyPath != "" {
-				if !android.InList(partitionVariables.BoardAvbKeyPath, allAvbKeys) {
-					allAvbKeys = append(allAvbKeys, partitionVariables.BoardAvbKeyPath)
-				}
-			}
-		}
-	}
-	for _, key := range allAvbKeys {
-		dir := filepath.Dir(key)
-		name := filepath.Base(key)
-		content := fmt.Sprintf(`filegroup(
-    name = "%s_filegroup",
-    srcs = ["%s"],
-    visibility = ["//visibility:public"],
-)`, name, name)
-		targets[dir] = append(targets[dir], BazelTarget{
-			name:        name + "_filegroup",
-			packageName: dir,
-			content:     content,
-			ruleClass:   "filegroup",
-		})
-	}
-}
-
-func createSystemPartition(
-	ctx *CodegenContext,
-	platformLabel bazelLabel,
-	variables *android.PartitionVariables,
-	moduleNameToPartition map[string]string,
-	convertedModulePathMap map[string]string,
-	targets map[string]BazelTargets) {
-	if !variables.PartitionQualifiedVariables["system"].BuildingImage {
-		return
-	}
-	qualifiedVariables := variables.PartitionQualifiedVariables["system"]
-
-	imageProps := generateImagePropDictionary(variables, "system")
-	imageProps["skip_fsck"] = "true"
-
-	var properties strings.Builder
-	for _, prop := range android.SortedKeys(imageProps) {
-		properties.WriteString(prop)
-		properties.WriteRune('=')
-		properties.WriteString(imageProps[prop])
-		properties.WriteRune('\n')
-	}
-
-	var extraProperties strings.Builder
-	if variables.BoardAvbEnable {
-		extraProperties.WriteString("    avb_enable = True,\n")
-		extraProperties.WriteString(fmt.Sprintf("    avb_add_hashtree_footer_args = %q,\n", qualifiedVariables.BoardAvbAddHashtreeFooterArgs))
-		keypath := qualifiedVariables.BoardAvbKeyPath
-		if keypath != "" {
-			extraProperties.WriteString(fmt.Sprintf("    avb_key = \"//%s:%s\",\n", filepath.Dir(keypath), filepath.Base(keypath)+"_filegroup"))
-			extraProperties.WriteString(fmt.Sprintf("    avb_algorithm = %q,\n", qualifiedVariables.BoardAvbAlgorithm))
-			extraProperties.WriteString(fmt.Sprintf("    avb_rollback_index = %s,\n", qualifiedVariables.BoardAvbRollbackIndex))
-			extraProperties.WriteString(fmt.Sprintf("    avb_rollback_index_location = %s,\n", qualifiedVariables.BoardAvbRollbackIndexLocation))
-		}
-	}
-
-	var deps []string
-	for _, mod := range variables.ProductPackages {
-		if path, ok := convertedModulePathMap[mod]; ok && ctx.Config().BazelContext.IsModuleNameAllowed(mod, false) {
-			if partition, ok := moduleNameToPartition[mod]; ok && partition == "system" {
-				if path == "//." {
-					path = "//"
-				}
-				deps = append(deps, fmt.Sprintf("        \"%s:%s\",\n", path, mod))
-			}
-		}
-	}
-	if len(deps) > 0 {
-		sort.Strings(deps)
-		extraProperties.WriteString("    deps = [\n")
-		for _, dep := range deps {
-			extraProperties.WriteString(dep)
-		}
-		extraProperties.WriteString("    ],\n")
-	}
-
-	targets[platformLabel.pkg] = append(targets[platformLabel.pkg], BazelTarget{
-		name:        "system_image",
-		packageName: platformLabel.pkg,
-		content: fmt.Sprintf(`partition(
-    name = "system_image",
-    base_staging_dir = "//build/bazel/bazel_sandwich:system_staging_dir",
-    base_staging_dir_file_list = "//build/bazel/bazel_sandwich:system_staging_dir_file_list",
-    root_dir = "//build/bazel/bazel_sandwich:root_staging_dir",
-    selinux_file_contexts = "//build/bazel/bazel_sandwich:selinux_file_contexts",
-    image_properties = """
-%s
-""",
-%s
-    type = "system",
-)`, properties.String(), extraProperties.String()),
-		ruleClass: "partition",
-		loads: []BazelLoad{{
-			file: "//build/bazel/rules/partitions:partition.bzl",
-			symbols: []BazelLoadSymbol{{
-				symbol: "partition",
-			}},
-		}},
-	}, BazelTarget{
-		name:        "system_image_test",
-		packageName: platformLabel.pkg,
-		content: `partition_diff_test(
-    name = "system_image_test",
-    partition1 = "//build/bazel/bazel_sandwich:make_system_image",
-    partition2 = ":system_image",
-)`,
-		ruleClass: "partition_diff_test",
-		loads: []BazelLoad{{
-			file: "//build/bazel/rules/partitions/diff:partition_diff.bzl",
-			symbols: []BazelLoadSymbol{{
-				symbol: "partition_diff_test",
-			}},
-		}},
-	}, BazelTarget{
-		name:        "run_system_image_test",
-		packageName: platformLabel.pkg,
-		content: `run_test_in_build(
-    name = "run_system_image_test",
-    test = ":system_image_test",
-)`,
-		ruleClass: "run_test_in_build",
-		loads: []BazelLoad{{
-			file: "//build/bazel/bazel_sandwich:run_test_in_build.bzl",
-			symbols: []BazelLoadSymbol{{
-				symbol: "run_test_in_build",
-			}},
-		}},
-	})
-}
-
-var allPartitionTypes = []string{
-	"system",
-	"vendor",
-	"cache",
-	"userdata",
-	"product",
-	"system_ext",
-	"oem",
-	"odm",
-	"vendor_dlkm",
-	"odm_dlkm",
-	"system_dlkm",
-}
-
-// An equivalent of make's generate-image-prop-dictionary function
-func generateImagePropDictionary(variables *android.PartitionVariables, partitionType string) map[string]string {
-	partitionQualifiedVariables, ok := variables.PartitionQualifiedVariables[partitionType]
-	if !ok {
-		panic("Unknown partitionType: " + partitionType)
-	}
-	ret := map[string]string{}
-	if partitionType == "system" {
-		if len(variables.PartitionQualifiedVariables["system_other"].BoardPartitionSize) > 0 {
-			ret["system_other_size"] = variables.PartitionQualifiedVariables["system_other"].BoardPartitionSize
-		}
-		if len(partitionQualifiedVariables.ProductHeadroom) > 0 {
-			ret["system_headroom"] = partitionQualifiedVariables.ProductHeadroom
-		}
-		addCommonRoFlagsToImageProps(variables, partitionType, ret)
-	}
-	// TODO: other partition-specific logic
-	if variables.TargetUserimagesUseExt2 {
-		ret["fs_type"] = "ext2"
-	} else if variables.TargetUserimagesUseExt3 {
-		ret["fs_type"] = "ext3"
-	} else if variables.TargetUserimagesUseExt4 {
-		ret["fs_type"] = "ext4"
-	}
-
-	if !variables.TargetUserimagesSparseExtDisabled {
-		ret["extfs_sparse_flag"] = "-s"
-	}
-	if !variables.TargetUserimagesSparseErofsDisabled {
-		ret["erofs_sparse_flag"] = "-s"
-	}
-	if !variables.TargetUserimagesSparseSquashfsDisabled {
-		ret["squashfs_sparse_flag"] = "-s"
-	}
-	if !variables.TargetUserimagesSparseF2fsDisabled {
-		ret["f2fs_sparse_flag"] = "-S"
-	}
-	erofsCompressor := variables.BoardErofsCompressor
-	if len(erofsCompressor) == 0 && hasErofsPartition(variables) {
-		if len(variables.BoardErofsUseLegacyCompression) > 0 {
-			erofsCompressor = "lz4"
-		} else {
-			erofsCompressor = "lz4hc,9"
-		}
-	}
-	if len(erofsCompressor) > 0 {
-		ret["erofs_default_compressor"] = erofsCompressor
-	}
-	if len(variables.BoardErofsCompressorHints) > 0 {
-		ret["erofs_default_compress_hints"] = variables.BoardErofsCompressorHints
-	}
-	if len(variables.BoardErofsCompressorHints) > 0 {
-		ret["erofs_default_compress_hints"] = variables.BoardErofsCompressorHints
-	}
-	if len(variables.BoardErofsPclusterSize) > 0 {
-		ret["erofs_pcluster_size"] = variables.BoardErofsPclusterSize
-	}
-	if len(variables.BoardErofsShareDupBlocks) > 0 {
-		ret["erofs_share_dup_blocks"] = variables.BoardErofsShareDupBlocks
-	}
-	if len(variables.BoardErofsUseLegacyCompression) > 0 {
-		ret["erofs_use_legacy_compression"] = variables.BoardErofsUseLegacyCompression
-	}
-	if len(variables.BoardExt4ShareDupBlocks) > 0 {
-		ret["ext4_share_dup_blocks"] = variables.BoardExt4ShareDupBlocks
-	}
-	if len(variables.BoardFlashLogicalBlockSize) > 0 {
-		ret["flash_logical_block_size"] = variables.BoardFlashLogicalBlockSize
-	}
-	if len(variables.BoardFlashEraseBlockSize) > 0 {
-		ret["flash_erase_block_size"] = variables.BoardFlashEraseBlockSize
-	}
-	if len(variables.BoardExt4ShareDupBlocks) > 0 {
-		ret["ext4_share_dup_blocks"] = variables.BoardExt4ShareDupBlocks
-	}
-	if len(variables.BoardExt4ShareDupBlocks) > 0 {
-		ret["ext4_share_dup_blocks"] = variables.BoardExt4ShareDupBlocks
-	}
-	for _, partitionType := range allPartitionTypes {
-		if qualifiedVariables, ok := variables.PartitionQualifiedVariables[partitionType]; ok && len(qualifiedVariables.ProductVerityPartition) > 0 {
-			ret[partitionType+"_verity_block_device"] = qualifiedVariables.ProductVerityPartition
-		}
-	}
-	// TODO: Vboot
-	// TODO: AVB
-	if variables.BoardUsesRecoveryAsBoot {
-		ret["recovery_as_boot"] = "true"
-	}
-	if variables.ProductUseDynamicPartitionSize {
-		ret["use_dynamic_partition_size"] = "true"
-	}
-	if variables.CopyImagesForTargetFilesZip {
-		ret["use_fixed_timestamp"] = "true"
-	}
-	return ret
-}
-
-// Soong equivalent of make's add-common-ro-flags-to-image-props
-func addCommonRoFlagsToImageProps(variables *android.PartitionVariables, partitionType string, ret map[string]string) {
-	partitionQualifiedVariables, ok := variables.PartitionQualifiedVariables[partitionType]
-	if !ok {
-		panic("Unknown partitionType: " + partitionType)
-	}
-	if len(partitionQualifiedVariables.BoardErofsCompressor) > 0 {
-		ret[partitionType+"_erofs_compressor"] = partitionQualifiedVariables.BoardErofsCompressor
-	}
-	if len(partitionQualifiedVariables.BoardErofsCompressHints) > 0 {
-		ret[partitionType+"_erofs_compress_hints"] = partitionQualifiedVariables.BoardErofsCompressHints
-	}
-	if len(partitionQualifiedVariables.BoardErofsPclusterSize) > 0 {
-		ret[partitionType+"_erofs_pcluster_size"] = partitionQualifiedVariables.BoardErofsPclusterSize
-	}
-	if len(partitionQualifiedVariables.BoardExtfsRsvPct) > 0 {
-		ret[partitionType+"_extfs_rsv_pct"] = partitionQualifiedVariables.BoardExtfsRsvPct
-	}
-	if len(partitionQualifiedVariables.BoardF2fsSloadCompressFlags) > 0 {
-		ret[partitionType+"_f2fs_sldc_flags"] = partitionQualifiedVariables.BoardF2fsSloadCompressFlags
-	}
-	if len(partitionQualifiedVariables.BoardFileSystemCompress) > 0 {
-		ret[partitionType+"_f2fs_compress"] = partitionQualifiedVariables.BoardFileSystemCompress
-	}
-	if len(partitionQualifiedVariables.BoardFileSystemType) > 0 {
-		ret[partitionType+"_fs_type"] = partitionQualifiedVariables.BoardFileSystemType
-	}
-	if len(partitionQualifiedVariables.BoardJournalSize) > 0 {
-		ret[partitionType+"_journal_size"] = partitionQualifiedVariables.BoardJournalSize
-	}
-	if len(partitionQualifiedVariables.BoardPartitionReservedSize) > 0 {
-		ret[partitionType+"_reserved_size"] = partitionQualifiedVariables.BoardPartitionReservedSize
-	}
-	if len(partitionQualifiedVariables.BoardPartitionSize) > 0 {
-		ret[partitionType+"_size"] = partitionQualifiedVariables.BoardPartitionSize
-	}
-	if len(partitionQualifiedVariables.BoardSquashfsBlockSize) > 0 {
-		ret[partitionType+"_squashfs_block_size"] = partitionQualifiedVariables.BoardSquashfsBlockSize
-	}
-	if len(partitionQualifiedVariables.BoardSquashfsCompressor) > 0 {
-		ret[partitionType+"_squashfs_compressor"] = partitionQualifiedVariables.BoardSquashfsCompressor
-	}
-	if len(partitionQualifiedVariables.BoardSquashfsCompressorOpt) > 0 {
-		ret[partitionType+"_squashfs_compressor_opt"] = partitionQualifiedVariables.BoardSquashfsCompressorOpt
-	}
-	if len(partitionQualifiedVariables.BoardSquashfsDisable4kAlign) > 0 {
-		ret[partitionType+"_squashfs_disable_4k_align"] = partitionQualifiedVariables.BoardSquashfsDisable4kAlign
-	}
-	if len(partitionQualifiedVariables.BoardPartitionSize) == 0 && len(partitionQualifiedVariables.BoardPartitionReservedSize) == 0 && len(partitionQualifiedVariables.ProductHeadroom) == 0 {
-		ret[partitionType+"_disable_sparse"] = "true"
-	}
-	addCommonFlagsToImageProps(variables, partitionType, ret)
-}
-
-func hasErofsPartition(variables *android.PartitionVariables) bool {
-	return variables.PartitionQualifiedVariables["product"].BoardFileSystemType == "erofs" ||
-		variables.PartitionQualifiedVariables["system_ext"].BoardFileSystemType == "erofs" ||
-		variables.PartitionQualifiedVariables["odm"].BoardFileSystemType == "erofs" ||
-		variables.PartitionQualifiedVariables["vendor"].BoardFileSystemType == "erofs" ||
-		variables.PartitionQualifiedVariables["system"].BoardFileSystemType == "erofs" ||
-		variables.PartitionQualifiedVariables["vendor_dlkm"].BoardFileSystemType == "erofs" ||
-		variables.PartitionQualifiedVariables["odm_dlkm"].BoardFileSystemType == "erofs" ||
-		variables.PartitionQualifiedVariables["system_dlkm"].BoardFileSystemType == "erofs"
-}
-
-// Soong equivalent of make's add-common-flags-to-image-props
-func addCommonFlagsToImageProps(variables *android.PartitionVariables, partitionType string, ret map[string]string) {
-	// The selinux_fc will be handled separately
-	partitionQualifiedVariables, ok := variables.PartitionQualifiedVariables[partitionType]
-	if !ok {
-		panic("Unknown partitionType: " + partitionType)
-	}
-	ret["building_"+partitionType+"_image"] = boolToMakeString(partitionQualifiedVariables.BuildingImage)
-}
-
-func boolToMakeString(b bool) string {
-	if b {
-		return "true"
-	}
-	return ""
-}
diff --git a/bp2build/bp2build_product_config_test.go b/bp2build/bp2build_product_config_test.go
deleted file mode 100644
index 02a2b51..0000000
--- a/bp2build/bp2build_product_config_test.go
+++ /dev/null
@@ -1,154 +0,0 @@
-package bp2build
-
-import (
-	"android/soong/android"
-	"android/soong/cc"
-	"android/soong/starlark_import"
-	"encoding/json"
-	"reflect"
-	"testing"
-
-	"github.com/google/blueprint/proptools"
-	"go.starlark.net/starlark"
-)
-
-func createStarlarkValue(t *testing.T, code string) starlark.Value {
-	t.Helper()
-	result, err := starlark.ExecFile(&starlark.Thread{}, "main.bzl", "x = "+code, nil)
-	if err != nil {
-		t.Error(err)
-	}
-	return result["x"]
-}
-
-func createStarlarkProductVariablesMap(t *testing.T, code string) map[string]starlark.Value {
-	t.Helper()
-	rawValue := createStarlarkValue(t, code)
-	value, err := starlark_import.Unmarshal[map[string]starlark.Value](rawValue)
-	if err != nil {
-		t.Error(err)
-	}
-	return value
-}
-
-func TestStarlarkMapToProductVariables(t *testing.T) {
-	thirty := 30
-	cases := []struct {
-		starlark string
-		result   android.ProductVariables
-	}{
-		{
-			starlark: `{"CompressedApex": True}`,
-			result:   android.ProductVariables{CompressedApex: proptools.BoolPtr(true)},
-		},
-		{
-			starlark: `{"ApexGlobalMinSdkVersionOverride": "Tiramisu"}`,
-			result:   android.ProductVariables{ApexGlobalMinSdkVersionOverride: proptools.StringPtr("Tiramisu")},
-		},
-		{
-			starlark: `{"ProductManufacturer": "Google"}`,
-			result:   android.ProductVariables{ProductManufacturer: "Google"},
-		},
-		{
-			starlark: `{"Unbundled_build_apps": ["app1", "app2"]}`,
-			result:   android.ProductVariables{Unbundled_build_apps: []string{"app1", "app2"}},
-		},
-		{
-			starlark: `{"Platform_sdk_version": 30}`,
-			result:   android.ProductVariables{Platform_sdk_version: &thirty},
-		},
-		{
-			starlark: `{"HostFakeSnapshotEnabled": True}`,
-			result:   android.ProductVariables{HostFakeSnapshotEnabled: true},
-		},
-	}
-
-	for _, testCase := range cases {
-		productVariables, err := starlarkMapToProductVariables(createStarlarkProductVariablesMap(t,
-			testCase.starlark))
-		if err != nil {
-			t.Error(err)
-			continue
-		}
-		testCase.result.Native_coverage = proptools.BoolPtr(false)
-		if !reflect.DeepEqual(testCase.result, productVariables) {
-			expected, err := json.Marshal(testCase.result)
-			if err != nil {
-				t.Error(err)
-				continue
-			}
-			actual, err := json.Marshal(productVariables)
-			if err != nil {
-				t.Error(err)
-				continue
-			}
-			expectedStr := string(expected)
-			actualStr := string(actual)
-			t.Errorf("expected %q, but got %q", expectedStr, actualStr)
-		}
-	}
-}
-
-func TestSystemPartitionDeps(t *testing.T) {
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("cc_library", cc.LibraryFactory)
-	}, Bp2buildTestCase{
-		ExtraFixturePreparer: android.GroupFixturePreparers(
-			android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
-				deviceProduct := "aosp_arm64"
-				variables.DeviceProduct = &deviceProduct
-				partitionVars := &variables.PartitionVarsForBazelMigrationOnlyDoNotUse
-				partitionVars.ProductDirectory = "build/make/target/product/"
-				partitionVars.ProductPackages = []string{"foo"}
-				var systemVars android.PartitionQualifiedVariablesType
-				systemVars.BuildingImage = true
-				partitionVars.PartitionQualifiedVariables = map[string]android.PartitionQualifiedVariablesType{
-					"system": systemVars,
-				}
-			}),
-			android.FixtureModifyConfig(func(config android.Config) {
-				// MockBazelContext will pretend everything is mixed-builds allowlisted.
-				// The default is noopBazelContext, which does the opposite.
-				config.BazelContext = android.MockBazelContext{}
-			}),
-		),
-		Blueprint: `
-cc_library {
-  name: "foo",
-}`,
-		ExpectedBazelTargets: []string{`android_product(
-    name = "aosp_arm64",
-    soong_variables = _soong_variables,
-)`, `partition(
-    name = "system_image",
-    base_staging_dir = "//build/bazel/bazel_sandwich:system_staging_dir",
-    base_staging_dir_file_list = "//build/bazel/bazel_sandwich:system_staging_dir_file_list",
-    root_dir = "//build/bazel/bazel_sandwich:root_staging_dir",
-    selinux_file_contexts = "//build/bazel/bazel_sandwich:selinux_file_contexts",
-    image_properties = """
-building_system_image=true
-erofs_sparse_flag=-s
-extfs_sparse_flag=-s
-f2fs_sparse_flag=-S
-skip_fsck=true
-squashfs_sparse_flag=-s
-system_disable_sparse=true
-
-""",
-    deps = [
-        "//:foo",
-    ],
-
-    type = "system",
-)`, `partition_diff_test(
-    name = "system_image_test",
-    partition1 = "//build/bazel/bazel_sandwich:make_system_image",
-    partition2 = ":system_image",
-)`, `run_test_in_build(
-    name = "run_system_image_test",
-    test = ":system_image_test",
-)`},
-		Dir:                      "build/make/target/product/aosp_arm64",
-		RunBp2buildProductConfig: true,
-	})
-}
diff --git a/bp2build/bpf_conversion_test.go b/bp2build/bpf_conversion_test.go
deleted file mode 100644
index 26b0bf4..0000000
--- a/bp2build/bpf_conversion_test.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"android/soong/android"
-	"android/soong/bpf"
-
-	"testing"
-)
-
-func runBpfTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "bpf"
-	(&tc).ModuleTypeUnderTestFactory = bpf.BpfFactory
-	RunBp2BuildTestCase(t, registerBpfModuleTypes, tc)
-}
-
-func registerBpfModuleTypes(ctx android.RegistrationContext) {}
-
-func TestBpfSupportedAttrs(t *testing.T) {
-	runBpfTestCase(t, Bp2buildTestCase{
-		Description: "Bpf module only converts supported attributes",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-bpf {
-    name: "bpfTestOut.o",
-    srcs: ["bpfTestSrcOne.c",
-           "bpfTestSrcTwo.c"],
-    btf: true,
-    cflags: ["-bpfCflagOne",
-             "-bpfCflagTwo"],
-    include_dirs: ["ia/ib/ic"],
-    sub_dir: "sa/ab",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("bpf", "bpfTestOut.o", AttrNameToString{
-				"absolute_includes": `["ia/ib/ic"]`,
-				"btf":               `True`,
-				"copts": `[
-        "-bpfCflagOne",
-        "-bpfCflagTwo",
-    ]`,
-				"srcs": `[
-        "bpfTestSrcOne.c",
-        "bpfTestSrcTwo.c",
-    ]`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/build_conversion.go b/bp2build/build_conversion.go
index d2187ff..af2f550 100644
--- a/bp2build/build_conversion.go
+++ b/bp2build/build_conversion.go
@@ -28,10 +28,7 @@
 	"android/soong/android"
 	"android/soong/bazel"
 	"android/soong/starlark_fmt"
-	"android/soong/ui/metrics/bp2build_metrics_proto"
-
 	"github.com/google/blueprint"
-	"github.com/google/blueprint/bootstrap"
 	"github.com/google/blueprint/proptools"
 )
 
@@ -201,18 +198,13 @@
 type CodegenMode int
 
 const (
-	// Bp2Build - generate BUILD files with targets buildable by Bazel directly.
-	//
-	// This mode is used for the Soong->Bazel build definition conversion.
-	Bp2Build CodegenMode = iota
-
 	// QueryView - generate BUILD files with targets representing fully mutated
 	// Soong modules, representing the fully configured Soong module graph with
 	// variants and dependency edges.
 	//
 	// This mode is used for discovering and introspecting the existing Soong
 	// module graph.
-	QueryView
+	QueryView CodegenMode = iota
 )
 
 type unconvertedDepsMode int
@@ -227,8 +219,6 @@
 
 func (mode CodegenMode) String() string {
 	switch mode {
-	case Bp2Build:
-		return "Bp2Build"
 	case QueryView:
 		return "QueryView"
 	default:
@@ -256,9 +246,6 @@
 // writing BUILD files in the output directory.
 func NewCodegenContext(config android.Config, context *android.Context, mode CodegenMode, topDir string) *CodegenContext {
 	var unconvertedDeps unconvertedDepsMode
-	if config.IsEnvTrue("BP2BUILD_ERROR_UNCONVERTED") {
-		unconvertedDeps = errorModulesUnconvertedDeps
-	}
 	return &CodegenContext{
 		context:            context,
 		config:             config,
@@ -281,526 +268,30 @@
 type conversionResults struct {
 	buildFileToTargets    map[string]BazelTargets
 	moduleNameToPartition map[string]string
-	metrics               CodegenMetrics
 }
 
 func (r conversionResults) BuildDirToTargets() map[string]BazelTargets {
 	return r.buildFileToTargets
 }
 
-// struct to store state of b bazel targets (e.g. go targets which do not implement android.Module)
-// this implements bp2buildModule interface and is passed to generateBazelTargets
-type bTarget struct {
-	targetName            string
-	targetPackage         string
-	bazelRuleClass        string
-	bazelRuleLoadLocation string
-	bazelAttributes       []interface{}
-}
-
-var _ bp2buildModule = (*bTarget)(nil)
-
-func (b bTarget) TargetName() string {
-	return b.targetName
-}
-
-func (b bTarget) TargetPackage() string {
-	return b.targetPackage
-}
-
-func (b bTarget) BazelRuleClass() string {
-	return b.bazelRuleClass
-}
-
-func (b bTarget) BazelRuleLoadLocation() string {
-	return b.bazelRuleLoadLocation
-}
-
-func (b bTarget) BazelAttributes() []interface{} {
-	return b.bazelAttributes
-}
-
-// Creates a target_compatible_with entry that is *not* compatible with android
-func targetNotCompatibleWithAndroid() bazel.LabelListAttribute {
-	ret := bazel.LabelListAttribute{}
-	ret.SetSelectValue(bazel.OsConfigurationAxis, bazel.OsAndroid,
-		bazel.MakeLabelList(
-			[]bazel.Label{
-				bazel.Label{
-					Label: "@platforms//:incompatible",
-				},
-			},
-		),
-	)
-	return ret
-}
-
-// helper function to return labels for srcs used in bootstrap_go_package and bootstrap_go_binary
-// this function has the following limitations which make it unsuitable for widespread use
-// - wildcard patterns in srcs
-// This is ok for go since build/blueprint does not support it.
-//
-// Prefer to use `BazelLabelForModuleSrc` instead
-func goSrcLabels(cfg android.Config, moduleDir string, srcs []string, linuxSrcs, darwinSrcs []string) bazel.LabelListAttribute {
-	labels := func(srcs []string) bazel.LabelList {
-		ret := []bazel.Label{}
-		for _, src := range srcs {
-			srcLabel := bazel.Label{
-				Label: src,
-			}
-			ret = append(ret, srcLabel)
-		}
-		// Respect package boundaries
-		return android.TransformSubpackagePaths(
-			cfg,
-			moduleDir,
-			bazel.MakeLabelList(ret),
-		)
-	}
-
-	ret := bazel.LabelListAttribute{}
-	// common
-	ret.SetSelectValue(bazel.NoConfigAxis, "", labels(srcs))
-	// linux
-	ret.SetSelectValue(bazel.OsConfigurationAxis, bazel.OsLinux, labels(linuxSrcs))
-	// darwin
-	ret.SetSelectValue(bazel.OsConfigurationAxis, bazel.OsDarwin, labels(darwinSrcs))
-	return ret
-}
-
-func goDepLabels(deps []string, goModulesMap nameToGoLibraryModule) bazel.LabelListAttribute {
-	labels := []bazel.Label{}
-	for _, dep := range deps {
-		moduleDir := goModulesMap[dep].Dir
-		if moduleDir == "." {
-			moduleDir = ""
-		}
-		label := bazel.Label{
-			Label: fmt.Sprintf("//%s:%s", moduleDir, dep),
-		}
-		labels = append(labels, label)
-	}
-	return bazel.MakeLabelListAttribute(bazel.MakeLabelList(labels))
-}
-
-// attributes common to blueprint_go_binary and bootstap_go_package
-type goAttributes struct {
-	Importpath             bazel.StringAttribute
-	Srcs                   bazel.LabelListAttribute
-	Deps                   bazel.LabelListAttribute
-	Data                   bazel.LabelListAttribute
-	Target_compatible_with bazel.LabelListAttribute
-
-	// attributes for the dynamically generated go_test target
-	Embed bazel.LabelListAttribute
-}
-
-type goTestProperties struct {
-	name           string
-	dir            string
-	testSrcs       []string
-	linuxTestSrcs  []string
-	darwinTestSrcs []string
-	testData       []string
-	// Name of the target that should be compiled together with the test
-	embedName string
-}
-
-// Creates a go_test target for bootstrap_go_package / blueprint_go_binary
-func generateBazelTargetsGoTest(ctx *android.Context, goModulesMap nameToGoLibraryModule, gp goTestProperties) (BazelTarget, error) {
-	ca := android.CommonAttributes{
-		Name: gp.name,
-	}
-	ga := goAttributes{
-		Srcs: goSrcLabels(ctx.Config(), gp.dir, gp.testSrcs, gp.linuxTestSrcs, gp.darwinTestSrcs),
-		Data: goSrcLabels(ctx.Config(), gp.dir, gp.testData, []string{}, []string{}),
-		Embed: bazel.MakeLabelListAttribute(
-			bazel.MakeLabelList(
-				[]bazel.Label{bazel.Label{Label: ":" + gp.embedName}},
-			),
-		),
-		Target_compatible_with: targetNotCompatibleWithAndroid(),
-	}
-
-	libTest := bTarget{
-		targetName:            gp.name,
-		targetPackage:         gp.dir,
-		bazelRuleClass:        "go_test",
-		bazelRuleLoadLocation: "@io_bazel_rules_go//go:def.bzl",
-		bazelAttributes:       []interface{}{&ca, &ga},
-	}
-	return generateBazelTarget(ctx, libTest)
-}
-
-// TODO - b/288491147: testSrcs of certain bootstrap_go_package/blueprint_go_binary are not hermetic and depend on
-// testdata checked into the filesystem.
-// Denylist the generation of go_test targets for these Soong modules.
-// The go_library/go_binary will still be generated, since those are hermitic.
-var (
-	goTestsDenylist = []string{
-		"android-archive-zip",
-		"bazel_notice_gen",
-		"blueprint-bootstrap-bpdoc",
-		"blueprint-microfactory",
-		"blueprint-pathtools",
-		"bssl_ar",
-		"compliance_checkmetadata",
-		"compliance_checkshare",
-		"compliance_dumpgraph",
-		"compliance_dumpresolutions",
-		"compliance_listshare",
-		"compliance-module",
-		"compliancenotice_bom",
-		"compliancenotice_shippedlibs",
-		"compliance_rtrace",
-		"compliance_sbom",
-		"golang-protobuf-internal-fuzz-jsonfuzz",
-		"golang-protobuf-internal-fuzz-textfuzz",
-		"golang-protobuf-internal-fuzz-wirefuzz",
-		"htmlnotice",
-		"protoc-gen-go",
-		"rbcrun-module",
-		"spdx-tools-builder",
-		"spdx-tools-builder2v1",
-		"spdx-tools-builder2v2",
-		"spdx-tools-builder2v3",
-		"spdx-tools-idsearcher",
-		"spdx-tools-spdx-json",
-		"spdx-tools-utils",
-		"soong-ui-build",
-		"textnotice",
-		"xmlnotice",
-	}
-)
-
-func testOfGoPackageIsIncompatible(g *bootstrap.GoPackage) bool {
-	return android.InList(g.Name(), goTestsDenylist) ||
-		// Denylist tests of soong_build
-		// Theses tests have a guard that prevent usage outside a test environment
-		// The guard (`ensureTestOnly`) looks for a `-test` in os.Args, which is present in soong's gotestrunner, but missing in `b test`
-		g.IsPluginFor("soong_build") ||
-		// soong-android is a dep of soong_build
-		// This dependency is created by soong_build by listing it in its deps explicitly in Android.bp, and not via `plugin_for` in `soong-android`
-		g.Name() == "soong-android"
-}
-
-func testOfGoBinaryIsIncompatible(g *bootstrap.GoBinary) bool {
-	return android.InList(g.Name(), goTestsDenylist)
-}
-
-func generateBazelTargetsGoPackage(ctx *android.Context, g *bootstrap.GoPackage, goModulesMap nameToGoLibraryModule) ([]BazelTarget, []error) {
-	ca := android.CommonAttributes{
-		Name: g.Name(),
-	}
-
-	// For this bootstrap_go_package dep chain,
-	// A --> B --> C ( ---> depends on)
-	// Soong provides the convenience of only listing B as deps of A even if a src file of A imports C
-	// Bazel OTOH
-	// 1. requires C to be listed in `deps` expllicity.
-	// 2. does not require C to be listed if src of A does not import C
-	//
-	// bp2build does not have sufficient info on whether C is a direct dep of A or not, so for now collect all transitive deps and add them to deps
-	transitiveDeps := transitiveGoDeps(g.Deps(), goModulesMap)
-
-	ga := goAttributes{
-		Importpath: bazel.StringAttribute{
-			Value: proptools.StringPtr(g.GoPkgPath()),
-		},
-		Srcs: goSrcLabels(ctx.Config(), ctx.ModuleDir(g), g.Srcs(), g.LinuxSrcs(), g.DarwinSrcs()),
-		Deps: goDepLabels(
-			android.FirstUniqueStrings(transitiveDeps),
-			goModulesMap,
-		),
-		Target_compatible_with: targetNotCompatibleWithAndroid(),
-	}
-
-	lib := bTarget{
-		targetName:            g.Name(),
-		targetPackage:         ctx.ModuleDir(g),
-		bazelRuleClass:        "go_library",
-		bazelRuleLoadLocation: "@io_bazel_rules_go//go:def.bzl",
-		bazelAttributes:       []interface{}{&ca, &ga},
-	}
-	retTargets := []BazelTarget{}
-	var retErrs []error
-	if libTarget, err := generateBazelTarget(ctx, lib); err == nil {
-		retTargets = append(retTargets, libTarget)
-	} else {
-		retErrs = []error{err}
-	}
-
-	// If the library contains test srcs, create an additional go_test target
-	if !testOfGoPackageIsIncompatible(g) && (len(g.TestSrcs()) > 0 || len(g.LinuxTestSrcs()) > 0 || len(g.DarwinTestSrcs()) > 0) {
-		gp := goTestProperties{
-			name:           g.Name() + "-test",
-			dir:            ctx.ModuleDir(g),
-			testSrcs:       g.TestSrcs(),
-			linuxTestSrcs:  g.LinuxTestSrcs(),
-			darwinTestSrcs: g.DarwinTestSrcs(),
-			testData:       g.TestData(),
-			embedName:      g.Name(), // embed the source go_library in the test so that its .go files are included in the compilation unit
-		}
-		if libTestTarget, err := generateBazelTargetsGoTest(ctx, goModulesMap, gp); err == nil {
-			retTargets = append(retTargets, libTestTarget)
-		} else {
-			retErrs = append(retErrs, err)
-		}
-	}
-
-	return retTargets, retErrs
-}
-
-type goLibraryModule struct {
-	Dir  string
-	Deps []string
-}
-
-type buildConversionMetadata struct {
-	nameToGoLibraryModule nameToGoLibraryModule
-	ndkHeaders            []blueprint.Module
-}
-
-type nameToGoLibraryModule map[string]goLibraryModule
-
-// Visit each module in the graph, and collect metadata about the build graph
-// If a module is of type `bootstrap_go_package`, return a map containing metadata like its dir and deps
-// If a module is of type `ndk_headers`, add it to a list and return the list
-func createBuildConversionMetadata(ctx *android.Context) buildConversionMetadata {
-	goMap := nameToGoLibraryModule{}
-	ndkHeaders := []blueprint.Module{}
-	ctx.VisitAllModules(func(m blueprint.Module) {
-		moduleType := ctx.ModuleType(m)
-		// We do not need to store information about blueprint_go_binary since it does not have any rdeps
-		if moduleType == "bootstrap_go_package" {
-			goMap[m.Name()] = goLibraryModule{
-				Dir:  ctx.ModuleDir(m),
-				Deps: m.(*bootstrap.GoPackage).Deps(),
-			}
-		} else if moduleType == "ndk_headers" || moduleType == "versioned_ndk_headers" {
-			ndkHeaders = append(ndkHeaders, m)
-		}
-	})
-	return buildConversionMetadata{
-		nameToGoLibraryModule: goMap,
-		ndkHeaders:            ndkHeaders,
-	}
-}
-
-// Returns the deps in the transitive closure of a go target
-func transitiveGoDeps(directDeps []string, goModulesMap nameToGoLibraryModule) []string {
-	allDeps := directDeps
-	i := 0
-	for i < len(allDeps) {
-		curr := allDeps[i]
-		allDeps = append(allDeps, goModulesMap[curr].Deps...)
-		i += 1
-	}
-	allDeps = android.SortedUniqueStrings(allDeps)
-	return allDeps
-}
-
-func generateBazelTargetsGoBinary(ctx *android.Context, g *bootstrap.GoBinary, goModulesMap nameToGoLibraryModule) ([]BazelTarget, []error) {
-	ca := android.CommonAttributes{
-		Name: g.Name(),
-	}
-
-	retTargets := []BazelTarget{}
-	var retErrs []error
-
-	// For this bootstrap_go_package dep chain,
-	// A --> B --> C ( ---> depends on)
-	// Soong provides the convenience of only listing B as deps of A even if a src file of A imports C
-	// Bazel OTOH
-	// 1. requires C to be listed in `deps` expllicity.
-	// 2. does not require C to be listed if src of A does not import C
-	//
-	// bp2build does not have sufficient info on whether C is a direct dep of A or not, so for now collect all transitive deps and add them to deps
-	transitiveDeps := transitiveGoDeps(g.Deps(), goModulesMap)
-
-	goSource := ""
-	// If the library contains test srcs, create an additional go_test target
-	// The go_test target will embed a go_source containining the source .go files it tests
-	if !testOfGoBinaryIsIncompatible(g) && (len(g.TestSrcs()) > 0 || len(g.LinuxTestSrcs()) > 0 || len(g.DarwinTestSrcs()) > 0) {
-		// Create a go_source containing the source .go files of go_library
-		// This target will be an `embed` of the go_binary and go_test
-		goSource = g.Name() + "-source"
-		ca := android.CommonAttributes{
-			Name: goSource,
-		}
-		ga := goAttributes{
-			Srcs:                   goSrcLabels(ctx.Config(), ctx.ModuleDir(g), g.Srcs(), g.LinuxSrcs(), g.DarwinSrcs()),
-			Deps:                   goDepLabels(transitiveDeps, goModulesMap),
-			Target_compatible_with: targetNotCompatibleWithAndroid(),
-		}
-		libTestSource := bTarget{
-			targetName:            goSource,
-			targetPackage:         ctx.ModuleDir(g),
-			bazelRuleClass:        "go_source",
-			bazelRuleLoadLocation: "@io_bazel_rules_go//go:def.bzl",
-			bazelAttributes:       []interface{}{&ca, &ga},
-		}
-		if libSourceTarget, err := generateBazelTarget(ctx, libTestSource); err == nil {
-			retTargets = append(retTargets, libSourceTarget)
-		} else {
-			retErrs = append(retErrs, err)
-		}
-
-		// Create a go_test target
-		gp := goTestProperties{
-			name:           g.Name() + "-test",
-			dir:            ctx.ModuleDir(g),
-			testSrcs:       g.TestSrcs(),
-			linuxTestSrcs:  g.LinuxTestSrcs(),
-			darwinTestSrcs: g.DarwinTestSrcs(),
-			testData:       g.TestData(),
-			// embed the go_source in the test
-			embedName: g.Name() + "-source",
-		}
-		if libTestTarget, err := generateBazelTargetsGoTest(ctx, goModulesMap, gp); err == nil {
-			retTargets = append(retTargets, libTestTarget)
-		} else {
-			retErrs = append(retErrs, err)
-		}
-
-	}
-
-	// Create a go_binary target
-	ga := goAttributes{
-		Deps:                   goDepLabels(transitiveDeps, goModulesMap),
-		Target_compatible_with: targetNotCompatibleWithAndroid(),
-	}
-
-	// If the binary has testSrcs, embed the common `go_source`
-	if goSource != "" {
-		ga.Embed = bazel.MakeLabelListAttribute(
-			bazel.MakeLabelList(
-				[]bazel.Label{bazel.Label{Label: ":" + goSource}},
-			),
-		)
-	} else {
-		ga.Srcs = goSrcLabels(ctx.Config(), ctx.ModuleDir(g), g.Srcs(), g.LinuxSrcs(), g.DarwinSrcs())
-	}
-
-	bin := bTarget{
-		targetName:            g.Name(),
-		targetPackage:         ctx.ModuleDir(g),
-		bazelRuleClass:        "go_binary",
-		bazelRuleLoadLocation: "@io_bazel_rules_go//go:def.bzl",
-		bazelAttributes:       []interface{}{&ca, &ga},
-	}
-
-	if binTarget, err := generateBazelTarget(ctx, bin); err == nil {
-		retTargets = append(retTargets, binTarget)
-	} else {
-		retErrs = []error{err}
-	}
-
-	return retTargets, retErrs
-}
-
 func GenerateBazelTargets(ctx *CodegenContext, generateFilegroups bool) (conversionResults, []error) {
 	ctx.Context().BeginEvent("GenerateBazelTargets")
 	defer ctx.Context().EndEvent("GenerateBazelTargets")
 	buildFileToTargets := make(map[string]BazelTargets)
 
-	// Simple metrics tracking for bp2build
-	metrics := CreateCodegenMetrics()
-
 	dirs := make(map[string]bool)
 	moduleNameToPartition := make(map[string]string)
 
 	var errs []error
 
-	// Visit go libraries in a pre-run and store its state in a map
-	// The time complexity remains O(N), and this does not add significant wall time.
-	meta := createBuildConversionMetadata(ctx.Context())
-	nameToGoLibMap := meta.nameToGoLibraryModule
-	ndkHeaders := meta.ndkHeaders
-
 	bpCtx := ctx.Context()
 	bpCtx.VisitAllModules(func(m blueprint.Module) {
 		dir := bpCtx.ModuleDir(m)
-		moduleType := bpCtx.ModuleType(m)
 		dirs[dir] = true
 
 		var targets []BazelTarget
-		var targetErrs []error
 
 		switch ctx.Mode() {
-		case Bp2Build:
-			if aModule, ok := m.(android.Module); ok {
-				reason := aModule.GetUnconvertedReason()
-				if reason != nil {
-					// If this module was force-enabled, cause an error.
-					if _, ok := ctx.Config().BazelModulesForceEnabledByFlag()[m.Name()]; ok && m.Name() != "" {
-						err := fmt.Errorf("Force Enabled Module %s not converted", m.Name())
-						errs = append(errs, err)
-					}
-
-					// Log the module isn't to be converted by bp2build.
-					// TODO: b/291598248 - Log handcrafted modules differently than other unconverted modules.
-					metrics.AddUnconvertedModule(m, moduleType, dir, *reason)
-					return
-				}
-				if len(aModule.Bp2buildTargets()) == 0 {
-					panic(fmt.Errorf("illegal bp2build invariant: module '%s' was neither converted nor marked unconvertible", aModule.Name()))
-				}
-
-				// Handle modules converted to generated targets.
-				targets, targetErrs = generateBazelTargets(bpCtx, aModule)
-				errs = append(errs, targetErrs...)
-				for _, t := range targets {
-					// A module can potentially generate more than 1 Bazel
-					// target, each of a different rule class.
-					metrics.IncrementRuleClassCount(t.ruleClass)
-				}
-
-				// record the partition
-				moduleNameToPartition[android.RemoveOptionalPrebuiltPrefix(aModule.Name())] = aModule.GetPartitionForBp2build()
-
-				// Log the module.
-				metrics.AddConvertedModule(aModule, moduleType, dir)
-
-				// Handle modules with unconverted deps. By default, emit a warning.
-				if unconvertedDeps := aModule.GetUnconvertedBp2buildDeps(); len(unconvertedDeps) > 0 {
-					msg := fmt.Sprintf("%s %s:%s depends on unconverted modules: %s",
-						moduleType, bpCtx.ModuleDir(m), m.Name(), strings.Join(unconvertedDeps, ", "))
-					switch ctx.unconvertedDepMode {
-					case warnUnconvertedDeps:
-						metrics.moduleWithUnconvertedDepsMsgs = append(metrics.moduleWithUnconvertedDepsMsgs, msg)
-					case errorModulesUnconvertedDeps:
-						errs = append(errs, fmt.Errorf(msg))
-						return
-					}
-				}
-				if unconvertedDeps := aModule.GetMissingBp2buildDeps(); len(unconvertedDeps) > 0 {
-					msg := fmt.Sprintf("%s %s:%s depends on missing modules: %s",
-						moduleType, bpCtx.ModuleDir(m), m.Name(), strings.Join(unconvertedDeps, ", "))
-					switch ctx.unconvertedDepMode {
-					case warnUnconvertedDeps:
-						metrics.moduleWithMissingDepsMsgs = append(metrics.moduleWithMissingDepsMsgs, msg)
-					case errorModulesUnconvertedDeps:
-						errs = append(errs, fmt.Errorf(msg))
-						return
-					}
-				}
-			} else if glib, ok := m.(*bootstrap.GoPackage); ok {
-				targets, targetErrs = generateBazelTargetsGoPackage(bpCtx, glib, nameToGoLibMap)
-				errs = append(errs, targetErrs...)
-				metrics.IncrementRuleClassCount("bootstrap_go_package")
-				metrics.AddConvertedModule(glib, "bootstrap_go_package", dir)
-			} else if gbin, ok := m.(*bootstrap.GoBinary); ok {
-				targets, targetErrs = generateBazelTargetsGoBinary(bpCtx, gbin, nameToGoLibMap)
-				errs = append(errs, targetErrs...)
-				metrics.IncrementRuleClassCount("blueprint_go_binary")
-				metrics.AddConvertedModule(gbin, "blueprint_go_binary", dir)
-			} else {
-				metrics.AddUnconvertedModule(m, moduleType, dir, android.UnconvertedReason{
-					ReasonType: int(bp2build_metrics_proto.UnconvertedReasonType_TYPE_UNSUPPORTED),
-				})
-				return
-			}
 		case QueryView:
 			// Blocklist certain module types from being generated.
 			if canonicalizeModuleType(bpCtx.ModuleType(m)) == "package" {
@@ -824,37 +315,6 @@
 		}
 	})
 
-	// Create an ndk_sysroot target that has a dependency edge on every target corresponding to Soong's ndk_headers
-	// This root target will provide headers to sdk variants of jni libraries
-	if ctx.Mode() == Bp2Build {
-		var depLabels bazel.LabelList
-		for _, ndkHeader := range ndkHeaders {
-			depLabel := bazel.Label{
-				Label: "//" + bpCtx.ModuleDir(ndkHeader) + ":" + ndkHeader.Name(),
-			}
-			depLabels.Add(&depLabel)
-		}
-		a := struct {
-			Deps bazel.LabelListAttribute
-		}{
-			Deps: bazel.MakeLabelListAttribute(bazel.UniqueSortedBazelLabelList(depLabels)),
-		}
-		ndkSysroot := bTarget{
-			targetName:            "ndk_sysroot",
-			targetPackage:         "build/bazel/rules/cc", // The location is subject to change, use build/bazel for now
-			bazelRuleClass:        "cc_library_headers",
-			bazelRuleLoadLocation: "//build/bazel/rules/cc:cc_library_headers.bzl",
-			bazelAttributes:       []interface{}{&a},
-		}
-
-		if t, err := generateBazelTarget(bpCtx, ndkSysroot); err == nil {
-			dir := ndkSysroot.targetPackage
-			buildFileToTargets[dir] = append(buildFileToTargets[dir], t)
-		} else {
-			errs = append(errs, err)
-		}
-	}
-
 	if len(errs) > 0 {
 		return conversionResults{}, errs
 	}
@@ -883,72 +343,9 @@
 	return conversionResults{
 		buildFileToTargets:    buildFileToTargets,
 		moduleNameToPartition: moduleNameToPartition,
-		metrics:               metrics,
 	}, errs
 }
 
-func generateBazelTargets(ctx bpToBuildContext, m android.Module) ([]BazelTarget, []error) {
-	var targets []BazelTarget
-	var errs []error
-	for _, m := range m.Bp2buildTargets() {
-		target, err := generateBazelTarget(ctx, m)
-		if err != nil {
-			errs = append(errs, err)
-			return targets, errs
-		}
-		targets = append(targets, target)
-	}
-	return targets, errs
-}
-
-type bp2buildModule interface {
-	TargetName() string
-	TargetPackage() string
-	BazelRuleClass() string
-	BazelRuleLoadLocation() string
-	BazelAttributes() []interface{}
-}
-
-func generateBazelTarget(ctx bpToBuildContext, m bp2buildModule) (BazelTarget, error) {
-	ruleClass := m.BazelRuleClass()
-	bzlLoadLocation := m.BazelRuleLoadLocation()
-
-	// extract the bazel attributes from the module.
-	attrs := m.BazelAttributes()
-	props, err := extractModuleProperties(attrs, true)
-	if err != nil {
-		return BazelTarget{}, err
-	}
-
-	// name is handled in a special manner
-	delete(props.Attrs, "name")
-
-	// Return the Bazel target with rule class and attributes, ready to be
-	// code-generated.
-	attributes := propsToAttributes(props.Attrs)
-	var content string
-	targetName := m.TargetName()
-	if targetName != "" {
-		content = fmt.Sprintf(ruleTargetTemplate, ruleClass, targetName, attributes)
-	} else {
-		content = fmt.Sprintf(unnamedRuleTargetTemplate, ruleClass, attributes)
-	}
-	var loads []BazelLoad
-	if bzlLoadLocation != "" {
-		loads = append(loads, BazelLoad{
-			file:    bzlLoadLocation,
-			symbols: []BazelLoadSymbol{{symbol: ruleClass}},
-		})
-	}
-	return BazelTarget{
-		name:        targetName,
-		packageName: m.TargetPackage(),
-		ruleClass:   ruleClass,
-		loads:       loads,
-		content:     content,
-	}, nil
-}
-
 // Convert a module and its deps and props into a Bazel macro/rule
 // representation in the BUILD file.
 func generateSoongModuleTarget(ctx bpToBuildContext, m blueprint.Module) (BazelTarget, error) {
diff --git a/bp2build/build_conversion_test.go b/bp2build/build_conversion_test.go
deleted file mode 100644
index f809bcc..0000000
--- a/bp2build/build_conversion_test.go
+++ /dev/null
@@ -1,2256 +0,0 @@
-// Copyright 2020 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"fmt"
-	"strings"
-	"testing"
-
-	"android/soong/android"
-	"android/soong/android/allowlists"
-	"android/soong/bazel"
-	"android/soong/python"
-)
-
-func TestGenerateSoongModuleTargets(t *testing.T) {
-	testCases := []struct {
-		description         string
-		bp                  string
-		expectedBazelTarget string
-	}{
-		{
-			description: "only name",
-			bp: `custom { name: "foo" }
-    `,
-			expectedBazelTarget: `soong_module(
-    name = "foo",
-    soong_module_name = "foo",
-    soong_module_type = "custom",
-    soong_module_variant = "",
-    soong_module_deps = [
-    ],
-    bool_prop = False,
-    string_prop = "",
-)`,
-		},
-		{
-			description: "handles bool",
-			bp: `custom {
-  name: "foo",
-  bool_prop: true,
-}
-    `,
-			expectedBazelTarget: `soong_module(
-    name = "foo",
-    soong_module_name = "foo",
-    soong_module_type = "custom",
-    soong_module_variant = "",
-    soong_module_deps = [
-    ],
-    bool_prop = True,
-    string_prop = "",
-)`,
-		},
-		{
-			description: "string escaping",
-			bp: `custom {
-  name: "foo",
-  owner: "a_string_with\"quotes\"_and_\\backslashes\\\\",
-}
-    `,
-			expectedBazelTarget: `soong_module(
-    name = "foo",
-    soong_module_name = "foo",
-    soong_module_type = "custom",
-    soong_module_variant = "",
-    soong_module_deps = [
-    ],
-    bool_prop = False,
-    owner = "a_string_with\"quotes\"_and_\\backslashes\\\\",
-    string_prop = "",
-)`,
-		},
-		{
-			description: "single item string list",
-			bp: `custom {
-  name: "foo",
-  required: ["bar"],
-}
-    `,
-			expectedBazelTarget: `soong_module(
-    name = "foo",
-    soong_module_name = "foo",
-    soong_module_type = "custom",
-    soong_module_variant = "",
-    soong_module_deps = [
-    ],
-    bool_prop = False,
-    required = ["bar"],
-    string_prop = "",
-)`,
-		},
-		{
-			description: "list of strings",
-			bp: `custom {
-  name: "foo",
-  target_required: ["qux", "bazqux"],
-}
-    `,
-			expectedBazelTarget: `soong_module(
-    name = "foo",
-    soong_module_name = "foo",
-    soong_module_type = "custom",
-    soong_module_variant = "",
-    soong_module_deps = [
-    ],
-    bool_prop = False,
-    string_prop = "",
-    target_required = [
-        "qux",
-        "bazqux",
-    ],
-)`,
-		},
-		{
-			description: "dist/dists",
-			bp: `custom {
-  name: "foo",
-  dist: {
-    targets: ["goal_foo"],
-    tag: ".foo",
-  },
-  dists: [{
-    targets: ["goal_bar"],
-    tag: ".bar",
-  }],
-}
-    `,
-			expectedBazelTarget: `soong_module(
-    name = "foo",
-    soong_module_name = "foo",
-    soong_module_type = "custom",
-    soong_module_variant = "",
-    soong_module_deps = [
-    ],
-    bool_prop = False,
-    dist = {
-        "tag": ".foo",
-        "targets": ["goal_foo"],
-    },
-    dists = [{
-        "tag": ".bar",
-        "targets": ["goal_bar"],
-    }],
-    string_prop = "",
-)`,
-		},
-		{
-			description: "put it together",
-			bp: `custom {
-  name: "foo",
-  required: ["bar"],
-  target_required: ["qux", "bazqux"],
-  bool_prop: true,
-  owner: "custom_owner",
-  dists: [
-    {
-      tag: ".tag",
-      targets: ["my_goal"],
-    },
-  ],
-}
-    `,
-			expectedBazelTarget: `soong_module(
-    name = "foo",
-    soong_module_name = "foo",
-    soong_module_type = "custom",
-    soong_module_variant = "",
-    soong_module_deps = [
-    ],
-    bool_prop = True,
-    dists = [{
-        "tag": ".tag",
-        "targets": ["my_goal"],
-    }],
-    owner = "custom_owner",
-    required = ["bar"],
-    string_prop = "",
-    target_required = [
-        "qux",
-        "bazqux",
-    ],
-)`,
-		},
-	}
-
-	dir := "."
-	for _, testCase := range testCases {
-		t.Run(testCase.description, func(t *testing.T) {
-			config := android.TestConfig(buildDir, nil, testCase.bp, nil)
-			ctx := android.NewTestContext(config)
-
-			ctx.RegisterModuleType("custom", customModuleFactoryHostAndDevice)
-			ctx.Register()
-
-			_, errs := ctx.ParseFileList(dir, []string{"Android.bp"})
-			android.FailIfErrored(t, errs)
-			_, errs = ctx.PrepareBuildActions(config)
-			android.FailIfErrored(t, errs)
-
-			codegenCtx := NewCodegenContext(config, ctx.Context, QueryView, "")
-			bazelTargets, err := generateBazelTargetsForDir(codegenCtx, dir)
-			android.FailIfErrored(t, err)
-			if actualCount, expectedCount := len(bazelTargets), 1; actualCount != expectedCount {
-				t.Fatalf("Expected %d bazel target, got %d", expectedCount, actualCount)
-			}
-
-			actualBazelTarget := bazelTargets[0]
-			if actualBazelTarget.content != testCase.expectedBazelTarget {
-				t.Errorf(
-					"Expected generated Bazel target to be '%s', got '%s'",
-					testCase.expectedBazelTarget,
-					actualBazelTarget.content,
-				)
-			}
-		})
-	}
-}
-
-func TestGenerateBazelTargetModules(t *testing.T) {
-	testCases := []Bp2buildTestCase{
-		{
-			Description: "string prop empty",
-			Blueprint: `custom {
-	name: "foo",
-    string_literal_prop: "",
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("custom", "foo", AttrNameToString{
-					"string_literal_prop": `""`,
-				}),
-			},
-		},
-		{
-			Description: `string prop "PROP"`,
-			Blueprint: `custom {
-	name: "foo",
-    string_literal_prop: "PROP",
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("custom", "foo", AttrNameToString{
-					"string_literal_prop": `"PROP"`,
-				}),
-			},
-		},
-		{
-			Description: `string prop arch variant`,
-			Blueprint: `custom {
-    name: "foo",
-    arch: {
-        arm: { string_literal_prop: "ARM" },
-        arm64: { string_literal_prop: "ARM64" },
-    },
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("custom", "foo", AttrNameToString{
-					"string_literal_prop": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "ARM",
-        "//build/bazel_common_rules/platforms/arch:arm64": "ARM64",
-        "//conditions:default": None,
-    })`,
-				}),
-			},
-		},
-		{
-			Description: "string ptr props",
-			Blueprint: `custom {
-	name: "foo",
-    string_ptr_prop: "",
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("custom", "foo", AttrNameToString{
-					"string_ptr_prop": `""`,
-				}),
-			},
-		},
-		{
-			Description: "string list props",
-			Blueprint: `custom {
-  name: "foo",
-    string_list_prop: ["a", "b"],
-    string_ptr_prop: "a",
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("custom", "foo", AttrNameToString{
-					"string_list_prop": `[
-        "a",
-        "b",
-    ]`,
-					"string_ptr_prop": `"a"`,
-				}),
-			},
-		},
-		{
-			Description: "control characters",
-			Blueprint: `custom {
-    name: "foo",
-    string_list_prop: ["\t", "\n"],
-    string_ptr_prop: "a\t\n\r",
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("custom", "foo", AttrNameToString{
-					"string_list_prop": `[
-        "\t",
-        "\n",
-    ]`,
-					"string_ptr_prop": `"a\t\n\r"`,
-				}),
-			},
-		},
-		{
-			Description: "handles dep",
-			Blueprint: `custom {
-  name: "has_dep",
-  arch_paths: [":dep"],
-  bazel_module: { bp2build_available: true },
-}
-
-custom {
-  name: "dep",
-  arch_paths: ["abc"],
-  bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("custom", "dep", AttrNameToString{
-					"arch_paths": `["abc"]`,
-				}),
-				MakeBazelTarget("custom", "has_dep", AttrNameToString{
-					"arch_paths": `[":dep"]`,
-				}),
-			},
-		},
-		{
-			Description: "arch-variant srcs",
-			Blueprint: `custom {
-    name: "arch_paths",
-    arch: {
-      x86: { arch_paths: ["x86.txt"] },
-      x86_64:  { arch_paths: ["x86_64.txt"] },
-      arm:  { arch_paths: ["arm.txt"] },
-      arm64:  { arch_paths: ["arm64.txt"] },
-      riscv64: { arch_paths: ["riscv64.txt"] },
-    },
-    target: {
-      linux: { arch_paths: ["linux.txt"] },
-      bionic: { arch_paths: ["bionic.txt"] },
-      host: { arch_paths: ["host.txt"] },
-      not_windows: { arch_paths: ["not_windows.txt"] },
-      android: { arch_paths: ["android.txt"] },
-      linux_musl: { arch_paths: ["linux_musl.txt"] },
-      musl: { arch_paths: ["musl.txt"] },
-      linux_glibc: { arch_paths: ["linux_glibc.txt"] },
-      glibc: { arch_paths: ["glibc.txt"] },
-      linux_bionic: { arch_paths: ["linux_bionic.txt"] },
-      darwin: { arch_paths: ["darwin.txt"] },
-      windows: { arch_paths: ["windows.txt"] },
-    },
-    multilib: {
-        lib32: { arch_paths: ["lib32.txt"] },
-        lib64: { arch_paths: ["lib64.txt"] },
-    },
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("custom", "arch_paths", AttrNameToString{
-					"arch_paths": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": [
-            "arm.txt",
-            "lib32.txt",
-        ],
-        "//build/bazel_common_rules/platforms/arch:arm64": [
-            "arm64.txt",
-            "lib64.txt",
-        ],
-        "//build/bazel_common_rules/platforms/arch:riscv64": [
-            "riscv64.txt",
-            "lib64.txt",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86": [
-            "x86.txt",
-            "lib32.txt",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86_64": [
-            "x86_64.txt",
-            "lib64.txt",
-        ],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel_common_rules/platforms/os:android": [
-            "linux.txt",
-            "bionic.txt",
-            "android.txt",
-        ],
-        "//build/bazel_common_rules/platforms/os:darwin": [
-            "host.txt",
-            "darwin.txt",
-            "not_windows.txt",
-        ],
-        "//build/bazel_common_rules/platforms/os:linux_bionic": [
-            "host.txt",
-            "linux.txt",
-            "bionic.txt",
-            "linux_bionic.txt",
-            "not_windows.txt",
-        ],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": [
-            "host.txt",
-            "linux.txt",
-            "glibc.txt",
-            "linux_glibc.txt",
-            "not_windows.txt",
-        ],
-        "//build/bazel_common_rules/platforms/os:linux_musl": [
-            "host.txt",
-            "linux.txt",
-            "musl.txt",
-            "linux_musl.txt",
-            "not_windows.txt",
-        ],
-        "//build/bazel_common_rules/platforms/os:windows": [
-            "host.txt",
-            "windows.txt",
-        ],
-        "//conditions:default": [],
-    })`,
-				}),
-			},
-		},
-		{
-			Description: "arch-variant deps",
-			Blueprint: `custom {
-  name: "has_dep",
-  arch: {
-    x86: {
-      arch_paths: [":dep"],
-    },
-  },
-  bazel_module: { bp2build_available: true },
-}
-
-custom {
-    name: "dep",
-    arch_paths: ["abc"],
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("custom", "dep", AttrNameToString{
-					"arch_paths": `["abc"]`,
-				}),
-				MakeBazelTarget("custom", "has_dep", AttrNameToString{
-					"arch_paths": `select({
-        "//build/bazel_common_rules/platforms/arch:x86": [":dep"],
-        "//conditions:default": [],
-    })`,
-				}),
-			},
-		},
-		{
-			Description: "embedded props",
-			Blueprint: `custom {
-    name: "embedded_props",
-    embedded_prop: "abc",
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("custom", "embedded_props", AttrNameToString{
-					"embedded_attr": `"abc"`,
-				}),
-			},
-		},
-		{
-			Description: "ptr to embedded props",
-			Blueprint: `custom {
-    name: "ptr_to_embedded_props",
-    other_embedded_prop: "abc",
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("custom", "ptr_to_embedded_props", AttrNameToString{
-					"other_embedded_attr": `"abc"`,
-				}),
-			},
-		},
-	}
-
-	dir := "."
-	for _, testCase := range testCases {
-		t.Run(testCase.Description, func(t *testing.T) {
-			config := android.TestConfig(buildDir, nil, testCase.Blueprint, nil)
-			ctx := android.NewTestContext(config)
-
-			registerCustomModuleForBp2buildConversion(ctx)
-
-			_, errs := ctx.ParseFileList(dir, []string{"Android.bp"})
-			if errored(t, testCase, errs) {
-				return
-			}
-			_, errs = ctx.ResolveDependencies(config)
-			if errored(t, testCase, errs) {
-				return
-			}
-
-			codegenCtx := NewCodegenContext(config, ctx.Context, Bp2Build, "")
-			bazelTargets, err := generateBazelTargetsForDir(codegenCtx, dir)
-			android.FailIfErrored(t, err)
-
-			if actualCount, expectedCount := len(bazelTargets), len(testCase.ExpectedBazelTargets); actualCount != expectedCount {
-				t.Errorf("Expected %d bazel target (%s),\ngot %d (%s)", expectedCount, testCase.ExpectedBazelTargets, actualCount, bazelTargets)
-			} else {
-				for i, expectedBazelTarget := range testCase.ExpectedBazelTargets {
-					actualBazelTarget := bazelTargets[i]
-					if actualBazelTarget.content != expectedBazelTarget {
-						t.Errorf(
-							"Expected generated Bazel target to be '%s', got '%s'",
-							expectedBazelTarget,
-							actualBazelTarget.content,
-						)
-					}
-				}
-			}
-		})
-	}
-}
-
-func TestBp2buildHostAndDevice(t *testing.T) {
-	testCases := []Bp2buildTestCase{
-		{
-			Description:                "host and device, device only",
-			ModuleTypeUnderTest:        "custom",
-			ModuleTypeUnderTestFactory: customModuleFactoryHostAndDevice,
-			Blueprint: `custom {
-		name: "foo",
-		bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				makeBazelTargetHostOrDevice("custom", "foo", AttrNameToString{}, android.DeviceSupported),
-			},
-		},
-		{
-			Description:                "host and device, both",
-			ModuleTypeUnderTest:        "custom",
-			ModuleTypeUnderTestFactory: customModuleFactoryHostAndDevice,
-			Blueprint: `custom {
-		name: "foo",
-		host_supported: true,
-		bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("custom", "foo", AttrNameToString{}),
-			},
-		},
-		{
-			Description:                "host and device, host explicitly disabled",
-			ModuleTypeUnderTest:        "custom",
-			ModuleTypeUnderTestFactory: customModuleFactoryHostAndDevice,
-			Blueprint: `custom {
-		name: "foo",
-		host_supported: false,
-		bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				makeBazelTargetHostOrDevice("custom", "foo", AttrNameToString{}, android.DeviceSupported),
-			},
-		},
-		{
-			Description:                "host and device, neither",
-			ModuleTypeUnderTest:        "custom",
-			ModuleTypeUnderTestFactory: customModuleFactoryHostAndDevice,
-			Blueprint: `custom {
-		name: "foo",
-		host_supported: false,
-		device_supported: false,
-		bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("custom", "foo", AttrNameToString{
-					"target_compatible_with": `["@platforms//:incompatible"]`,
-				}),
-			},
-		},
-		{
-			Description:                "host and device, neither, cannot override with product_var",
-			ModuleTypeUnderTest:        "custom",
-			ModuleTypeUnderTestFactory: customModuleFactoryHostAndDevice,
-			Blueprint: `custom {
-		name: "foo",
-		host_supported: false,
-		device_supported: false,
-		product_variables: { unbundled_build: { enabled: true } },
-		bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("custom", "foo", AttrNameToString{
-					"target_compatible_with": `["@platforms//:incompatible"]`,
-				}),
-			},
-		},
-		{
-			Description:                "host and device, both, disabled overrided with product_var",
-			ModuleTypeUnderTest:        "custom",
-			ModuleTypeUnderTestFactory: customModuleFactoryHostAndDevice,
-			Blueprint: `custom {
-		name: "foo",
-		host_supported: true,
-		device_supported: true,
-		enabled: false,
-		product_variables: { unbundled_build: { enabled: true } },
-		bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("custom", "foo", AttrNameToString{
-					"target_compatible_with": `select({
-        "//build/bazel/product_config/config_settings:unbundled_build": [],
-        "//conditions:default": ["@platforms//:incompatible"],
-    })`,
-				}),
-			},
-		},
-		{
-			Description:                "host and device, neither, cannot override with arch enabled",
-			ModuleTypeUnderTest:        "custom",
-			ModuleTypeUnderTestFactory: customModuleFactoryHostAndDevice,
-			Blueprint: `custom {
-		name: "foo",
-		host_supported: false,
-		device_supported: false,
-		arch: { x86: { enabled: true } },
-		bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("custom", "foo", AttrNameToString{
-					"target_compatible_with": `["@platforms//:incompatible"]`,
-				}),
-			},
-		},
-		{
-			Description:                "host and device, host only",
-			ModuleTypeUnderTest:        "custom",
-			ModuleTypeUnderTestFactory: customModuleFactoryHostAndDevice,
-			Blueprint: `custom {
-		name: "foo",
-		host_supported: true,
-		device_supported: false,
-		bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				makeBazelTargetHostOrDevice("custom", "foo", AttrNameToString{}, android.HostSupported),
-			},
-		},
-		{
-			Description:                "host only",
-			ModuleTypeUnderTest:        "custom",
-			ModuleTypeUnderTestFactory: customModuleFactoryHostSupported,
-			Blueprint: `custom {
-		name: "foo",
-		bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				makeBazelTargetHostOrDevice("custom", "foo", AttrNameToString{}, android.HostSupported),
-			},
-		},
-		{
-			Description:                "device only",
-			ModuleTypeUnderTest:        "custom",
-			ModuleTypeUnderTestFactory: customModuleFactoryDeviceSupported,
-			Blueprint: `custom {
-		name: "foo",
-		bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				makeBazelTargetHostOrDevice("custom", "foo", AttrNameToString{}, android.DeviceSupported),
-			},
-		},
-		{
-			Description:                "host and device default, default",
-			ModuleTypeUnderTest:        "custom",
-			ModuleTypeUnderTestFactory: customModuleFactoryHostAndDeviceDefault,
-			Blueprint: `custom {
-		name: "foo",
-		bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("custom", "foo", AttrNameToString{}),
-			},
-		},
-		{
-			Description:                "host and device default, device only",
-			ModuleTypeUnderTest:        "custom",
-			ModuleTypeUnderTestFactory: customModuleFactoryHostAndDeviceDefault,
-			Blueprint: `custom {
-		name: "foo",
-		host_supported: false,
-		bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				makeBazelTargetHostOrDevice("custom", "foo", AttrNameToString{}, android.DeviceSupported),
-			},
-		},
-		{
-			Description:                "host and device default, host only",
-			ModuleTypeUnderTest:        "custom",
-			ModuleTypeUnderTestFactory: customModuleFactoryHostAndDeviceDefault,
-			Blueprint: `custom {
-		name: "foo",
-		device_supported: false,
-		bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				makeBazelTargetHostOrDevice("custom", "foo", AttrNameToString{}, android.HostSupported),
-			},
-		},
-		{
-			Description:                "host and device default, neither",
-			ModuleTypeUnderTest:        "custom",
-			ModuleTypeUnderTestFactory: customModuleFactoryHostAndDeviceDefault,
-			Blueprint: `custom {
-		name: "foo",
-		host_supported: false,
-		device_supported: false,
-		bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("custom", "foo", AttrNameToString{
-					"target_compatible_with": `["@platforms//:incompatible"]`,
-				}),
-			},
-		},
-	}
-
-	for _, tc := range testCases {
-		t.Run(tc.Description, func(t *testing.T) {
-			RunBp2BuildTestCaseSimple(t, tc)
-		})
-	}
-}
-
-func TestLoadStatements(t *testing.T) {
-	testCases := []struct {
-		bazelTargets           BazelTargets
-		expectedLoadStatements string
-	}{
-		{
-			bazelTargets: BazelTargets{
-				BazelTarget{
-					name:      "foo",
-					ruleClass: "cc_library",
-					loads: []BazelLoad{{
-						file:    "//build/bazel/rules:cc.bzl",
-						symbols: []BazelLoadSymbol{{symbol: "cc_library"}},
-					}},
-				},
-			},
-			expectedLoadStatements: `load("//build/bazel/rules:cc.bzl", "cc_library")`,
-		},
-		{
-			bazelTargets: BazelTargets{
-				BazelTarget{
-					name:      "foo",
-					ruleClass: "cc_library",
-					loads: []BazelLoad{{
-						file:    "//build/bazel/rules:cc.bzl",
-						symbols: []BazelLoadSymbol{{symbol: "cc_library"}},
-					}},
-				},
-				BazelTarget{
-					name:      "bar",
-					ruleClass: "cc_library",
-					loads: []BazelLoad{{
-						file:    "//build/bazel/rules:cc.bzl",
-						symbols: []BazelLoadSymbol{{symbol: "cc_library"}},
-					}},
-				},
-			},
-			expectedLoadStatements: `load("//build/bazel/rules:cc.bzl", "cc_library")`,
-		},
-		{
-			bazelTargets: BazelTargets{
-				BazelTarget{
-					name:      "foo",
-					ruleClass: "cc_library",
-					loads: []BazelLoad{{
-						file:    "//build/bazel/rules:cc.bzl",
-						symbols: []BazelLoadSymbol{{symbol: "cc_library"}},
-					}},
-				},
-				BazelTarget{
-					name:      "bar",
-					ruleClass: "cc_binary",
-					loads: []BazelLoad{{
-						file:    "//build/bazel/rules:cc.bzl",
-						symbols: []BazelLoadSymbol{{symbol: "cc_binary"}},
-					}},
-				},
-			},
-			expectedLoadStatements: `load("//build/bazel/rules:cc.bzl", "cc_binary", "cc_library")`,
-		},
-		{
-			bazelTargets: BazelTargets{
-				BazelTarget{
-					name:      "foo",
-					ruleClass: "cc_library",
-					loads: []BazelLoad{{
-						file:    "//build/bazel/rules:cc.bzl",
-						symbols: []BazelLoadSymbol{{symbol: "cc_library"}},
-					}},
-				},
-				BazelTarget{
-					name:      "bar",
-					ruleClass: "cc_binary",
-					loads: []BazelLoad{{
-						file:    "//build/bazel/rules:cc.bzl",
-						symbols: []BazelLoadSymbol{{symbol: "cc_binary"}},
-					}},
-				},
-				BazelTarget{
-					name:      "baz",
-					ruleClass: "java_binary",
-					loads: []BazelLoad{{
-						file:    "//build/bazel/rules:java.bzl",
-						symbols: []BazelLoadSymbol{{symbol: "java_binary"}},
-					}},
-				},
-			},
-			expectedLoadStatements: `load("//build/bazel/rules:cc.bzl", "cc_binary", "cc_library")
-load("//build/bazel/rules:java.bzl", "java_binary")`,
-		},
-		{
-			bazelTargets: BazelTargets{
-				BazelTarget{
-					name:      "foo",
-					ruleClass: "cc_binary",
-					loads: []BazelLoad{{
-						file:    "//build/bazel/rules:cc.bzl",
-						symbols: []BazelLoadSymbol{{symbol: "cc_binary"}},
-					}},
-				},
-				BazelTarget{
-					name:      "bar",
-					ruleClass: "java_binary",
-					loads: []BazelLoad{{
-						file:    "//build/bazel/rules:java.bzl",
-						symbols: []BazelLoadSymbol{{symbol: "java_binary"}},
-					}},
-				},
-				BazelTarget{
-					name:      "baz",
-					ruleClass: "genrule",
-					// Note: no loads for native rules
-				},
-			},
-			expectedLoadStatements: `load("//build/bazel/rules:cc.bzl", "cc_binary")
-load("//build/bazel/rules:java.bzl", "java_binary")`,
-		},
-	}
-
-	for _, testCase := range testCases {
-		actual := testCase.bazelTargets.LoadStatements()
-		expected := testCase.expectedLoadStatements
-		if actual != expected {
-			t.Fatalf("Expected load statements to be %s, got %s", expected, actual)
-		}
-	}
-
-}
-
-func TestGenerateBazelTargetModules_OneToMany_LoadedFromStarlark(t *testing.T) {
-	testCases := []struct {
-		bp                       string
-		expectedBazelTarget      string
-		expectedBazelTargetCount int
-		expectedLoadStatements   string
-	}{
-		{
-			bp: `custom {
-    name: "bar",
-    host_supported: true,
-    one_to_many_prop: true,
-    bazel_module: { bp2build_available: true  },
-}`,
-			expectedBazelTarget: `my_library(
-    name = "bar",
-)
-
-proto_library(
-    name = "bar_proto_library_deps",
-)
-
-my_proto_library(
-    name = "bar_my_proto_library_deps",
-)`,
-			expectedBazelTargetCount: 3,
-			expectedLoadStatements: `load("//build/bazel/rules:proto.bzl", "my_proto_library", "proto_library")
-load("//build/bazel/rules:rules.bzl", "my_library")`,
-		},
-	}
-
-	dir := "."
-	for _, testCase := range testCases {
-		config := android.TestConfig(buildDir, nil, testCase.bp, nil)
-		ctx := android.NewTestContext(config)
-		ctx.RegisterModuleType("custom", customModuleFactoryHostAndDevice)
-		ctx.RegisterForBazelConversion()
-
-		_, errs := ctx.ParseFileList(dir, []string{"Android.bp"})
-		android.FailIfErrored(t, errs)
-		_, errs = ctx.ResolveDependencies(config)
-		android.FailIfErrored(t, errs)
-
-		codegenCtx := NewCodegenContext(config, ctx.Context, Bp2Build, "")
-		bazelTargets, err := generateBazelTargetsForDir(codegenCtx, dir)
-		android.FailIfErrored(t, err)
-		if actualCount := len(bazelTargets); actualCount != testCase.expectedBazelTargetCount {
-			t.Fatalf("Expected %d bazel target, got %d", testCase.expectedBazelTargetCount, actualCount)
-		}
-
-		actualBazelTargets := bazelTargets.String()
-		if actualBazelTargets != testCase.expectedBazelTarget {
-			t.Errorf(
-				"Expected generated Bazel target to be '%s', got '%s'",
-				testCase.expectedBazelTarget,
-				actualBazelTargets,
-			)
-		}
-
-		actualLoadStatements := bazelTargets.LoadStatements()
-		if actualLoadStatements != testCase.expectedLoadStatements {
-			t.Errorf(
-				"Expected generated load statements to be '%s', got '%s'",
-				testCase.expectedLoadStatements,
-				actualLoadStatements,
-			)
-		}
-	}
-}
-
-func TestModuleTypeBp2Build(t *testing.T) {
-	testCases := []Bp2buildTestCase{
-		{
-			Description:                "filegroup with does not specify srcs",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			Blueprint: `filegroup {
-    name: "fg_foo",
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{}),
-			},
-		},
-		{
-			Description:                "filegroup with no srcs",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			Blueprint: `filegroup {
-    name: "fg_foo",
-    srcs: [],
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{}),
-			},
-		},
-		{
-			Description:                "filegroup with srcs",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			Blueprint: `filegroup {
-    name: "fg_foo",
-    srcs: ["a", "b"],
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{
-					"srcs": `[
-        "a",
-        "b",
-    ]`,
-				}),
-			},
-		},
-		{
-			Description:                "filegroup with dot-slash-prefixed srcs",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			Blueprint: `filegroup {
-    name: "fg_foo",
-    srcs: ["./a", "./b"],
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{
-					"srcs": `[
-        "a",
-        "b",
-    ]`,
-				}),
-			},
-		},
-		{
-			Description:                "filegroup with excludes srcs",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			Blueprint: `filegroup {
-    name: "fg_foo",
-    srcs: ["a", "b"],
-    exclude_srcs: ["a"],
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{
-					"srcs": `["b"]`,
-				}),
-			},
-		},
-		{
-			Description:                "depends_on_other_dir_module",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			Blueprint: `filegroup {
-    name: "fg_foo",
-    srcs: [
-        ":foo",
-        "c",
-    ],
-    bazel_module: { bp2build_available: true },
-}`,
-			Filesystem: map[string]string{
-				"other/Android.bp": `filegroup {
-    name: "foo",
-    srcs: ["a", "b"],
-    bazel_module: { bp2build_available: true },
-}`,
-			},
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{
-					"srcs": `[
-        "//other:foo",
-        "c",
-    ]`,
-				}),
-			},
-		},
-	}
-
-	for _, testCase := range testCases {
-		t.Run(testCase.Description, func(t *testing.T) {
-			RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, testCase)
-		})
-	}
-}
-
-func TestAllowlistingBp2buildTargetsExplicitly(t *testing.T) {
-	testCases := []struct {
-		moduleTypeUnderTest        string
-		moduleTypeUnderTestFactory android.ModuleFactory
-		bp                         string
-		expectedCount              int
-		description                string
-	}{
-		{
-			description:                "explicitly unavailable",
-			moduleTypeUnderTest:        "filegroup",
-			moduleTypeUnderTestFactory: android.FileGroupFactory,
-			bp: `filegroup {
-    name: "foo",
-    srcs: ["a", "b"],
-    bazel_module: { bp2build_available: false },
-}`,
-			expectedCount: 0,
-		},
-		{
-			description:                "implicitly unavailable",
-			moduleTypeUnderTest:        "filegroup",
-			moduleTypeUnderTestFactory: android.FileGroupFactory,
-			bp: `filegroup {
-    name: "foo",
-    srcs: ["a", "b"],
-}`,
-			expectedCount: 0,
-		},
-		{
-			description:                "explicitly available",
-			moduleTypeUnderTest:        "filegroup",
-			moduleTypeUnderTestFactory: android.FileGroupFactory,
-			bp: `filegroup {
-    name: "foo",
-    srcs: ["a", "b"],
-    bazel_module: { bp2build_available: true },
-}`,
-			expectedCount: 1,
-		},
-		{
-			description:                "generates more than 1 target if needed",
-			moduleTypeUnderTest:        "custom",
-			moduleTypeUnderTestFactory: customModuleFactoryHostAndDevice,
-			bp: `custom {
-    name: "foo",
-    one_to_many_prop: true,
-    bazel_module: { bp2build_available: true },
-}`,
-			expectedCount: 3,
-		},
-	}
-
-	dir := "."
-	for _, testCase := range testCases {
-		t.Run(testCase.description, func(t *testing.T) {
-			config := android.TestConfig(buildDir, nil, testCase.bp, nil)
-			ctx := android.NewTestContext(config)
-			ctx.RegisterModuleType(testCase.moduleTypeUnderTest, testCase.moduleTypeUnderTestFactory)
-			ctx.RegisterForBazelConversion()
-
-			_, errs := ctx.ParseFileList(dir, []string{"Android.bp"})
-			android.FailIfErrored(t, errs)
-			_, errs = ctx.ResolveDependencies(config)
-			android.FailIfErrored(t, errs)
-
-			codegenCtx := NewCodegenContext(config, ctx.Context, Bp2Build, "")
-			bazelTargets, err := generateBazelTargetsForDir(codegenCtx, dir)
-			android.FailIfErrored(t, err)
-			if actualCount := len(bazelTargets); actualCount != testCase.expectedCount {
-				t.Fatalf("%s: Expected %d bazel target, got %d", testCase.description, testCase.expectedCount, actualCount)
-			}
-		})
-	}
-}
-
-func TestAllowlistingBp2buildTargetsWithConfig(t *testing.T) {
-	testCases := []struct {
-		moduleTypeUnderTest        string
-		moduleTypeUnderTestFactory android.ModuleFactory
-		expectedCount              map[string]int
-		description                string
-		bp2buildConfig             allowlists.Bp2BuildConfig
-		checkDir                   string
-		fs                         map[string]string
-		forceEnabledModules        []string
-		expectedErrorMessages      []string
-	}{
-		{
-			description:                "test bp2build config package and subpackages config",
-			moduleTypeUnderTest:        "filegroup",
-			moduleTypeUnderTestFactory: android.FileGroupFactory,
-			expectedCount: map[string]int{
-				"migrated":                           1,
-				"migrated/but_not_really":            0,
-				"migrated/but_not_really/but_really": 1,
-				"not_migrated":                       0,
-				"also_not_migrated":                  0,
-			},
-			bp2buildConfig: allowlists.Bp2BuildConfig{
-				"migrated":                allowlists.Bp2BuildDefaultTrueRecursively,
-				"migrated/but_not_really": allowlists.Bp2BuildDefaultFalse,
-				"not_migrated":            allowlists.Bp2BuildDefaultFalse,
-			},
-			fs: map[string]string{
-				"migrated/Android.bp":                           `filegroup { name: "a" }`,
-				"migrated/but_not_really/Android.bp":            `filegroup { name: "b" }`,
-				"migrated/but_not_really/but_really/Android.bp": `filegroup { name: "c" }`,
-				"not_migrated/Android.bp":                       `filegroup { name: "d" }`,
-				"also_not_migrated/Android.bp":                  `filegroup { name: "e" }`,
-			},
-		},
-		{
-			description:                "test bp2build config opt-in and opt-out",
-			moduleTypeUnderTest:        "filegroup",
-			moduleTypeUnderTestFactory: android.FileGroupFactory,
-			expectedCount: map[string]int{
-				"package-opt-in":             2,
-				"package-opt-in/subpackage":  0,
-				"package-opt-out":            1,
-				"package-opt-out/subpackage": 0,
-			},
-			bp2buildConfig: allowlists.Bp2BuildConfig{
-				"package-opt-in":  allowlists.Bp2BuildDefaultFalse,
-				"package-opt-out": allowlists.Bp2BuildDefaultTrueRecursively,
-			},
-			fs: map[string]string{
-				"package-opt-in/Android.bp": `
-filegroup { name: "opt-in-a" }
-filegroup { name: "opt-in-b", bazel_module: { bp2build_available: true } }
-filegroup { name: "opt-in-c", bazel_module: { bp2build_available: true } }
-`,
-
-				"package-opt-in/subpackage/Android.bp": `
-filegroup { name: "opt-in-d" } // parent package not configured to DefaultTrueRecursively
-`,
-
-				"package-opt-out/Android.bp": `
-filegroup { name: "opt-out-a" }
-filegroup { name: "opt-out-b", bazel_module: { bp2build_available: false } }
-filegroup { name: "opt-out-c", bazel_module: { bp2build_available: false } }
-`,
-
-				"package-opt-out/subpackage/Android.bp": `
-filegroup { name: "opt-out-g", bazel_module: { bp2build_available: false } }
-filegroup { name: "opt-out-h", bazel_module: { bp2build_available: false } }
-`,
-			},
-		},
-		{
-			description:                "test force-enabled errors out",
-			moduleTypeUnderTest:        "filegroup",
-			moduleTypeUnderTestFactory: android.FileGroupFactory,
-			expectedCount: map[string]int{
-				"migrated":     0,
-				"not_migrated": 0,
-			},
-			bp2buildConfig: allowlists.Bp2BuildConfig{
-				"migrated/but_not_really": allowlists.Bp2BuildDefaultFalse,
-				"not_migrated":            allowlists.Bp2BuildDefaultFalse,
-			},
-			fs: map[string]string{
-				"migrated/Android.bp": `filegroup { name: "a" }`,
-			},
-			forceEnabledModules:   []string{"a"},
-			expectedErrorMessages: []string{"Force Enabled Module a not converted"},
-		},
-	}
-
-	dir := "."
-	for _, testCase := range testCases {
-		fs := make(map[string][]byte)
-		toParse := []string{
-			"Android.bp",
-		}
-		for f, content := range testCase.fs {
-			if strings.HasSuffix(f, "Android.bp") {
-				toParse = append(toParse, f)
-			}
-			fs[f] = []byte(content)
-		}
-		config := android.TestConfig(buildDir, nil, "", fs)
-		config.AddForceEnabledModules(testCase.forceEnabledModules)
-		ctx := android.NewTestContext(config)
-		ctx.RegisterModuleType(testCase.moduleTypeUnderTest, testCase.moduleTypeUnderTestFactory)
-		allowlist := android.NewBp2BuildAllowlist().SetDefaultConfig(testCase.bp2buildConfig)
-		ctx.RegisterBp2BuildConfig(allowlist)
-		ctx.RegisterForBazelConversion()
-
-		_, errs := ctx.ParseFileList(dir, toParse)
-		android.FailIfErrored(t, errs)
-		_, errs = ctx.ResolveDependencies(config)
-		android.FailIfErrored(t, errs)
-
-		codegenCtx := NewCodegenContext(config, ctx.Context, Bp2Build, "")
-
-		// For each directory, test that the expected number of generated targets is correct.
-		for dir, expectedCount := range testCase.expectedCount {
-			bazelTargets, err := generateBazelTargetsForDir(codegenCtx, dir)
-			android.CheckErrorsAgainstExpectations(t, err, testCase.expectedErrorMessages)
-			if actualCount := len(bazelTargets); actualCount != expectedCount {
-				t.Fatalf(
-					"%s: Expected %d bazel target for %s package, got %d",
-					testCase.description,
-					expectedCount,
-					dir,
-					actualCount)
-			}
-
-		}
-	}
-}
-
-func TestCombineBuildFilesBp2buildTargets(t *testing.T) {
-	testCases := []Bp2buildTestCase{
-		{
-			Description:                "filegroup bazel_module.label",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			Blueprint: `filegroup {
-    name: "fg_foo",
-    bazel_module: { label: "//other:fg_foo" },
-}`,
-			ExpectedBazelTargets: []string{},
-			Filesystem: map[string]string{
-				"other/BUILD.bazel": `// BUILD file`,
-			},
-		},
-		{
-			Description:                "multiple bazel_module.label same BUILD",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			Blueprint: `filegroup {
-        name: "fg_foo",
-        bazel_module: { label: "//other:fg_foo" },
-    }
-
-    filegroup {
-        name: "foo",
-        bazel_module: { label: "//other:foo" },
-    }`,
-			ExpectedBazelTargets: []string{},
-			Filesystem: map[string]string{
-				"other/BUILD.bazel": `// BUILD file`,
-			},
-		},
-		{
-			Description:                "filegroup bazel_module.label and bp2build in subdir",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			Dir:                        "other",
-			Blueprint:                  ``,
-			Filesystem: map[string]string{
-				"other/Android.bp": `filegroup {
-        name: "fg_foo",
-        bazel_module: {
-          bp2build_available: true,
-        },
-      }
-      filegroup {
-        name: "fg_bar",
-        bazel_module: {
-          label: "//other:fg_bar"
-        },
-      }`,
-				"other/BUILD.bazel": `// definition for fg_bar`,
-			},
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{}),
-			},
-		},
-		{
-			Description:                "filegroup bazel_module.label and filegroup bp2build",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-
-			Filesystem: map[string]string{
-				"other/BUILD.bazel": `// BUILD file`,
-			},
-			Blueprint: `filegroup {
-        name: "fg_foo",
-        bazel_module: {
-          label: "//other:fg_foo",
-        },
-    }
-
-    filegroup {
-        name: "fg_bar",
-        bazel_module: {
-          bp2build_available: true,
-        },
-    }`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_bar", map[string]string{}),
-			},
-		},
-	}
-
-	dir := "."
-	for _, testCase := range testCases {
-		t.Run(testCase.Description, func(t *testing.T) {
-			fs := make(map[string][]byte)
-			toParse := []string{
-				"Android.bp",
-			}
-			for f, content := range testCase.Filesystem {
-				if strings.HasSuffix(f, "Android.bp") {
-					toParse = append(toParse, f)
-				}
-				fs[f] = []byte(content)
-			}
-			config := android.TestConfig(buildDir, nil, testCase.Blueprint, fs)
-			ctx := android.NewTestContext(config)
-			ctx.RegisterModuleType(testCase.ModuleTypeUnderTest, testCase.ModuleTypeUnderTestFactory)
-			ctx.RegisterForBazelConversion()
-
-			_, errs := ctx.ParseFileList(dir, toParse)
-			if errored(t, testCase, errs) {
-				return
-			}
-			_, errs = ctx.ResolveDependencies(config)
-			if errored(t, testCase, errs) {
-				return
-			}
-
-			checkDir := dir
-			if testCase.Dir != "" {
-				checkDir = testCase.Dir
-			}
-			codegenCtx := NewCodegenContext(config, ctx.Context, Bp2Build, "")
-			bazelTargets, err := generateBazelTargetsForDir(codegenCtx, checkDir)
-			android.FailIfErrored(t, err)
-			bazelTargets.sort()
-			actualCount := len(bazelTargets)
-			expectedCount := len(testCase.ExpectedBazelTargets)
-			if actualCount != expectedCount {
-				t.Errorf("Expected %d bazel target, got %d\n%s", expectedCount, actualCount, bazelTargets)
-			}
-			for i, target := range bazelTargets {
-				actualContent := target.content
-				expectedContent := testCase.ExpectedBazelTargets[i]
-				if expectedContent != actualContent {
-					t.Errorf(
-						"Expected generated Bazel target to be '%s', got '%s'",
-						expectedContent,
-						actualContent,
-					)
-				}
-			}
-		})
-	}
-}
-
-func TestGlob(t *testing.T) {
-	testCases := []Bp2buildTestCase{
-		{
-			Description:                "filegroup with glob",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			Blueprint: `filegroup {
-    name: "fg_foo",
-    srcs: ["**/*.txt"],
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{
-					"srcs": `[
-        "other/a.txt",
-        "other/b.txt",
-        "other/subdir/a.txt",
-    ]`,
-				}),
-			},
-			Filesystem: map[string]string{
-				"other/a.txt":        "",
-				"other/b.txt":        "",
-				"other/subdir/a.txt": "",
-				"other/file":         "",
-			},
-		},
-		{
-			Description:                "filegroup with glob in subdir",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			Dir:                        "other",
-			Filesystem: map[string]string{
-				"other/Android.bp": `filegroup {
-    name: "fg_foo",
-    srcs: ["**/*.txt"],
-    bazel_module: { bp2build_available: true },
-}`,
-				"other/a.txt":        "",
-				"other/b.txt":        "",
-				"other/subdir/a.txt": "",
-				"other/file":         "",
-			},
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{
-					"srcs": `[
-        "a.txt",
-        "b.txt",
-        "subdir/a.txt",
-    ]`,
-				}),
-			},
-		},
-		{
-			Description:                "filegroup with glob with no kept BUILD files",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			KeepBuildFileForDirs:       []string{
-				// empty
-			},
-			Blueprint: `filegroup {
-    name: "fg_foo",
-    srcs: ["**/*.txt"],
-    bazel_module: { bp2build_available: true },
-}`,
-			Filesystem: map[string]string{
-				"a.txt":         "",
-				"b.txt":         "",
-				"foo/BUILD":     "",
-				"foo/a.txt":     "",
-				"foo/bar/BUILD": "",
-				"foo/bar/b.txt": "",
-			},
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{
-					"srcs": `[
-        "a.txt",
-        "b.txt",
-        "foo/a.txt",
-        "foo/bar/b.txt",
-    ]`,
-				}),
-			},
-		},
-		{
-			Description:                "filegroup with glob with kept BUILD file",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			KeepBuildFileForDirs: []string{
-				"foo",
-			},
-			Blueprint: `filegroup {
-    name: "fg_foo",
-    srcs: ["**/*.txt"],
-    bazel_module: { bp2build_available: true },
-}`,
-			Filesystem: map[string]string{
-				"a.txt":         "",
-				"b.txt":         "",
-				"foo/BUILD":     "",
-				"foo/a.txt":     "",
-				"foo/bar/BUILD": "",
-				"foo/bar/b.txt": "",
-			},
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{
-					"srcs": `[
-        "a.txt",
-        "b.txt",
-        "//foo:a.txt",
-        "//foo:bar/b.txt",
-    ]`,
-				}),
-			},
-		},
-		{
-			Description:                "filegroup with glob with kept BUILD.bazel file",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			KeepBuildFileForDirs: []string{
-				"foo",
-			},
-			Blueprint: `filegroup {
-    name: "fg_foo",
-    srcs: ["**/*.txt"],
-    bazel_module: { bp2build_available: true },
-}`,
-			Filesystem: map[string]string{
-				"a.txt":               "",
-				"b.txt":               "",
-				"foo/BUILD.bazel":     "",
-				"foo/a.txt":           "",
-				"foo/bar/BUILD.bazel": "",
-				"foo/bar/b.txt":       "",
-			},
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{
-					"srcs": `[
-        "a.txt",
-        "b.txt",
-        "//foo:a.txt",
-        "//foo:bar/b.txt",
-    ]`,
-				}),
-			},
-		},
-		{
-			Description:                "filegroup with glob with Android.bp file as boundary",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			Blueprint: `filegroup {
-    name: "fg_foo",
-    srcs: ["**/*.txt"],
-    bazel_module: { bp2build_available: true },
-}`,
-			Filesystem: map[string]string{
-				"a.txt":              "",
-				"b.txt":              "",
-				"foo/Android.bp":     "",
-				"foo/a.txt":          "",
-				"foo/bar/Android.bp": "",
-				"foo/bar/b.txt":      "",
-			},
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{
-					"srcs": `[
-        "a.txt",
-        "b.txt",
-        "//foo:a.txt",
-        "//foo/bar:b.txt",
-    ]`,
-				}),
-			},
-		},
-		{
-			Description:                "filegroup with glob in subdir with kept BUILD and BUILD.bazel file",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			Dir:                        "other",
-			KeepBuildFileForDirs: []string{
-				"other/foo",
-				"other/foo/bar",
-				// deliberately not other/foo/baz/BUILD.
-			},
-			Filesystem: map[string]string{
-				"other/Android.bp": `filegroup {
-    name: "fg_foo",
-    srcs: ["**/*.txt"],
-    bazel_module: { bp2build_available: true },
-}`,
-				"other/a.txt":               "",
-				"other/b.txt":               "",
-				"other/foo/BUILD":           "",
-				"other/foo/a.txt":           "",
-				"other/foo/bar/BUILD.bazel": "",
-				"other/foo/bar/b.txt":       "",
-				"other/foo/baz/BUILD":       "",
-				"other/foo/baz/c.txt":       "",
-			},
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{
-					"srcs": `[
-        "a.txt",
-        "b.txt",
-        "//other/foo:a.txt",
-        "//other/foo/bar:b.txt",
-        "//other/foo:baz/c.txt",
-    ]`,
-				}),
-			},
-		},
-	}
-
-	for _, testCase := range testCases {
-		t.Run(testCase.Description, func(t *testing.T) {
-			RunBp2BuildTestCaseSimple(t, testCase)
-		})
-	}
-}
-
-func TestGlobExcludeSrcs(t *testing.T) {
-	testCases := []Bp2buildTestCase{
-		{
-			Description:                "filegroup top level exclude_srcs",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			Blueprint: `filegroup {
-    name: "fg_foo",
-    srcs: ["**/*.txt"],
-    exclude_srcs: ["c.txt"],
-    bazel_module: { bp2build_available: true },
-}`,
-			Filesystem: map[string]string{
-				"a.txt":          "",
-				"b.txt":          "",
-				"c.txt":          "",
-				"dir/Android.bp": "",
-				"dir/e.txt":      "",
-				"dir/f.txt":      "",
-			},
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{
-					"srcs": `[
-        "a.txt",
-        "b.txt",
-        "//dir:e.txt",
-        "//dir:f.txt",
-    ]`,
-				}),
-			},
-		},
-		{
-			Description:                "filegroup in subdir exclude_srcs",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			Blueprint:                  "",
-			Dir:                        "dir",
-			Filesystem: map[string]string{
-				"dir/Android.bp": `filegroup {
-    name: "fg_foo",
-    srcs: ["**/*.txt"],
-    exclude_srcs: ["b.txt"],
-    bazel_module: { bp2build_available: true },
-}
-`,
-				"dir/a.txt":             "",
-				"dir/b.txt":             "",
-				"dir/subdir/Android.bp": "",
-				"dir/subdir/e.txt":      "",
-				"dir/subdir/f.txt":      "",
-			},
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{
-					"srcs": `[
-        "a.txt",
-        "//dir/subdir:e.txt",
-        "//dir/subdir:f.txt",
-    ]`,
-				}),
-			},
-		},
-	}
-
-	for _, testCase := range testCases {
-		t.Run(testCase.Description, func(t *testing.T) {
-			RunBp2BuildTestCaseSimple(t, testCase)
-		})
-	}
-}
-
-func TestCommonBp2BuildModuleAttrs(t *testing.T) {
-	testCases := []Bp2buildTestCase{
-		{
-			Description:                "Required into data test",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			StubbedBuildDefinitions:    []string{"reqd"},
-			Blueprint: simpleModule("filegroup", "reqd") + `
-filegroup {
-    name: "fg_foo",
-    required: ["reqd"],
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{
-					"data": `[":reqd"]`,
-				}),
-			},
-		},
-		{
-			Description:                "Required into data test, cyclic self reference is filtered out",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			StubbedBuildDefinitions:    []string{"reqd"},
-			Blueprint: simpleModule("filegroup", "reqd") + `
-filegroup {
-    name: "fg_foo",
-    required: ["reqd", "fg_foo"],
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{
-					"data": `[":reqd"]`,
-				}),
-			},
-		},
-		{
-			Description:                "Required via arch into data test",
-			ModuleTypeUnderTest:        "python_library",
-			ModuleTypeUnderTestFactory: python.PythonLibraryFactory,
-			StubbedBuildDefinitions:    []string{"reqdx86", "reqdarm"},
-			Blueprint: simpleModule("python_library", "reqdx86") +
-				simpleModule("python_library", "reqdarm") + `
-python_library {
-    name: "fg_foo",
-    arch: {
-       arm: {
-         required: ["reqdarm"],
-       },
-       x86: {
-         required: ["reqdx86"],
-       },
-    },
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("py_library", "fg_foo", map[string]string{
-					"data": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": [":reqdarm"],
-        "//build/bazel_common_rules/platforms/arch:x86": [":reqdx86"],
-        "//conditions:default": [],
-    })`,
-					"srcs_version": `"PY3"`,
-					"imports":      `["."]`,
-				}),
-			},
-		},
-		{
-			Description:                "Required appended to data test",
-			ModuleTypeUnderTest:        "python_library",
-			ModuleTypeUnderTestFactory: python.PythonLibraryFactory,
-			Filesystem: map[string]string{
-				"data.bin": "",
-				"src.py":   "",
-			},
-			StubbedBuildDefinitions: []string{"reqd"},
-			Blueprint: simpleModule("python_library", "reqd") + `
-python_library {
-    name: "fg_foo",
-    data: ["data.bin"],
-    required: ["reqd"],
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("py_library", "fg_foo", map[string]string{
-					"data": `[
-        "data.bin",
-        ":reqd",
-    ]`,
-					"srcs_version": `"PY3"`,
-					"imports":      `["."]`,
-				}),
-			},
-		},
-		{
-			Description:                "All props-to-attrs at once together test",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			StubbedBuildDefinitions:    []string{"reqd"},
-			Blueprint: simpleModule("filegroup", "reqd") + `
-filegroup {
-    name: "fg_foo",
-    required: ["reqd"],
-    bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "fg_foo", map[string]string{
-					"data": `[":reqd"]`,
-				}),
-			},
-		},
-	}
-
-	for _, tc := range testCases {
-		t.Run(tc.Description, func(t *testing.T) {
-			RunBp2BuildTestCaseSimple(t, tc)
-		})
-	}
-}
-
-func TestLicensesAttrConversion(t *testing.T) {
-	RunBp2BuildTestCase(t,
-		func(ctx android.RegistrationContext) {
-			ctx.RegisterModuleType("license", android.LicenseFactory)
-		},
-		Bp2buildTestCase{
-			Description:                "Test that licenses: attribute is converted",
-			ModuleTypeUnderTest:        "filegroup",
-			ModuleTypeUnderTestFactory: android.FileGroupFactory,
-			Blueprint: `
-license {
-    name: "my_license",
-}
-filegroup {
-    name: "my_filegroup",
-    licenses: ["my_license"],
-}
-`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("filegroup", "my_filegroup", AttrNameToString{
-					"applicable_licenses": `[":my_license"]`,
-				}),
-				MakeBazelTargetNoRestrictions("android_license", "my_license", AttrNameToString{}),
-			},
-		})
-}
-
-func TestGenerateConfigSetting(t *testing.T) {
-	bp := `
-	custom {
-		name: "foo",
-		test_config_setting: true,
-	}
-	`
-	expectedBazelTargets := []string{
-		MakeBazelTargetNoRestrictions(
-			"config_setting",
-			"foo_config_setting",
-			AttrNameToString{
-				"flag_values": `{
-        "//build/bazel/rules/my_string_setting": "foo",
-    }`,
-			},
-		),
-		MakeBazelTarget(
-			"custom",
-			"foo",
-			AttrNameToString{},
-		),
-	}
-	registerCustomModule := func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("custom", customModuleFactoryHostAndDevice)
-	}
-	RunBp2BuildTestCase(t, registerCustomModule, Bp2buildTestCase{
-		Blueprint:            bp,
-		ExpectedBazelTargets: expectedBazelTargets,
-		Description:          "Generating API contribution Bazel targets for custom module",
-	})
-}
-
-// If values of all keys in an axis are equal to //conditions:default, drop the axis and print the common value
-func TestPrettyPrintSelectMapEqualValues(t *testing.T) {
-	lla := bazel.LabelListAttribute{
-		Value: bazel.LabelList{},
-	}
-	libFooImplLabel := bazel.Label{
-		Label: ":libfoo.impl",
-	}
-	lla.SetSelectValue(bazel.OsAndInApexAxis, bazel.AndroidPlatform, bazel.MakeLabelList([]bazel.Label{libFooImplLabel}))
-	lla.SetSelectValue(bazel.OsAndInApexAxis, bazel.ConditionsDefaultConfigKey, bazel.MakeLabelList([]bazel.Label{libFooImplLabel}))
-	actual, _ := prettyPrintAttribute(lla, 0)
-	android.AssertStringEquals(t, "Print the common value if all keys in an axis have the same value", `[":libfoo.impl"]`, actual)
-}
-
-func TestAlreadyPresentBuildTarget(t *testing.T) {
-	bp := `
-	custom {
-		name: "foo",
-	}
-	custom {
-		name: "bar",
-	}
-	`
-	alreadyPresentBuildFile :=
-		MakeBazelTarget(
-			"custom",
-			"foo",
-			AttrNameToString{},
-		)
-	expectedBazelTargets := []string{
-		MakeBazelTarget(
-			"custom",
-			"bar",
-			AttrNameToString{},
-		),
-	}
-	registerCustomModule := func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("custom", customModuleFactoryHostAndDevice)
-	}
-	RunBp2BuildTestCase(t, registerCustomModule, Bp2buildTestCase{
-		AlreadyExistingBuildContents: alreadyPresentBuildFile,
-		Blueprint:                    bp,
-		ExpectedBazelTargets:         expectedBazelTargets,
-		Description:                  "Not duplicating work for an already-present BUILD target.",
-	})
-}
-
-func TestAlreadyPresentOneToManyBuildTarget(t *testing.T) {
-	bp := `
-	custom {
-		name: "foo",
-    one_to_many_prop: true,
-	}
-	custom {
-		name: "bar",
-	}
-	`
-	alreadyPresentBuildFile :=
-		MakeBazelTarget(
-			"custom",
-			// one_to_many_prop ensures that foo generates "foo_proto_library_deps".
-			"foo_proto_library_deps",
-			AttrNameToString{},
-		)
-	expectedBazelTargets := []string{
-		MakeBazelTarget(
-			"custom",
-			"bar",
-			AttrNameToString{},
-		),
-	}
-	registerCustomModule := func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("custom", customModuleFactoryHostAndDevice)
-	}
-	RunBp2BuildTestCase(t, registerCustomModule, Bp2buildTestCase{
-		AlreadyExistingBuildContents: alreadyPresentBuildFile,
-		Blueprint:                    bp,
-		ExpectedBazelTargets:         expectedBazelTargets,
-		Description:                  "Not duplicating work for an already-present BUILD target (different generated name)",
-	})
-}
-
-// Verifies that if a module is defined in pkg1/Android.bp, that a target present
-// in pkg2/BUILD.bazel does not result in the module being labeled "already defined
-// in a BUILD file".
-func TestBuildTargetPresentOtherDirectory(t *testing.T) {
-	bp := `
-	custom {
-		name: "foo",
-	}
-	`
-	expectedBazelTargets := []string{
-		MakeBazelTarget(
-			"custom",
-			"foo",
-			AttrNameToString{},
-		),
-	}
-	registerCustomModule := func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("custom", customModuleFactoryHostAndDevice)
-	}
-	RunBp2BuildTestCase(t, registerCustomModule, Bp2buildTestCase{
-		KeepBuildFileForDirs: []string{"other_pkg"},
-		Filesystem: map[string]string{
-			"other_pkg/BUILD.bazel": MakeBazelTarget("custom", "foo", AttrNameToString{}),
-		},
-		Blueprint:            bp,
-		ExpectedBazelTargets: expectedBazelTargets,
-		Description:          "Not treating a BUILD target as the bazel definition for a module in another package",
-	})
-}
-
-// If CommonAttributes.Dir is set, the bazel target should be created in that dir
-func TestCreateBazelTargetInDifferentDir(t *testing.T) {
-	t.Parallel()
-	bp := `
-	custom {
-		name: "foo",
-		dir: "subdir",
-	}
-	`
-	registerCustomModule := func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("custom", customModuleFactoryHostAndDevice)
-	}
-	// Check that foo is not created in root dir
-	RunBp2BuildTestCase(t, registerCustomModule, Bp2buildTestCase{
-		Description: "foo is not created in root dir because it sets dir explicitly",
-		Blueprint:   bp,
-		Filesystem: map[string]string{
-			"subdir/Android.bp": "",
-		},
-		ExpectedBazelTargets: []string{},
-	})
-	// Check that foo is created in `subdir`
-	RunBp2BuildTestCase(t, registerCustomModule, Bp2buildTestCase{
-		Description: "foo is created in `subdir` because it sets dir explicitly",
-		Blueprint:   bp,
-		Filesystem: map[string]string{
-			"subdir/Android.bp": "",
-		},
-		Dir: "subdir",
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("custom", "foo", AttrNameToString{}),
-		},
-	})
-	// Check that we cannot create target in different dir if it is does not an Android.bp
-	RunBp2BuildTestCase(t, registerCustomModule, Bp2buildTestCase{
-		Description: "foo cannot be created in `subdir` because it does not contain an Android.bp file",
-		Blueprint:   bp,
-		Dir:         "subdir",
-		ExpectedErr: fmt.Errorf("Cannot use ca.Dir to create a BazelTarget in dir: subdir since it does not contain an Android.bp file"),
-	})
-
-}
-
-func TestBp2buildDepsMutator_missingTransitiveDep(t *testing.T) {
-	bp := `
-	custom {
-		name: "foo",
-	}
-
-	custom {
-		name: "has_deps",
-	  arch_paths: [":has_missing_dep", ":foo"],
-	}
-
-	custom {
-		name: "has_missing_dep",
-	  arch_paths: [":missing"],
-	}
-	`
-	expectedBazelTargets := []string{
-		MakeBazelTarget(
-			"custom",
-			"foo",
-			AttrNameToString{},
-		),
-	}
-	registerCustomModule := func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("custom", customModuleFactoryHostAndDevice)
-	}
-	RunBp2BuildTestCase(t, registerCustomModule, Bp2buildTestCase{
-		Blueprint:            bp,
-		ExpectedBazelTargets: expectedBazelTargets,
-		Description:          "Skipping conversion of a target with missing transitive dep",
-	})
-}
-
-func TestBp2buildDepsMutator_missingDirectDep(t *testing.T) {
-	bp := `
-	custom {
-		name: "foo",
-	  arch_paths: [":exists"],
-	}
-	custom {
-		name: "exists",
-	}
-
-	custom {
-		name: "has_missing_dep",
-	  arch_paths: [":missing"],
-	}
-	`
-	expectedBazelTargets := []string{
-		MakeBazelTarget(
-			"custom",
-			"foo",
-			AttrNameToString{"arch_paths": `[":exists"]`},
-		),
-		MakeBazelTarget(
-			"custom",
-			"exists",
-			AttrNameToString{},
-		),
-	}
-	registerCustomModule := func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("custom", customModuleFactoryHostAndDevice)
-	}
-	RunBp2BuildTestCase(t, registerCustomModule, Bp2buildTestCase{
-		Blueprint:            bp,
-		ExpectedBazelTargets: expectedBazelTargets,
-		Description:          "Skipping conversion of a target with missing direct dep",
-	})
-}
-
-func TestBp2buildDepsMutator_unconvertedDirectDep(t *testing.T) {
-	bp := `
-	custom {
-		name: "has_unconverted_dep",
-	  arch_paths: [":unconvertible"],
-	}
-
-	custom {
-		name: "unconvertible",
-		does_not_convert_to_bazel: true
-	}
-	`
-	registerCustomModule := func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("custom", customModuleFactoryHostAndDevice)
-	}
-	RunBp2BuildTestCase(t, registerCustomModule, Bp2buildTestCase{
-		Blueprint:            bp,
-		ExpectedBazelTargets: []string{},
-		Description:          "Skipping conversion of a target with unconverted direct dep",
-	})
-}
-
-func TestBp2buildDepsMutator_unconvertedTransitiveDep(t *testing.T) {
-	bp := `
-	custom {
-		name: "foo",
-	  arch_paths: [":has_unconverted_dep", ":bar"],
-	}
-
-	custom {
-		name: "bar",
-	}
-
-	custom {
-		name: "has_unconverted_dep",
-	  arch_paths: [":unconvertible"],
-	}
-
-	custom {
-		name: "unconvertible",
-		does_not_convert_to_bazel: true
-	}
-	`
-	expectedBazelTargets := []string{
-		MakeBazelTarget(
-			"custom",
-			"bar",
-			AttrNameToString{},
-		),
-	}
-	registerCustomModule := func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("custom", customModuleFactoryHostAndDevice)
-	}
-	RunBp2BuildTestCase(t, registerCustomModule, Bp2buildTestCase{
-		Blueprint:            bp,
-		ExpectedBazelTargets: expectedBazelTargets,
-		Description:          "Skipping conversion of a target with unconverted transitive dep",
-	})
-}
-
-func TestBp2buildDepsMutator_alreadyExistsBuildDeps(t *testing.T) {
-	bp := `
-	custom {
-		name: "foo",
-	  arch_paths: [":bar"],
-	}
-	custom {
-		name: "bar",
-	  arch_paths: [":checked_in"],
-	}
-	custom {
-		name: "checked_in",
-	  arch_paths: [":checked_in"],
-		does_not_convert_to_bazel: true
-	}
-	`
-	expectedBazelTargets := []string{
-		MakeBazelTarget(
-			"custom",
-			"foo",
-			AttrNameToString{"arch_paths": `[":bar"]`},
-		),
-		MakeBazelTarget(
-			"custom",
-			"bar",
-			AttrNameToString{"arch_paths": `[":checked_in"]`},
-		),
-	}
-	registerCustomModule := func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("custom", customModuleFactoryHostAndDevice)
-	}
-	RunBp2BuildTestCase(t, registerCustomModule, Bp2buildTestCase{
-		StubbedBuildDefinitions: []string{"checked_in"},
-		Blueprint:               bp,
-		ExpectedBazelTargets:    expectedBazelTargets,
-		Description:             "Convert target with already-existing build dep",
-	})
-}
-
-// Tests that deps of libc are always considered valid for libc. This circumvents
-// an issue that, in a variantless graph (such as bp2build's), libc has the
-// unique predicament that it depends on itself.
-func TestBp2buildDepsMutator_depOnLibc(t *testing.T) {
-	bp := `
-	custom {
-		name: "foo",
-	  arch_paths: [":libc"],
-	}
-	custom {
-		name: "libc",
-	  arch_paths: [":libc_dep"],
-	}
-	custom {
-		name: "libc_dep",
-		does_not_convert_to_bazel: true
-	}
-	`
-	expectedBazelTargets := []string{
-		MakeBazelTarget(
-			"custom",
-			"foo",
-			AttrNameToString{"arch_paths": `[":libc"]`},
-		),
-		MakeBazelTarget(
-			"custom",
-			"libc",
-			AttrNameToString{"arch_paths": `[":libc_dep"]`},
-		),
-	}
-	registerCustomModule := func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("custom", customModuleFactoryHostAndDevice)
-	}
-	RunBp2BuildTestCase(t, registerCustomModule, Bp2buildTestCase{
-		StubbedBuildDefinitions: []string{"checked_in"},
-		Blueprint:               bp,
-		ExpectedBazelTargets:    expectedBazelTargets,
-		Description:             "Convert target with dep on libc",
-	})
-}
diff --git a/bp2build/bzl_conversion_test.go b/bp2build/bzl_conversion_test.go
deleted file mode 100644
index 645298f..0000000
--- a/bp2build/bzl_conversion_test.go
+++ /dev/null
@@ -1,241 +0,0 @@
-// Copyright 2020 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"io/ioutil"
-	"os"
-	"strings"
-	"testing"
-
-	"android/soong/android"
-)
-
-func setUp() {
-	var err error
-	buildDir, err = ioutil.TempDir("", "bazel_queryview_test")
-	if err != nil {
-		panic(err)
-	}
-}
-
-func tearDown() {
-	os.RemoveAll(buildDir)
-}
-
-func TestMain(m *testing.M) {
-	run := func() int {
-		setUp()
-		defer tearDown()
-
-		return m.Run()
-	}
-
-	os.Exit(run())
-}
-
-func TestGenerateModuleRuleShims(t *testing.T) {
-	moduleTypeFactories := map[string]android.ModuleFactory{
-		"custom":          customModuleFactoryBase,
-		"custom_test":     customTestModuleFactoryBase,
-		"custom_defaults": customDefaultsModuleFactoryBasic,
-	}
-	ruleShims := CreateRuleShims(moduleTypeFactories)
-
-	if len(ruleShims) != 1 {
-		t.Errorf("Expected to generate 1 rule shim, but got %d", len(ruleShims))
-	}
-
-	ruleShim := ruleShims["bp2build"]
-	expectedRules := []string{
-		"custom",
-		"custom_defaults",
-		"custom_test_",
-	}
-
-	if len(ruleShim.rules) != len(expectedRules) {
-		t.Errorf("Expected %d rules, but got %d", len(expectedRules), len(ruleShim.rules))
-	}
-
-	for i, rule := range ruleShim.rules {
-		if rule != expectedRules[i] {
-			t.Errorf("Expected rule shim to contain %s, but got %s", expectedRules[i], rule)
-		}
-	}
-	expectedBzl := `load("//build/bazel/queryview_rules:providers.bzl", "SoongModuleInfo")
-
-def _custom_impl(ctx):
-    return [SoongModuleInfo()]
-
-custom = rule(
-    implementation = _custom_impl,
-    attrs = {
-        "soong_module_name": attr.string(mandatory = True),
-        "soong_module_variant": attr.string(),
-        "soong_module_deps": attr.label_list(providers = [SoongModuleInfo]),
-        "api": attr.string(),
-        "arch_paths": attr.string_list(),
-        "arch_paths_exclude": attr.string_list(),
-        # bazel_module start
-#         "label": attr.string(),
-#         "bp2build_available": attr.bool(),
-        # bazel_module end
-        "bool_prop": attr.bool(),
-        "bool_ptr_prop": attr.bool(),
-        "dir": attr.string(),
-        "does_not_convert_to_bazel": attr.bool(),
-        "embedded_prop": attr.string(),
-        "int64_ptr_prop": attr.int(),
-        # nested_props start
-#         "nested_prop": attr.string(),
-        # nested_props end
-        # nested_props_ptr start
-#         "nested_prop": attr.string(),
-        # nested_props_ptr end
-        "one_to_many_prop": attr.bool(),
-        "other_embedded_prop": attr.string(),
-        "string_list_prop": attr.string_list(),
-        "string_literal_prop": attr.string(),
-        "string_prop": attr.string(),
-        "string_ptr_prop": attr.string(),
-        "test_config_setting": attr.bool(),
-    },
-)
-
-def _custom_defaults_impl(ctx):
-    return [SoongModuleInfo()]
-
-custom_defaults = rule(
-    implementation = _custom_defaults_impl,
-    attrs = {
-        "soong_module_name": attr.string(mandatory = True),
-        "soong_module_variant": attr.string(),
-        "soong_module_deps": attr.label_list(providers = [SoongModuleInfo]),
-        "api": attr.string(),
-        "arch_paths": attr.string_list(),
-        "arch_paths_exclude": attr.string_list(),
-        "bool_prop": attr.bool(),
-        "bool_ptr_prop": attr.bool(),
-        "dir": attr.string(),
-        "does_not_convert_to_bazel": attr.bool(),
-        "embedded_prop": attr.string(),
-        "int64_ptr_prop": attr.int(),
-        # nested_props start
-#         "nested_prop": attr.string(),
-        # nested_props end
-        # nested_props_ptr start
-#         "nested_prop": attr.string(),
-        # nested_props_ptr end
-        "one_to_many_prop": attr.bool(),
-        "other_embedded_prop": attr.string(),
-        "string_list_prop": attr.string_list(),
-        "string_literal_prop": attr.string(),
-        "string_prop": attr.string(),
-        "string_ptr_prop": attr.string(),
-        "test_config_setting": attr.bool(),
-    },
-)
-
-def _custom_test__impl(ctx):
-    return [SoongModuleInfo()]
-
-custom_test_ = rule(
-    implementation = _custom_test__impl,
-    attrs = {
-        "soong_module_name": attr.string(mandatory = True),
-        "soong_module_variant": attr.string(),
-        "soong_module_deps": attr.label_list(providers = [SoongModuleInfo]),
-        "api": attr.string(),
-        "arch_paths": attr.string_list(),
-        "arch_paths_exclude": attr.string_list(),
-        "bool_prop": attr.bool(),
-        "bool_ptr_prop": attr.bool(),
-        "dir": attr.string(),
-        "does_not_convert_to_bazel": attr.bool(),
-        "embedded_prop": attr.string(),
-        "int64_ptr_prop": attr.int(),
-        # nested_props start
-#         "nested_prop": attr.string(),
-        # nested_props end
-        # nested_props_ptr start
-#         "nested_prop": attr.string(),
-        # nested_props_ptr end
-        "one_to_many_prop": attr.bool(),
-        "other_embedded_prop": attr.string(),
-        "string_list_prop": attr.string_list(),
-        "string_literal_prop": attr.string(),
-        "string_prop": attr.string(),
-        "string_ptr_prop": attr.string(),
-        "test_config_setting": attr.bool(),
-        # test_prop start
-#         "test_string_prop": attr.string(),
-        # test_prop end
-    },
-)
-`
-
-	if ruleShim.content != expectedBzl {
-		t.Errorf(
-			"Expected the generated rule shim bzl to be:\n%s\nbut got:\n%s",
-			expectedBzl,
-			ruleShim.content)
-	}
-}
-
-func TestGenerateSoongModuleBzl(t *testing.T) {
-	ruleShims := map[string]RuleShim{
-		"file1": RuleShim{
-			rules:   []string{"a", "b"},
-			content: "irrelevant",
-		},
-		"file2": RuleShim{
-			rules:   []string{"c", "d"},
-			content: "irrelevant",
-		},
-	}
-	files := CreateBazelFiles(ruleShims, make(map[string]BazelTargets), QueryView)
-
-	var actualSoongModuleBzl BazelFile
-	for _, f := range files {
-		if f.Basename == "soong_module.bzl" {
-			actualSoongModuleBzl = f
-		}
-	}
-
-	expectedLoad := `load("//build/bazel/queryview_rules:file1.bzl", "a", "b")
-load("//build/bazel/queryview_rules:file2.bzl", "c", "d")
-`
-	expectedRuleMap := `soong_module_rule_map = {
-    "a": a,
-    "b": b,
-    "c": c,
-    "d": d,
-}`
-	if !strings.Contains(actualSoongModuleBzl.Contents, expectedLoad) {
-		t.Errorf(
-			"Generated soong_module.bzl:\n\n%s\n\n"+
-				"Could not find the load statement in the generated soong_module.bzl:\n%s",
-			actualSoongModuleBzl.Contents,
-			expectedLoad)
-	}
-
-	if !strings.Contains(actualSoongModuleBzl.Contents, expectedRuleMap) {
-		t.Errorf(
-			"Generated soong_module.bzl:\n\n%s\n\n"+
-				"Could not find the module -> rule map in the generated soong_module.bzl:\n%s",
-			actualSoongModuleBzl.Contents,
-			expectedRuleMap)
-	}
-}
diff --git a/bp2build/cc_binary_conversion_test.go b/bp2build/cc_binary_conversion_test.go
deleted file mode 100644
index 2857a91..0000000
--- a/bp2build/cc_binary_conversion_test.go
+++ /dev/null
@@ -1,1309 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"fmt"
-	"strings"
-	"testing"
-
-	"android/soong/android"
-	"android/soong/cc"
-	"android/soong/genrule"
-)
-
-const (
-	ccBinaryTypePlaceHolder = "{rule_name}"
-)
-
-type testBazelTarget struct {
-	typ   string
-	name  string
-	attrs AttrNameToString
-}
-
-func generateBazelTargetsForTest(targets []testBazelTarget, hod android.HostOrDeviceSupported) []string {
-	ret := make([]string, 0, len(targets))
-	for _, t := range targets {
-		attrs := t.attrs.clone()
-		ret = append(ret, makeBazelTargetHostOrDevice(t.typ, t.name, attrs, hod))
-	}
-	return ret
-}
-
-type ccBinaryBp2buildTestCase struct {
-	description             string
-	filesystem              map[string]string
-	blueprint               string
-	targets                 []testBazelTarget
-	stubbedBuildDefinitions []string
-}
-
-func registerCcBinaryModuleTypes(ctx android.RegistrationContext) {
-	cc.RegisterCCBuildComponents(ctx)
-	ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-	ctx.RegisterModuleType("cc_library_static", cc.LibraryStaticFactory)
-	ctx.RegisterModuleType("cc_library", cc.LibraryFactory)
-	ctx.RegisterModuleType("genrule", genrule.GenRuleFactory)
-}
-
-var binaryReplacer = strings.NewReplacer(ccBinaryTypePlaceHolder, "cc_binary")
-var hostBinaryReplacer = strings.NewReplacer(ccBinaryTypePlaceHolder, "cc_binary_host")
-
-func runCcBinaryTests(t *testing.T, tc ccBinaryBp2buildTestCase) {
-	t.Helper()
-	runCcBinaryTestCase(t, tc)
-	runCcHostBinaryTestCase(t, tc)
-}
-
-func runCcBinaryTestCase(t *testing.T, testCase ccBinaryBp2buildTestCase) {
-	t.Helper()
-	moduleTypeUnderTest := "cc_binary"
-
-	description := fmt.Sprintf("%s %s", moduleTypeUnderTest, testCase.description)
-	t.Run(description, func(t *testing.T) {
-		t.Helper()
-		RunBp2BuildTestCase(t, registerCcBinaryModuleTypes, Bp2buildTestCase{
-			ExpectedBazelTargets:       generateBazelTargetsForTest(testCase.targets, android.DeviceSupported),
-			ModuleTypeUnderTest:        moduleTypeUnderTest,
-			ModuleTypeUnderTestFactory: cc.BinaryFactory,
-			Description:                description,
-			Blueprint:                  binaryReplacer.Replace(testCase.blueprint),
-			Filesystem:                 testCase.filesystem,
-			StubbedBuildDefinitions:    testCase.stubbedBuildDefinitions,
-		})
-	})
-}
-
-func runCcHostBinaryTestCase(t *testing.T, testCase ccBinaryBp2buildTestCase) {
-	t.Helper()
-	moduleTypeUnderTest := "cc_binary_host"
-	description := fmt.Sprintf("%s %s", moduleTypeUnderTest, testCase.description)
-	t.Run(description, func(t *testing.T) {
-		RunBp2BuildTestCase(t, registerCcBinaryModuleTypes, Bp2buildTestCase{
-			ExpectedBazelTargets:       generateBazelTargetsForTest(testCase.targets, android.HostSupported),
-			ModuleTypeUnderTest:        moduleTypeUnderTest,
-			ModuleTypeUnderTestFactory: cc.BinaryHostFactory,
-			Description:                description,
-			Blueprint:                  hostBinaryReplacer.Replace(testCase.blueprint),
-			Filesystem:                 testCase.filesystem,
-			StubbedBuildDefinitions:    testCase.stubbedBuildDefinitions,
-		})
-	})
-}
-
-func TestBasicCcBinary(t *testing.T) {
-	runCcBinaryTests(t, ccBinaryBp2buildTestCase{
-		description: "basic -- properties -> attrs with little/no transformation",
-		filesystem: map[string]string{
-			soongCcVersionLibBpPath: soongCcVersionLibBp,
-		},
-		stubbedBuildDefinitions: []string{"//build/soong/cc/libbuildversion:libbuildversion"},
-		blueprint: `
-{rule_name} {
-    name: "foo",
-    srcs: ["a.cc"],
-    local_include_dirs: ["dir"],
-    include_dirs: ["absolute_dir"],
-    cflags: ["-Dcopt"],
-    cppflags: ["-Dcppflag"],
-    conlyflags: ["-Dconlyflag"],
-    asflags: ["-Dasflag"],
-    ldflags: ["ld-flag"],
-    rtti: true,
-    strip: {
-        all: true,
-        keep_symbols: true,
-        keep_symbols_and_debug_frame: true,
-        keep_symbols_list: ["symbol"],
-        none: true,
-    },
-    sdk_version: "current",
-    min_sdk_version: "29",
-    use_version_lib: true,
-}
-`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"absolute_includes": `["absolute_dir"]`,
-				"asflags":           `["-Dasflag"]`,
-				"conlyflags":        `["-Dconlyflag"]`,
-				"copts":             `["-Dcopt"]`,
-				"cppflags":          `["-Dcppflag"]`,
-				"linkopts":          `["ld-flag"]`,
-				"local_includes": `[
-        "dir",
-        ".",
-    ]`,
-				"rtti": `True`,
-				"srcs": `["a.cc"]`,
-				"strip": `{
-        "all": True,
-        "keep_symbols": True,
-        "keep_symbols_and_debug_frame": True,
-        "keep_symbols_list": ["symbol"],
-        "none": True,
-    }`,
-				"sdk_version":        `"current"`,
-				"min_sdk_version":    `"29"`,
-				"use_version_lib":    `True`,
-				"whole_archive_deps": `["//build/soong/cc/libbuildversion:libbuildversion"]`,
-			},
-			},
-		},
-	})
-}
-
-func TestCcBinaryWithSharedLdflagDisableFeature(t *testing.T) {
-	runCcBinaryTests(t, ccBinaryBp2buildTestCase{
-		description: `ldflag "-shared" disables static_flag feature`,
-		blueprint: `
-{rule_name} {
-    name: "foo",
-    ldflags: ["-shared"],
-    include_build_directory: false,
-}
-`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"features": `["-static_flag"]`,
-				"linkopts": `["-shared"]`,
-			},
-			},
-		},
-	})
-}
-
-func TestCcBinaryWithLinkStatic(t *testing.T) {
-	runCcBinaryTests(t, ccBinaryBp2buildTestCase{
-		description: "link static",
-		blueprint: `
-{rule_name} {
-    name: "foo",
-    static_executable: true,
-    include_build_directory: false,
-}
-`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"linkshared": `False`,
-			},
-			},
-		},
-	})
-}
-
-func TestCcBinaryVersionScriptAndDynamicList(t *testing.T) {
-	runCcBinaryTests(t, ccBinaryBp2buildTestCase{
-		description: `version script and dynamic list`,
-		blueprint: `
-{rule_name} {
-    name: "foo",
-    include_build_directory: false,
-    version_script: "vs",
-    dynamic_list: "dynamic.list",
-}
-`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"additional_linker_inputs": `[
-        "vs",
-        "dynamic.list",
-    ]`,
-				"linkopts": `[
-        "-Wl,--version-script,$(location vs)",
-        "-Wl,--dynamic-list,$(location dynamic.list)",
-    ]`,
-				"features": `["android_cfi_exports_map"]`,
-			},
-			},
-		},
-	})
-}
-
-func TestCcBinaryLdflagsSplitBySpaceExceptSoongAdded(t *testing.T) {
-	runCcBinaryTests(t, ccBinaryBp2buildTestCase{
-		description: "ldflags are split by spaces except for the ones added by soong (version script and dynamic list)",
-		blueprint: `
-{rule_name} {
-    name: "foo",
-		ldflags: [
-			"--nospace_flag",
-			"-z spaceflag",
-		],
-		version_script: "version_script",
-		dynamic_list: "dynamic.list",
-    include_build_directory: false,
-}
-`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"additional_linker_inputs": `[
-        "version_script",
-        "dynamic.list",
-    ]`,
-				"features": `["android_cfi_exports_map"]`,
-				"linkopts": `[
-        "--nospace_flag",
-        "-z",
-        "spaceflag",
-        "-Wl,--version-script,$(location version_script)",
-        "-Wl,--dynamic-list,$(location dynamic.list)",
-    ]`,
-			}}},
-	})
-}
-
-func TestCcBinarySplitSrcsByLang(t *testing.T) {
-	runCcHostBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description:             "split srcs by lang",
-		stubbedBuildDefinitions: []string{"fg_foo"},
-		blueprint: `
-{rule_name} {
-    name: "foo",
-    srcs: [
-        "asonly.S",
-        "conly.c",
-        "cpponly.cpp",
-        ":fg_foo",
-    ],
-    include_build_directory: false,
-}
-` + simpleModule("filegroup", "fg_foo"),
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"srcs": `[
-        "cpponly.cpp",
-        ":fg_foo_cpp_srcs",
-    ]`,
-				"srcs_as": `[
-        "asonly.S",
-        ":fg_foo_as_srcs",
-    ]`,
-				"srcs_c": `[
-        "conly.c",
-        ":fg_foo_c_srcs",
-    ]`,
-			},
-			},
-		},
-	})
-}
-
-func TestCcBinaryDoNotDistinguishBetweenDepsAndImplementationDeps(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "no implementation deps",
-		stubbedBuildDefinitions: []string{"generated_hdr", "export_generated_hdr", "static_dep", "implementation_static_dep",
-			"whole_static_dep", "not_explicitly_exported_whole_static_dep", "shared_dep", "implementation_shared_dep"},
-		blueprint: `
-genrule {
-    name: "generated_hdr",
-    cmd: "nothing to see here",
-}
-
-genrule {
-    name: "export_generated_hdr",
-    cmd: "nothing to see here",
-}
-
-{rule_name} {
-    name: "foo",
-    srcs: ["foo.cpp"],
-    shared_libs: ["implementation_shared_dep", "shared_dep"],
-    export_shared_lib_headers: ["shared_dep"],
-    static_libs: ["implementation_static_dep", "static_dep"],
-    export_static_lib_headers: ["static_dep", "whole_static_dep"],
-    whole_static_libs: ["not_explicitly_exported_whole_static_dep", "whole_static_dep"],
-    include_build_directory: false,
-    generated_headers: ["generated_hdr", "export_generated_hdr"],
-    export_generated_headers: ["export_generated_hdr"],
-}
-` +
-			simpleModule("cc_library_static", "static_dep") +
-			simpleModule("cc_library_static", "implementation_static_dep") +
-			simpleModule("cc_library_static", "whole_static_dep") +
-			simpleModule("cc_library_static", "not_explicitly_exported_whole_static_dep") +
-			simpleModule("cc_library", "shared_dep") +
-			simpleModule("cc_library", "implementation_shared_dep"),
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"deps": `[
-        ":implementation_static_dep",
-        ":static_dep",
-    ]`,
-				"dynamic_deps": `[
-        ":implementation_shared_dep",
-        ":shared_dep",
-    ]`,
-				"srcs": `[
-        "foo.cpp",
-        ":generated_hdr",
-        ":export_generated_hdr",
-    ]`,
-				"whole_archive_deps": `[
-        ":not_explicitly_exported_whole_static_dep",
-        ":whole_static_dep",
-    ]`,
-				"local_includes": `["."]`,
-			},
-			},
-		},
-	})
-}
-
-func TestCcBinaryNocrtTests(t *testing.T) {
-	baseTestCases := []struct {
-		description   string
-		soongProperty string
-		bazelAttr     AttrNameToString
-	}{
-		{
-			description:   "nocrt: true",
-			soongProperty: `nocrt: true,`,
-			bazelAttr:     AttrNameToString{"features": `["-link_crt"]`},
-		},
-		{
-			description:   "nocrt: false",
-			soongProperty: `nocrt: false,`,
-			bazelAttr:     AttrNameToString{},
-		},
-		{
-			description: "nocrt: not set",
-			bazelAttr:   AttrNameToString{},
-		},
-	}
-
-	baseBlueprint := `{rule_name} {
-    name: "foo",%s
-    include_build_directory: false,
-}
-`
-
-	for _, btc := range baseTestCases {
-		prop := btc.soongProperty
-		if len(prop) > 0 {
-			prop = "\n" + prop
-		}
-		runCcBinaryTests(t, ccBinaryBp2buildTestCase{
-			description: btc.description,
-			blueprint:   fmt.Sprintf(baseBlueprint, prop),
-			targets: []testBazelTarget{
-				{"cc_binary", "foo", btc.bazelAttr},
-			},
-		})
-	}
-}
-
-func TestCcBinaryNo_libcrtTests(t *testing.T) {
-	baseTestCases := []struct {
-		description   string
-		soongProperty string
-		bazelAttr     AttrNameToString
-	}{
-		{
-			description:   "no_libcrt: true",
-			soongProperty: `no_libcrt: true,`,
-			bazelAttr:     AttrNameToString{"features": `["-use_libcrt"]`},
-		},
-		{
-			description:   "no_libcrt: false",
-			soongProperty: `no_libcrt: false,`,
-			bazelAttr:     AttrNameToString{},
-		},
-		{
-			description: "no_libcrt: not set",
-			bazelAttr:   AttrNameToString{},
-		},
-	}
-
-	baseBlueprint := `{rule_name} {
-    name: "foo",%s
-    include_build_directory: false,
-}
-`
-
-	for _, btc := range baseTestCases {
-		prop := btc.soongProperty
-		if len(prop) > 0 {
-			prop = "\n" + prop
-		}
-		runCcBinaryTests(t, ccBinaryBp2buildTestCase{
-			description: btc.description,
-			blueprint:   fmt.Sprintf(baseBlueprint, prop),
-			targets: []testBazelTarget{
-				{"cc_binary", "foo", btc.bazelAttr},
-			},
-		})
-	}
-}
-
-func TestCcBinaryPropertiesToFeatures(t *testing.T) {
-	baseTestCases := []struct {
-		description   string
-		soongProperty string
-		bazelAttr     AttrNameToString
-	}{
-		{
-			description:   "pack_relocation: true",
-			soongProperty: `pack_relocations: true,`,
-			bazelAttr:     AttrNameToString{},
-		},
-		{
-			description:   "pack_relocations: false",
-			soongProperty: `pack_relocations: false,`,
-			bazelAttr:     AttrNameToString{"features": `["disable_pack_relocations"]`},
-		},
-		{
-			description: "pack_relocations: not set",
-			bazelAttr:   AttrNameToString{},
-		},
-		{
-			description:   "pack_relocation: true",
-			soongProperty: `allow_undefined_symbols: true,`,
-			bazelAttr:     AttrNameToString{"features": `["-no_undefined_symbols"]`},
-		},
-		{
-			description:   "allow_undefined_symbols: false",
-			soongProperty: `allow_undefined_symbols: false,`,
-			bazelAttr:     AttrNameToString{},
-		},
-		{
-			description: "allow_undefined_symbols: not set",
-			bazelAttr:   AttrNameToString{},
-		},
-	}
-
-	baseBlueprint := `{rule_name} {
-    name: "foo",%s
-    include_build_directory: false,
-}
-`
-	for _, btc := range baseTestCases {
-		prop := btc.soongProperty
-		if len(prop) > 0 {
-			prop = "\n" + prop
-		}
-		runCcBinaryTests(t, ccBinaryBp2buildTestCase{
-			description: btc.description,
-			blueprint:   fmt.Sprintf(baseBlueprint, prop),
-			targets: []testBazelTarget{
-				{"cc_binary", "foo", btc.bazelAttr},
-			},
-		})
-	}
-}
-
-func TestCcBinarySharedProto(t *testing.T) {
-	runCcBinaryTests(t, ccBinaryBp2buildTestCase{
-		stubbedBuildDefinitions: []string{"libprotobuf-cpp-full", "libprotobuf-cpp-lite"},
-		blueprint: soongCcProtoLibraries + `{rule_name} {
-	name: "foo",
-	srcs: ["foo.proto"],
-	proto: {
-	},
-	include_build_directory: false,
-}`,
-		targets: []testBazelTarget{
-			{"proto_library", "foo_proto", AttrNameToString{
-				"srcs": `["foo.proto"]`,
-			}}, {"cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
-				"deps": `[":foo_proto"]`,
-			}}, {"cc_binary", "foo", AttrNameToString{
-				"dynamic_deps":       `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":foo_cc_proto_lite"]`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryStaticProto(t *testing.T) {
-	runCcBinaryTests(t, ccBinaryBp2buildTestCase{
-		stubbedBuildDefinitions: []string{"libprotobuf-cpp-full", "libprotobuf-cpp-lite"},
-		blueprint: soongCcProtoLibraries + `{rule_name} {
-	name: "foo",
-	srcs: ["foo.proto"],
-	static_executable: true,
-	proto: {
-	},
-	include_build_directory: false,
-}`,
-		targets: []testBazelTarget{
-			{"proto_library", "foo_proto", AttrNameToString{
-				"srcs": `["foo.proto"]`,
-			}}, {"cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
-				"deps": `[":foo_proto"]`,
-			}}, {"cc_binary", "foo", AttrNameToString{
-				"deps":               `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":foo_cc_proto_lite"]`,
-				"linkshared":         `False`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryConvertLex(t *testing.T) {
-	runCcBinaryTests(t, ccBinaryBp2buildTestCase{
-		description: `.l and .ll sources converted to .c and .cc`,
-		blueprint: `
-{rule_name} {
-    name: "foo",
-		srcs: ["foo.c", "bar.cc", "foo1.l", "foo2.l", "bar1.ll", "bar2.ll"],
-		lex: { flags: ["--foo_opt", "--bar_opt"] },
-		include_build_directory: false,
-}
-`,
-		targets: []testBazelTarget{
-			{"genlex", "foo_genlex_l", AttrNameToString{
-				"srcs": `[
-        "foo1.l",
-        "foo2.l",
-    ]`,
-				"lexopts": `[
-        "--foo_opt",
-        "--bar_opt",
-    ]`,
-			}},
-			{"genlex", "foo_genlex_ll", AttrNameToString{
-				"srcs": `[
-        "bar1.ll",
-        "bar2.ll",
-    ]`,
-				"lexopts": `[
-        "--foo_opt",
-        "--bar_opt",
-    ]`,
-			}},
-			{"cc_binary", "foo", AttrNameToString{
-				"srcs": `[
-        "bar.cc",
-        ":foo_genlex_ll",
-    ]`,
-				"srcs_c": `[
-        "foo.c",
-        ":foo_genlex_l",
-    ]`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryRuntimeLibs(t *testing.T) {
-	runCcBinaryTests(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary with runtime libs",
-		blueprint: `
-cc_library {
-    name: "bar",
-    srcs: ["b.cc"],
-}
-
-{rule_name} {
-    name: "foo",
-    srcs: ["a.cc"],
-    runtime_libs: ["bar"],
-}
-`,
-		targets: []testBazelTarget{
-			{"cc_library_static", "bar_bp2build_cc_library_static", AttrNameToString{
-				"local_includes":         `["."]`,
-				"srcs":                   `["b.cc"]`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-			},
-			},
-			{"cc_library_shared", "bar", AttrNameToString{
-				"local_includes":         `["."]`,
-				"srcs":                   `["b.cc"]`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-			},
-			},
-			{"cc_binary", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"srcs":           `["a.cc"]`,
-				"runtime_deps":   `[":bar"]`,
-			},
-			},
-		},
-	})
-}
-
-func TestCcBinaryWithInstructionSet(t *testing.T) {
-	runCcBinaryTests(t, ccBinaryBp2buildTestCase{
-		description: "instruction set",
-		blueprint: `
-{rule_name} {
-    name: "foo",
-    arch: {
-      arm: {
-        instruction_set: "arm",
-      }
-    }
-}
-`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"features": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["arm_isa_arm"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryEmptySuffix(t *testing.T) {
-	runCcBinaryTests(t, ccBinaryBp2buildTestCase{
-		description: "binary with empty suffix",
-		blueprint: `
-{rule_name} {
-    name: "foo",
-    suffix: "",
-}`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"suffix":         `""`,
-			}},
-		},
-	})
-}
-
-func TestCcBinarySuffix(t *testing.T) {
-	runCcBinaryTests(t, ccBinaryBp2buildTestCase{
-		description: "binary with suffix",
-		blueprint: `
-{rule_name} {
-    name: "foo",
-    suffix: "-suf",
-}
-`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"suffix":         `"-suf"`,
-			}},
-		},
-	})
-}
-
-func TestCcArchVariantBinarySuffix(t *testing.T) {
-	runCcBinaryTests(t, ccBinaryBp2buildTestCase{
-		description: "binary with suffix",
-		blueprint: `
-{rule_name} {
-    name: "foo",
-    arch: {
-        arm64: { suffix: "-64" },
-        arm:   { suffix: "-32" },
-		},
-}
-`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"suffix": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "-32",
-        "//build/bazel_common_rules/platforms/arch:arm64": "-64",
-        "//conditions:default": None,
-    })`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryWithSyspropSrcs(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary with sysprop sources",
-		blueprint: `
-{rule_name} {
-	name: "foo",
-	srcs: [
-		"bar.sysprop",
-		"baz.sysprop",
-		"blah.cpp",
-	],
-	min_sdk_version: "5",
-}`,
-		targets: []testBazelTarget{
-			{"sysprop_library", "foo_sysprop_library", AttrNameToString{
-				"srcs": `[
-        "bar.sysprop",
-        "baz.sysprop",
-    ]`,
-			}},
-			{"cc_sysprop_library_static", "foo_cc_sysprop_library_static", AttrNameToString{
-				"dep":             `":foo_sysprop_library"`,
-				"min_sdk_version": `"5"`,
-			}},
-			{"cc_binary", "foo", AttrNameToString{
-				"srcs":               `["blah.cpp"]`,
-				"local_includes":     `["."]`,
-				"min_sdk_version":    `"5"`,
-				"whole_archive_deps": `[":foo_cc_sysprop_library_static"]`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryWithSyspropSrcsSomeConfigs(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary with sysprop sources in some configs but not others",
-		blueprint: `
-{rule_name} {
-	name: "foo",
-	srcs: [
-		"blah.cpp",
-	],
-	target: {
-		android: {
-			srcs: ["bar.sysprop"],
-		},
-	},
-	min_sdk_version: "5",
-}`,
-		targets: []testBazelTarget{
-			{"sysprop_library", "foo_sysprop_library", AttrNameToString{
-				"srcs": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["bar.sysprop"],
-        "//conditions:default": [],
-    })`,
-			}},
-			{"cc_sysprop_library_static", "foo_cc_sysprop_library_static", AttrNameToString{
-				"dep":             `":foo_sysprop_library"`,
-				"min_sdk_version": `"5"`,
-			}},
-			{"cc_binary", "foo", AttrNameToString{
-				"srcs":            `["blah.cpp"]`,
-				"local_includes":  `["."]`,
-				"min_sdk_version": `"5"`,
-				"whole_archive_deps": `select({
-        "//build/bazel_common_rules/platforms/os:android": [":foo_cc_sysprop_library_static"],
-        "//conditions:default": [],
-    })`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryWithIntegerOverflowProperty(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary with integer overflow property specified",
-		blueprint: `
-{rule_name} {
-	name: "foo",
-	sanitize: {
-		integer_overflow: true,
-	},
-}`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"features":       `["ubsan_integer_overflow"]`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryWithMiscUndefinedProperty(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary with miscellaneous properties specified",
-		blueprint: `
-{rule_name} {
-	name: "foo",
-	sanitize: {
-		misc_undefined: ["undefined", "nullability"],
-	},
-}`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"features": `[
-        "ubsan_undefined",
-        "ubsan_nullability",
-    ]`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryWithUBSanPropertiesArchSpecific(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary has correct feature select when UBSan props are specified in arch specific blocks",
-		blueprint: `
-{rule_name} {
-	name: "foo",
-	sanitize: {
-		misc_undefined: ["undefined", "nullability"],
-	},
-	target: {
-			android: {
-					sanitize: {
-							misc_undefined: ["alignment"],
-					},
-			},
-			linux_glibc: {
-					sanitize: {
-							integer_overflow: true,
-					},
-			},
-	},
-}`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"features": `[
-        "ubsan_undefined",
-        "ubsan_nullability",
-    ] + select({
-        "//build/bazel_common_rules/platforms/os:android": ["ubsan_alignment"],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
-        "//conditions:default": [],
-    })`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryWithSanitizerBlocklist(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary has the correct feature when sanitize.blocklist is provided",
-		blueprint: `
-{rule_name} {
-	name: "foo",
-	sanitize: {
-		blocklist: "foo_blocklist.txt",
-	},
-}`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"copts": `select({
-        "//build/bazel/rules/cc:sanitizers_enabled": ["-fsanitize-ignorelist=$(location foo_blocklist.txt)"],
-        "//conditions:default": [],
-    })`,
-				"additional_compiler_inputs": `select({
-        "//build/bazel/rules/cc:sanitizers_enabled": [":foo_blocklist.txt"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryWithThinLto(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary has correct features when thin LTO is enabled",
-		blueprint: `
-{rule_name} {
-	name: "foo",
-	lto: {
-		thin: true,
-	},
-}`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"features":       `["android_thin_lto"]`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryWithLtoNever(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary has correct features when LTO is explicitly disabled",
-		blueprint: `
-{rule_name} {
-	name: "foo",
-	lto: {
-		never: true,
-	},
-}`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"features":       `["-android_thin_lto"]`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryWithThinLtoArchSpecific(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary has correct features when LTO differs across arch and os variants",
-		blueprint: `
-{rule_name} {
-	name: "foo",
-	target: {
-		android: {
-			lto: {
-				thin: true,
-			},
-		},
-	},
-	arch: {
-		riscv64: {
-			lto: {
-				thin: false,
-			},
-		},
-	},
-}`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm": ["android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": ["android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_x86": ["android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["android_thin_lto"],
-        "//conditions:default": [],
-    })`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryWithThinLtoDisabledDefaultEnabledVariant(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary has correct features when LTO disabled by default but enabled on a particular variant",
-		blueprint: `
-{rule_name} {
-	name: "foo",
-	lto: {
-		never: true,
-	},
-	target: {
-		android: {
-			lto: {
-				thin: true,
-				never: false,
-			},
-		},
-	},
-}`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["android_thin_lto"],
-        "//conditions:default": ["-android_thin_lto"],
-    })`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryWithThinLtoAndWholeProgramVtables(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary has correct features when thin LTO is enabled with whole_program_vtables",
-		blueprint: `
-{rule_name} {
-	name: "foo",
-	lto: {
-		thin: true,
-	},
-	whole_program_vtables: true,
-}`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"features": `[
-        "android_thin_lto",
-        "android_thin_lto_whole_program_vtables",
-    ]`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryHiddenVisibilityConvertedToFeature(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary changes hidden visibility to feature",
-		blueprint: `
-{rule_name} {
-	name: "foo",
-	cflags: ["-fvisibility=hidden"],
-}`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"features":       `["visibility_hidden"]`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryHiddenVisibilityConvertedToFeatureOsSpecific(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary changes hidden visibility to feature for specific os",
-		blueprint: `
-{rule_name} {
-	name: "foo",
-	target: {
-		android: {
-			cflags: ["-fvisibility=hidden"],
-		},
-	},
-}`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["visibility_hidden"],
-        "//conditions:default": [],
-    })`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryWithCfi(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary has correct features when cfi is enabled",
-		blueprint: `
-{rule_name} {
-	name: "foo",
-	sanitize: {
-		cfi: true,
-	},
-}`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"features":       `["android_cfi"]`,
-				"local_includes": `["."]`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryWithCfiOsSpecific(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary has correct features when cfi is enabled for specific variants",
-		blueprint: `
-{rule_name} {
-	name: "foo",
-	target: {
-		android: {
-			sanitize: {
-				cfi: true,
-			},
-		},
-	},
-}`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["android_cfi"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryWithCfiAndCfiAssemblySupport(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary has correct features when cfi is enabled with cfi assembly support",
-		blueprint: `
-{rule_name} {
-	name: "foo",
-	sanitize: {
-		cfi: true,
-		config: {
-			cfi_assembly_support: true,
-		},
-	},
-}`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"features": `[
-        "android_cfi",
-        "android_cfi_assembly_support",
-    ]`,
-				"local_includes": `["."]`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryExplicitlyDisablesCfiWhenFalse(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary disables cfi when explciitly set to false in the bp",
-		blueprint: `
-{rule_name} {
-	name: "foo",
-	sanitize: {
-		cfi: false,
-	},
-}
-`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo", AttrNameToString{
-				"features":       `["-android_cfi"]`,
-				"local_includes": `["."]`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryStem(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		description: "cc_binary with stem property",
-		blueprint: `
-cc_binary {
-	name: "foo_with_stem_simple",
-	stem: "foo",
-}
-cc_binary {
-	name: "foo_with_arch_variant_stem",
-	arch: {
-		arm: {
-			stem: "foo-arm",
-		},
-		arm64: {
-			stem: "foo-arm64",
-		},
-	},
-}
-`,
-		targets: []testBazelTarget{
-			{"cc_binary", "foo_with_stem_simple", AttrNameToString{
-				"stem":           `"foo"`,
-				"local_includes": `["."]`,
-			}},
-			{"cc_binary", "foo_with_arch_variant_stem", AttrNameToString{
-				"stem": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "foo-arm",
-        "//build/bazel_common_rules/platforms/arch:arm64": "foo-arm64",
-        "//conditions:default": None,
-    })`,
-				"local_includes": `["."]`,
-			}},
-		},
-	})
-}
-
-func TestCCBinaryRscriptSrc(t *testing.T) {
-	runCcBinaryTests(t, ccBinaryBp2buildTestCase{
-		description: `cc_binary with rscript files in sources`,
-		blueprint: `
-{rule_name} {
-    name : "foo",
-    srcs : [
-        "ccSrc.cc",
-        "rsSrc.rscript",
-    ],
-    include_build_directory: false,
-}
-`,
-		targets: []testBazelTarget{
-			{"rscript_to_cpp", "foo_renderscript", AttrNameToString{
-				"srcs": `["rsSrc.rscript"]`,
-			}},
-			{"cc_binary", "foo", AttrNameToString{
-				"absolute_includes": `[
-        "frameworks/rs",
-        "frameworks/rs/cpp",
-    ]`,
-				"local_includes": `["."]`,
-				"srcs": `[
-        "ccSrc.cc",
-        "foo_renderscript",
-    ]`,
-			}},
-		},
-	})
-}
-
-func TestCcBinaryStatic_SystemSharedLibUsedAsDep(t *testing.T) {
-	runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
-		stubbedBuildDefinitions: []string{"libm", "libc"},
-		description:             "cc_library_static system_shared_lib empty for linux_bionic variant",
-		blueprint: soongCcLibraryStaticPreamble +
-			simpleModule("cc_library", "libc") + `
-
-cc_library {
-    name: "libm",
-}
-
-cc_binary {
-    name: "used_in_bionic_oses",
-    target: {
-        android: {
-            static_libs: ["libc"],
-        },
-        linux_bionic: {
-            static_libs: ["libc"],
-        },
-    },
-    include_build_directory: false,
-    static_executable: true,
-}
-
-cc_binary {
-    name: "all",
-    static_libs: ["libc"],
-    include_build_directory: false,
-    static_executable: true,
-}
-
-cc_binary {
-    name: "keep_for_empty_system_shared_libs",
-    static_libs: ["libc"],
-    system_shared_libs: [],
-    include_build_directory: false,
-    static_executable: true,
-}
-
-cc_binary {
-    name: "used_with_stubs",
-    static_libs: ["libm"],
-    include_build_directory: false,
-    static_executable: true,
-}
-
-cc_binary {
-    name: "keep_with_stubs",
-    static_libs: ["libm"],
-    system_shared_libs: [],
-    include_build_directory: false,
-    static_executable: true,
-}
-`,
-		targets: []testBazelTarget{
-			{"cc_binary", "all", AttrNameToString{
-				"linkshared": "False",
-			}},
-			{"cc_binary", "keep_for_empty_system_shared_libs", AttrNameToString{
-				"deps":        `[":libc_bp2build_cc_library_static"]`,
-				"system_deps": `[]`,
-				"linkshared":  "False",
-			}},
-			{"cc_binary", "keep_with_stubs", AttrNameToString{
-				"linkshared":  "False",
-				"deps":        `[":libm_bp2build_cc_library_static"]`,
-				"system_deps": `[]`,
-			}},
-			{"cc_binary", "used_in_bionic_oses", AttrNameToString{
-				"linkshared": "False",
-			}},
-			{"cc_binary", "used_with_stubs", AttrNameToString{
-				"linkshared": "False",
-			}},
-		},
-	})
-}
diff --git a/bp2build/cc_library_conversion_test.go b/bp2build/cc_library_conversion_test.go
deleted file mode 100644
index 188c81b..0000000
--- a/bp2build/cc_library_conversion_test.go
+++ /dev/null
@@ -1,5366 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"fmt"
-	"testing"
-
-	"android/soong/aidl_library"
-	"android/soong/android"
-	"android/soong/cc"
-)
-
-const (
-	// See cc/testing.go for more context
-	soongCcLibraryPreamble = `
-cc_defaults {
-    name: "linux_bionic_supported",
-}
-`
-
-	soongCcVersionLibBpPath = "build/soong/cc/libbuildversion/Android.bp"
-	soongCcVersionLibBp     = `
-cc_library_static {
-	name: "libbuildversion",
-}
-`
-
-	soongCcProtoLibraries = `
-cc_library {
-	name: "libprotobuf-cpp-lite",
-}
-
-cc_library {
-	name: "libprotobuf-cpp-full",
-}`
-
-	soongCcProtoPreamble = soongCcLibraryPreamble + soongCcProtoLibraries
-)
-
-func runCcLibraryTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	tc.StubbedBuildDefinitions = append(tc.StubbedBuildDefinitions, "libprotobuf-cpp-lite", "libprotobuf-cpp-full")
-	RunBp2BuildTestCase(t, registerCcLibraryModuleTypes, tc)
-}
-
-func registerCcLibraryModuleTypes(ctx android.RegistrationContext) {
-	cc.RegisterCCBuildComponents(ctx)
-	ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-	ctx.RegisterModuleType("cc_library_static", cc.LibraryStaticFactory)
-	ctx.RegisterModuleType("cc_prebuilt_library_static", cc.PrebuiltStaticLibraryFactory)
-	ctx.RegisterModuleType("cc_library_headers", cc.LibraryHeaderFactory)
-	ctx.RegisterModuleType("aidl_library", aidl_library.AidlLibraryFactory)
-	ctx.RegisterModuleType("ndk_library", cc.NdkLibraryFactory)
-}
-
-func TestCcLibrarySimple(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library - simple example",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		StubbedBuildDefinitions:    []string{"//build/soong/cc/libbuildversion:libbuildversion", "some-headers"},
-		Filesystem: map[string]string{
-			soongCcVersionLibBpPath: soongCcVersionLibBp,
-			"android.cpp":           "",
-			"bionic.cpp":            "",
-			"darwin.cpp":            "",
-			// Refer to cc.headerExts for the supported header extensions in Soong.
-			"header.h":         "",
-			"header.hh":        "",
-			"header.hpp":       "",
-			"header.hxx":       "",
-			"header.h++":       "",
-			"header.inl":       "",
-			"header.inc":       "",
-			"header.ipp":       "",
-			"header.h.generic": "",
-			"impl.cpp":         "",
-			"linux.cpp":        "",
-			"x86.cpp":          "",
-			"x86_64.cpp":       "",
-			"foo-dir/a.h":      "",
-		},
-		Blueprint: soongCcLibraryPreamble +
-			simpleModule("cc_library_headers", "some-headers") + `
-cc_library {
-    name: "foo-lib",
-    srcs: ["impl.cpp"],
-    cflags: ["-Wall"],
-    header_libs: ["some-headers"],
-    export_include_dirs: ["foo-dir"],
-    ldflags: ["-Wl,--exclude-libs=bar.a"],
-    arch: {
-        x86: {
-            ldflags: ["-Wl,--exclude-libs=baz.a"],
-            srcs: ["x86.cpp"],
-        },
-        x86_64: {
-            ldflags: ["-Wl,--exclude-libs=qux.a"],
-            srcs: ["x86_64.cpp"],
-        },
-    },
-    target: {
-        android: {
-            srcs: ["android.cpp"],
-        },
-        linux_glibc: {
-            srcs: ["linux.cpp"],
-        },
-        darwin: {
-            srcs: ["darwin.cpp"],
-        },
-        bionic: {
-          srcs: ["bionic.cpp"]
-        },
-    },
-    include_build_directory: false,
-    sdk_version: "current",
-    min_sdk_version: "29",
-    use_version_lib: true,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
-			"copts":               `["-Wall"]`,
-			"export_includes":     `["foo-dir"]`,
-			"implementation_deps": `[":some-headers"]`,
-			"linkopts": `["-Wl,--exclude-libs=bar.a"] + select({
-        "//build/bazel_common_rules/platforms/arch:x86": ["-Wl,--exclude-libs=baz.a"],
-        "//build/bazel_common_rules/platforms/arch:x86_64": ["-Wl,--exclude-libs=qux.a"],
-        "//conditions:default": [],
-    })`,
-			"srcs": `["impl.cpp"] + select({
-        "//build/bazel_common_rules/platforms/arch:x86": ["x86.cpp"],
-        "//build/bazel_common_rules/platforms/arch:x86_64": ["x86_64.cpp"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel_common_rules/platforms/os:android": [
-            "bionic.cpp",
-            "android.cpp",
-        ],
-        "//build/bazel_common_rules/platforms/os:darwin": ["darwin.cpp"],
-        "//build/bazel_common_rules/platforms/os:linux_bionic": ["bionic.cpp"],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": ["linux.cpp"],
-        "//conditions:default": [],
-    })`,
-			"sdk_version":        `"current"`,
-			"min_sdk_version":    `"29"`,
-			"use_version_lib":    `True`,
-			"whole_archive_deps": `["//build/soong/cc/libbuildversion:libbuildversion"]`,
-			"deps": `select({
-        "//build/bazel/rules/apex:unbundled_app": ["//build/bazel/rules/cc:ndk_sysroot"],
-        "//conditions:default": [],
-    })`,
-		}),
-	})
-}
-
-func TestCcLibraryTrimmedLdAndroid(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library - trimmed example of //bionic/linker:ld-android",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		StubbedBuildDefinitions:    []string{"libc_headers"},
-		Filesystem: map[string]string{
-			"ld-android.cpp":           "",
-			"linked_list.h":            "",
-			"linker.h":                 "",
-			"linker_block_allocator.h": "",
-			"linker_cfi.h":             "",
-		},
-		Blueprint: soongCcLibraryPreamble +
-			simpleModule("cc_library_headers", "libc_headers") + `
-cc_library {
-    name: "fake-ld-android",
-    srcs: ["ld_android.cpp"],
-    cflags: [
-        "-Wall",
-        "-Wextra",
-        "-Wunused",
-        "-Werror",
-    ],
-    header_libs: ["libc_headers"],
-    ldflags: [
-        "-Wl,--exclude-libs=libgcc.a",
-        "-Wl,--exclude-libs=libgcc_stripped.a",
-        "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
-        "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
-        "-Wl,--exclude-libs=libclang_rt.builtins-i686-android.a",
-        "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
-    ],
-    arch: {
-        x86: {
-            ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
-        },
-        x86_64: {
-            ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("fake-ld-android", AttrNameToString{
-			"srcs": `["ld_android.cpp"]`,
-			"copts": `[
-        "-Wall",
-        "-Wextra",
-        "-Wunused",
-        "-Werror",
-    ]`,
-			"implementation_deps": `[":libc_headers"]`,
-			"linkopts": `[
-        "-Wl,--exclude-libs=libgcc.a",
-        "-Wl,--exclude-libs=libgcc_stripped.a",
-        "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
-        "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
-        "-Wl,--exclude-libs=libclang_rt.builtins-i686-android.a",
-        "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
-    ] + select({
-        "//build/bazel_common_rules/platforms/arch:x86": ["-Wl,--exclude-libs=libgcc_eh.a"],
-        "//build/bazel_common_rules/platforms/arch:x86_64": ["-Wl,--exclude-libs=libgcc_eh.a"],
-        "//conditions:default": [],
-    })`,
-		}),
-	})
-}
-
-func TestCcLibraryExcludeSrcs(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library exclude_srcs - trimmed example of //external/arm-optimized-routines:libarm-optimized-routines-math",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Dir:                        "external",
-		Filesystem: map[string]string{
-			"external/math/cosf.c":      "",
-			"external/math/erf.c":       "",
-			"external/math/erf_data.c":  "",
-			"external/math/erff.c":      "",
-			"external/math/erff_data.c": "",
-			"external/Android.bp": `
-cc_library {
-    name: "fake-libarm-optimized-routines-math",
-    exclude_srcs: [
-        // Provided by:
-        // bionic/libm/upstream-freebsd/lib/msun/src/s_erf.c
-        // bionic/libm/upstream-freebsd/lib/msun/src/s_erff.c
-        "math/erf.c",
-        "math/erf_data.c",
-        "math/erff.c",
-        "math/erff_data.c",
-    ],
-    srcs: [
-        "math/*.c",
-    ],
-    // arch-specific settings
-    arch: {
-        arm64: {
-            cflags: [
-                "-DHAVE_FAST_FMA=1",
-            ],
-        },
-    },
-    bazel_module: { bp2build_available: true },
-}
-`,
-		},
-		Blueprint: soongCcLibraryPreamble,
-		ExpectedBazelTargets: makeCcLibraryTargets("fake-libarm-optimized-routines-math", AttrNameToString{
-			"copts": `select({
-        "//build/bazel_common_rules/platforms/arch:arm64": ["-DHAVE_FAST_FMA=1"],
-        "//conditions:default": [],
-    })`,
-			"local_includes": `["."]`,
-			"srcs_c":         `["math/cosf.c"]`,
-		}),
-	})
-}
-
-func TestCcLibrarySharedStaticProps(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library shared/static props",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"both.cpp":       "",
-			"sharedonly.cpp": "",
-			"staticonly.cpp": "",
-		},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "a",
-    srcs: ["both.cpp"],
-    cflags: ["bothflag"],
-    shared_libs: ["shared_dep_for_both"],
-    static_libs: ["static_dep_for_both", "whole_and_static_lib_for_both"],
-    whole_static_libs: ["whole_static_lib_for_both", "whole_and_static_lib_for_both"],
-    static: {
-        srcs: ["staticonly.cpp"],
-        cflags: ["staticflag"],
-        shared_libs: ["shared_dep_for_static"],
-        static_libs: ["static_dep_for_static"],
-        whole_static_libs: ["whole_static_lib_for_static"],
-    },
-    shared: {
-        srcs: ["sharedonly.cpp"],
-        cflags: ["sharedflag"],
-        shared_libs: ["shared_dep_for_shared"],
-        static_libs: ["static_dep_for_shared"],
-        whole_static_libs: ["whole_static_lib_for_shared"],
-    },
-    include_build_directory: false,
-}
-
-cc_library_static {
-    name: "static_dep_for_shared",
-}
-
-cc_library_static {
-    name: "static_dep_for_static",
-}
-
-cc_library_static {
-    name: "static_dep_for_both",
-}
-
-cc_library_static {
-    name: "whole_static_lib_for_shared",
-}
-
-cc_library_static {
-    name: "whole_static_lib_for_static",
-}
-
-cc_library_static {
-    name: "whole_static_lib_for_both",
-}
-
-cc_library_static {
-    name: "whole_and_static_lib_for_both",
-}
-
-cc_library {
-    name: "shared_dep_for_shared",
-}
-
-cc_library {
-    name: "shared_dep_for_static",
-}
-
-cc_library {
-    name: "shared_dep_for_both",
-}
-`,
-		StubbedBuildDefinitions: []string{"static_dep_for_shared", "static_dep_for_static",
-			"static_dep_for_both", "whole_static_lib_for_shared", "whole_static_lib_for_static",
-			"whole_static_lib_for_both", "whole_and_static_lib_for_both", "shared_dep_for_shared",
-			"shared_dep_for_static", "shared_dep_for_both",
-		},
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
-				"copts": `[
-        "bothflag",
-        "staticflag",
-    ]`,
-				"implementation_deps": `[
-        ":static_dep_for_both",
-        ":static_dep_for_static",
-    ]`,
-				"implementation_dynamic_deps": `[
-        ":shared_dep_for_both",
-        ":shared_dep_for_static",
-    ]`,
-				"srcs": `[
-        "both.cpp",
-        "staticonly.cpp",
-    ]`,
-				"whole_archive_deps": `[
-        ":whole_static_lib_for_both",
-        ":whole_and_static_lib_for_both",
-        ":whole_static_lib_for_static",
-    ]`}),
-			MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
-				"copts": `[
-        "bothflag",
-        "sharedflag",
-    ]`,
-				"implementation_deps": `[
-        ":static_dep_for_both",
-        ":static_dep_for_shared",
-    ]`,
-				"implementation_dynamic_deps": `[
-        ":shared_dep_for_both",
-        ":shared_dep_for_shared",
-    ]`,
-				"srcs": `[
-        "both.cpp",
-        "sharedonly.cpp",
-    ]`,
-				"whole_archive_deps": `[
-        ":whole_static_lib_for_both",
-        ":whole_and_static_lib_for_both",
-        ":whole_static_lib_for_shared",
-    ]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryDeps(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library shared/static props",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"both.cpp":       "",
-			"sharedonly.cpp": "",
-			"staticonly.cpp": "",
-		},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "a",
-    srcs: ["both.cpp"],
-    cflags: ["bothflag"],
-    shared_libs: ["implementation_shared_dep_for_both", "shared_dep_for_both"],
-    export_shared_lib_headers: ["shared_dep_for_both"],
-    static_libs: ["implementation_static_dep_for_both", "static_dep_for_both"],
-    export_static_lib_headers: ["static_dep_for_both", "whole_static_dep_for_both"],
-    whole_static_libs: ["not_explicitly_exported_whole_static_dep_for_both", "whole_static_dep_for_both"],
-    static: {
-        srcs: ["staticonly.cpp"],
-        cflags: ["staticflag"],
-        shared_libs: ["implementation_shared_dep_for_static", "shared_dep_for_static"],
-        export_shared_lib_headers: ["shared_dep_for_static"],
-        static_libs: ["implementation_static_dep_for_static", "static_dep_for_static"],
-        export_static_lib_headers: ["static_dep_for_static", "whole_static_dep_for_static"],
-        whole_static_libs: ["not_explicitly_exported_whole_static_dep_for_static", "whole_static_dep_for_static"],
-    },
-    shared: {
-        srcs: ["sharedonly.cpp"],
-        cflags: ["sharedflag"],
-        shared_libs: ["implementation_shared_dep_for_shared", "shared_dep_for_shared"],
-        export_shared_lib_headers: ["shared_dep_for_shared"],
-        static_libs: ["implementation_static_dep_for_shared", "static_dep_for_shared"],
-        export_static_lib_headers: ["static_dep_for_shared", "whole_static_dep_for_shared"],
-        whole_static_libs: ["not_explicitly_exported_whole_static_dep_for_shared", "whole_static_dep_for_shared"],
-    },
-    include_build_directory: false,
-}
-` + simpleModule("cc_library_static", "static_dep_for_shared") +
-			simpleModule("cc_library_static", "implementation_static_dep_for_shared") +
-			simpleModule("cc_library_static", "static_dep_for_static") +
-			simpleModule("cc_library_static", "implementation_static_dep_for_static") +
-			simpleModule("cc_library_static", "static_dep_for_both") +
-			simpleModule("cc_library_static", "implementation_static_dep_for_both") +
-			simpleModule("cc_library_static", "whole_static_dep_for_shared") +
-			simpleModule("cc_library_static", "not_explicitly_exported_whole_static_dep_for_shared") +
-			simpleModule("cc_library_static", "whole_static_dep_for_static") +
-			simpleModule("cc_library_static", "not_explicitly_exported_whole_static_dep_for_static") +
-			simpleModule("cc_library_static", "whole_static_dep_for_both") +
-			simpleModule("cc_library_static", "not_explicitly_exported_whole_static_dep_for_both") +
-			simpleModule("cc_library", "shared_dep_for_shared") +
-			simpleModule("cc_library", "implementation_shared_dep_for_shared") +
-			simpleModule("cc_library", "shared_dep_for_static") +
-			simpleModule("cc_library", "implementation_shared_dep_for_static") +
-			simpleModule("cc_library", "shared_dep_for_both") +
-			simpleModule("cc_library", "implementation_shared_dep_for_both"),
-		StubbedBuildDefinitions: []string{"static_dep_for_shared", "implementation_static_dep_for_shared",
-			"static_dep_for_static", "implementation_static_dep_for_static", "static_dep_for_both",
-			"implementation_static_dep_for_both", "whole_static_dep_for_shared",
-			"not_explicitly_exported_whole_static_dep_for_shared", "whole_static_dep_for_static",
-			"not_explicitly_exported_whole_static_dep_for_static", "whole_static_dep_for_both",
-			"not_explicitly_exported_whole_static_dep_for_both", "shared_dep_for_shared",
-			"implementation_shared_dep_for_shared", "shared_dep_for_static",
-			"implementation_shared_dep_for_static", "shared_dep_for_both",
-			"implementation_shared_dep_for_both",
-		},
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
-				"copts": `[
-        "bothflag",
-        "staticflag",
-    ]`,
-				"deps": `[
-        ":static_dep_for_both",
-        ":static_dep_for_static",
-    ]`,
-				"dynamic_deps": `[
-        ":shared_dep_for_both",
-        ":shared_dep_for_static",
-    ]`,
-				"implementation_deps": `[
-        ":implementation_static_dep_for_both",
-        ":implementation_static_dep_for_static",
-    ]`,
-				"implementation_dynamic_deps": `[
-        ":implementation_shared_dep_for_both",
-        ":implementation_shared_dep_for_static",
-    ]`,
-				"srcs": `[
-        "both.cpp",
-        "staticonly.cpp",
-    ]`,
-				"whole_archive_deps": `[
-        ":not_explicitly_exported_whole_static_dep_for_both",
-        ":whole_static_dep_for_both",
-        ":not_explicitly_exported_whole_static_dep_for_static",
-        ":whole_static_dep_for_static",
-    ]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
-				"copts": `[
-        "bothflag",
-        "sharedflag",
-    ]`,
-				"deps": `[
-        ":static_dep_for_both",
-        ":static_dep_for_shared",
-    ]`,
-				"dynamic_deps": `[
-        ":shared_dep_for_both",
-        ":shared_dep_for_shared",
-    ]`,
-				"implementation_deps": `[
-        ":implementation_static_dep_for_both",
-        ":implementation_static_dep_for_shared",
-    ]`,
-				"implementation_dynamic_deps": `[
-        ":implementation_shared_dep_for_both",
-        ":implementation_shared_dep_for_shared",
-    ]`,
-				"srcs": `[
-        "both.cpp",
-        "sharedonly.cpp",
-    ]`,
-				"whole_archive_deps": `[
-        ":not_explicitly_exported_whole_static_dep_for_both",
-        ":whole_static_dep_for_both",
-        ":not_explicitly_exported_whole_static_dep_for_shared",
-        ":whole_static_dep_for_shared",
-    ]`,
-			})},
-	},
-	)
-}
-
-func TestCcLibraryWholeStaticLibsAlwaysLink(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Dir:                        "foo/bar",
-		StubbedBuildDefinitions: []string{"//foo/bar:whole_static_lib_for_shared", "//foo/bar:whole_static_lib_for_static",
-			"//foo/bar:whole_static_lib_for_both"},
-		Filesystem: map[string]string{
-			"foo/bar/Android.bp": `
-cc_library {
-    name: "a",
-    whole_static_libs: ["whole_static_lib_for_both"],
-    static: {
-        whole_static_libs: ["whole_static_lib_for_static"],
-    },
-    shared: {
-        whole_static_libs: ["whole_static_lib_for_shared"],
-    },
-    bazel_module: { bp2build_available: true },
-    include_build_directory: false,
-}
-
-cc_prebuilt_library_static { name: "whole_static_lib_for_shared" }
-
-cc_prebuilt_library_static { name: "whole_static_lib_for_static" }
-
-cc_prebuilt_library_static { name: "whole_static_lib_for_both" }
-`,
-		},
-		Blueprint: soongCcLibraryPreamble,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
-				"whole_archive_deps": `[
-        ":whole_static_lib_for_both_alwayslink",
-        ":whole_static_lib_for_static_alwayslink",
-    ]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
-				"whole_archive_deps": `[
-        ":whole_static_lib_for_both_alwayslink",
-        ":whole_static_lib_for_shared_alwayslink",
-    ]`,
-			}),
-		},
-	},
-	)
-}
-
-func TestCcLibrarySharedStaticPropsInArch(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library shared/static props in arch",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Dir:                        "foo/bar",
-		Filesystem: map[string]string{
-			"foo/bar/arm.cpp":        "",
-			"foo/bar/x86.cpp":        "",
-			"foo/bar/sharedonly.cpp": "",
-			"foo/bar/staticonly.cpp": "",
-			"foo/bar/Android.bp": `
-cc_library {
-    name: "a",
-    arch: {
-        arm: {
-            shared: {
-                srcs: ["arm_shared.cpp"],
-                cflags: ["-DARM_SHARED"],
-                static_libs: ["arm_static_dep_for_shared"],
-                whole_static_libs: ["arm_whole_static_dep_for_shared"],
-                shared_libs: ["arm_shared_dep_for_shared"],
-            },
-        },
-        x86: {
-            static: {
-                srcs: ["x86_static.cpp"],
-                cflags: ["-DX86_STATIC"],
-                static_libs: ["x86_dep_for_static"],
-            },
-        },
-    },
-    target: {
-        android: {
-            shared: {
-                srcs: ["android_shared.cpp"],
-                cflags: ["-DANDROID_SHARED"],
-                static_libs: ["android_dep_for_shared"],
-            },
-        },
-        android_arm: {
-            shared: {
-                cflags: ["-DANDROID_ARM_SHARED"],
-            },
-        },
-    },
-    srcs: ["both.cpp"],
-    cflags: ["bothflag"],
-    static_libs: ["static_dep_for_both"],
-    static: {
-        srcs: ["staticonly.cpp"],
-        cflags: ["staticflag"],
-        static_libs: ["static_dep_for_static"],
-    },
-    shared: {
-        srcs: ["sharedonly.cpp"],
-        cflags: ["sharedflag"],
-        static_libs: ["static_dep_for_shared"],
-    },
-    bazel_module: { bp2build_available: true },
-}
-
-cc_library_static { name: "static_dep_for_shared" }
-cc_library_static { name: "static_dep_for_static" }
-cc_library_static { name: "static_dep_for_both" }
-
-cc_library_static { name: "arm_static_dep_for_shared" }
-cc_library_static { name: "arm_whole_static_dep_for_shared" }
-cc_library_static { name: "arm_shared_dep_for_shared" }
-
-cc_library_static { name: "x86_dep_for_static" }
-
-cc_library_static { name: "android_dep_for_shared" }
-`,
-		},
-		StubbedBuildDefinitions: []string{"//foo/bar:static_dep_for_shared", "//foo/bar:static_dep_for_static",
-			"//foo/bar:static_dep_for_both", "//foo/bar:arm_static_dep_for_shared", "//foo/bar:arm_whole_static_dep_for_shared",
-			"//foo/bar:arm_shared_dep_for_shared", "//foo/bar:x86_dep_for_static", "//foo/bar:android_dep_for_shared",
-		},
-		Blueprint: soongCcLibraryPreamble,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
-				"copts": `[
-        "bothflag",
-        "staticflag",
-    ] + select({
-        "//build/bazel_common_rules/platforms/arch:x86": ["-DX86_STATIC"],
-        "//conditions:default": [],
-    })`,
-				"implementation_deps": `[
-        ":static_dep_for_both",
-        ":static_dep_for_static",
-    ] + select({
-        "//build/bazel_common_rules/platforms/arch:x86": [":x86_dep_for_static"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-				"srcs": `[
-        "both.cpp",
-        "staticonly.cpp",
-    ] + select({
-        "//build/bazel_common_rules/platforms/arch:x86": ["x86_static.cpp"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
-				"copts": `[
-        "bothflag",
-        "sharedflag",
-    ] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["-DARM_SHARED"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel_common_rules/platforms/os:android": ["-DANDROID_SHARED"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm": ["-DANDROID_ARM_SHARED"],
-        "//conditions:default": [],
-    })`,
-				"implementation_deps": `[
-        ":static_dep_for_both",
-        ":static_dep_for_shared",
-    ] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": [":arm_static_dep_for_shared"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel_common_rules/platforms/os:android": [":android_dep_for_shared"],
-        "//conditions:default": [],
-    })`,
-				"implementation_dynamic_deps": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": [":arm_shared_dep_for_shared"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-				"srcs": `[
-        "both.cpp",
-        "sharedonly.cpp",
-    ] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["arm_shared.cpp"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel_common_rules/platforms/os:android": ["android_shared.cpp"],
-        "//conditions:default": [],
-    })`,
-				"whole_archive_deps": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": [":arm_whole_static_dep_for_shared"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	},
-	)
-}
-
-func TestCcLibrarySharedStaticPropsWithMixedSources(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library shared/static props with c/cpp/s mixed sources",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Dir:                        "foo/bar",
-		StubbedBuildDefinitions:    []string{"//foo/bar:shared_filegroup", "//foo/bar:static_filegroup", "//foo/bar:both_filegroup"},
-		Filesystem: map[string]string{
-			"foo/bar/both_source.cpp":   "",
-			"foo/bar/both_source.cc":    "",
-			"foo/bar/both_source.c":     "",
-			"foo/bar/both_source.s":     "",
-			"foo/bar/both_source.S":     "",
-			"foo/bar/shared_source.cpp": "",
-			"foo/bar/shared_source.cc":  "",
-			"foo/bar/shared_source.c":   "",
-			"foo/bar/shared_source.s":   "",
-			"foo/bar/shared_source.S":   "",
-			"foo/bar/static_source.cpp": "",
-			"foo/bar/static_source.cc":  "",
-			"foo/bar/static_source.c":   "",
-			"foo/bar/static_source.s":   "",
-			"foo/bar/static_source.S":   "",
-			"foo/bar/Android.bp": `
-cc_library {
-    name: "a",
-    srcs: [
-    "both_source.cpp",
-    "both_source.cc",
-    "both_source.c",
-    "both_source.s",
-    "both_source.S",
-    ":both_filegroup",
-  ],
-    static: {
-        srcs: [
-          "static_source.cpp",
-          "static_source.cc",
-          "static_source.c",
-          "static_source.s",
-          "static_source.S",
-          ":static_filegroup",
-        ],
-    },
-    shared: {
-        srcs: [
-          "shared_source.cpp",
-          "shared_source.cc",
-          "shared_source.c",
-          "shared_source.s",
-          "shared_source.S",
-          ":shared_filegroup",
-        ],
-    },
-    bazel_module: { bp2build_available: true },
-}
-
-filegroup {
-    name: "both_filegroup",
-    srcs: [
-        // Not relevant, handled by filegroup macro
-  ],
-}
-
-filegroup {
-    name: "shared_filegroup",
-    srcs: [
-        // Not relevant, handled by filegroup macro
-  ],
-}
-
-filegroup {
-    name: "static_filegroup",
-    srcs: [
-        // Not relevant, handled by filegroup macro
-  ],
-}
-`,
-		},
-		Blueprint: soongCcLibraryPreamble,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
-				"local_includes": `["."]`,
-				"srcs": `[
-        "both_source.cpp",
-        "both_source.cc",
-        ":both_filegroup_cpp_srcs",
-        "static_source.cpp",
-        "static_source.cc",
-        ":static_filegroup_cpp_srcs",
-    ]`,
-				"srcs_as": `[
-        "both_source.s",
-        "both_source.S",
-        ":both_filegroup_as_srcs",
-        "static_source.s",
-        "static_source.S",
-        ":static_filegroup_as_srcs",
-    ]`,
-				"srcs_c": `[
-        "both_source.c",
-        ":both_filegroup_c_srcs",
-        "static_source.c",
-        ":static_filegroup_c_srcs",
-    ]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
-				"local_includes": `["."]`,
-				"srcs": `[
-        "both_source.cpp",
-        "both_source.cc",
-        ":both_filegroup_cpp_srcs",
-        "shared_source.cpp",
-        "shared_source.cc",
-        ":shared_filegroup_cpp_srcs",
-    ]`,
-				"srcs_as": `[
-        "both_source.s",
-        "both_source.S",
-        ":both_filegroup_as_srcs",
-        "shared_source.s",
-        "shared_source.S",
-        ":shared_filegroup_as_srcs",
-    ]`,
-				"srcs_c": `[
-        "both_source.c",
-        ":both_filegroup_c_srcs",
-        "shared_source.c",
-        ":shared_filegroup_c_srcs",
-    ]`,
-			})}})
-}
-
-func TestCcLibraryNonConfiguredVersionScriptAndDynamicList(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library non-configured version script and dynamic list",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Dir:                        "foo/bar",
-		Filesystem: map[string]string{
-			"foo/bar/Android.bp": `
-cc_library {
-    name: "a",
-    srcs: ["a.cpp"],
-    version_script: "v.map",
-    dynamic_list: "dynamic.list",
-    bazel_module: { bp2build_available: true },
-    include_build_directory: false,
-}
-`,
-		},
-		Blueprint: soongCcLibraryPreamble,
-		ExpectedBazelTargets: makeCcLibraryTargets("a", AttrNameToString{
-			"additional_linker_inputs": `[
-        "v.map",
-        "dynamic.list",
-    ]`,
-			"linkopts": `[
-        "-Wl,--version-script,$(location v.map)",
-        "-Wl,--dynamic-list,$(location dynamic.list)",
-    ]`,
-			"srcs":     `["a.cpp"]`,
-			"features": `["android_cfi_exports_map"]`,
-		}),
-	},
-	)
-}
-
-func TestCcLibraryConfiguredVersionScriptAndDynamicList(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library configured version script and dynamic list",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Dir:                        "foo/bar",
-		Filesystem: map[string]string{
-			"foo/bar/Android.bp": `
-cc_library {
-   name: "a",
-   srcs: ["a.cpp"],
-   arch: {
-     arm: {
-       version_script: "arm.map",
-       dynamic_list: "dynamic_arm.list",
-     },
-     arm64: {
-       version_script: "arm64.map",
-       dynamic_list: "dynamic_arm64.list",
-     },
-   },
-
-   bazel_module: { bp2build_available: true },
-    include_build_directory: false,
-}
-    `,
-		},
-		Blueprint: soongCcLibraryPreamble,
-		ExpectedBazelTargets: makeCcLibraryTargets("a", AttrNameToString{
-			"additional_linker_inputs": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": [
-            "arm.map",
-            "dynamic_arm.list",
-        ],
-        "//build/bazel_common_rules/platforms/arch:arm64": [
-            "arm64.map",
-            "dynamic_arm64.list",
-        ],
-        "//conditions:default": [],
-    })`,
-			"linkopts": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": [
-            "-Wl,--version-script,$(location arm.map)",
-            "-Wl,--dynamic-list,$(location dynamic_arm.list)",
-        ],
-        "//build/bazel_common_rules/platforms/arch:arm64": [
-            "-Wl,--version-script,$(location arm64.map)",
-            "-Wl,--dynamic-list,$(location dynamic_arm64.list)",
-        ],
-        "//conditions:default": [],
-    })`,
-			"srcs": `["a.cpp"]`,
-			"features": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["android_cfi_exports_map"],
-        "//build/bazel_common_rules/platforms/arch:arm64": ["android_cfi_exports_map"],
-        "//conditions:default": [],
-    })`,
-		}),
-	},
-	)
-}
-
-func TestCcLibraryLdflagsSplitBySpaceExceptSoongAdded(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "ldflags are split by spaces except for the ones added by soong (version script and dynamic list)",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"version_script": "",
-			"dynamic.list":   "",
-		},
-		Blueprint: `
-cc_library {
-    name: "foo",
-    ldflags: [
-        "--nospace_flag",
-        "-z spaceflag",
-    ],
-    version_script: "version_script",
-    dynamic_list: "dynamic.list",
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"features": `["android_cfi_exports_map"]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"additional_linker_inputs": `[
-        "version_script",
-        "dynamic.list",
-    ]`,
-				"features": `["android_cfi_exports_map"]`,
-				"linkopts": `[
-        "--nospace_flag",
-        "-z",
-        "spaceflag",
-        "-Wl,--version-script,$(location version_script)",
-        "-Wl,--dynamic-list,$(location dynamic.list)",
-    ]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedLibs(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library shared_libs",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		StubbedBuildDefinitions:    []string{"mylib"},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "mylib",
-}
-
-cc_library {
-    name: "a",
-    shared_libs: ["mylib",],
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("a", AttrNameToString{
-			"implementation_dynamic_deps": `[":mylib"]`,
-		}),
-	},
-	)
-}
-
-func TestCcLibraryFeatures(t *testing.T) {
-	expected_targets := []string{}
-	expected_targets = append(expected_targets, makeCcLibraryTargets("a", AttrNameToString{
-		"features": `[
-        "disable_pack_relocations",
-        "-no_undefined_symbols",
-    ]`,
-		"native_coverage": `False`,
-		"srcs":            `["a.cpp"]`,
-	})...)
-	expected_targets = append(expected_targets, makeCcLibraryTargets("b", AttrNameToString{
-		"features": `select({
-        "//build/bazel_common_rules/platforms/arch:x86_64": [
-            "disable_pack_relocations",
-            "-no_undefined_symbols",
-        ],
-        "//conditions:default": [],
-    })`,
-		"native_coverage": `False`,
-		"srcs":            `["b.cpp"]`,
-	})...)
-	expected_targets = append(expected_targets, makeCcLibraryTargets("c", AttrNameToString{
-		"features": `select({
-        "//build/bazel_common_rules/platforms/os:darwin": [
-            "disable_pack_relocations",
-            "-no_undefined_symbols",
-        ],
-        "//conditions:default": [],
-    })`,
-		"srcs": `["c.cpp"]`,
-	})...)
-
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library pack_relocations test",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "a",
-    srcs: ["a.cpp"],
-    pack_relocations: false,
-    allow_undefined_symbols: true,
-    include_build_directory: false,
-    native_coverage: false,
-}
-
-cc_library {
-    name: "b",
-    srcs: ["b.cpp"],
-    arch: {
-        x86_64: {
-            pack_relocations: false,
-            allow_undefined_symbols: true,
-        },
-    },
-    include_build_directory: false,
-    native_coverage: false,
-}
-
-cc_library {
-    name: "c",
-    srcs: ["c.cpp"],
-    target: {
-        darwin: {
-            pack_relocations: false,
-            allow_undefined_symbols: true,
-        },
-    },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: expected_targets,
-	})
-}
-
-func TestCcLibrarySpacesInCopts(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library spaces in copts",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "a",
-    cflags: ["-include header.h",],
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("a", AttrNameToString{
-			"copts": `[
-        "-include",
-        "header.h",
-    ]`,
-		}),
-	},
-	)
-}
-
-func TestCcLibraryCppFlagsGoesIntoCopts(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library cppflags usage",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcLibraryPreamble + `cc_library {
-    name: "a",
-    srcs: ["a.cpp"],
-    cflags: ["-Wall"],
-    cppflags: [
-        "-fsigned-char",
-        "-pedantic",
-    ],
-    arch: {
-        arm64: {
-            cppflags: ["-DARM64=1"],
-        },
-    },
-    target: {
-        android: {
-            cppflags: ["-DANDROID=1"],
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("a", AttrNameToString{
-			"copts": `["-Wall"]`,
-			"cppflags": `[
-        "-fsigned-char",
-        "-pedantic",
-    ] + select({
-        "//build/bazel_common_rules/platforms/arch:arm64": ["-DARM64=1"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel_common_rules/platforms/os:android": ["-DANDROID=1"],
-        "//conditions:default": [],
-    })`,
-			"srcs": `["a.cpp"]`,
-		}),
-	},
-	)
-}
-
-func TestCcLibraryExcludeLibs(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem:                 map[string]string{},
-		StubbedBuildDefinitions: []string{"arm_whole_static_lib_excludes", "malloc_not_svelte_whole_static_lib",
-			"arm_static_lib_excludes", "malloc_not_svelte_whole_static_lib_excludes", "arm_shared_lib_excludes",
-			"malloc_not_svelte_static_lib_excludes", "arm_shared_lib_excludes", "malloc_not_svelte_shared_lib",
-		},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library {
-    name: "foo_static",
-    srcs: ["common.c"],
-    whole_static_libs: [
-        "arm_whole_static_lib_excludes",
-        "malloc_not_svelte_whole_static_lib_excludes"
-    ],
-    static_libs: [
-        "arm_static_lib_excludes",
-        "malloc_not_svelte_static_lib_excludes"
-    ],
-    shared_libs: [
-        "arm_shared_lib_excludes",
-    ],
-    arch: {
-        arm: {
-            exclude_shared_libs: [
-                 "arm_shared_lib_excludes",
-            ],
-            exclude_static_libs: [
-                "arm_static_lib_excludes",
-                "arm_whole_static_lib_excludes",
-            ],
-        },
-    },
-    product_variables: {
-        malloc_not_svelte: {
-            shared_libs: ["malloc_not_svelte_shared_lib"],
-            whole_static_libs: ["malloc_not_svelte_whole_static_lib"],
-            exclude_static_libs: [
-                "malloc_not_svelte_static_lib_excludes",
-                "malloc_not_svelte_whole_static_lib_excludes",
-            ],
-        },
-    },
-    include_build_directory: false,
-}
-
-cc_library {
-    name: "arm_whole_static_lib_excludes",
-}
-
-cc_library {
-    name: "malloc_not_svelte_whole_static_lib",
-}
-
-cc_library {
-    name: "malloc_not_svelte_whole_static_lib_excludes",
-}
-
-cc_library {
-    name: "arm_static_lib_excludes",
-}
-
-cc_library {
-    name: "malloc_not_svelte_static_lib_excludes",
-}
-
-cc_library {
-    name: "arm_shared_lib_excludes",
-}
-
-cc_library {
-    name: "malloc_not_svelte_shared_lib",
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("foo_static", AttrNameToString{
-			"implementation_deps": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": [],
-        "//conditions:default": [":arm_static_lib_excludes_bp2build_cc_library_static"],
-    }) + select({
-        "//build/bazel/product_config/config_settings:malloc_not_svelte": [],
-        "//conditions:default": [":malloc_not_svelte_static_lib_excludes_bp2build_cc_library_static"],
-    })`,
-			"implementation_dynamic_deps": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": [],
-        "//conditions:default": [":arm_shared_lib_excludes"],
-    }) + select({
-        "//build/bazel/product_config/config_settings:malloc_not_svelte": [":malloc_not_svelte_shared_lib"],
-        "//conditions:default": [],
-    })`,
-			"srcs_c": `["common.c"]`,
-			"whole_archive_deps": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": [],
-        "//conditions:default": [":arm_whole_static_lib_excludes_bp2build_cc_library_static"],
-    }) + select({
-        "//build/bazel/product_config/config_settings:malloc_not_svelte": [":malloc_not_svelte_whole_static_lib_bp2build_cc_library_static"],
-        "//conditions:default": [":malloc_not_svelte_whole_static_lib_excludes_bp2build_cc_library_static"],
-    })`,
-		}),
-	},
-	)
-}
-
-func TestCcLibraryProductVariablesHeaderLibs(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem:                 map[string]string{},
-		StubbedBuildDefinitions:    []string{"malloc_not_svelte_header_lib"},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library {
-    name: "foo_static",
-    srcs: ["common.c"],
-    product_variables: {
-        malloc_not_svelte: {
-            header_libs: ["malloc_not_svelte_header_lib"],
-        },
-    },
-    include_build_directory: false,
-}
-
-cc_library {
-    name: "malloc_not_svelte_header_lib",
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("foo_static", AttrNameToString{
-			"implementation_deps": `select({
-        "//build/bazel/product_config/config_settings:malloc_not_svelte": [":malloc_not_svelte_header_lib"],
-        "//conditions:default": [],
-    })`,
-			"srcs_c":                 `["common.c"]`,
-			"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-		}),
-	},
-	)
-}
-
-func TestCCLibraryNoCrtTrue(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library - nocrt: true disables feature",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"impl.cpp": "",
-		},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "foo-lib",
-    srcs: ["impl.cpp"],
-    nocrt: true,
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
-			"features": `["-link_crt"]`,
-			"srcs":     `["impl.cpp"]`,
-		}),
-	},
-	)
-}
-
-func TestCCLibraryNoCrtFalse(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library - nocrt: false - does not emit attribute",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"impl.cpp": "",
-		},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "foo-lib",
-    srcs: ["impl.cpp"],
-    nocrt: false,
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
-			"srcs": `["impl.cpp"]`,
-		}),
-	})
-}
-
-func TestCCLibraryNoCrtArchVariant(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library - nocrt in select",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"impl.cpp": "",
-		},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "foo-lib",
-    srcs: ["impl.cpp"],
-    arch: {
-        arm: {
-            nocrt: true,
-        },
-        x86: {
-            nocrt: false,
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
-			"features": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["-link_crt"],
-        "//conditions:default": [],
-    })`,
-			"srcs": `["impl.cpp"]`,
-		}),
-	})
-}
-
-func TestCCLibraryNoLibCrtTrue(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"impl.cpp": "",
-		},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "foo-lib",
-    srcs: ["impl.cpp"],
-    no_libcrt: true,
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
-			"features": `["-use_libcrt"]`,
-			"srcs":     `["impl.cpp"]`,
-		}),
-	})
-}
-
-func makeCcLibraryTargets(name string, attrs AttrNameToString) []string {
-	STATIC_ONLY_ATTRS := map[string]bool{}
-	SHARED_ONLY_ATTRS := map[string]bool{
-		"link_crt":                 true,
-		"additional_linker_inputs": true,
-		"linkopts":                 true,
-		"strip":                    true,
-		"inject_bssl_hash":         true,
-		"stubs_symbol_file":        true,
-		"use_version_lib":          true,
-	}
-
-	sharedAttrs := AttrNameToString{}
-	staticAttrs := AttrNameToString{}
-	for key, val := range attrs {
-		if _, staticOnly := STATIC_ONLY_ATTRS[key]; !staticOnly {
-			sharedAttrs[key] = val
-		}
-		if _, sharedOnly := SHARED_ONLY_ATTRS[key]; !sharedOnly {
-			staticAttrs[key] = val
-		}
-	}
-	sharedTarget := MakeBazelTarget("cc_library_shared", name, sharedAttrs)
-	staticTarget := MakeBazelTarget("cc_library_static", name+"_bp2build_cc_library_static", staticAttrs)
-
-	return []string{staticTarget, sharedTarget}
-}
-
-func TestCCLibraryNoLibCrtFalse(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"impl.cpp": "",
-		},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "foo-lib",
-    srcs: ["impl.cpp"],
-    no_libcrt: false,
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
-			"srcs": `["impl.cpp"]`,
-		}),
-	})
-}
-
-func TestCCLibraryNoLibCrtArchVariant(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"impl.cpp": "",
-		},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "foo-lib",
-    srcs: ["impl.cpp"],
-    arch: {
-        arm: {
-            no_libcrt: true,
-        },
-        x86: {
-            no_libcrt: true,
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
-			"srcs": `["impl.cpp"]`,
-			"features": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["-use_libcrt"],
-        "//build/bazel_common_rules/platforms/arch:x86": ["-use_libcrt"],
-        "//conditions:default": [],
-    })`,
-		}),
-	})
-}
-
-func TestCCLibraryNoLibCrtArchAndTargetVariant(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"impl.cpp": "",
-		},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "foo-lib",
-    srcs: ["impl.cpp"],
-    arch: {
-        arm: {
-            no_libcrt: true,
-        },
-        x86: {
-            no_libcrt: true,
-        },
-    },
-    target: {
-        darwin: {
-            no_libcrt: true,
-        }
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
-			"features": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["-use_libcrt"],
-        "//build/bazel_common_rules/platforms/arch:x86": ["-use_libcrt"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel_common_rules/platforms/os:darwin": ["-use_libcrt"],
-        "//conditions:default": [],
-    })`,
-			"srcs": `["impl.cpp"]`,
-		}),
-	})
-}
-
-func TestCCLibraryNoLibCrtArchAndTargetVariantConflict(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"impl.cpp": "",
-		},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "foo-lib",
-    srcs: ["impl.cpp"],
-    arch: {
-        arm: {
-            no_libcrt: true,
-        },
-        // This is expected to override the value for darwin_x86_64.
-        x86_64: {
-            no_libcrt: true,
-        },
-    },
-    target: {
-        darwin: {
-            no_libcrt: false,
-        }
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
-			"srcs": `["impl.cpp"]`,
-			"features": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["-use_libcrt"],
-        "//build/bazel_common_rules/platforms/arch:x86_64": ["-use_libcrt"],
-        "//conditions:default": [],
-    })`,
-		}),
-	})
-}
-
-func TestCcLibraryStrip(t *testing.T) {
-	expectedTargets := []string{}
-	expectedTargets = append(expectedTargets, makeCcLibraryTargets("all", AttrNameToString{
-		"strip": `{
-        "all": True,
-    }`,
-	})...)
-	expectedTargets = append(expectedTargets, makeCcLibraryTargets("keep_symbols", AttrNameToString{
-		"strip": `{
-        "keep_symbols": True,
-    }`,
-	})...)
-	expectedTargets = append(expectedTargets, makeCcLibraryTargets("keep_symbols_and_debug_frame", AttrNameToString{
-		"strip": `{
-        "keep_symbols_and_debug_frame": True,
-    }`,
-	})...)
-	expectedTargets = append(expectedTargets, makeCcLibraryTargets("keep_symbols_list", AttrNameToString{
-		"strip": `{
-        "keep_symbols_list": ["symbol"],
-    }`,
-	})...)
-	expectedTargets = append(expectedTargets, makeCcLibraryTargets("none", AttrNameToString{
-		"strip": `{
-        "none": True,
-    }`,
-	})...)
-	expectedTargets = append(expectedTargets, makeCcLibraryTargets("nothing", AttrNameToString{})...)
-
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library strip args",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "nothing",
-    include_build_directory: false,
-}
-cc_library {
-    name: "keep_symbols",
-    strip: {
-        keep_symbols: true,
-    },
-    include_build_directory: false,
-}
-cc_library {
-    name: "keep_symbols_and_debug_frame",
-    strip: {
-        keep_symbols_and_debug_frame: true,
-    },
-    include_build_directory: false,
-}
-cc_library {
-    name: "none",
-    strip: {
-        none: true,
-    },
-    include_build_directory: false,
-}
-cc_library {
-    name: "keep_symbols_list",
-    strip: {
-        keep_symbols_list: ["symbol"],
-    },
-    include_build_directory: false,
-}
-cc_library {
-    name: "all",
-    strip: {
-        all: true,
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: expectedTargets,
-	})
-}
-
-func TestCcLibraryStripWithArch(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library strip args",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "multi-arch",
-    target: {
-        darwin: {
-            strip: {
-                keep_symbols_list: ["foo", "bar"]
-            }
-        },
-    },
-    arch: {
-        arm: {
-            strip: {
-                keep_symbols_and_debug_frame: true,
-            },
-        },
-        arm64: {
-            strip: {
-                keep_symbols: true,
-            },
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("multi-arch", AttrNameToString{
-			"strip": `{
-        "keep_symbols": select({
-            "//build/bazel_common_rules/platforms/arch:arm64": True,
-            "//conditions:default": None,
-        }),
-        "keep_symbols_and_debug_frame": select({
-            "//build/bazel_common_rules/platforms/arch:arm": True,
-            "//conditions:default": None,
-        }),
-        "keep_symbols_list": select({
-            "//build/bazel_common_rules/platforms/os:darwin": [
-                "foo",
-                "bar",
-            ],
-            "//conditions:default": [],
-        }),
-    }`,
-		}),
-	},
-	)
-}
-
-func TestCcLibrary_SystemSharedLibsRootEmpty(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library system_shared_libs empty at root",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "root_empty",
-    system_shared_libs: [],
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("root_empty", AttrNameToString{
-			"system_dynamic_deps": `[]`,
-		}),
-	},
-	)
-}
-
-func TestCcLibrary_SystemSharedLibsStaticEmpty(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library system_shared_libs empty for static variant",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "static_empty",
-    static: {
-        system_shared_libs: [],
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "static_empty_bp2build_cc_library_static", AttrNameToString{
-				"system_dynamic_deps": "[]",
-			}),
-			MakeBazelTarget("cc_library_shared", "static_empty", AttrNameToString{}),
-		},
-	})
-}
-
-func TestCcLibrary_SystemSharedLibsSharedEmpty(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library system_shared_libs empty for shared variant",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "shared_empty",
-    shared: {
-        system_shared_libs: [],
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "shared_empty_bp2build_cc_library_static", AttrNameToString{}),
-			MakeBazelTarget("cc_library_shared", "shared_empty", AttrNameToString{
-				"system_dynamic_deps": "[]",
-			}),
-		},
-	})
-}
-
-func TestCcLibrary_SystemSharedLibsSharedBionicEmpty(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library system_shared_libs empty for shared, bionic variant",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "shared_empty",
-    target: {
-        bionic: {
-            shared: {
-                system_shared_libs: [],
-            }
-        }
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "shared_empty_bp2build_cc_library_static", AttrNameToString{}),
-			MakeBazelTarget("cc_library_shared", "shared_empty", AttrNameToString{
-				"system_dynamic_deps": "[]",
-			}),
-		},
-	})
-}
-
-func TestCcLibrary_SystemSharedLibsLinuxBionicEmpty(t *testing.T) {
-	// Note that this behavior is technically incorrect (it's a simplification).
-	// The correct behavior would be if bp2build wrote `system_dynamic_deps = []`
-	// only for linux_bionic, but `android` had `["libc", "libdl", "libm"].
-	// b/195791252 tracks the fix.
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library system_shared_libs empty for linux_bionic variant",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		StubbedBuildDefinitions:    []string{"libc_musl"},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-	name: "libc_musl",
-}
-
-cc_library {
-    name: "target_linux_bionic_empty",
-    target: {
-        linux_bionic: {
-            system_shared_libs: [],
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("target_linux_bionic_empty", AttrNameToString{
-			"system_dynamic_deps": `select({
-        "//build/bazel_common_rules/platforms/os:linux_musl": [":libc_musl"],
-        "//conditions:default": [],
-    })`,
-		}),
-	},
-	)
-}
-
-func TestCcLibrary_SystemSharedLibsBionicEmpty(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library system_shared_libs empty for bionic variant",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		StubbedBuildDefinitions:    []string{"libc_musl"},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-	name: "libc_musl",
-}
-
-cc_library {
-    name: "target_bionic_empty",
-    target: {
-        bionic: {
-            system_shared_libs: [],
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("target_bionic_empty", AttrNameToString{
-			"system_dynamic_deps": `select({
-        "//build/bazel_common_rules/platforms/os:linux_musl": [":libc_musl"],
-        "//conditions:default": [],
-    })`,
-		}),
-	},
-	)
-}
-
-func TestCcLibrary_SystemSharedLibsMuslEmpty(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library system_shared_lib empty for musl variant",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		StubbedBuildDefinitions:    []string{"libc_musl"},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-		name: "libc_musl",
-}
-
-cc_library {
-    name: "target_musl_empty",
-    target: {
-        musl: {
-            system_shared_libs: [],
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("target_musl_empty", AttrNameToString{
-			"system_dynamic_deps": `[]`,
-		}),
-	})
-}
-
-func TestCcLibrary_SystemSharedLibsLinuxMuslEmpty(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library system_shared_lib empty for linux_musl variant",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		StubbedBuildDefinitions:    []string{"libc_musl"},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-		name: "libc_musl",
-}
-
-cc_library {
-    name: "target_linux_musl_empty",
-    target: {
-        linux_musl: {
-            system_shared_libs: [],
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("target_linux_musl_empty", AttrNameToString{
-			"system_dynamic_deps": `[]`,
-		}),
-	})
-}
-func TestCcLibrary_SystemSharedLibsSharedAndRoot(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library system_shared_libs set for shared and root",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		StubbedBuildDefinitions:    []string{"libc", "libm"},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "libc",
-}
-cc_library {
-    name: "libm",
-}
-
-cc_library {
-    name: "foo",
-    system_shared_libs: ["libc"],
-    shared: {
-        system_shared_libs: ["libm"],
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"system_dynamic_deps": `[":libc"]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"system_dynamic_deps": `[
-        ":libc",
-        ":libm",
-    ]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryOsSelects(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library - selects for all os targets",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem:                 map[string]string{},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "foo-lib",
-    srcs: ["base.cpp"],
-    target: {
-        android: {
-            srcs: ["android.cpp"],
-        },
-        linux: {
-            srcs: ["linux.cpp"],
-        },
-        linux_glibc: {
-            srcs: ["linux_glibc.cpp"],
-        },
-        darwin: {
-            srcs: ["darwin.cpp"],
-        },
-        bionic: {
-            srcs: ["bionic.cpp"],
-        },
-        linux_musl: {
-            srcs: ["linux_musl.cpp"],
-        },
-        windows: {
-            srcs: ["windows.cpp"],
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("foo-lib", AttrNameToString{
-			"srcs": `["base.cpp"] + select({
-        "//build/bazel_common_rules/platforms/os:android": [
-            "linux.cpp",
-            "bionic.cpp",
-            "android.cpp",
-        ],
-        "//build/bazel_common_rules/platforms/os:darwin": ["darwin.cpp"],
-        "//build/bazel_common_rules/platforms/os:linux_bionic": [
-            "linux.cpp",
-            "bionic.cpp",
-        ],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": [
-            "linux.cpp",
-            "linux_glibc.cpp",
-        ],
-        "//build/bazel_common_rules/platforms/os:linux_musl": [
-            "linux.cpp",
-            "linux_musl.cpp",
-        ],
-        "//build/bazel_common_rules/platforms/os:windows": ["windows.cpp"],
-        "//conditions:default": [],
-    })`,
-		}),
-	},
-	)
-}
-
-func TestLibcryptoHashInjection(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library - libcrypto hash injection",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem:                 map[string]string{},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "libcrypto",
-    target: {
-        android: {
-            inject_bssl_hash: true,
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("libcrypto", AttrNameToString{
-			"inject_bssl_hash": `select({
-        "//build/bazel_common_rules/platforms/os:android": True,
-        "//conditions:default": None,
-    })`,
-		}),
-	},
-	)
-}
-
-func TestCcLibraryCppStdWithGnuExtensions_ConvertsToFeatureAttr(t *testing.T) {
-	type testCase struct {
-		cpp_std        string
-		c_std          string
-		gnu_extensions string
-		bazel_cpp_std  string
-		bazel_c_std    string
-	}
-
-	testCases := []testCase{
-		// Existing usages of cpp_std in AOSP are:
-		// experimental, c++11, c++17, c++2a, c++98, gnu++11, gnu++17
-		//
-		// not set, only emit if gnu_extensions is disabled. the default (gnu+17
-		// is set in the toolchain.)
-		{cpp_std: "", gnu_extensions: "", bazel_cpp_std: ""},
-		{cpp_std: "", gnu_extensions: "false", bazel_cpp_std: "cpp_std_default_no_gnu", bazel_c_std: "c_std_default_no_gnu"},
-		{cpp_std: "", gnu_extensions: "true", bazel_cpp_std: ""},
-		// experimental defaults to gnu++2a
-		{cpp_std: "experimental", gnu_extensions: "", bazel_cpp_std: "cpp_std_experimental"},
-		{cpp_std: "experimental", gnu_extensions: "false", bazel_cpp_std: "cpp_std_experimental_no_gnu", bazel_c_std: "c_std_default_no_gnu"},
-		{cpp_std: "experimental", gnu_extensions: "true", bazel_cpp_std: "cpp_std_experimental"},
-		// Explicitly setting a c++ std does not use replace gnu++ std even if
-		// gnu_extensions is true.
-		// "c++11",
-		{cpp_std: "c++11", gnu_extensions: "", bazel_cpp_std: "c++11"},
-		{cpp_std: "c++11", gnu_extensions: "false", bazel_cpp_std: "c++11", bazel_c_std: "c_std_default_no_gnu"},
-		{cpp_std: "c++11", gnu_extensions: "true", bazel_cpp_std: "c++11"},
-		// "c++17",
-		{cpp_std: "c++17", gnu_extensions: "", bazel_cpp_std: "c++17"},
-		{cpp_std: "c++17", gnu_extensions: "false", bazel_cpp_std: "c++17", bazel_c_std: "c_std_default_no_gnu"},
-		{cpp_std: "c++17", gnu_extensions: "true", bazel_cpp_std: "c++17"},
-		// "c++2a",
-		{cpp_std: "c++2a", gnu_extensions: "", bazel_cpp_std: "c++2a"},
-		{cpp_std: "c++2a", gnu_extensions: "false", bazel_cpp_std: "c++2a", bazel_c_std: "c_std_default_no_gnu"},
-		{cpp_std: "c++2a", gnu_extensions: "true", bazel_cpp_std: "c++2a"},
-		// "c++98",
-		{cpp_std: "c++98", gnu_extensions: "", bazel_cpp_std: "c++98"},
-		{cpp_std: "c++98", gnu_extensions: "false", bazel_cpp_std: "c++98", bazel_c_std: "c_std_default_no_gnu"},
-		{cpp_std: "c++98", gnu_extensions: "true", bazel_cpp_std: "c++98"},
-		// gnu++ is replaced with c++ if gnu_extensions is explicitly false.
-		// "gnu++11",
-		{cpp_std: "gnu++11", gnu_extensions: "", bazel_cpp_std: "gnu++11"},
-		{cpp_std: "gnu++11", gnu_extensions: "false", bazel_cpp_std: "c++11", bazel_c_std: "c_std_default_no_gnu"},
-		{cpp_std: "gnu++11", gnu_extensions: "true", bazel_cpp_std: "gnu++11"},
-		// "gnu++17",
-		{cpp_std: "gnu++17", gnu_extensions: "", bazel_cpp_std: "gnu++17"},
-		{cpp_std: "gnu++17", gnu_extensions: "false", bazel_cpp_std: "c++17", bazel_c_std: "c_std_default_no_gnu"},
-		{cpp_std: "gnu++17", gnu_extensions: "true", bazel_cpp_std: "gnu++17"},
-
-		// some c_std test cases
-		{c_std: "experimental", gnu_extensions: "", bazel_c_std: "c_std_experimental"},
-		{c_std: "experimental", gnu_extensions: "false", bazel_cpp_std: "cpp_std_default_no_gnu", bazel_c_std: "c_std_experimental_no_gnu"},
-		{c_std: "experimental", gnu_extensions: "true", bazel_c_std: "c_std_experimental"},
-		{c_std: "gnu11", cpp_std: "gnu++17", gnu_extensions: "", bazel_cpp_std: "gnu++17", bazel_c_std: "gnu11"},
-		{c_std: "gnu11", cpp_std: "gnu++17", gnu_extensions: "false", bazel_cpp_std: "c++17", bazel_c_std: "c11"},
-		{c_std: "gnu11", cpp_std: "gnu++17", gnu_extensions: "true", bazel_cpp_std: "gnu++17", bazel_c_std: "gnu11"},
-	}
-	for i, tc := range testCases {
-		name := fmt.Sprintf("cpp std: %q, c std: %q, gnu_extensions: %q", tc.cpp_std, tc.c_std, tc.gnu_extensions)
-		t.Run(name, func(t *testing.T) {
-			name_prefix := fmt.Sprintf("a_%v", i)
-			cppStdProp := ""
-			if tc.cpp_std != "" {
-				cppStdProp = fmt.Sprintf("    cpp_std: \"%s\",", tc.cpp_std)
-			}
-			cStdProp := ""
-			if tc.c_std != "" {
-				cStdProp = fmt.Sprintf("    c_std: \"%s\",", tc.c_std)
-			}
-			gnuExtensionsProp := ""
-			if tc.gnu_extensions != "" {
-				gnuExtensionsProp = fmt.Sprintf("    gnu_extensions: %s,", tc.gnu_extensions)
-			}
-			attrs := AttrNameToString{}
-			if tc.bazel_cpp_std != "" {
-				attrs["cpp_std"] = fmt.Sprintf(`"%s"`, tc.bazel_cpp_std)
-			}
-			if tc.bazel_c_std != "" {
-				attrs["c_std"] = fmt.Sprintf(`"%s"`, tc.bazel_c_std)
-			}
-
-			runCcLibraryTestCase(t, Bp2buildTestCase{
-				Description: fmt.Sprintf(
-					"cc_library with cpp_std: %s and gnu_extensions: %s", tc.cpp_std, tc.gnu_extensions),
-				ModuleTypeUnderTest:        "cc_library",
-				ModuleTypeUnderTestFactory: cc.LibraryFactory,
-				Blueprint: soongCcLibraryPreamble + fmt.Sprintf(`
-cc_library {
-	name: "%s_full",
-%s // cpp_std: *string
-%s // c_std: *string
-%s // gnu_extensions: *bool
-	include_build_directory: false,
-}
-`, name_prefix, cppStdProp, cStdProp, gnuExtensionsProp),
-				ExpectedBazelTargets: makeCcLibraryTargets(name_prefix+"_full", attrs),
-			})
-
-			runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-				Description: fmt.Sprintf(
-					"cc_library_static with cpp_std: %s and gnu_extensions: %s", tc.cpp_std, tc.gnu_extensions),
-				ModuleTypeUnderTest:        "cc_library_static",
-				ModuleTypeUnderTestFactory: cc.LibraryStaticFactory,
-				Blueprint: soongCcLibraryPreamble + fmt.Sprintf(`
-cc_library_static {
-	name: "%s_static",
-%s // cpp_std: *string
-%s // c_std: *string
-%s // gnu_extensions: *bool
-	include_build_directory: false,
-}
-`, name_prefix, cppStdProp, cStdProp, gnuExtensionsProp),
-				ExpectedBazelTargets: []string{
-					MakeBazelTarget("cc_library_static", name_prefix+"_static", attrs),
-				},
-			})
-
-			runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-				Description: fmt.Sprintf(
-					"cc_library_shared with cpp_std: %s and gnu_extensions: %s", tc.cpp_std, tc.gnu_extensions),
-				ModuleTypeUnderTest:        "cc_library_shared",
-				ModuleTypeUnderTestFactory: cc.LibrarySharedFactory,
-				Blueprint: soongCcLibraryPreamble + fmt.Sprintf(`
-cc_library_shared {
-	name: "%s_shared",
-%s // cpp_std: *string
-%s // c_std: *string
-%s // gnu_extensions: *bool
-	include_build_directory: false,
-}
-`, name_prefix, cppStdProp, cStdProp, gnuExtensionsProp),
-				ExpectedBazelTargets: []string{
-					MakeBazelTarget("cc_library_shared", name_prefix+"_shared", attrs),
-				},
-			})
-		})
-	}
-}
-
-func TestCcLibraryProtoSimple(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcProtoPreamble + `cc_library {
-	name: "foo",
-	srcs: ["foo.proto"],
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-				"srcs": `["foo.proto"]`,
-			}), MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
-				"deps": `[":foo_proto"]`,
-			}), MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
-				"deps":                              `[":libprotobuf-cpp-lite"]`,
-			}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"dynamic_deps":                      `[":libprotobuf-cpp-lite"]`,
-				"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryProtoNoCanonicalPathFromRoot(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcProtoPreamble + `cc_library {
-	name: "foo",
-	srcs: ["foo.proto"],
-	proto: { canonical_path_from_root: false},
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-				"srcs":                `["foo.proto"]`,
-				"strip_import_prefix": `""`,
-			}), MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
-				"deps": `[":foo_proto"]`,
-			}), MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
-				"deps":                              `[":libprotobuf-cpp-lite"]`,
-			}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"dynamic_deps":                      `[":libprotobuf-cpp-lite"]`,
-				"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryProtoExplicitCanonicalPathFromRoot(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcProtoPreamble + `cc_library {
-	name: "foo",
-	srcs: ["foo.proto"],
-	proto: { canonical_path_from_root: true},
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-				"srcs": `["foo.proto"]`,
-			}), MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
-				"deps": `[":foo_proto"]`,
-			}), MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
-				"deps":                              `[":libprotobuf-cpp-lite"]`,
-			}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"dynamic_deps":                      `[":libprotobuf-cpp-lite"]`,
-				"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryProtoFull(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcProtoPreamble + `cc_library {
-	name: "foo",
-	srcs: ["foo.proto"],
-	proto: {
-		type: "full",
-	},
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-				"srcs": `["foo.proto"]`,
-			}), MakeBazelTarget("cc_proto_library", "foo_cc_proto", AttrNameToString{
-				"deps": `[":foo_proto"]`,
-			}), MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"implementation_whole_archive_deps": `[":foo_cc_proto"]`,
-				"deps":                              `[":libprotobuf-cpp-full"]`,
-			}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"dynamic_deps":                      `[":libprotobuf-cpp-full"]`,
-				"implementation_whole_archive_deps": `[":foo_cc_proto"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryProtoLite(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcProtoPreamble + `cc_library {
-	name: "foo",
-	srcs: ["foo.proto"],
-	proto: {
-		type: "lite",
-	},
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-				"srcs": `["foo.proto"]`,
-			}), MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
-				"deps": `[":foo_proto"]`,
-			}), MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
-				"deps":                              `[":libprotobuf-cpp-lite"]`,
-			}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"dynamic_deps":                      `[":libprotobuf-cpp-lite"]`,
-				"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryProtoExportHeaders(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcProtoPreamble + `cc_library {
-	name: "foo",
-	srcs: ["foo.proto"],
-	proto: {
-		export_proto_headers: true,
-	},
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-				"srcs": `["foo.proto"]`,
-			}), MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
-				"deps": `[":foo_proto"]`,
-			}), MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"deps":               `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":foo_cc_proto_lite"]`,
-			}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"dynamic_deps":       `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":foo_cc_proto_lite"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryProtoIncludeDirs(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcProtoPreamble + `cc_library {
-	name: "foo",
-	srcs: ["foo.proto"],
-	proto: {
-		include_dirs: ["external/protobuf/src"],
-	},
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-				"srcs": `["foo.proto"]`,
-				"deps": `["//external/protobuf:libprotobuf-proto"]`,
-			}), MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
-				"deps": `[":foo_proto"]`,
-			}), MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"deps":                              `[":libprotobuf-cpp-lite"]`,
-				"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
-			}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"dynamic_deps":                      `[":libprotobuf-cpp-lite"]`,
-				"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryProtoIncludeDirsUnknown(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcProtoPreamble + `cc_library {
-	name: "foo",
-	srcs: ["foo.proto"],
-	proto: {
-		include_dirs: ["external/protobuf/abc"],
-	},
-	include_build_directory: false,
-}`,
-		ExpectedErr: fmt.Errorf("module \"foo\": TODO: Add support for proto.include_dir: external/protobuf/abc. This directory does not contain an Android.bp file"),
-	})
-}
-
-func TestCcLibraryConvertedProtoFilegroups(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcProtoPreamble + `
-filegroup {
-	name: "a_fg_proto",
-	srcs: ["a_fg.proto"],
-}
-
-cc_library {
-	name: "a",
-	srcs: [
-    ":a_fg_proto",
-    "a.proto",
-  ],
-	proto: {
-		export_proto_headers: true,
-	},
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("proto_library", "a_proto", AttrNameToString{
-				"deps": `[":a_fg_proto_bp2build_converted"]`,
-				"srcs": `["a.proto"]`,
-			}), MakeBazelTarget("cc_lite_proto_library", "a_cc_proto_lite", AttrNameToString{
-				"deps": `[
-        ":a_fg_proto_bp2build_converted",
-        ":a_proto",
-    ]`,
-			}), MakeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
-				"deps":               `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":a_cc_proto_lite"]`,
-			}), MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
-				"dynamic_deps":       `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":a_cc_proto_lite"]`,
-			}), MakeBazelTargetNoRestrictions("proto_library", "a_fg_proto_proto", AttrNameToString{
-				"srcs": `["a_fg.proto"]`,
-				"tags": `[
-        "apex_available=//apex_available:anyapex",
-        "manual",
-    ]`,
-			}), MakeBazelTargetNoRestrictions("alias", "a_fg_proto_bp2build_converted", AttrNameToString{
-				"actual": `"//.:a_fg_proto_proto"`,
-				"tags": `[
-        "apex_available=//apex_available:anyapex",
-        "manual",
-    ]`,
-			}), MakeBazelTargetNoRestrictions("filegroup", "a_fg_proto", AttrNameToString{
-				"srcs": `["a_fg.proto"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryConvertedProtoFilegroupsNoProtoFiles(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcProtoPreamble + `
-filegroup {
-	name: "a_fg_proto",
-	srcs: ["a_fg.proto"],
-}
-
-cc_library {
-	name: "a",
-	srcs: [
-    ":a_fg_proto",
-  ],
-	proto: {
-		export_proto_headers: true,
-	},
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_lite_proto_library", "a_cc_proto_lite", AttrNameToString{
-				"deps": `[":a_fg_proto_bp2build_converted"]`,
-			}), MakeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
-				"deps":               `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":a_cc_proto_lite"]`,
-			}), MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
-				"dynamic_deps":       `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":a_cc_proto_lite"]`,
-			}), MakeBazelTargetNoRestrictions("proto_library", "a_fg_proto_proto", AttrNameToString{
-				"srcs": `["a_fg.proto"]`,
-				"tags": `[
-        "apex_available=//apex_available:anyapex",
-        "manual",
-    ]`,
-			}), MakeBazelTargetNoRestrictions("alias", "a_fg_proto_bp2build_converted", AttrNameToString{
-				"actual": `"//.:a_fg_proto_proto"`,
-				"tags": `[
-        "apex_available=//apex_available:anyapex",
-        "manual",
-    ]`,
-			}), MakeBazelTargetNoRestrictions("filegroup", "a_fg_proto", AttrNameToString{
-				"srcs": `["a_fg.proto"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryExternalConvertedProtoFilegroups(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		StubbedBuildDefinitions:    []string{"//path/to/A:a_fg_proto"},
-		Filesystem: map[string]string{
-			"path/to/A/Android.bp": `
-filegroup {
-	name: "a_fg_proto",
-	srcs: ["a_fg.proto"],
-}`,
-		},
-		Blueprint: soongCcProtoPreamble + `
-cc_library {
-	name: "a",
-	srcs: [
-    ":a_fg_proto",
-    "a.proto",
-  ],
-	proto: {
-		export_proto_headers: true,
-	},
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("proto_library", "a_proto", AttrNameToString{
-				"deps": `["//path/to/A:a_fg_proto_bp2build_converted"]`,
-				"srcs": `["a.proto"]`,
-			}), MakeBazelTarget("cc_lite_proto_library", "a_cc_proto_lite", AttrNameToString{
-				"deps": `[
-        "//path/to/A:a_fg_proto_bp2build_converted",
-        ":a_proto",
-    ]`,
-			}), MakeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
-				"deps":               `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":a_cc_proto_lite"]`,
-			}), MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
-				"dynamic_deps":       `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":a_cc_proto_lite"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryProtoFilegroups(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		StubbedBuildDefinitions:    []string{"a_fg_proto", "b_protos", "c-proto-srcs", "proto-srcs-d"},
-		Blueprint: soongCcProtoPreamble +
-			simpleModule("filegroup", "a_fg_proto") +
-			simpleModule("filegroup", "b_protos") +
-			simpleModule("filegroup", "c-proto-srcs") +
-			simpleModule("filegroup", "proto-srcs-d") + `
-cc_library {
-	name: "a",
-	srcs: [":a_fg_proto"],
-	proto: {
-		export_proto_headers: true,
-	},
-	include_build_directory: false,
-}
-
-cc_library {
-	name: "b",
-	srcs: [":b_protos"],
-	proto: {
-		export_proto_headers: true,
-	},
-	include_build_directory: false,
-}
-
-cc_library {
-	name: "c",
-	srcs: [":c-proto-srcs"],
-	proto: {
-		export_proto_headers: true,
-	},
-	include_build_directory: false,
-}
-
-cc_library {
-	name: "d",
-	srcs: [":proto-srcs-d"],
-	proto: {
-		export_proto_headers: true,
-	},
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("proto_library", "a_proto", AttrNameToString{
-				"srcs": `[":a_fg_proto"]`,
-			}), MakeBazelTarget("cc_lite_proto_library", "a_cc_proto_lite", AttrNameToString{
-				"deps": `[":a_proto"]`,
-			}), MakeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
-				"deps":               `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":a_cc_proto_lite"]`,
-				"srcs":               `[":a_fg_proto_cpp_srcs"]`,
-				"srcs_as":            `[":a_fg_proto_as_srcs"]`,
-				"srcs_c":             `[":a_fg_proto_c_srcs"]`,
-			}), MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
-				"dynamic_deps":       `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":a_cc_proto_lite"]`,
-				"srcs":               `[":a_fg_proto_cpp_srcs"]`,
-				"srcs_as":            `[":a_fg_proto_as_srcs"]`,
-				"srcs_c":             `[":a_fg_proto_c_srcs"]`,
-			}), MakeBazelTarget("proto_library", "b_proto", AttrNameToString{
-				"srcs": `[":b_protos"]`,
-			}), MakeBazelTarget("cc_lite_proto_library", "b_cc_proto_lite", AttrNameToString{
-				"deps": `[":b_proto"]`,
-			}), MakeBazelTarget("cc_library_static", "b_bp2build_cc_library_static", AttrNameToString{
-				"deps":               `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":b_cc_proto_lite"]`,
-				"srcs":               `[":b_protos_cpp_srcs"]`,
-				"srcs_as":            `[":b_protos_as_srcs"]`,
-				"srcs_c":             `[":b_protos_c_srcs"]`,
-			}), MakeBazelTarget("cc_library_shared", "b", AttrNameToString{
-				"dynamic_deps":       `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":b_cc_proto_lite"]`,
-				"srcs":               `[":b_protos_cpp_srcs"]`,
-				"srcs_as":            `[":b_protos_as_srcs"]`,
-				"srcs_c":             `[":b_protos_c_srcs"]`,
-			}), MakeBazelTarget("proto_library", "c_proto", AttrNameToString{
-				"srcs": `[":c-proto-srcs"]`,
-			}), MakeBazelTarget("cc_lite_proto_library", "c_cc_proto_lite", AttrNameToString{
-				"deps": `[":c_proto"]`,
-			}), MakeBazelTarget("cc_library_static", "c_bp2build_cc_library_static", AttrNameToString{
-				"deps":               `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":c_cc_proto_lite"]`,
-				"srcs":               `[":c-proto-srcs_cpp_srcs"]`,
-				"srcs_as":            `[":c-proto-srcs_as_srcs"]`,
-				"srcs_c":             `[":c-proto-srcs_c_srcs"]`,
-			}), MakeBazelTarget("cc_library_shared", "c", AttrNameToString{
-				"dynamic_deps":       `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":c_cc_proto_lite"]`,
-				"srcs":               `[":c-proto-srcs_cpp_srcs"]`,
-				"srcs_as":            `[":c-proto-srcs_as_srcs"]`,
-				"srcs_c":             `[":c-proto-srcs_c_srcs"]`,
-			}), MakeBazelTarget("proto_library", "d_proto", AttrNameToString{
-				"srcs": `[":proto-srcs-d"]`,
-			}), MakeBazelTarget("cc_lite_proto_library", "d_cc_proto_lite", AttrNameToString{
-				"deps": `[":d_proto"]`,
-			}), MakeBazelTarget("cc_library_static", "d_bp2build_cc_library_static", AttrNameToString{
-				"deps":               `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":d_cc_proto_lite"]`,
-				"srcs":               `[":proto-srcs-d_cpp_srcs"]`,
-				"srcs_as":            `[":proto-srcs-d_as_srcs"]`,
-				"srcs_c":             `[":proto-srcs-d_c_srcs"]`,
-			}), MakeBazelTarget("cc_library_shared", "d", AttrNameToString{
-				"dynamic_deps":       `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":d_cc_proto_lite"]`,
-				"srcs":               `[":proto-srcs-d_cpp_srcs"]`,
-				"srcs_as":            `[":proto-srcs-d_as_srcs"]`,
-				"srcs_c":             `[":proto-srcs-d_c_srcs"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryDisabledArchAndTarget(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcProtoPreamble + `cc_library {
-	name: "foo",
-	srcs: ["foo.cpp"],
-	host_supported: true,
-	target: {
-		darwin: {
-			enabled: false,
-		},
-		windows: {
-			enabled: false,
-		},
-		linux_glibc_x86: {
-			enabled: false,
-		},
-	},
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: makeCcLibraryTargets("foo", AttrNameToString{
-			"srcs": `["foo.cpp"]`,
-			"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os_arch:darwin_arm64": ["@platforms//:incompatible"],
-        "//build/bazel_common_rules/platforms/os_arch:darwin_x86_64": ["@platforms//:incompatible"],
-        "//build/bazel_common_rules/platforms/os_arch:linux_glibc_x86": ["@platforms//:incompatible"],
-        "//build/bazel_common_rules/platforms/os_arch:windows_x86": ["@platforms//:incompatible"],
-        "//build/bazel_common_rules/platforms/os_arch:windows_x86_64": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-		}),
-	})
-}
-
-func TestCcLibraryDisabledArchAndTargetWithDefault(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcProtoPreamble + `cc_library {
-	name: "foo",
-	srcs: ["foo.cpp"],
-  enabled: false,
-	host_supported: true,
-	target: {
-		darwin: {
-			enabled: true,
-		},
-		windows: {
-			enabled: false,
-		},
-		linux_glibc_x86: {
-			enabled: false,
-		},
-	},
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: makeCcLibraryTargets("foo", AttrNameToString{
-			"srcs": `["foo.cpp"]`,
-			"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os_arch:darwin_arm64": [],
-        "//build/bazel_common_rules/platforms/os_arch:darwin_x86_64": [],
-        "//conditions:default": ["@platforms//:incompatible"],
-    })`,
-		}),
-	})
-}
-
-func TestCcLibrarySharedDisabled(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcProtoPreamble + `cc_library {
-	name: "foo",
-	srcs: ["foo.cpp"],
-	enabled: false,
-	shared: {
-		enabled: true,
-	},
-	target: {
-		android: {
-			shared: {
-				enabled: false,
-			},
-		}
-  },
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-			"srcs":                   `["foo.cpp"]`,
-			"target_compatible_with": `["@platforms//:incompatible"]`,
-		}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-			"srcs": `["foo.cpp"]`,
-			"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-		}),
-		},
-	})
-}
-
-func TestCcLibraryStaticDisabledForSomeArch(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcProtoPreamble + `cc_library {
-	name: "foo",
-	host_supported: true,
-	srcs: ["foo.cpp"],
-	shared: {
-		enabled: false
-	},
-	target: {
-		darwin: {
-			enabled: true,
-		},
-		windows: {
-			enabled: false,
-		},
-		linux_glibc_x86: {
-			shared: {
-				enabled: true,
-			},
-		},
-	},
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-			"srcs": `["foo.cpp"]`,
-			"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:windows": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-		}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-			"srcs": `["foo.cpp"]`,
-			"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os_arch:darwin_arm64": [],
-        "//build/bazel_common_rules/platforms/os_arch:darwin_x86_64": [],
-        "//build/bazel_common_rules/platforms/os_arch:linux_glibc_x86": [],
-        "//conditions:default": ["@platforms//:incompatible"],
-    })`,
-		}),
-		}})
-}
-
-func TestCcLibraryStubs(t *testing.T) {
-	expectedBazelTargets := makeCcLibraryTargets("a", AttrNameToString{
-		"stubs_symbol_file": `"a.map.txt"`,
-	})
-	expectedBazelTargets = append(expectedBazelTargets, makeCcStubSuiteTargets("a", AttrNameToString{
-		"api_surface":          `"module-libapi"`,
-		"soname":               `"a.so"`,
-		"source_library_label": `"//foo/bar:a"`,
-		"stubs_symbol_file":    `"a.map.txt"`,
-		"stubs_versions": `[
-        "28",
-        "29",
-        "current",
-    ]`,
-	}))
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library stubs",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Dir:                        "foo/bar",
-		Filesystem: map[string]string{
-			"foo/bar/Android.bp": `
-cc_library {
-    name: "a",
-    stubs: { symbol_file: "a.map.txt", versions: ["28", "29", "current"] },
-    bazel_module: { bp2build_available: true },
-    include_build_directory: false,
-}
-`,
-		},
-		Blueprint:            soongCcLibraryPreamble,
-		ExpectedBazelTargets: expectedBazelTargets,
-	},
-	)
-}
-
-func TestCcLibraryStubsAcrossConfigsDuplicatesRemoved(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "stub target generation of the same lib across configs should not result in duplicates",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"bar.map.txt": "",
-		},
-		StubbedBuildDefinitions: []string{"barlib"},
-		Blueprint: `
-cc_library {
-	name: "barlib",
-	stubs: { symbol_file: "bar.map.txt", versions: ["28", "29", "current"] },
-}
-cc_library {
-	name: "foolib",
-	shared_libs: ["barlib"],
-	target: {
-		android: {
-			shared_libs: ["barlib"],
-		},
-	},
-	bazel_module: { bp2build_available: true },
-	apex_available: ["foo"],
-}`,
-		ExpectedBazelTargets: makeCcLibraryTargets("foolib", AttrNameToString{
-			"implementation_dynamic_deps": `select({
-        "//build/bazel/rules/apex:foo": ["@api_surfaces//module-libapi/current:barlib"],
-        "//conditions:default": [":barlib"],
-    })`,
-			"local_includes": `["."]`,
-			"tags":           `["apex_available=foo"]`,
-		}),
-	})
-}
-
-func TestCcLibraryExcludesLibsHost(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"bar.map.txt": "",
-		},
-		StubbedBuildDefinitions: []string{"bazlib", "quxlib", "barlib"},
-		Blueprint: simpleModule("cc_library", "bazlib") + `
-cc_library {
-	name: "quxlib",
-	stubs: { symbol_file: "bar.map.txt", versions: ["current"] },
-}
-cc_library {
-	name: "barlib",
-	stubs: { symbol_file: "bar.map.txt", versions: ["28", "29", "current"] },
-}
-cc_library {
-	name: "foolib",
-	shared_libs: ["barlib", "quxlib"],
-	target: {
-		host: {
-			shared_libs: ["bazlib"],
-			exclude_shared_libs: ["barlib"],
-		},
-	},
-	include_build_directory: false,
-	bazel_module: { bp2build_available: true },
-	apex_available: ["foo"],
-}`,
-		ExpectedBazelTargets: makeCcLibraryTargets("foolib", AttrNameToString{
-			"implementation_dynamic_deps": `select({
-        "//build/bazel_common_rules/platforms/os:darwin": [":bazlib"],
-        "//build/bazel_common_rules/platforms/os:linux_bionic": [":bazlib"],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": [":bazlib"],
-        "//build/bazel_common_rules/platforms/os:linux_musl": [":bazlib"],
-        "//build/bazel_common_rules/platforms/os:windows": [":bazlib"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel/rules/apex:foo": [
-            "@api_surfaces//module-libapi/current:barlib",
-            "@api_surfaces//module-libapi/current:quxlib",
-        ],
-        "//build/bazel_common_rules/platforms/os:darwin": [":quxlib"],
-        "//build/bazel_common_rules/platforms/os:linux_bionic": [":quxlib"],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": [":quxlib"],
-        "//build/bazel_common_rules/platforms/os:linux_musl": [":quxlib"],
-        "//build/bazel_common_rules/platforms/os:windows": [":quxlib"],
-        "//conditions:default": [
-            ":barlib",
-            ":quxlib",
-        ],
-    })`,
-			"tags": `["apex_available=foo"]`,
-		}),
-	})
-}
-
-func TestCcLibraryEscapeLdflags(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcProtoPreamble + `cc_library {
-	name: "foo",
-	ldflags: ["-Wl,--rpath,${ORIGIN}"],
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: makeCcLibraryTargets("foo", AttrNameToString{
-			"linkopts": `["-Wl,--rpath,$${ORIGIN}"]`,
-		}),
-	})
-}
-
-func TestCcLibraryConvertLex(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"foo.c":   "",
-			"bar.cc":  "",
-			"foo1.l":  "",
-			"bar1.ll": "",
-			"foo2.l":  "",
-			"bar2.ll": "",
-		},
-		Blueprint: `cc_library {
-	name: "foo_lib",
-	srcs: ["foo.c", "bar.cc", "foo1.l", "foo2.l", "bar1.ll", "bar2.ll"],
-	lex: { flags: ["--foo_flags"] },
-	include_build_directory: false,
-	bazel_module: { bp2build_available: true },
-}`,
-		ExpectedBazelTargets: append([]string{
-			MakeBazelTarget("genlex", "foo_lib_genlex_l", AttrNameToString{
-				"srcs": `[
-        "foo1.l",
-        "foo2.l",
-    ]`,
-				"lexopts": `["--foo_flags"]`,
-			}),
-			MakeBazelTarget("genlex", "foo_lib_genlex_ll", AttrNameToString{
-				"srcs": `[
-        "bar1.ll",
-        "bar2.ll",
-    ]`,
-				"lexopts": `["--foo_flags"]`,
-			}),
-		},
-			makeCcLibraryTargets("foo_lib", AttrNameToString{
-				"srcs": `[
-        "bar.cc",
-        ":foo_lib_genlex_ll",
-    ]`,
-				"srcs_c": `[
-        "foo.c",
-        ":foo_lib_genlex_l",
-    ]`,
-			})...),
-	})
-}
-
-func TestCCLibraryRuntimeDeps(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Blueprint: `cc_library_shared {
-	name: "bar",
-}
-
-cc_library {
-  name: "foo",
-  runtime_libs: ["bar"],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "bar", AttrNameToString{
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"runtime_deps":   `[":bar"]`,
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"runtime_deps":   `[":bar"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithInstructionSet(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `cc_library {
-    name: "foo",
-    arch: {
-      arm: {
-        instruction_set: "arm",
-      }
-    }
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("foo", AttrNameToString{
-			"features": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["arm_isa_arm"],
-        "//conditions:default": [],
-    })`,
-			"local_includes": `["."]`,
-		}),
-	})
-}
-
-func TestCcLibraryEmptySuffix(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library with empty suffix",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"foo.c": "",
-		},
-		Blueprint: `cc_library {
-    name: "foo",
-    suffix: "",
-    srcs: ["foo.c"],
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"srcs_c": `["foo.c"]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"srcs_c": `["foo.c"]`,
-				"suffix": `""`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySuffix(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library with suffix",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"foo.c": "",
-		},
-		Blueprint: `cc_library {
-    name: "foo",
-    suffix: "-suf",
-    srcs: ["foo.c"],
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"srcs_c": `["foo.c"]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"srcs_c": `["foo.c"]`,
-				"suffix": `"-suf"`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryArchVariantSuffix(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library with arch-variant suffix",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"foo.c": "",
-		},
-		Blueprint: `cc_library {
-    name: "foo",
-    arch: {
-        arm64: { suffix: "-64" },
-        arm:   { suffix: "-32" },
-		},
-    srcs: ["foo.c"],
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"srcs_c": `["foo.c"]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"srcs_c": `["foo.c"]`,
-				"suffix": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "-32",
-        "//build/bazel_common_rules/platforms/arch:arm64": "-64",
-        "//conditions:default": None,
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithAidlLibrary(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library with aidl_library",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-aidl_library {
-    name: "A_aidl",
-    srcs: ["aidl/A.aidl"],
-	hdrs: ["aidl/Header.aidl"],
-	strip_import_prefix: "aidl",
-}
-cc_library {
-	name: "foo",
-	aidl: {
-		libs: ["A_aidl"],
-	},
-	export_include_dirs: ["include"],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTargetNoRestrictions("aidl_library", "A_aidl", AttrNameToString{
-				"srcs":                `["aidl/A.aidl"]`,
-				"hdrs":                `["aidl/Header.aidl"]`,
-				"strip_import_prefix": `"aidl"`,
-				"tags":                `["apex_available=//apex_available:anyapex"]`,
-			}),
-			MakeBazelTarget("cc_aidl_library", "foo_cc_aidl_library", AttrNameToString{
-				"deps":            `[":A_aidl"]`,
-				"local_includes":  `["."]`,
-				"export_includes": `["include"]`,
-			}),
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"implementation_whole_archive_deps": `[":foo_cc_aidl_library"]`,
-				"local_includes":                    `["."]`,
-				"export_includes":                   `["include"]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"implementation_whole_archive_deps": `[":foo_cc_aidl_library"]`,
-				"local_includes":                    `["."]`,
-				"export_includes":                   `["include"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithAidlSrcs(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library with aidl srcs",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-filegroup {
-    name: "A_aidl",
-    srcs: ["aidl/A.aidl"],
-	path: "aidl",
-}
-cc_library {
-	name: "foo",
-	srcs: [
-		":A_aidl",
-		"B.aidl",
-	],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTargetNoRestrictions("aidl_library", "A_aidl", AttrNameToString{
-				"srcs":                `["aidl/A.aidl"]`,
-				"strip_import_prefix": `"aidl"`,
-				"tags":                `["apex_available=//apex_available:anyapex"]`,
-			}),
-			MakeBazelTarget("aidl_library", "foo_aidl_library", AttrNameToString{
-				"srcs": `["B.aidl"]`,
-			}),
-			MakeBazelTarget("cc_aidl_library", "foo_cc_aidl_library", AttrNameToString{
-				"local_includes": `["."]`,
-				"deps": `[
-        ":A_aidl",
-        ":foo_aidl_library",
-    ]`,
-			}),
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"implementation_whole_archive_deps": `[":foo_cc_aidl_library"]`,
-				"local_includes":                    `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"implementation_whole_archive_deps": `[":foo_cc_aidl_library"]`,
-				"local_includes":                    `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithNonAdjacentAidlFilegroup(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library with non aidl filegroup",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		StubbedBuildDefinitions:    []string{"//path/to/A:A_aidl"},
-		Filesystem: map[string]string{
-			"path/to/A/Android.bp": `
-filegroup {
-    name: "A_aidl",
-    srcs: ["aidl/A.aidl"],
-    path: "aidl",
-}`,
-		},
-		Blueprint: `
-cc_library {
-    name: "foo",
-    srcs: [
-        ":A_aidl",
-    ],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_aidl_library", "foo_cc_aidl_library", AttrNameToString{
-				"local_includes": `["."]`,
-				"deps":           `["//path/to/A:A_aidl"]`,
-			}),
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"implementation_whole_archive_deps": `[":foo_cc_aidl_library"]`,
-				"local_includes":                    `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"local_includes":                    `["."]`,
-				"implementation_whole_archive_deps": `[":foo_cc_aidl_library"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithExportAidlHeaders(t *testing.T) {
-	t.Parallel()
-
-	expectedBazelTargets := []string{
-		MakeBazelTarget("cc_aidl_library", "foo_cc_aidl_library", AttrNameToString{
-			"local_includes": `["."]`,
-			"deps":           `[":foo_aidl_library"]`,
-		}),
-		MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-			"whole_archive_deps": `[":foo_cc_aidl_library"]`,
-			"local_includes":     `["."]`,
-		}),
-		MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-			"whole_archive_deps": `[":foo_cc_aidl_library"]`,
-			"local_includes":     `["."]`,
-		}),
-	}
-	testCases := []struct {
-		description          string
-		bp                   string
-		expectedBazelTargets []string
-	}{
-		{
-			description: "cc_library with aidl srcs and aidl.export_aidl_headers set",
-			bp: `
-			cc_library {
-				name: "foo",
-				srcs: [
-					"Foo.aidl",
-				],
-				aidl: {
-					export_aidl_headers: true,
-				}
-			}`,
-			expectedBazelTargets: append(
-				expectedBazelTargets,
-				MakeBazelTarget("aidl_library", "foo_aidl_library", AttrNameToString{
-					"srcs": `["Foo.aidl"]`,
-				})),
-		},
-		{
-			description: "cc_library with aidl.libs and aidl.export_aidl_headers set",
-			bp: `
-			aidl_library {
-				name: "foo_aidl_library",
-				srcs: ["Foo.aidl"],
-			}
-			cc_library {
-				name: "foo",
-				aidl: {
-					libs: ["foo_aidl_library"],
-					export_aidl_headers: true,
-				}
-			}`,
-			expectedBazelTargets: append(
-				expectedBazelTargets,
-				MakeBazelTargetNoRestrictions("aidl_library", "foo_aidl_library", AttrNameToString{
-					"srcs": `["Foo.aidl"]`,
-					"tags": `["apex_available=//apex_available:anyapex"]`,
-				}),
-			),
-		},
-	}
-
-	for _, testCase := range testCases {
-		runCcLibraryTestCase(t, Bp2buildTestCase{
-			Description:                "cc_library with export aidl headers",
-			ModuleTypeUnderTest:        "cc_library",
-			ModuleTypeUnderTestFactory: cc.LibraryFactory,
-			Blueprint:                  testCase.bp,
-			ExpectedBazelTargets:       testCase.expectedBazelTargets,
-		})
-	}
-}
-
-func TestCcLibraryWithTargetApex(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library with target.apex",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		StubbedBuildDefinitions:    []string{"bar", "baz", "buh"},
-		Blueprint: `
-cc_library {
-    name: "foo",
-	shared_libs: ["bar", "baz"],
-	static_libs: ["baz", "buh"],
-	target: {
-        apex: {
-            exclude_shared_libs: ["bar"],
-            exclude_static_libs: ["buh"],
-        }
-    }
-}` + simpleModule("cc_library_static", "baz") +
-			simpleModule("cc_library_static", "buh") +
-			simpleModule("cc_library_static", "bar"),
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"implementation_deps": `[":baz"] + select({
-        "//build/bazel/rules/apex:in_apex": [],
-        "//conditions:default": [":buh"],
-    })`,
-				"implementation_dynamic_deps": `[":baz"] + select({
-        "//build/bazel/rules/apex:in_apex": [],
-        "//conditions:default": [":bar"],
-    })`,
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"implementation_deps": `[":baz"] + select({
-        "//build/bazel/rules/apex:in_apex": [],
-        "//conditions:default": [":buh"],
-    })`,
-				"implementation_dynamic_deps": `[":baz"] + select({
-        "//build/bazel/rules/apex:in_apex": [],
-        "//conditions:default": [":bar"],
-    })`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithTargetApexAndExportLibHeaders(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library with target.apex and export_shared|static_lib_headers",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library_static {
-    name: "foo",
-	shared_libs: ["bar", "baz"],
-    static_libs: ["abc"],
-    export_shared_lib_headers: ["baz"],
-    export_static_lib_headers: ["abc"],
-	target: {
-        apex: {
-            exclude_shared_libs: ["baz", "bar"],
-            exclude_static_libs: ["abc"],
-        }
-    }
-}` + simpleModule("cc_library_static", "bar") +
-			simpleModule("cc_library_static", "baz") +
-			simpleModule("cc_library_static", "abc"),
-		StubbedBuildDefinitions: []string{"bar", "baz", "abc"},
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"implementation_dynamic_deps": `select({
-        "//build/bazel/rules/apex:in_apex": [],
-        "//conditions:default": [":bar"],
-    })`,
-				"dynamic_deps": `select({
-        "//build/bazel/rules/apex:in_apex": [],
-        "//conditions:default": [":baz"],
-    })`,
-				"deps": `select({
-        "//build/bazel/rules/apex:in_apex": [],
-        "//conditions:default": [":abc"],
-    })`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithSyspropSrcs(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library with sysprop sources",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-	name: "foo",
-	srcs: [
-		"bar.sysprop",
-		"baz.sysprop",
-		"blah.cpp",
-	],
-	min_sdk_version: "5",
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("sysprop_library", "foo_sysprop_library", AttrNameToString{
-				"srcs": `[
-        "bar.sysprop",
-        "baz.sysprop",
-    ]`,
-			}),
-			MakeBazelTarget("cc_sysprop_library_static", "foo_cc_sysprop_library_static", AttrNameToString{
-				"dep":             `":foo_sysprop_library"`,
-				"min_sdk_version": `"5"`,
-			}),
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"srcs":               `["blah.cpp"]`,
-				"local_includes":     `["."]`,
-				"min_sdk_version":    `"5"`,
-				"whole_archive_deps": `[":foo_cc_sysprop_library_static"]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"srcs":               `["blah.cpp"]`,
-				"local_includes":     `["."]`,
-				"min_sdk_version":    `"5"`,
-				"whole_archive_deps": `[":foo_cc_sysprop_library_static"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithSyspropSrcsSomeConfigs(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library with sysprop sources in some configs but not others",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-	name: "foo",
-	host_supported: true,
-	srcs: [
-		"blah.cpp",
-	],
-	target: {
-		android: {
-			srcs: ["bar.sysprop"],
-		},
-	},
-	min_sdk_version: "5",
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTargetNoRestrictions("sysprop_library", "foo_sysprop_library", AttrNameToString{
-				"srcs": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["bar.sysprop"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTargetNoRestrictions("cc_sysprop_library_static", "foo_cc_sysprop_library_static", AttrNameToString{
-				"dep":             `":foo_sysprop_library"`,
-				"min_sdk_version": `"5"`,
-			}),
-			MakeBazelTargetNoRestrictions("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"srcs":            `["blah.cpp"]`,
-				"local_includes":  `["."]`,
-				"min_sdk_version": `"5"`,
-				"whole_archive_deps": `select({
-        "//build/bazel_common_rules/platforms/os:android": [":foo_cc_sysprop_library_static"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTargetNoRestrictions("cc_library_shared", "foo", AttrNameToString{
-				"srcs":            `["blah.cpp"]`,
-				"local_includes":  `["."]`,
-				"min_sdk_version": `"5"`,
-				"whole_archive_deps": `select({
-        "//build/bazel_common_rules/platforms/os:android": [":foo_cc_sysprop_library_static"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithAidlAndLibs(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_aidl_library depends on libs from parent cc_library_static",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		StubbedBuildDefinitions:    []string{"bar-static", "baz-static", "bar-shared", "baz-shared"},
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	srcs: [
-		"Foo.aidl",
-	],
-	static_libs: [
-		"bar-static",
-		"baz-static",
-	],
-	shared_libs: [
-		"bar-shared",
-		"baz-shared",
-	],
-	export_static_lib_headers: [
-		"baz-static",
-	],
-	export_shared_lib_headers: [
-		"baz-shared",
-	],
-}` +
-			simpleModule("cc_library_static", "bar-static") +
-			simpleModule("cc_library_static", "baz-static") +
-			simpleModule("cc_library", "bar-shared") +
-			simpleModule("cc_library", "baz-shared"),
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("aidl_library", "foo_aidl_library", AttrNameToString{
-				"srcs": `["Foo.aidl"]`,
-			}),
-			MakeBazelTarget("cc_aidl_library", "foo_cc_aidl_library", AttrNameToString{
-				"local_includes": `["."]`,
-				"deps":           `[":foo_aidl_library"]`,
-				"implementation_deps": `[
-        ":baz-static",
-        ":bar-static",
-    ]`,
-				"implementation_dynamic_deps": `[
-        ":baz-shared",
-        ":bar-shared",
-    ]`,
-			}),
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"implementation_whole_archive_deps": `[":foo_cc_aidl_library"]`,
-				"deps":                              `[":baz-static"]`,
-				"implementation_deps":               `[":bar-static"]`,
-				"dynamic_deps":                      `[":baz-shared"]`,
-				"implementation_dynamic_deps":       `[":bar-shared"]`,
-				"local_includes":                    `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithTidy(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library uses tidy properties",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	srcs: ["foo.cpp"],
-}
-cc_library_static {
-	name: "foo-no-tidy",
-	srcs: ["foo.cpp"],
-	tidy: false,
-}
-cc_library_static {
-	name: "foo-tidy",
-	srcs: ["foo.cpp"],
-	tidy: true,
-	tidy_checks: ["check1", "check2"],
-	tidy_checks_as_errors: ["check1error", "check2error"],
-	tidy_disabled_srcs: ["bar.cpp"],
-	tidy_timeout_srcs: ["baz.cpp"],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"srcs":           `["foo.cpp"]`,
-			}),
-			MakeBazelTarget("cc_library_static", "foo-no-tidy", AttrNameToString{
-				"local_includes": `["."]`,
-				"srcs":           `["foo.cpp"]`,
-				"tidy":           `"never"`,
-			}),
-			MakeBazelTarget("cc_library_static", "foo-tidy", AttrNameToString{
-				"local_includes": `["."]`,
-				"srcs":           `["foo.cpp"]`,
-				"tidy":           `"local"`,
-				"tidy_checks": `[
-        "check1",
-        "check2",
-    ]`,
-				"tidy_checks_as_errors": `[
-        "check1error",
-        "check2error",
-    ]`,
-				"tidy_disabled_srcs": `["bar.cpp"]`,
-				"tidy_timeout_srcs":  `["baz.cpp"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithAfdoEnabled(t *testing.T) {
-	bp := `
-cc_library {
-	name: "foo",
-	afdo: true,
-	include_build_directory: false,
-}`
-
-	// TODO(b/260714900): Add test case for arch-specific afdo profile
-	testCases := []struct {
-		description          string
-		filesystem           map[string]string
-		expectedBazelTargets []string
-	}{
-		{
-			description: "cc_library with afdo enabled and existing profile",
-			filesystem: map[string]string{
-				"vendor/google_data/pgo_profile/sampling/Android.bp": "",
-				"vendor/google_data/pgo_profile/sampling/foo.afdo":   "",
-			},
-			expectedBazelTargets: []string{
-				MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{}),
-				MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-					"fdo_profile": `"//vendor/google_data/pgo_profile/sampling:foo"`,
-				}),
-			},
-		},
-		{
-			description: "cc_library with afdo enabled and existing profile in AOSP",
-			filesystem: map[string]string{
-				"toolchain/pgo-profiles/sampling/Android.bp": "",
-				"toolchain/pgo-profiles/sampling/foo.afdo":   "",
-			},
-			expectedBazelTargets: []string{
-				MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{}),
-				MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-					"fdo_profile": `"//toolchain/pgo-profiles/sampling:foo"`,
-				}),
-			},
-		},
-		{
-			description: "cc_library with afdo enabled but profile filename doesn't match with module name",
-			filesystem: map[string]string{
-				"toolchain/pgo-profiles/sampling/Android.bp": "",
-				"toolchain/pgo-profiles/sampling/bar.afdo":   "",
-			},
-			expectedBazelTargets: []string{
-				MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{}),
-				MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{}),
-			},
-		},
-		{
-			description: "cc_library with afdo enabled but profile doesn't exist",
-			expectedBazelTargets: []string{
-				MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{}),
-				MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{}),
-			},
-		},
-		{
-			description: "cc_library with afdo enabled and existing profile but BUILD file doesn't exist",
-			filesystem: map[string]string{
-				"vendor/google_data/pgo_profile/sampling/foo.afdo": "",
-			},
-			expectedBazelTargets: []string{
-				MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{}),
-				MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{}),
-			},
-		},
-	}
-	for _, testCase := range testCases {
-		t.Run(testCase.description, func(t *testing.T) {
-			runCcLibraryTestCase(t, Bp2buildTestCase{
-				ExpectedBazelTargets:       testCase.expectedBazelTargets,
-				ModuleTypeUnderTest:        "cc_library",
-				ModuleTypeUnderTestFactory: cc.LibraryFactory,
-				Description:                testCase.description,
-				Blueprint:                  binaryReplacer.Replace(bp),
-				Filesystem:                 testCase.filesystem,
-			})
-		})
-	}
-}
-
-func TestCcLibraryHeaderAbiChecker(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library with header abi checker",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `cc_library {
-    name: "foo",
-    header_abi_checker: {
-        enabled: true,
-        symbol_file: "a.map.txt",
-        exclude_symbol_versions: [
-						"29",
-						"30",
-				],
-        exclude_symbol_tags: [
-						"tag1",
-						"tag2",
-				],
-        check_all_apis: true,
-        diff_flags: ["-allow-adding-removing-weak-symbols"],
-    },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"abi_checker_enabled":     `True`,
-				"abi_checker_symbol_file": `"a.map.txt"`,
-				"abi_checker_exclude_symbol_versions": `[
-        "29",
-        "30",
-    ]`,
-				"abi_checker_exclude_symbol_tags": `[
-        "tag1",
-        "tag2",
-    ]`,
-				"abi_checker_check_all_apis": `True`,
-				"abi_checker_diff_flags":     `["-allow-adding-removing-weak-symbols"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryApexAvailable(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library apex_available converted to tags",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "a",
-    srcs: ["a.cpp"],
-    apex_available: ["com.android.foo"],
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("a", AttrNameToString{
-			"tags":           `["apex_available=com.android.foo"]`,
-			"srcs":           `["a.cpp"]`,
-			"local_includes": `["."]`,
-		}),
-	},
-	)
-}
-
-func TestCcLibraryApexAvailableMultiple(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library apex_available converted to multiple tags",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "a",
-    srcs: ["a.cpp"],
-    apex_available: ["com.android.foo", "//apex_available:platform", "com.android.bar"],
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("a", AttrNameToString{
-			"tags": `[
-        "apex_available=com.android.foo",
-        "apex_available=//apex_available:platform",
-        "apex_available=com.android.bar",
-    ]`,
-			"srcs":           `["a.cpp"]`,
-			"local_includes": `["."]`,
-		}),
-	},
-	)
-}
-
-// Export_include_dirs and Export_system_include_dirs have "variant_prepend" tag.
-// In bp2build output, variant info(select) should go before general info.
-// Internal order of the property should be unchanged. (e.g. ["eid1", "eid2"])
-func TestCcLibraryVariantPrependPropOrder(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library variant prepend properties order",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-  name: "a",
-  srcs: ["a.cpp"],
-  export_include_dirs: ["eid1", "eid2"],
-  export_system_include_dirs: ["esid1", "esid2"],
-    target: {
-      android: {
-        export_include_dirs: ["android_eid1", "android_eid2"],
-        export_system_include_dirs: ["android_esid1", "android_esid2"],
-      },
-      android_arm: {
-        export_include_dirs: ["android_arm_eid1", "android_arm_eid2"],
-        export_system_include_dirs: ["android_arm_esid1", "android_arm_esid2"],
-      },
-      linux: {
-        export_include_dirs: ["linux_eid1", "linux_eid2"],
-        export_system_include_dirs: ["linux_esid1", "linux_esid2"],
-      },
-    },
-    multilib: {
-      lib32: {
-        export_include_dirs: ["lib32_eid1", "lib32_eid2"],
-        export_system_include_dirs: ["lib32_esid1", "lib32_esid2"],
-      },
-    },
-    arch: {
-      arm: {
-        export_include_dirs: ["arm_eid1", "arm_eid2"],
-        export_system_include_dirs: ["arm_esid1", "arm_esid2"],
-      },
-    }
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("a", AttrNameToString{
-			"export_includes": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm": [
-            "android_arm_eid1",
-            "android_arm_eid2",
-        ],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel_common_rules/platforms/os:android": [
-            "android_eid1",
-            "android_eid2",
-            "linux_eid1",
-            "linux_eid2",
-        ],
-        "//build/bazel_common_rules/platforms/os:linux_bionic": [
-            "linux_eid1",
-            "linux_eid2",
-        ],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": [
-            "linux_eid1",
-            "linux_eid2",
-        ],
-        "//build/bazel_common_rules/platforms/os:linux_musl": [
-            "linux_eid1",
-            "linux_eid2",
-        ],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel_common_rules/platforms/arch:arm": [
-            "lib32_eid1",
-            "lib32_eid2",
-            "arm_eid1",
-            "arm_eid2",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86": [
-            "lib32_eid1",
-            "lib32_eid2",
-        ],
-        "//conditions:default": [],
-    }) + [
-        "eid1",
-        "eid2",
-    ]`,
-			"export_system_includes": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm": [
-            "android_arm_esid1",
-            "android_arm_esid2",
-        ],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel_common_rules/platforms/os:android": [
-            "android_esid1",
-            "android_esid2",
-            "linux_esid1",
-            "linux_esid2",
-        ],
-        "//build/bazel_common_rules/platforms/os:linux_bionic": [
-            "linux_esid1",
-            "linux_esid2",
-        ],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": [
-            "linux_esid1",
-            "linux_esid2",
-        ],
-        "//build/bazel_common_rules/platforms/os:linux_musl": [
-            "linux_esid1",
-            "linux_esid2",
-        ],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel_common_rules/platforms/arch:arm": [
-            "lib32_esid1",
-            "lib32_esid2",
-            "arm_esid1",
-            "arm_esid2",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86": [
-            "lib32_esid1",
-            "lib32_esid2",
-        ],
-        "//conditions:default": [],
-    }) + [
-        "esid1",
-        "esid2",
-    ]`,
-			"srcs":                   `["a.cpp"]`,
-			"local_includes":         `["."]`,
-			"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-		}),
-	},
-	)
-}
-
-func TestCcLibraryWithIntegerOverflowProperty(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library has correct features when integer_overflow property is provided",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-		name: "foo",
-		sanitize: {
-				integer_overflow: true,
-		},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"features":       `["ubsan_integer_overflow"]`,
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features":       `["ubsan_integer_overflow"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithMiscUndefinedProperty(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library has correct features when misc_undefined property is provided",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-		name: "foo",
-		sanitize: {
-				misc_undefined: ["undefined", "nullability"],
-		},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"features": `[
-        "ubsan_undefined",
-        "ubsan_nullability",
-    ]`,
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features": `[
-        "ubsan_undefined",
-        "ubsan_nullability",
-    ]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithSanitizerBlocklist(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library has correct feature when sanitize.blocklist is provided",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-		name: "foo",
-		sanitize: {
-			blocklist: "foo_blocklist.txt",
-		},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"copts": `select({
-        "//build/bazel/rules/cc:sanitizers_enabled": ["-fsanitize-ignorelist=$(location foo_blocklist.txt)"],
-        "//conditions:default": [],
-    })`,
-				"additional_compiler_inputs": `select({
-        "//build/bazel/rules/cc:sanitizers_enabled": [":foo_blocklist.txt"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"copts": `select({
-        "//build/bazel/rules/cc:sanitizers_enabled": ["-fsanitize-ignorelist=$(location foo_blocklist.txt)"],
-        "//conditions:default": [],
-    })`,
-				"additional_compiler_inputs": `select({
-        "//build/bazel/rules/cc:sanitizers_enabled": [":foo_blocklist.txt"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithUBSanPropertiesArchSpecific(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library has correct feature select when UBSan props are specified in arch specific blocks",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-		name: "foo",
-		sanitize: {
-				misc_undefined: ["undefined", "nullability"],
-		},
-		target: {
-				android: {
-						sanitize: {
-								misc_undefined: ["alignment"],
-						},
-				},
-				linux_glibc: {
-						sanitize: {
-								integer_overflow: true,
-						},
-				},
-		},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"features": `[
-        "ubsan_undefined",
-        "ubsan_nullability",
-    ] + select({
-        "//build/bazel_common_rules/platforms/os:android": ["ubsan_alignment"],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features": `[
-        "ubsan_undefined",
-        "ubsan_nullability",
-    ] + select({
-        "//build/bazel_common_rules/platforms/os:android": ["ubsan_alignment"],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryInApexWithStubSharedLibs(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library with in apex with stub shared_libs and export_shared_lib_headers",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		StubbedBuildDefinitions:    []string{"barlib", "bazlib"},
-		Blueprint: `
-cc_library {
-	name: "barlib",
-	stubs: { symbol_file: "bar.map.txt", versions: ["28", "29", "current"] },
-	apex_available: ["//apex_available:platform",],
-}
-cc_library {
-	name: "bazlib",
-	stubs: { symbol_file: "bar.map.txt", versions: ["28", "29", "current"] },
-	apex_available: ["//apex_available:platform",],
-}
-cc_library {
-    name: "foo",
-	  shared_libs: ["barlib", "bazlib"],
-    export_shared_lib_headers: ["bazlib"],
-    apex_available: [
-        "//apex_available:platform",
-    ],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"implementation_dynamic_deps": `[":barlib"]`,
-				"dynamic_deps":                `[":bazlib"]`,
-				"local_includes":              `["."]`,
-				"tags":                        `["apex_available=//apex_available:platform"]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"implementation_dynamic_deps": `[":barlib"]`,
-				"dynamic_deps":                `[":bazlib"]`,
-				"local_includes":              `["."]`,
-				"tags":                        `["apex_available=//apex_available:platform"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithThinLto(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library has correct features when thin LTO is enabled",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-	name: "foo",
-	lto: {
-		thin: true,
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"features":       `["android_thin_lto"]`,
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features":       `["android_thin_lto"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithLtoNever(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library has correct features when LTO is explicitly disabled",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-	name: "foo",
-	lto: {
-		never: true,
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"features":       `["-android_thin_lto"]`,
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features":       `["-android_thin_lto"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithThinLtoArchSpecific(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library has correct features when LTO differs across arch and os variants",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-	name: "foo",
-	target: {
-		android: {
-			lto: {
-				thin: true,
-			},
-		},
-	},
-	arch: {
-		riscv64: {
-			lto: {
-				thin: false,
-			},
-		},
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"local_includes": `["."]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm": ["android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": ["android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_x86": ["android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["android_thin_lto"],
-        "//conditions:default": [],
-    })`}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm": ["android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": ["android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_x86": ["android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["android_thin_lto"],
-        "//conditions:default": [],
-    })`}),
-		},
-	})
-}
-
-func TestCcLibraryWithThinLtoDisabledDefaultEnabledVariant(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library has correct features when LTO disabled by default but enabled on a particular variant",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-	name: "foo",
-	lto: {
-		never: true,
-	},
-	target: {
-		android: {
-			lto: {
-				thin: true,
-				never: false,
-			},
-		},
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"local_includes": `["."]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["android_thin_lto"],
-        "//conditions:default": ["-android_thin_lto"],
-    })`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["android_thin_lto"],
-        "//conditions:default": ["-android_thin_lto"],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithThinLtoWholeProgramVtables(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library has correct features when thin LTO is enabled with whole_program_vtables",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-	name: "foo",
-	lto: {
-		thin: true,
-	},
-	whole_program_vtables: true,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"features": `[
-        "android_thin_lto",
-        "android_thin_lto_whole_program_vtables",
-    ]`,
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features": `[
-        "android_thin_lto",
-        "android_thin_lto_whole_program_vtables",
-    ]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryHiddenVisibilityConvertedToFeature(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library changes hidden visibility flag to feature",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-	name: "foo",
-	cflags: ["-fvisibility=hidden"],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"features":       `["visibility_hidden"]`,
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features":       `["visibility_hidden"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryHiddenVisibilityConvertedToFeatureSharedSpecific(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library changes hidden visibility flag to feature when specific to shared variant",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-	name: "foo",
-	shared: {
-		cflags: ["-fvisibility=hidden"],
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features":       `["visibility_hidden"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryHiddenVisibilityConvertedToFeatureStaticSpecific(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library changes hidden visibility flag to feature when specific to static variant",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-	name: "foo",
-	static: {
-		cflags: ["-fvisibility=hidden"],
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"features":       `["visibility_hidden"]`,
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryHiddenVisibilityConvertedToFeatureOsSpecific(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library changes hidden visibility flag to feature when specific to an os",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-	name: "foo",
-	target: {
-		android: {
-			cflags: ["-fvisibility=hidden"],
-		},
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["visibility_hidden"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["visibility_hidden"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-// Test that a config_setting specific to an apex is created by cc_library.
-func TestCcLibraryCreatesInApexConfigSetting(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library creates a config_setting for each apex in apex_available",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Dir:                        "build/bazel/rules/apex",
-		Blueprint: `
-cc_library {
-	name: "foo",
-	apex_available: [
-	"//apex_available:platform", // This will be skipped, since it is equivalent to //build/bazel/rules/apex:android-non_apex
-	"myapex"
-	],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTargetNoRestrictions(
-				"config_setting",
-				"myapex",
-				AttrNameToString{
-					"flag_values": `{
-        "//build/bazel/rules/apex:api_domain": "myapex",
-    }`,
-					"constraint_values": `["//build/bazel_common_rules/platforms/os:android"]`,
-				},
-			),
-		},
-	})
-}
-
-func TestCcLibraryCppFlagsInProductVariables(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library cppflags in product variables",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: soongCcLibraryPreamble + `cc_library {
-    name: "a",
-    srcs: ["a.cpp"],
-    cppflags: [
-        "-Wextra",
-        "-DDEBUG_ONLY_CODE=0",
-    ],
-    product_variables: {
-        eng: {
-            cppflags: [
-                "-UDEBUG_ONLY_CODE",
-                "-DDEBUG_ONLY_CODE=1",
-            ],
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: makeCcLibraryTargets("a", AttrNameToString{
-			"cppflags": `[
-        "-Wextra",
-        "-DDEBUG_ONLY_CODE=0",
-    ] + select({
-        "//build/bazel/product_config/config_settings:eng": [
-            "-UDEBUG_ONLY_CODE",
-            "-DDEBUG_ONLY_CODE=1",
-        ],
-        "//conditions:default": [],
-    })`,
-			"srcs": `["a.cpp"]`,
-		}),
-	},
-	)
-}
-
-func TestCcLibraryYaccConversion(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library is built from .y/.yy files",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		StubbedBuildDefinitions:    []string{"staticlib", "sharedlib"},
-		Blueprint: soongCcLibraryPreamble + `cc_library {
-    name: "a",
-    srcs: [
-	"a.cpp",
-	"a.yy",
-    ],
-    shared_libs: ["sharedlib"],
-    static_libs: ["staticlib"],
-    yacc: {
-	    flags: ["someYaccFlag"],
-	    gen_location_hh: true,
-	    gen_position_hh: true,
-	},
-}
-cc_library_static {
-	name: "staticlib",
-}
-cc_library {
-	name: "sharedlib",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_yacc_static_library", "a_yacc", AttrNameToString{
-				"src":                         `"a.yy"`,
-				"implementation_deps":         `[":staticlib"]`,
-				"implementation_dynamic_deps": `[":sharedlib"]`,
-				"flags":                       `["someYaccFlag"]`,
-				"gen_location_hh":             "True",
-				"gen_position_hh":             "True",
-				"local_includes":              `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
-				"srcs":                              `["a.cpp"]`,
-				"implementation_deps":               `[":staticlib"]`,
-				"implementation_dynamic_deps":       `[":sharedlib"]`,
-				"implementation_whole_archive_deps": `[":a_yacc"]`,
-				"local_includes":                    `["."]`,
-			}),
-			MakeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
-				"srcs":                              `["a.cpp"]`,
-				"implementation_deps":               `[":staticlib"]`,
-				"implementation_dynamic_deps":       `[":sharedlib"]`,
-				"implementation_whole_archive_deps": `[":a_yacc"]`,
-				"local_includes":                    `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryHostLdLibs(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_binary linker flags for host_ldlibs",
-		ModuleTypeUnderTest:        "cc_binary",
-		ModuleTypeUnderTestFactory: cc.BinaryFactory,
-		Blueprint: soongCcLibraryPreamble + `cc_binary {
-    name: "a",
-    host_supported: true,
-    ldflags: ["-lcommon"],
-    target: {
-	linux: {
-		host_ldlibs: [
-			"-llinux",
-		],
-	},
-	darwin: {
-		ldflags: ["-ldarwinadditional"],
-		host_ldlibs: [
-			"-ldarwin",
-		],
-	},
-	windows: {
-		host_ldlibs: [
-			"-lwindows",
-		],
-	},
-    },
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTargetNoRestrictions("cc_binary", "a", AttrNameToString{
-				"linkopts": `["-lcommon"] + select({
-        "//build/bazel_common_rules/platforms/os:darwin": [
-            "-ldarwinadditional",
-            "-ldarwin",
-        ],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": ["-llinux"],
-        "//build/bazel_common_rules/platforms/os:windows": ["-lwindows"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithCfi(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library has correct features when cfi is enabled",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-	name: "foo",
-	sanitize: {
-		cfi: true,
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"features":       `["android_cfi"]`,
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features":       `["android_cfi"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithCfiOsSpecific(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library has correct features when cfi is enabled for specific variants",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-	name: "foo",
-	target: {
-		android: {
-			sanitize: {
-				cfi: true,
-			},
-		},
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["android_cfi"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["android_cfi"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithCfiAndCfiAssemblySupport(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library has correct features when cfi is enabled with cfi_assembly_support",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-	name: "foo",
-	sanitize: {
-		cfi: true,
-		config: {
-			cfi_assembly_support: true,
-		},
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"features": `[
-        "android_cfi",
-        "android_cfi_assembly_support",
-    ]`,
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features": `[
-        "android_cfi",
-        "android_cfi_assembly_support",
-    ]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryExplicitlyDisablesCfiWhenFalse(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library disables cfi when explciitly set to false in the bp",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-	name: "foo",
-	sanitize: {
-		cfi: false,
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
-				"features":       `["-android_cfi"]`,
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features":       `["-android_cfi"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryWithStem(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library with stem property",
-		ModuleTypeUnderTest:        "cc_library_shared",
-		ModuleTypeUnderTestFactory: cc.LibrarySharedFactory,
-		Blueprint: soongCcLibraryPreamble + `
-cc_library_shared {
-	name: "foo_with_stem_simple",
-	stem: "foo",
-}
-cc_library_shared {
-	name: "foo_with_arch_variant_stem",
-	arch: {
-		arm: {
-			stem: "foo-arm",
-		},
-		arm64: {
-			stem: "foo-arm64",
-		},
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo_with_stem_simple", AttrNameToString{
-				"stem":           `"foo"`,
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo_with_arch_variant_stem", AttrNameToString{
-				"stem": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "foo-arm",
-        "//build/bazel_common_rules/platforms/arch:arm64": "foo-arm64",
-        "//conditions:default": None,
-    })`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-// Bazel enforces that proto_library and the .proto file are in the same bazel package
-func TestGenerateProtoLibraryInSamePackage(t *testing.T) {
-	tc := Bp2buildTestCase{
-		Description:                "cc_library depends on .proto files from multiple packages",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	srcs: [
-	   "foo.proto",
-	   "bar/bar.proto", // Different package because there is a bar/Android.bp
-	   "baz/subbaz/baz.proto", // Different package because there is baz/subbaz/Android.bp
-	],
-	proto: {
-		canonical_path_from_root: true,
-	}
-}
-` + simpleModule("cc_library", "libprotobuf-cpp-lite"),
-		Filesystem: map[string]string{
-			"bar/Android.bp":        "",
-			"baz/subbaz/Android.bp": "",
-		},
-	}
-
-	// We will run the test 3 times and check in the root, bar and baz/subbaz directories
-	// Root dir
-	tc.ExpectedBazelTargets = []string{
-		MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-			"local_includes":                    `["."]`,
-			"deps":                              `[":libprotobuf-cpp-lite"]`,
-			"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
-		}),
-		MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-			"srcs": `["foo.proto"]`,
-			"tags": `["manual"]`,
-		}),
-		MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
-			"deps": `[
-        ":foo_proto",
-        "//bar:foo_proto",
-        "//baz/subbaz:foo_proto",
-    ]`,
-		}),
-	}
-	runCcLibraryTestCase(t, tc)
-
-	// bar dir
-	tc.Dir = "bar"
-	tc.ExpectedBazelTargets = []string{
-		MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-			"srcs": `["//bar:bar.proto"]`,
-			"tags": `["manual"]`,
-		}),
-	}
-	runCcLibraryTestCase(t, tc)
-
-	// baz/subbaz dir
-	tc.Dir = "baz/subbaz"
-	tc.ExpectedBazelTargets = []string{
-		MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-			"srcs": `["//baz/subbaz:baz.proto"]`,
-			"tags": `["manual"]`,
-		}),
-	}
-	runCcLibraryTestCase(t, tc)
-}
-
-// Bazel enforces that proto_library and the .proto file are in the same bazel package
-func TestGenerateProtoLibraryInSamePackageNotCanonicalFromRoot(t *testing.T) {
-	tc := Bp2buildTestCase{
-		Description:                "cc_library depends on .proto files from multiple packages",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	srcs: [
-	   "foo.proto",
-	   "bar/bar.proto", // Different package because there is a bar/Android.bp
-	   "baz/subbaz/baz.proto", // Different package because there is baz/subbaz/Android.bp
-	],
-	proto: {
-		canonical_path_from_root: false,
-	}
-}
-` + simpleModule("cc_library", "libprotobuf-cpp-lite"),
-		Filesystem: map[string]string{
-			"bar/Android.bp":        "",
-			"baz/subbaz/Android.bp": "",
-		},
-	}
-
-	// We will run the test 3 times and check in the root, bar and baz/subbaz directories
-	// Root dir
-	tc.ExpectedBazelTargets = []string{
-		MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-			"local_includes":                    `["."]`,
-			"deps":                              `[":libprotobuf-cpp-lite"]`,
-			"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
-		}),
-		MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-			"srcs":                `["foo.proto"]`,
-			"strip_import_prefix": `""`,
-			"tags":                `["manual"]`,
-		}),
-		MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
-			"deps": `[
-        ":foo_proto",
-        "//bar:foo_proto",
-        "//baz/subbaz:foo_proto",
-    ]`,
-		}),
-	}
-	runCcLibraryTestCase(t, tc)
-
-	// bar dir
-	tc.Dir = "bar"
-	tc.ExpectedBazelTargets = []string{
-		MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-			"srcs":                `["//bar:bar.proto"]`,
-			"strip_import_prefix": `""`,
-			"import_prefix":       `"bar"`,
-			"tags":                `["manual"]`,
-		}),
-	}
-	runCcLibraryTestCase(t, tc)
-
-	// baz/subbaz dir
-	tc.Dir = "baz/subbaz"
-	tc.ExpectedBazelTargets = []string{
-		MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-			"srcs":                `["//baz/subbaz:baz.proto"]`,
-			"strip_import_prefix": `""`,
-			"import_prefix":       `"baz/subbaz"`,
-			"tags":                `["manual"]`,
-		}),
-	}
-	runCcLibraryTestCase(t, tc)
-}
-
-func TestProtoIncludeDirs(t *testing.T) {
-	tc := Bp2buildTestCase{
-		Description:                "cc_library depends on .proto files using proto.include_dirs",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	srcs: [
-	   "foo.proto",
-	],
-	proto: {
-		include_dirs: ["bar"],
-	}
-}
-` + simpleModule("cc_library", "libprotobuf-cpp-lite"),
-		Filesystem: map[string]string{
-			"bar/Android.bp":     "",
-			"bar/bar.proto":      "",
-			"bar/baz/Android.bp": "",
-			"bar/baz/baz.proto":  "",
-		},
-	}
-
-	// We will run the test 3 times and check in the root, bar and bar/baz directories
-	// Root dir
-	tc.ExpectedBazelTargets = []string{
-		MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-			"local_includes":                    `["."]`,
-			"deps":                              `[":libprotobuf-cpp-lite"]`,
-			"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
-		}),
-		MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-			"srcs": `["foo.proto"]`,
-			"tags": `["manual"]`,
-		}),
-		MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
-			"deps": `[":foo_proto"]`,
-			"transitive_deps": `[
-        "//bar:bar.include_dir_bp2build_generated_proto",
-        "//bar/baz:bar.include_dir_bp2build_generated_proto",
-    ]`,
-		}),
-	}
-	runCcLibraryTestCase(t, tc)
-
-	// bar dir
-	tc.Dir = "bar"
-	tc.ExpectedBazelTargets = []string{
-		MakeBazelTargetNoRestrictions("proto_library", "bar.include_dir_bp2build_generated_proto", AttrNameToString{
-			"srcs":                `["bar.proto"]`,
-			"strip_import_prefix": `""`,
-			"tags":                `["manual"]`,
-		}),
-	}
-	runCcLibraryTestCase(t, tc)
-
-	// bar/baz dir
-	tc.Dir = "bar/baz"
-	tc.ExpectedBazelTargets = []string{
-		MakeBazelTargetNoRestrictions("proto_library", "bar.include_dir_bp2build_generated_proto", AttrNameToString{
-			"srcs":                `["//bar/baz:baz.proto"]`,
-			"strip_import_prefix": `""`,
-			"import_prefix":       `"baz"`,
-			"tags":                `["manual"]`,
-		}),
-	}
-	runCcLibraryTestCase(t, tc)
-}
-
-func TestProtoIncludeDirsWithSrcsInMultiplePackages(t *testing.T) {
-	tc := Bp2buildTestCase{
-		Description:                "cc_library has srcs in multiple bazel packages and uses proto.include_dirs",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	srcs: [
-	   "foo.proto",
-	   "bar/bar.proto",
-	],
-	proto: {
-		include_dirs: ["baz"],
-	}
-}
-` + simpleModule("cc_library", "libprotobuf-cpp-lite"),
-		Filesystem: map[string]string{
-			"bar/Android.bp": "", // package boundary
-			"baz/Android.bp": "",
-			"baz/baz.proto":  "",
-		},
-	}
-
-	tc.ExpectedBazelTargets = []string{
-		MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-			"local_includes":                    `["."]`,
-			"deps":                              `[":libprotobuf-cpp-lite"]`,
-			"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
-		}),
-		MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-			"srcs": `["foo.proto"]`,
-			"tags": `["manual"]`,
-		}),
-		MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
-			"deps": `[
-        ":foo_proto",
-        "//bar:foo_proto",
-    ]`,
-			"transitive_deps": `["//baz:baz.include_dir_bp2build_generated_proto"]`,
-		}),
-	}
-	runCcLibraryTestCase(t, tc)
-
-}
-
-func TestProtoLocalIncludeDirs(t *testing.T) {
-	tc := Bp2buildTestCase{
-		Description:                "cc_library depends on .proto files using proto.local_include_dirs",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-	name: "libprotobuf-cpp-lite",
-  // TODO: b/285631638 - A stubbed proto library dependency does not work as a protolib
-  // dependency of cc_library_static.
-	bazel_module: { bp2build_available: false },
-}
-`,
-		Filesystem: map[string]string{
-			"foo/Android.bp": `cc_library_static {
-	name: "foo",
-	srcs: [
-	   "foo.proto",
-	],
-	proto: {
-		local_include_dirs: ["foo_subdir"],
-	},
-	bazel_module: { bp2build_available: true },
-}`,
-			"foo/foo.proto":                   "",
-			"foo/foo_subdir/Android.bp":       "",
-			"foo/foo_subdir/foo_subdir.proto": "",
-		},
-	}
-
-	// We will run the test 2 times and check in foo and foo/foo_subdir directories
-	// foo dir
-	tc.Dir = "foo"
-	tc.ExpectedBazelTargets = []string{
-		MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-			"local_includes":                    `["."]`,
-			"deps":                              `["//:libprotobuf-cpp-lite"]`,
-			"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
-		}),
-		MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-			"srcs": `["foo.proto"]`,
-			"tags": `["manual"]`,
-		}),
-		MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
-			"deps":            `[":foo_proto"]`,
-			"transitive_deps": `["//foo/foo_subdir:foo.foo_subdir.include_dir_bp2build_generated_proto"]`,
-		}),
-	}
-	runCcLibraryTestCase(t, tc)
-
-	// foo/foo_subdir
-	tc.Dir = "foo/foo_subdir"
-	tc.ExpectedBazelTargets = []string{
-		MakeBazelTargetNoRestrictions("proto_library", "foo.foo_subdir.include_dir_bp2build_generated_proto", AttrNameToString{
-			"srcs":                `["foo_subdir.proto"]`,
-			"strip_import_prefix": `""`,
-			"tags":                `["manual"]`,
-		}),
-	}
-	runCcLibraryTestCase(t, tc)
-}
-
-// `foo_device` and `bar_host` can depend on .proto files of a specific dir,
-// the dynamically generated proto_library should not have any target_compatible_with
-func TestProtoLibraryForIncludeDirsIsOsAgnostic(t *testing.T) {
-	tc := Bp2buildTestCase{
-		Description:                "proto_library generated for proto.include_dirs is compatible for all axes",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: simpleModule("cc_library", "libprotobuf-cpp-lite") + `
-cc_library {
-	name: "foo_device",
-	device_supported: true, // this is the default behavior, but added explicitly here for illustration
-	host_supported: false,
-	proto: {include_dirs: ["dir"]},
-}
-cc_library {
-	name: "bar_host",
-	device_supported: false,
-	host_supported: true,
-	srcs: ["bar.proto"],
-	proto: {include_dirs: ["dir"]},
-}
-`,
-		Filesystem: map[string]string{
-			"dir/Android.bp": "",
-			"dir/dir.proto":  "",
-		},
-		Dir: "dir", // check for the generated proto_library
-		ExpectedBazelTargets: []string{
-			MakeBazelTargetNoRestrictions("proto_library", "dir.include_dir_bp2build_generated_proto", AttrNameToString{
-				"srcs":                `["dir.proto"]`,
-				"strip_import_prefix": `""`,
-				"tags":                `["manual"]`,
-			}),
-		},
-	}
-	runCcLibraryTestCase(t, tc)
-}
-
-func TestCcCompileMultilibConversion(t *testing.T) {
-	tc := Bp2buildTestCase{
-		Description:                "cc_library with compile_multilib",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-	name: "lib32",
-	compile_multilib: "32",
-}
-cc_library {
-	name: "lib64",
-	compile_multilib: "64",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTargetNoRestrictions("cc_library_shared", "lib32", AttrNameToString{
-				"local_includes": `["."]`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm64": ["@platforms//:incompatible"],
-        "//build/bazel_common_rules/platforms/arch:riscv64": ["@platforms//:incompatible"],
-        "//build/bazel_common_rules/platforms/arch:x86_64": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTargetNoRestrictions("cc_library_static", "lib32_bp2build_cc_library_static", AttrNameToString{
-				"local_includes": `["."]`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm64": ["@platforms//:incompatible"],
-        "//build/bazel_common_rules/platforms/arch:riscv64": ["@platforms//:incompatible"],
-        "//build/bazel_common_rules/platforms/arch:x86_64": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTargetNoRestrictions("cc_library_shared", "lib64", AttrNameToString{
-				"local_includes": `["."]`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["@platforms//:incompatible"],
-        "//build/bazel_common_rules/platforms/arch:x86": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTargetNoRestrictions("cc_library_static", "lib64_bp2build_cc_library_static", AttrNameToString{
-				"local_includes": `["."]`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["@platforms//:incompatible"],
-        "//build/bazel_common_rules/platforms/arch:x86": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	}
-	runCcLibraryTestCase(t, tc)
-}
-
-func TestNdkLibraryConversion(t *testing.T) {
-	tc := Bp2buildTestCase{
-		Description:                "ndk_library conversion",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-cc_library {
-	name: "libfoo",
-}
-ndk_library {
-	name: "libfoo",
-	first_version: "29",
-	symbol_file: "libfoo.map.txt",
-}
-`,
-		StubbedBuildDefinitions: []string{"libfoo"},
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_stub_suite", "libfoo.ndk_stub_libs", AttrNameToString{
-				"api_surface":          `"publicapi"`,
-				"included_in_ndk":      `True`,
-				"soname":               `"libfoo.so"`,
-				"source_library_label": `"//:libfoo"`,
-				"symbol_file":          `"libfoo.map.txt"`,
-				"versions": `[
-        "29",
-        "30",
-        "S",
-        "Tiramisu",
-        "current",
-    ]`,
-			}),
-		},
-	}
-	runCcLibraryTestCase(t, tc)
-}
-
-func TestNdkHeadersConversion(t *testing.T) {
-	tc := Bp2buildTestCase{
-		Description:                "ndk_headers conversion",
-		ModuleTypeUnderTest:        "ndk_headers",
-		ModuleTypeUnderTestFactory: cc.NdkHeadersFactory,
-		Blueprint: `
-ndk_headers {
-	name: "libfoo_headers",
-	from: "from",
-	to: "to",
-	srcs: ["foo.h", "foo_other.h"]
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTargetNoRestrictions("ndk_headers", "libfoo_headers", AttrNameToString{
-				"strip_import_prefix": `"from"`,
-				"import_prefix":       `"to"`,
-				"hdrs": `[
-        "foo.h",
-        "foo_other.h",
-    ]`,
-			}),
-		},
-	}
-	runCcLibraryTestCase(t, tc)
-}
-
-func TestVersionedNdkHeadersConversion(t *testing.T) {
-	tc := Bp2buildTestCase{
-		Description:                "versioned_ndk_headers conversion",
-		ModuleTypeUnderTest:        "versioned_ndk_headers",
-		ModuleTypeUnderTestFactory: cc.VersionedNdkHeadersFactory,
-		Blueprint: `
-versioned_ndk_headers {
-	name: "libfoo_headers",
-	from: "from",
-	to: "to",
-}
-`,
-		Filesystem: map[string]string{
-			"from/foo.h":       "",
-			"from/foo_other.h": "",
-		},
-		ExpectedBazelTargets: []string{
-			MakeBazelTargetNoRestrictions("ndk_headers", "libfoo_headers", AttrNameToString{
-				"strip_import_prefix": `"from"`,
-				"import_prefix":       `"to"`,
-				"hdrs": `[
-        "from/foo.h",
-        "from/foo_other.h",
-    ]`,
-				"run_versioner": "True",
-			}),
-		},
-	}
-	runCcLibraryTestCase(t, tc)
-}
-
-// Regression test for b/303307456.
-// TODO: b/202299295 - Remove this test when cc rules have proper support
-// for the `required` property
-func TestCcModules_requiredProperty(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc modules do not use the required property",
-		Filesystem: map[string]string{
-			"foo.c": "",
-			"bar.c": "",
-		},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library {
-    name: "foo_both",
-    srcs: ["foo.c"],
-    include_build_directory: false,
-    required: ["bar"],
-}
-cc_library_shared {
-    name: "foo_shared",
-    srcs: ["foo.c"],
-    include_build_directory: false,
-    required: ["bar"],
-}
-cc_library_static {
-    name: "foo_static",
-    srcs: ["foo.c"],
-    include_build_directory: false,
-    required: ["bar"],
-}
-cc_library_static {
-    name: "bar",
-    srcs: ["bar.c"],
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_both_bp2build_cc_library_static", AttrNameToString{
-				"srcs_c": `["foo.c"]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo_both", AttrNameToString{
-				"srcs_c": `["foo.c"]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
-				"srcs_c": `["foo.c"]`,
-			}),
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"srcs_c": `["foo.c"]`,
-			}),
-			MakeBazelTarget("cc_library_static", "bar", AttrNameToString{
-				"srcs_c": `["bar.c"]`,
-			}),
-		},
-	})
-}
-
-func TestPropertiesIfStubLibraryIsInNdk(t *testing.T) {
-	tc := Bp2buildTestCase{
-		Description:                "If an equivalent ndk_library exists, set included_in_ndk=true for module-libapi stubs",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Blueprint: `
-// libfoo is an ndk library and contributes to module-libapi
-cc_library {
-	name: "libfoo",
-	stubs: {symbol_file: "libfoo.map.txt"},
-}
-ndk_library {
-	name: "libfoo",
-	first_version: "29",
-	symbol_file: "libfoo.map.txt",
-}
-// libbar is not an ndk library, but contributes to module-libapi
-cc_library {
-	name: "libbar",
-	stubs: {symbol_file: "libbar.map.txt"},
-}
-`,
-		StubbedBuildDefinitions: []string{"libfoo.ndk"},
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "libfoo_bp2build_cc_library_static", AttrNameToString{
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "libfoo", AttrNameToString{
-				"local_includes":    `["."]`,
-				"stubs_symbol_file": `"libfoo.map.txt"`,
-			}),
-			MakeBazelTarget("cc_stub_suite", "libfoo_stub_libs", AttrNameToString{
-				"api_surface":          `"module-libapi"`,
-				"soname":               `"libfoo.so"`,
-				"source_library_label": `"//:libfoo"`,
-				"symbol_file":          `"libfoo.map.txt"`,
-				"versions":             `["current"]`,
-				"included_in_ndk":      `True`,
-			}),
-			MakeBazelTarget("cc_library_static", "libbar_bp2build_cc_library_static", AttrNameToString{
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "libbar", AttrNameToString{
-				"local_includes":    `["."]`,
-				"stubs_symbol_file": `"libbar.map.txt"`,
-			}),
-			MakeBazelTarget("cc_stub_suite", "libbar_stub_libs", AttrNameToString{
-				"api_surface":          `"module-libapi"`,
-				"soname":               `"libbar.so"`,
-				"source_library_label": `"//:libbar"`,
-				"symbol_file":          `"libbar.map.txt"`,
-				"versions":             `["current"]`,
-			}),
-		},
-	}
-	runCcLibraryTestCase(t, tc)
-}
diff --git a/bp2build/cc_library_headers_conversion_test.go b/bp2build/cc_library_headers_conversion_test.go
deleted file mode 100644
index 7655986..0000000
--- a/bp2build/cc_library_headers_conversion_test.go
+++ /dev/null
@@ -1,486 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/cc"
-)
-
-const (
-	// See cc/testing.go for more context
-	soongCcLibraryHeadersPreamble = `
-cc_defaults {
-    name: "linux_bionic_supported",
-}`
-)
-
-func TestCcLibraryHeadersLoadStatement(t *testing.T) {
-	testCases := []struct {
-		bazelTargets           BazelTargets
-		expectedLoadStatements string
-	}{
-		{
-			bazelTargets: BazelTargets{
-				BazelTarget{
-					name:      "cc_library_headers_target",
-					ruleClass: "cc_library_headers",
-					// Note: no bzlLoadLocation for native rules
-				},
-			},
-			expectedLoadStatements: ``,
-		},
-	}
-
-	for _, testCase := range testCases {
-		actual := testCase.bazelTargets.LoadStatements()
-		expected := testCase.expectedLoadStatements
-		if actual != expected {
-			t.Fatalf("Expected load statements to be %s, got %s", expected, actual)
-		}
-	}
-}
-
-func registerCcLibraryHeadersModuleTypes(ctx android.RegistrationContext) {
-	cc.RegisterCCBuildComponents(ctx)
-	cc.RegisterLibraryHeadersBuildComponents(ctx)
-	ctx.RegisterModuleType("cc_library_shared", cc.LibrarySharedFactory)
-}
-
-func runCcLibraryHeadersTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, registerCcLibraryHeadersModuleTypes, tc)
-}
-
-func TestCcLibraryHeadersSimple(t *testing.T) {
-	runCcLibraryHeadersTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_headers test",
-		Filesystem: map[string]string{
-			"dir-1/dir1a.h":                        "",
-			"dir-1/dir1b.h":                        "",
-			"dir-2/dir2a.h":                        "",
-			"dir-2/dir2b.h":                        "",
-			"arch_arm64_exported_include_dir/a.h":  "",
-			"arch_x86_exported_include_dir/b.h":    "",
-			"arch_x86_64_exported_include_dir/c.h": "",
-		},
-		Blueprint: soongCcLibraryHeadersPreamble + `
-cc_library_headers {
-    name: "foo_headers",
-    export_include_dirs: ["dir-1", "dir-2"],
-
-    arch: {
-        arm64: {
-      // We expect dir-1 headers to be dropped, because dir-1 is already in export_include_dirs
-            export_include_dirs: ["arch_arm64_exported_include_dir", "dir-1"],
-        },
-        x86: {
-            export_include_dirs: ["arch_x86_exported_include_dir"],
-        },
-        x86_64: {
-            export_include_dirs: ["arch_x86_64_exported_include_dir"],
-        },
-    },
-    sdk_version: "current",
-    min_sdk_version: "29",
-
-    // TODO: Also support export_header_lib_headers
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
-				"export_includes": `select({
-        "//build/bazel_common_rules/platforms/arch:arm64": ["arch_arm64_exported_include_dir"],
-        "//build/bazel_common_rules/platforms/arch:x86": ["arch_x86_exported_include_dir"],
-        "//build/bazel_common_rules/platforms/arch:x86_64": ["arch_x86_64_exported_include_dir"],
-        "//conditions:default": [],
-    }) + [
-        "dir-1",
-        "dir-2",
-    ]`,
-				"sdk_version":     `"current"`,
-				"min_sdk_version": `"29"`,
-				"deps": `select({
-        "//build/bazel/rules/apex:unbundled_app": ["//build/bazel/rules/cc:ndk_sysroot"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-// header_libs has "variant_prepend" tag. In bp2build output,
-// variant info(select) should go before general info.
-func TestCcLibraryHeadersOsSpecificHeader(t *testing.T) {
-	runCcLibraryHeadersTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_headers test with os-specific header_libs props",
-		Filesystem:  map[string]string{},
-		StubbedBuildDefinitions: []string{"android-lib", "base-lib", "darwin-lib",
-			"linux-lib", "linux_bionic-lib", "windows-lib"},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library_headers {
-    name: "android-lib",
-}
-cc_library_headers {
-    name: "base-lib",
-}
-cc_library_headers {
-    name: "darwin-lib",
-}
-cc_library_headers {
-    name: "linux-lib",
-}
-cc_library_headers {
-    name: "linux_bionic-lib",
-}
-cc_library_headers {
-    name: "windows-lib",
-}
-cc_library_headers {
-    name: "foo_headers",
-    header_libs: ["base-lib"],
-		export_header_lib_headers: ["base-lib"],
-    target: {
-        android: {
-						header_libs: ["android-lib"],
-						export_header_lib_headers: ["android-lib"],
-				},
-        darwin: {
-						header_libs: ["darwin-lib"],
-						export_header_lib_headers: ["darwin-lib"],
-				},
-        linux_bionic: {
-						header_libs: ["linux_bionic-lib"],
-						export_header_lib_headers: ["linux_bionic-lib"],
-				},
-        linux_glibc: {
-						header_libs: ["linux-lib"],
-						export_header_lib_headers: ["linux-lib"],
-				},
-        windows: {
-						header_libs: ["windows-lib"],
-						export_header_lib_headers: ["windows-lib"],
-				},
-    },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
-				"deps": `select({
-        "//build/bazel_common_rules/platforms/os:android": [":android-lib"],
-        "//build/bazel_common_rules/platforms/os:darwin": [":darwin-lib"],
-        "//build/bazel_common_rules/platforms/os:linux_bionic": [":linux_bionic-lib"],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": [":linux-lib"],
-        "//build/bazel_common_rules/platforms/os:windows": [":windows-lib"],
-        "//conditions:default": [],
-    }) + [":base-lib"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryHeadersOsSpecficHeaderLibsExportHeaderLibHeaders(t *testing.T) {
-	runCcLibraryHeadersTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_headers test with os-specific header_libs and export_header_lib_headers props",
-		Filesystem:              map[string]string{},
-		StubbedBuildDefinitions: []string{"android-lib", "exported-lib"},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library_headers {
-    name: "android-lib",
-  }
-cc_library_headers {
-    name: "exported-lib",
-}
-cc_library_headers {
-    name: "foo_headers",
-    target: {
-        android: {
-            header_libs: ["android-lib", "exported-lib"],
-            export_header_lib_headers: ["exported-lib"]
-        },
-    },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
-				"deps": `select({
-        "//build/bazel_common_rules/platforms/os:android": [":exported-lib"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryHeadersArchAndTargetExportSystemIncludes(t *testing.T) {
-	runCcLibraryHeadersTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_headers test with arch-specific and target-specific export_system_include_dirs props",
-		Filesystem:  map[string]string{},
-		Blueprint: soongCcLibraryPreamble + `cc_library_headers {
-    name: "foo_headers",
-    export_system_include_dirs: [
-        "shared_include_dir",
-    ],
-    target: {
-        android: {
-            export_system_include_dirs: [
-                "android_include_dir",
-            ],
-        },
-        linux_glibc: {
-            export_system_include_dirs: [
-                "linux_include_dir",
-            ],
-        },
-        darwin: {
-            export_system_include_dirs: [
-                "darwin_include_dir",
-            ],
-        },
-    },
-    arch: {
-        arm: {
-            export_system_include_dirs: [
-                "arm_include_dir",
-            ],
-        },
-        x86_64: {
-            export_system_include_dirs: [
-                "x86_64_include_dir",
-            ],
-        },
-    },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
-				"export_system_includes": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["android_include_dir"],
-        "//build/bazel_common_rules/platforms/os:darwin": ["darwin_include_dir"],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": ["linux_include_dir"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["arm_include_dir"],
-        "//build/bazel_common_rules/platforms/arch:x86_64": ["x86_64_include_dir"],
-        "//conditions:default": [],
-    }) + ["shared_include_dir"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryHeadersNoCrtIgnored(t *testing.T) {
-	runCcLibraryHeadersTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_headers test",
-		Filesystem: map[string]string{
-			"lib-1/lib1a.h":                        "",
-			"lib-1/lib1b.h":                        "",
-			"lib-2/lib2a.h":                        "",
-			"lib-2/lib2b.h":                        "",
-			"dir-1/dir1a.h":                        "",
-			"dir-1/dir1b.h":                        "",
-			"dir-2/dir2a.h":                        "",
-			"dir-2/dir2b.h":                        "",
-			"arch_arm64_exported_include_dir/a.h":  "",
-			"arch_x86_exported_include_dir/b.h":    "",
-			"arch_x86_64_exported_include_dir/c.h": "",
-		},
-		Blueprint: soongCcLibraryHeadersPreamble + `
-cc_library_headers {
-    name: "lib-1",
-    export_include_dirs: ["lib-1"],
-    no_libcrt: true,
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_headers", "lib-1", AttrNameToString{
-				"export_includes": `["lib-1"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryHeadersExportedStaticLibHeadersReexported(t *testing.T) {
-	runCcLibraryHeadersTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_headers exported_static_lib_headers is reexported",
-		Filesystem:              map[string]string{},
-		StubbedBuildDefinitions: []string{"foo_export", "foo_no_reexport"},
-		Blueprint: soongCcLibraryHeadersPreamble + `
-cc_library_headers {
-		name: "foo_headers",
-		export_static_lib_headers: ["foo_export"],
-		static_libs: ["foo_export", "foo_no_reexport"],
-    bazel_module: { bp2build_available: true },
-}
-` + simpleModule("cc_library_headers", "foo_export") +
-			simpleModule("cc_library_headers", "foo_no_reexport"),
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
-				"deps": `[":foo_export"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryHeadersExportedSharedLibHeadersReexported(t *testing.T) {
-	runCcLibraryHeadersTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_headers exported_shared_lib_headers is reexported",
-		Filesystem:              map[string]string{},
-		StubbedBuildDefinitions: []string{"foo_export", "foo_no_reexport"},
-		Blueprint: soongCcLibraryHeadersPreamble + `
-cc_library_headers {
-		name: "foo_headers",
-		export_shared_lib_headers: ["foo_export"],
-		shared_libs: ["foo_export", "foo_no_reexport"],
-    bazel_module: { bp2build_available: true },
-}
-` + simpleModule("cc_library_headers", "foo_export") +
-			simpleModule("cc_library_headers", "foo_no_reexport"),
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
-				"deps": `[":foo_export"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryHeadersExportedHeaderLibHeadersReexported(t *testing.T) {
-	runCcLibraryHeadersTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_headers exported_header_lib_headers is reexported",
-		Filesystem:              map[string]string{},
-		StubbedBuildDefinitions: []string{"foo_export", "foo_no_reexport"},
-		Blueprint: soongCcLibraryHeadersPreamble + `
-cc_library_headers {
-		name: "foo_headers",
-		export_header_lib_headers: ["foo_export"],
-		header_libs: ["foo_export", "foo_no_reexport"],
-    bazel_module: { bp2build_available: true },
-}
-` + simpleModule("cc_library_headers", "foo_export") +
-			simpleModule("cc_library_headers", "foo_no_reexport"),
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
-				"deps": `[":foo_export"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryHeadersWholeStaticLibsReexported(t *testing.T) {
-	runCcLibraryHeadersTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_headers whole_static_libs is reexported",
-		Filesystem:              map[string]string{},
-		StubbedBuildDefinitions: []string{"foo_export"},
-		Blueprint: soongCcLibraryHeadersPreamble + `
-cc_library_headers {
-		name: "foo_headers",
-		whole_static_libs: ["foo_export"],
-    bazel_module: { bp2build_available: true },
-}
-` + simpleModule("cc_library_headers", "foo_export"),
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
-				"deps": `[":foo_export"]`,
-			}),
-		},
-	})
-}
-
-func TestPrebuiltCcLibraryHeadersWholeStaticLibsReexported(t *testing.T) {
-	runCcLibraryHeadersTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_headers whole_static_libs is reexported",
-		Filesystem: map[string]string{
-			"foo/bar/Android.bp": simpleModule("cc_library_headers", "foo_headers"),
-		},
-		StubbedBuildDefinitions: []string{"foo_export"},
-		Blueprint: soongCcLibraryHeadersPreamble + `
-cc_prebuilt_library_headers {
-		name: "foo_headers",
-		whole_static_libs: ["foo_export"],
-    bazel_module: { bp2build_available: true },
-}
-` + simpleModule("cc_library_headers", "foo_export"),
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
-				"deps": `[":foo_export"]`,
-			}),
-		},
-	})
-}
-
-func TestPrebuiltCcLibraryHeadersPreferredRdepUpdated(t *testing.T) {
-	runCcLibraryHeadersTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_headers prebuilt preferred is used as rdep",
-		StubbedBuildDefinitions: []string{"foo_export", "//foo/bar:foo_headers"},
-		Filesystem: map[string]string{
-			"foo/bar/Android.bp": simpleModule("cc_library_headers", "foo_headers"),
-		},
-		Blueprint: soongCcLibraryHeadersPreamble + `
-cc_prebuilt_library_headers {
-		name: "foo_headers",
-		whole_static_libs: ["foo_export"],
-		bazel_module: { bp2build_available: true },
-		prefer: true,
-}
-
-cc_library_shared {
-	name: "foo",
-	header_libs: ["foo_headers"],
-	include_build_directory: false,
-}
-` + simpleModule("cc_library_headers", "foo_export"),
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
-				"deps": `[":foo_export"]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"implementation_deps": `[":foo_headers"]`,
-			}),
-		},
-	})
-}
-
-func TestPrebuiltCcLibraryHeadersRdepUpdated(t *testing.T) {
-	runCcLibraryHeadersTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_headers not preferred is not used for rdep",
-		StubbedBuildDefinitions: []string{"foo_export", "//foo/bar:foo_headers"},
-		Filesystem: map[string]string{
-			"foo/bar/Android.bp": simpleModule("cc_library_headers", "foo_headers"),
-		},
-		Blueprint: soongCcLibraryHeadersPreamble + `
-cc_prebuilt_library_headers {
-		name: "foo_headers",
-		whole_static_libs: ["foo_export"],
-		bazel_module: { bp2build_available: true },
-		prefer: false,
-}
-
-cc_library_shared {
-	name: "foo",
-	header_libs: ["foo_headers"],
-	include_build_directory: false,
-}
-` + simpleModule("cc_library_headers", "foo_export"),
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
-				"deps": `[":foo_export"]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"implementation_deps": `["//foo/bar:foo_headers"]`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/cc_library_shared_conversion_test.go b/bp2build/cc_library_shared_conversion_test.go
deleted file mode 100644
index 9f9fcf9..0000000
--- a/bp2build/cc_library_shared_conversion_test.go
+++ /dev/null
@@ -1,1656 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/cc"
-)
-
-const (
-	// See cc/testing.go for more context
-	// TODO(alexmarquez): Split out the preamble into common code?
-	soongCcLibrarySharedPreamble = soongCcLibraryStaticPreamble
-)
-
-func registerCcLibrarySharedModuleTypes(ctx android.RegistrationContext) {
-	cc.RegisterCCBuildComponents(ctx)
-	ctx.RegisterModuleType("cc_library_headers", cc.LibraryHeaderFactory)
-	ctx.RegisterModuleType("cc_library_static", cc.LibraryStaticFactory)
-	ctx.RegisterModuleType("cc_library", cc.LibraryFactory)
-	ctx.RegisterModuleType("ndk_library", cc.NdkLibraryFactory)
-}
-
-func runCcLibrarySharedTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	t.Parallel()
-	tc.StubbedBuildDefinitions = append(tc.StubbedBuildDefinitions, "libbuildversion", "libprotobuf-cpp-lite", "libprotobuf-cpp-full")
-	(&tc).ModuleTypeUnderTest = "cc_library_shared"
-	(&tc).ModuleTypeUnderTestFactory = cc.LibrarySharedFactory
-	RunBp2BuildTestCase(t, registerCcLibrarySharedModuleTypes, tc)
-}
-
-func TestCcLibrarySharedSimple(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_shared simple overall test",
-		StubbedBuildDefinitions: []string{"header_lib_1", "header_lib_2", "whole_static_lib_1", "whole_static_lib_2", "shared_lib_1", "shared_lib_2"},
-		Filesystem: map[string]string{
-			// NOTE: include_dir headers *should not* appear in Bazel hdrs later (?)
-			"include_dir_1/include_dir_1_a.h": "",
-			"include_dir_1/include_dir_1_b.h": "",
-			"include_dir_2/include_dir_2_a.h": "",
-			"include_dir_2/include_dir_2_b.h": "",
-			// NOTE: local_include_dir headers *should not* appear in Bazel hdrs later (?)
-			"local_include_dir_1/local_include_dir_1_a.h": "",
-			"local_include_dir_1/local_include_dir_1_b.h": "",
-			"local_include_dir_2/local_include_dir_2_a.h": "",
-			"local_include_dir_2/local_include_dir_2_b.h": "",
-			// NOTE: export_include_dir headers *should* appear in Bazel hdrs later
-			"export_include_dir_1/export_include_dir_1_a.h": "",
-			"export_include_dir_1/export_include_dir_1_b.h": "",
-			"export_include_dir_2/export_include_dir_2_a.h": "",
-			"export_include_dir_2/export_include_dir_2_b.h": "",
-			// NOTE: Soong implicitly includes headers in the current directory
-			"implicit_include_1.h": "",
-			"implicit_include_2.h": "",
-		},
-		Blueprint: soongCcLibrarySharedPreamble + `
-cc_library_headers {
-    name: "header_lib_1",
-    export_include_dirs: ["header_lib_1"],
-}
-
-cc_library_headers {
-    name: "header_lib_2",
-    export_include_dirs: ["header_lib_2"],
-}
-
-cc_library_shared {
-    name: "shared_lib_1",
-    srcs: ["shared_lib_1.cc"],
-}
-
-cc_library_shared {
-    name: "shared_lib_2",
-    srcs: ["shared_lib_2.cc"],
-}
-
-cc_library_static {
-    name: "whole_static_lib_1",
-    srcs: ["whole_static_lib_1.cc"],
-}
-
-cc_library_static {
-    name: "whole_static_lib_2",
-    srcs: ["whole_static_lib_2.cc"],
-}
-
-cc_library_shared {
-    name: "foo_shared",
-    srcs: [
-        "foo_shared1.cc",
-        "foo_shared2.cc",
-    ],
-    cflags: [
-        "-Dflag1",
-        "-Dflag2"
-    ],
-    shared_libs: [
-        "shared_lib_1",
-        "shared_lib_2"
-    ],
-    whole_static_libs: [
-        "whole_static_lib_1",
-        "whole_static_lib_2"
-    ],
-    include_dirs: [
-        "include_dir_1",
-        "include_dir_2",
-    ],
-    local_include_dirs: [
-        "local_include_dir_1",
-        "local_include_dir_2",
-    ],
-    export_include_dirs: [
-        "export_include_dir_1",
-        "export_include_dir_2"
-    ],
-    header_libs: [
-        "header_lib_1",
-        "header_lib_2"
-    ],
-    sdk_version: "current",
-    min_sdk_version: "29",
-
-    // TODO: Also support export_header_lib_headers
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
-				"absolute_includes": `[
-        "include_dir_1",
-        "include_dir_2",
-    ]`,
-				"copts": `[
-        "-Dflag1",
-        "-Dflag2",
-    ]`,
-				"export_includes": `[
-        "export_include_dir_1",
-        "export_include_dir_2",
-    ]`,
-				"implementation_deps": `[
-        ":header_lib_1",
-        ":header_lib_2",
-    ]`,
-				"implementation_dynamic_deps": `[
-        ":shared_lib_1",
-        ":shared_lib_2",
-    ]`,
-				"local_includes": `[
-        "local_include_dir_1",
-        "local_include_dir_2",
-        ".",
-    ]`,
-				"srcs": `[
-        "foo_shared1.cc",
-        "foo_shared2.cc",
-    ]`,
-				"whole_archive_deps": `[
-        ":whole_static_lib_1",
-        ":whole_static_lib_2",
-    ]`,
-				"sdk_version":     `"current"`,
-				"min_sdk_version": `"29"`,
-				"deps": `select({
-        "//build/bazel/rules/apex:unbundled_app": ["//build/bazel/rules/cc:ndk_sysroot"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedArchSpecificSharedLib(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_shared arch-specific shared_libs with whole_static_libs",
-		Filesystem:              map[string]string{},
-		StubbedBuildDefinitions: []string{"static_dep", "shared_dep"},
-		Blueprint: soongCcLibrarySharedPreamble + `
-cc_library_static {
-    name: "static_dep",
-}
-cc_library_shared {
-    name: "shared_dep",
-}
-cc_library_shared {
-    name: "foo_shared",
-    arch: { arm64: { shared_libs: ["shared_dep"], whole_static_libs: ["static_dep"] } },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
-				"implementation_dynamic_deps": `select({
-        "//build/bazel_common_rules/platforms/arch:arm64": [":shared_dep"],
-        "//conditions:default": [],
-    })`,
-				"whole_archive_deps": `select({
-        "//build/bazel_common_rules/platforms/arch:arm64": [":static_dep"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedOsSpecificSharedLib(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		StubbedBuildDefinitions: []string{"shared_dep"},
-		Description:             "cc_library_shared os-specific shared_libs",
-		Filesystem:              map[string]string{},
-		Blueprint: soongCcLibrarySharedPreamble + `
-cc_library_shared {
-    name: "shared_dep",
-}
-cc_library_shared {
-    name: "foo_shared",
-    target: { android: { shared_libs: ["shared_dep"], } },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
-				"implementation_dynamic_deps": `select({
-        "//build/bazel_common_rules/platforms/os:android": [":shared_dep"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedBaseArchOsSpecificSharedLib(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		StubbedBuildDefinitions: []string{"shared_dep", "shared_dep2", "shared_dep3"},
-		Description:             "cc_library_shared base, arch, and os-specific shared_libs",
-		Filesystem:              map[string]string{},
-		Blueprint: soongCcLibrarySharedPreamble + `
-cc_library_shared {
-    name: "shared_dep",
-}
-cc_library_shared {
-    name: "shared_dep2",
-}
-cc_library_shared {
-    name: "shared_dep3",
-}
-cc_library_shared {
-    name: "foo_shared",
-    shared_libs: ["shared_dep"],
-    target: { android: { shared_libs: ["shared_dep2"] } },
-    arch: { arm64: { shared_libs: ["shared_dep3"] } },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
-				"implementation_dynamic_deps": `[":shared_dep"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm64": [":shared_dep3"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel_common_rules/platforms/os:android": [":shared_dep2"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedSimpleExcludeSrcs(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared simple exclude_srcs",
-		Filesystem: map[string]string{
-			"common.c":       "",
-			"foo-a.c":        "",
-			"foo-excluded.c": "",
-		},
-		Blueprint: soongCcLibrarySharedPreamble + `
-cc_library_shared {
-    name: "foo_shared",
-    srcs: ["common.c", "foo-*.c"],
-    exclude_srcs: ["foo-excluded.c"],
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
-				"srcs_c": `[
-        "common.c",
-        "foo-a.c",
-    ]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedStrip(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared stripping",
-		Filesystem:  map[string]string{},
-		Blueprint: soongCcLibrarySharedPreamble + `
-cc_library_shared {
-    name: "foo_shared",
-    strip: {
-        keep_symbols: false,
-        keep_symbols_and_debug_frame: true,
-        keep_symbols_list: ["sym", "sym2"],
-        all: true,
-        none: false,
-    },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
-				"strip": `{
-        "all": True,
-        "keep_symbols": False,
-        "keep_symbols_and_debug_frame": True,
-        "keep_symbols_list": [
-            "sym",
-            "sym2",
-        ],
-        "none": False,
-    }`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedVersionScriptAndDynamicList(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared version script and dynamic list",
-		Filesystem: map[string]string{
-			"version_script": "",
-			"dynamic.list":   "",
-		},
-		Blueprint: soongCcLibrarySharedPreamble + `
-cc_library_shared {
-    name: "foo_shared",
-    version_script: "version_script",
-    dynamic_list: "dynamic.list",
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
-				"additional_linker_inputs": `[
-        "version_script",
-        "dynamic.list",
-    ]`,
-				"linkopts": `[
-        "-Wl,--version-script,$(location version_script)",
-        "-Wl,--dynamic-list,$(location dynamic.list)",
-    ]`,
-				"features": `["android_cfi_exports_map"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryLdflagsSplitBySpaceSoongAdded(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "ldflags are split by spaces except for the ones added by soong (version script and dynamic list)",
-		Filesystem: map[string]string{
-			"version_script": "",
-			"dynamic.list":   "",
-		},
-		Blueprint: `
-cc_library_shared {
-    name: "foo",
-    ldflags: [
-        "--nospace_flag",
-        "-z spaceflag",
-    ],
-    version_script: "version_script",
-    dynamic_list: "dynamic.list",
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"additional_linker_inputs": `[
-        "version_script",
-        "dynamic.list",
-    ]`,
-				"linkopts": `[
-        "--nospace_flag",
-        "-z",
-        "spaceflag",
-        "-Wl,--version-script,$(location version_script)",
-        "-Wl,--dynamic-list,$(location dynamic.list)",
-    ]`,
-				"features": `["android_cfi_exports_map"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedNoCrtTrue(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared - nocrt: true disables feature",
-		Filesystem: map[string]string{
-			"impl.cpp": "",
-		},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library_shared {
-    name: "foo_shared",
-    srcs: ["impl.cpp"],
-    nocrt: true,
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
-				"features": `["-link_crt"]`,
-				"srcs":     `["impl.cpp"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedNoCrtFalse(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared - nocrt: false doesn't disable feature",
-		Filesystem: map[string]string{
-			"impl.cpp": "",
-		},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library_shared {
-    name: "foo_shared",
-    srcs: ["impl.cpp"],
-    nocrt: false,
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
-				"srcs": `["impl.cpp"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedNoCrtArchVariant(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared - nocrt in select",
-		Filesystem: map[string]string{
-			"impl.cpp": "",
-		},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library_shared {
-    name: "foo_shared",
-    srcs: ["impl.cpp"],
-    arch: {
-        arm: {
-            nocrt: true,
-        },
-        x86: {
-            nocrt: false,
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
-				"features": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["-link_crt"],
-        "//conditions:default": [],
-    })`,
-				"srcs": `["impl.cpp"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedProto(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Blueprint: soongCcProtoPreamble + `cc_library_shared {
-	name: "foo",
-	srcs: ["foo.proto"],
-	proto: {
-		export_proto_headers: true,
-	},
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-				"srcs": `["foo.proto"]`,
-			}), MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
-				"deps": `[":foo_proto"]`,
-			}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"dynamic_deps":       `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":foo_cc_proto_lite"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedUseVersionLib(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Filesystem: map[string]string{
-			soongCcVersionLibBpPath: soongCcVersionLibBp,
-		},
-		StubbedBuildDefinitions: []string{"//build/soong/cc/libbuildversion:libbuildversion"},
-		Blueprint: soongCcProtoPreamble + `cc_library_shared {
-        name: "foo",
-        use_version_lib: true,
-        include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"use_version_lib":    "True",
-				"whole_archive_deps": `["//build/soong/cc/libbuildversion:libbuildversion"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedStubs(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library_shared stubs",
-		ModuleTypeUnderTest:        "cc_library_shared",
-		ModuleTypeUnderTestFactory: cc.LibrarySharedFactory,
-		Dir:                        "foo/bar",
-		Filesystem: map[string]string{
-			"foo/bar/Android.bp": `
-cc_library_shared {
-	name: "a",
-	stubs: { symbol_file: "a.map.txt", versions: ["28", "29", "current"] },
-	bazel_module: { bp2build_available: true },
-	include_build_directory: false,
-}
-`,
-		},
-		Blueprint: soongCcLibraryPreamble,
-		ExpectedBazelTargets: []string{makeCcStubSuiteTargets("a", AttrNameToString{
-			"api_surface":          `"module-libapi"`,
-			"soname":               `"a.so"`,
-			"source_library_label": `"//foo/bar:a"`,
-			"stubs_symbol_file":    `"a.map.txt"`,
-			"stubs_versions": `[
-        "28",
-        "29",
-        "current",
-    ]`,
-		}),
-			MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
-				"stubs_symbol_file": `"a.map.txt"`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedStubs_UseImplementationInSameApex(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library_shared stubs",
-		ModuleTypeUnderTest:        "cc_library_shared",
-		ModuleTypeUnderTestFactory: cc.LibrarySharedFactory,
-		StubbedBuildDefinitions:    []string{"a"},
-		Blueprint: soongCcLibrarySharedPreamble + `
-cc_library_shared {
-	name: "a",
-	stubs: { symbol_file: "a.map.txt", versions: ["28", "29", "current"] },
-	include_build_directory: false,
-	apex_available: ["made_up_apex"],
-}
-cc_library_shared {
-	name: "b",
-	shared_libs: [":a"],
-	include_build_directory: false,
-	apex_available: ["made_up_apex"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "b", AttrNameToString{
-				"implementation_dynamic_deps": `[":a"]`,
-				"tags":                        `["apex_available=made_up_apex"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedStubs_UseStubsInDifferentApex(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library_shared stubs",
-		ModuleTypeUnderTest:        "cc_library_shared",
-		ModuleTypeUnderTestFactory: cc.LibrarySharedFactory,
-		StubbedBuildDefinitions:    []string{"a"},
-		Blueprint: soongCcLibrarySharedPreamble + `
-cc_library_shared {
-	name: "a",
-	stubs: { symbol_file: "a.map.txt", versions: ["28", "29", "current"] },
-	include_build_directory: false,
-	apex_available: ["apex_a"],
-}
-cc_library_shared {
-	name: "b",
-	shared_libs: [":a"],
-	include_build_directory: false,
-	apex_available: ["apex_b"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "b", AttrNameToString{
-				"implementation_dynamic_deps": `select({
-        "//build/bazel/rules/apex:apex_b": ["@api_surfaces//module-libapi/current:a"],
-        "//build/bazel/rules/apex:system": ["@api_surfaces//module-libapi/current:a"],
-        "//conditions:default": [":a"],
-    })`,
-				"tags": `["apex_available=apex_b"]`,
-			}),
-		},
-	})
-}
-
-// Tests that library in apexfoo links against stubs of platform_lib and otherapex_lib
-func TestCcLibrarySharedStubs_UseStubsFromMultipleApiDomains(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library_shared stubs",
-		ModuleTypeUnderTest:        "cc_library_shared",
-		ModuleTypeUnderTestFactory: cc.LibrarySharedFactory,
-		StubbedBuildDefinitions:    []string{"libplatform_stable", "libapexfoo_stable"},
-		Blueprint: soongCcLibrarySharedPreamble + `
-cc_library_shared {
-	name: "libplatform_stable",
-	stubs: { symbol_file: "libplatform_stable.map.txt", versions: ["28", "29", "current"] },
-	apex_available: ["//apex_available:platform"],
-	include_build_directory: false,
-}
-cc_library_shared {
-	name: "libapexfoo_stable",
-	stubs: { symbol_file: "libapexfoo_stable.map.txt", versions: ["28", "29", "current"] },
-	apex_available: ["apexfoo"],
-	include_build_directory: false,
-}
-cc_library_shared {
-	name: "libutils",
-	shared_libs: ["libplatform_stable", "libapexfoo_stable",],
-	apex_available: ["//apex_available:platform", "apexfoo", "apexbar"],
-	include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "libutils", AttrNameToString{
-				"implementation_dynamic_deps": `select({
-        "//build/bazel/rules/apex:apexbar": [
-            "@api_surfaces//module-libapi/current:libplatform_stable",
-            "@api_surfaces//module-libapi/current:libapexfoo_stable",
-        ],
-        "//build/bazel/rules/apex:apexfoo": [
-            "@api_surfaces//module-libapi/current:libplatform_stable",
-            ":libapexfoo_stable",
-        ],
-        "//build/bazel/rules/apex:system": [
-            ":libplatform_stable",
-            "@api_surfaces//module-libapi/current:libapexfoo_stable",
-        ],
-        "//conditions:default": [
-            ":libplatform_stable",
-            ":libapexfoo_stable",
-        ],
-    })`,
-				"tags": `[
-        "apex_available=//apex_available:platform",
-        "apex_available=apexfoo",
-        "apex_available=apexbar",
-    ]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedStubs_IgnorePlatformAvailable(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library_shared stubs",
-		ModuleTypeUnderTest:        "cc_library_shared",
-		ModuleTypeUnderTestFactory: cc.LibrarySharedFactory,
-		StubbedBuildDefinitions:    []string{"a"},
-		Blueprint: soongCcLibrarySharedPreamble + `
-cc_library_shared {
-	name: "a",
-	stubs: { symbol_file: "a.map.txt", versions: ["28", "29", "current"] },
-	include_build_directory: false,
-	apex_available: ["//apex_available:platform", "apex_a"],
-}
-cc_library_shared {
-	name: "b",
-	shared_libs: [":a"],
-	include_build_directory: false,
-	apex_available: ["//apex_available:platform", "apex_b"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "b", AttrNameToString{
-				"implementation_dynamic_deps": `select({
-        "//build/bazel/rules/apex:apex_b": ["@api_surfaces//module-libapi/current:a"],
-        "//build/bazel/rules/apex:system": ["@api_surfaces//module-libapi/current:a"],
-        "//conditions:default": [":a"],
-    })`,
-				"tags": `[
-        "apex_available=//apex_available:platform",
-        "apex_available=apex_b",
-    ]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryDoesNotDropStubDepIfNoVariationAcrossAxis(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library depeends on impl for all configurations",
-		ModuleTypeUnderTest:        "cc_library_shared",
-		ModuleTypeUnderTestFactory: cc.LibrarySharedFactory,
-		StubbedBuildDefinitions:    []string{"a"},
-		Blueprint: soongCcLibrarySharedPreamble + `
-cc_library_shared {
-	name: "a",
-	stubs: { symbol_file: "a.map.txt", versions: ["28", "29", "current"] },
-	apex_available: ["//apex_available:platform"],
-}
-cc_library_shared {
-	name: "b",
-	shared_libs: [":a"],
-	include_build_directory: false,
-	apex_available: ["//apex_available:platform"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "b", AttrNameToString{
-				"implementation_dynamic_deps": `[":a"]`,
-				"tags":                        `["apex_available=//apex_available:platform"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedStubs_MultipleApexAvailable(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		ModuleTypeUnderTest:        "cc_library_shared",
-		ModuleTypeUnderTestFactory: cc.LibrarySharedFactory,
-		StubbedBuildDefinitions:    []string{"a"},
-		Blueprint: soongCcLibrarySharedPreamble + `
-cc_library_shared {
-	name: "a",
-	stubs: { symbol_file: "a.map.txt", versions: ["28", "29", "current"] },
-	include_build_directory: false,
-	apex_available: ["//apex_available:platform", "apex_a", "apex_b"],
-}
-cc_library_shared {
-	name: "b",
-	shared_libs: [":a"],
-	include_build_directory: false,
-	apex_available: ["//apex_available:platform", "apex_b"],
-}
-
-cc_library_shared {
-	name: "c",
-	shared_libs: [":a"],
-	include_build_directory: false,
-	apex_available: ["//apex_available:platform", "apex_a", "apex_b"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "b", AttrNameToString{
-				"implementation_dynamic_deps": `select({
-        "//build/bazel/rules/apex:system": ["@api_surfaces//module-libapi/current:a"],
-        "//conditions:default": [":a"],
-    })`,
-				"tags": `[
-        "apex_available=//apex_available:platform",
-        "apex_available=apex_b",
-    ]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "c", AttrNameToString{
-				"implementation_dynamic_deps": `[":a"]`,
-				"tags": `[
-        "apex_available=//apex_available:platform",
-        "apex_available=apex_a",
-        "apex_available=apex_b",
-    ]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedSystemSharedLibsSharedEmpty(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library_shared system_shared_libs empty shared default",
-		ModuleTypeUnderTest:        "cc_library_shared",
-		ModuleTypeUnderTestFactory: cc.LibrarySharedFactory,
-		Blueprint: soongCcLibrarySharedPreamble + `
-cc_defaults {
-    name: "empty_defaults",
-    shared: {
-        system_shared_libs: [],
-    },
-    include_build_directory: false,
-}
-cc_library_shared {
-    name: "empty",
-    defaults: ["empty_defaults"],
-}
-`,
-		ExpectedBazelTargets: []string{MakeBazelTarget("cc_library_shared", "empty", AttrNameToString{
-			"system_dynamic_deps": "[]",
-		})},
-	})
-}
-
-func TestCcLibrarySharedConvertLex(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library_shared with lex files",
-		ModuleTypeUnderTest:        "cc_library_shared",
-		ModuleTypeUnderTestFactory: cc.LibrarySharedFactory,
-		Filesystem: map[string]string{
-			"foo.c":   "",
-			"bar.cc":  "",
-			"foo1.l":  "",
-			"bar1.ll": "",
-			"foo2.l":  "",
-			"bar2.ll": "",
-		},
-		Blueprint: `cc_library_shared {
-	name: "foo_lib",
-	srcs: ["foo.c", "bar.cc", "foo1.l", "foo2.l", "bar1.ll", "bar2.ll"],
-	lex: { flags: ["--foo_flags"] },
-	include_build_directory: false,
-	bazel_module: { bp2build_available: true },
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("genlex", "foo_lib_genlex_l", AttrNameToString{
-				"srcs": `[
-        "foo1.l",
-        "foo2.l",
-    ]`,
-				"lexopts": `["--foo_flags"]`,
-			}),
-			MakeBazelTarget("genlex", "foo_lib_genlex_ll", AttrNameToString{
-				"srcs": `[
-        "bar1.ll",
-        "bar2.ll",
-    ]`,
-				"lexopts": `["--foo_flags"]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo_lib", AttrNameToString{
-				"srcs": `[
-        "bar.cc",
-        ":foo_lib_genlex_ll",
-    ]`,
-				"srcs_c": `[
-        "foo.c",
-        ":foo_lib_genlex_l",
-    ]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedClangUnknownFlags(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Blueprint: soongCcProtoPreamble + `cc_library_shared {
-	name: "foo",
-	conlyflags: ["-a", "-finline-functions"],
-	cflags: ["-b","-finline-functions"],
-	cppflags: ["-c", "-finline-functions"],
-	ldflags: ["-d","-finline-functions", "-e"],
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"conlyflags": `["-a"]`,
-				"copts":      `["-b"]`,
-				"cppflags":   `["-c"]`,
-				"linkopts": `[
-        "-d",
-        "-e",
-    ]`,
-			}),
-		},
-	})
-}
-
-func TestCCLibraryFlagSpaceSplitting(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Blueprint: soongCcProtoPreamble + `cc_library_shared {
-	name: "foo",
-	conlyflags: [ "-include header.h"],
-	cflags: ["-include header.h"],
-	cppflags: ["-include header.h"],
-	version_script: "version_script",
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"additional_linker_inputs": `["version_script"]`,
-				"conlyflags": `[
-        "-include",
-        "header.h",
-    ]`,
-				"copts": `[
-        "-include",
-        "header.h",
-    ]`,
-				"cppflags": `[
-        "-include",
-        "header.h",
-    ]`,
-				"linkopts": `["-Wl,--version-script,$(location version_script)"]`,
-				"features": `["android_cfi_exports_map"]`,
-			}),
-		},
-	})
-}
-
-func TestCCLibrarySharedRuntimeDeps(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Blueprint: `cc_library_shared {
-	name: "bar",
-}
-
-cc_library_shared {
-  name: "foo",
-  runtime_libs: ["bar"],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "bar", AttrNameToString{
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"runtime_deps":   `[":bar"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedEmptySuffix(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared with empty suffix",
-		Filesystem: map[string]string{
-			"foo.c": "",
-		},
-		Blueprint: soongCcLibrarySharedPreamble + `
-cc_library_shared {
-    name: "foo_shared",
-    suffix: "",
-    srcs: ["foo.c"],
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
-				"srcs_c": `["foo.c"]`,
-				"suffix": `""`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedSuffix(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared with suffix",
-		Filesystem: map[string]string{
-			"foo.c": "",
-		},
-		Blueprint: soongCcLibrarySharedPreamble + `
-cc_library_shared {
-    name: "foo_shared",
-    suffix: "-suf",
-    srcs: ["foo.c"],
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
-				"srcs_c": `["foo.c"]`,
-				"suffix": `"-suf"`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedArchVariantSuffix(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared with arch-variant suffix",
-		Filesystem: map[string]string{
-			"foo.c": "",
-		},
-		Blueprint: soongCcLibrarySharedPreamble + `
-cc_library_shared {
-    name: "foo_shared",
-    arch: {
-        arm64: { suffix: "-64" },
-        arm:   { suffix: "-32" },
-		},
-    srcs: ["foo.c"],
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
-				"srcs_c": `["foo.c"]`,
-				"suffix": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "-32",
-        "//build/bazel_common_rules/platforms/arch:arm64": "-64",
-        "//conditions:default": None,
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedWithSyspropSrcs(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared with sysprop sources",
-		Blueprint: `
-cc_library_shared {
-	name: "foo",
-	srcs: [
-		"bar.sysprop",
-		"baz.sysprop",
-		"blah.cpp",
-	],
-	min_sdk_version: "5",
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("sysprop_library", "foo_sysprop_library", AttrNameToString{
-				"srcs": `[
-        "bar.sysprop",
-        "baz.sysprop",
-    ]`,
-			}),
-			MakeBazelTarget("cc_sysprop_library_static", "foo_cc_sysprop_library_static", AttrNameToString{
-				"dep":             `":foo_sysprop_library"`,
-				"min_sdk_version": `"5"`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"srcs":               `["blah.cpp"]`,
-				"local_includes":     `["."]`,
-				"min_sdk_version":    `"5"`,
-				"whole_archive_deps": `[":foo_cc_sysprop_library_static"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedWithSyspropSrcsSomeConfigs(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared with sysprop sources in some configs but not others",
-		Blueprint: `
-cc_library_shared {
-	name: "foo",
-	srcs: [
-		"blah.cpp",
-	],
-	target: {
-		android: {
-			srcs: ["bar.sysprop"],
-		},
-	},
-	min_sdk_version: "5",
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("sysprop_library", "foo_sysprop_library", AttrNameToString{
-				"srcs": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["bar.sysprop"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("cc_sysprop_library_static", "foo_cc_sysprop_library_static", AttrNameToString{
-				"dep":             `":foo_sysprop_library"`,
-				"min_sdk_version": `"5"`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"srcs":            `["blah.cpp"]`,
-				"local_includes":  `["."]`,
-				"min_sdk_version": `"5"`,
-				"whole_archive_deps": `select({
-        "//build/bazel_common_rules/platforms/os:android": [":foo_cc_sysprop_library_static"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedHeaderAbiChecker(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared with header abi checker",
-		Blueprint: `cc_library_shared {
-    name: "foo",
-    header_abi_checker: {
-        enabled: true,
-        symbol_file: "a.map.txt",
-        exclude_symbol_versions: [
-						"29",
-						"30",
-				],
-        exclude_symbol_tags: [
-						"tag1",
-						"tag2",
-				],
-        check_all_apis: true,
-        diff_flags: ["-allow-adding-removing-weak-symbols"],
-    },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"abi_checker_enabled":     `True`,
-				"abi_checker_symbol_file": `"a.map.txt"`,
-				"abi_checker_exclude_symbol_versions": `[
-        "29",
-        "30",
-    ]`,
-				"abi_checker_exclude_symbol_tags": `[
-        "tag1",
-        "tag2",
-    ]`,
-				"abi_checker_check_all_apis": `True`,
-				"abi_checker_diff_flags":     `["-allow-adding-removing-weak-symbols"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedWithIntegerOverflowProperty(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared has correct features when integer_overflow property is provided",
-		Blueprint: `
-cc_library_shared {
-		name: "foo",
-		sanitize: {
-				integer_overflow: true,
-		},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features":       `["ubsan_integer_overflow"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedWithMiscUndefinedProperty(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared has correct features when misc_undefined property is provided",
-		Blueprint: `
-cc_library_shared {
-		name: "foo",
-		sanitize: {
-				misc_undefined: ["undefined", "nullability"],
-		},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features": `[
-        "ubsan_undefined",
-        "ubsan_nullability",
-    ]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedWithUBSanPropertiesArchSpecific(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared has correct feature select when UBSan props are specified in arch specific blocks",
-		Blueprint: `
-cc_library_shared {
-		name: "foo",
-		sanitize: {
-				misc_undefined: ["undefined", "nullability"],
-		},
-		target: {
-				android: {
-						sanitize: {
-								misc_undefined: ["alignment"],
-						},
-				},
-				linux_glibc: {
-						sanitize: {
-								integer_overflow: true,
-						},
-				},
-		},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features": `[
-        "ubsan_undefined",
-        "ubsan_nullability",
-    ] + select({
-        "//build/bazel_common_rules/platforms/os:android": ["ubsan_alignment"],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedWithSanitizerBlocklist(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared has correct features when sanitize.blocklist is provided",
-		Blueprint: `
-cc_library_shared {
-	name: "foo",
-	sanitize: {
-		blocklist: "foo_blocklist.txt",
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"copts": `select({
-        "//build/bazel/rules/cc:sanitizers_enabled": ["-fsanitize-ignorelist=$(location foo_blocklist.txt)"],
-        "//conditions:default": [],
-    })`,
-				"additional_compiler_inputs": `select({
-        "//build/bazel/rules/cc:sanitizers_enabled": [":foo_blocklist.txt"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedWithThinLto(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared has correct features when thin lto is enabled",
-		Blueprint: `
-cc_library_shared {
-	name: "foo",
-	lto: {
-		thin: true,
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features":       `["android_thin_lto"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedWithLtoNever(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared has correct features when thin lto is enabled",
-		Blueprint: `
-cc_library_shared {
-	name: "foo",
-	lto: {
-		never: true,
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features":       `["-android_thin_lto"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedWithThinLtoArchSpecific(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared has correct features when LTO differs across arch and os variants",
-		Blueprint: `
-cc_library_shared {
-	name: "foo",
-	target: {
-		android: {
-			lto: {
-				thin: true,
-			},
-		},
-	},
-	arch: {
-		riscv64: {
-			lto: {
-				thin: false,
-			},
-		},
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm": ["android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": ["android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_x86": ["android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["android_thin_lto"],
-        "//conditions:default": [],
-    })`}),
-		},
-	})
-}
-
-func TestCcLibrarySharedWithThinLtoDisabledDefaultEnabledVariant(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared with thin lto disabled by default but enabled on a particular variant",
-		Blueprint: `
-cc_library_shared {
-	name: "foo",
-	lto: {
-		never: true,
-	},
-	target: {
-		android: {
-			lto: {
-				thin: true,
-				never: false,
-			},
-		},
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["android_thin_lto"],
-        "//conditions:default": ["-android_thin_lto"],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedWithThinLtoAndWholeProgramVtables(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared has correct features when thin LTO is enabled with whole_program_vtables",
-		Blueprint: `
-cc_library_shared {
-	name: "foo",
-	lto: {
-		thin: true,
-	},
-	whole_program_vtables: true,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features": `[
-        "android_thin_lto",
-        "android_thin_lto_whole_program_vtables",
-    ]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedHiddenVisibilityConvertedToFeature(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared changes hidden visibility flag to feature",
-		Blueprint: `
-cc_library_shared{
-	name: "foo",
-	cflags: ["-fvisibility=hidden"],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features":       `["visibility_hidden"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedHiddenVisibilityConvertedToFeatureOsSpecific(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared changes hidden visibility flag to feature for specific os",
-		Blueprint: `
-cc_library_shared{
-	name: "foo",
-	target: {
-		android: {
-			cflags: ["-fvisibility=hidden"],
-		},
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["visibility_hidden"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedStubsDessertVersionConversion(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared converts dessert codename versions to numerical versions",
-		Blueprint: `
-cc_library_shared {
-	name: "a",
-	include_build_directory: false,
-	stubs: {
-		symbol_file: "a.map.txt",
-		versions: [
-			"Q",
-			"R",
-			"31",
-		],
-	},
-}
-cc_library_shared {
-	name: "b",
-	include_build_directory: false,
-	stubs: {
-		symbol_file: "b.map.txt",
-		versions: [
-			"Q",
-			"R",
-			"31",
-			"current",
-		],
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			makeCcStubSuiteTargets("a", AttrNameToString{
-				"api_surface":          `"module-libapi"`,
-				"soname":               `"a.so"`,
-				"source_library_label": `"//:a"`,
-				"stubs_symbol_file":    `"a.map.txt"`,
-				"stubs_versions": `[
-        "29",
-        "30",
-        "31",
-        "current",
-    ]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
-				"stubs_symbol_file": `"a.map.txt"`,
-			}),
-			makeCcStubSuiteTargets("b", AttrNameToString{
-				"api_surface":          `"module-libapi"`,
-				"soname":               `"b.so"`,
-				"source_library_label": `"//:b"`,
-				"stubs_symbol_file":    `"b.map.txt"`,
-				"stubs_versions": `[
-        "29",
-        "30",
-        "31",
-        "current",
-    ]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "b", AttrNameToString{
-				"stubs_symbol_file": `"b.map.txt"`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedWithCfi(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared has correct features when cfi is enabled for specific variants",
-		Blueprint: `
-cc_library_shared {
-	name: "foo",
-	sanitize: {
-		cfi: true,
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features":       `["android_cfi"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedWithCfiOsSpecific(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared has correct features when cfi is enabled",
-		Blueprint: `
-cc_library_shared {
-	name: "foo",
-	target: {
-		android: {
-			sanitize: {
-				cfi: true,
-			},
-		},
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["android_cfi"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedWithCfiAndCfiAssemblySupport(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared has correct features when cfi is enabled with cfi assembly support",
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	sanitize: {
-		cfi: true,
-		config: {
-			cfi_assembly_support: true,
-		},
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"features": `[
-        "android_cfi",
-        "android_cfi_assembly_support",
-    ]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySharedExplicitlyDisablesCfiWhenFalse(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_shared disables cfi when explciitly set to false in the bp",
-		Blueprint: `
-cc_library_shared {
-	name: "foo",
-	sanitize: {
-		cfi: false,
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"features":       `["-android_cfi"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCCLibrarySharedRscriptSrc(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: ``,
-		Blueprint: `
-cc_library_shared{
-    name : "foo",
-    srcs : [
-        "ccSrc.cc",
-        "rsSrc.rscript",
-    ],
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("rscript_to_cpp", "foo_renderscript", AttrNameToString{
-				"srcs": `["rsSrc.rscript"]`,
-			}),
-			MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
-				"absolute_includes": `[
-        "frameworks/rs",
-        "frameworks/rs/cpp",
-    ]`,
-				"local_includes": `["."]`,
-				"srcs": `[
-        "ccSrc.cc",
-        "foo_renderscript",
-    ]`,
-			})}})
-}
-
-func TestCcLibrarySdkVariantUsesStubs(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library_shared stubs",
-		ModuleTypeUnderTest:        "cc_library_shared",
-		ModuleTypeUnderTestFactory: cc.LibrarySharedFactory,
-		StubbedBuildDefinitions:    []string{"libNoStubs", "libHasApexStubs", "libHasApexAndNdkStubs", "libHasApexAndNdkStubs.ndk_stub_libs"},
-		Blueprint: soongCcLibrarySharedPreamble + `
-cc_library_shared {
-	name: "libUsesSdk",
-	sdk_version: "current",
-	shared_libs: [
-		"libNoStubs",
-		"libHasApexStubs",
-		"libHasApexAndNdkStubs",
-	]
-}
-cc_library_shared {
-	name: "libNoStubs",
-}
-cc_library_shared {
-	name: "libHasApexStubs",
-	stubs: { symbol_file: "a.map.txt", versions: ["28", "29", "current"] },
-	apex_available: ["apex_a"],
-}
-cc_library_shared {
-	name: "libHasApexAndNdkStubs",
-	stubs: { symbol_file: "b.map.txt", versions: ["28", "29", "current"] },
-	apex_available: ["apex_b"],
-}
-ndk_library {
-	name: "libHasApexAndNdkStubs",
-	first_version: "28",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "libUsesSdk", AttrNameToString{
-				"implementation_dynamic_deps": `[":libNoStubs"] + select({
-        "//build/bazel/rules/apex:system": [
-            "@api_surfaces//module-libapi/current:libHasApexStubs",
-            "@api_surfaces//module-libapi/current:libHasApexAndNdkStubs",
-        ],
-        "//build/bazel/rules/apex:unbundled_app": [
-            ":libHasApexStubs",
-            "//.:libHasApexAndNdkStubs.ndk_stub_libs-current",
-        ],
-        "//conditions:default": [
-            ":libHasApexStubs",
-            ":libHasApexAndNdkStubs",
-        ],
-    })`,
-				"local_includes": `["."]`,
-				"sdk_version":    `"current"`,
-				"deps": `select({
-        "//build/bazel/rules/apex:unbundled_app": ["//build/bazel/rules/cc:ndk_sysroot"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/cc_library_static_conversion_test.go b/bp2build/cc_library_static_conversion_test.go
deleted file mode 100644
index d7bbd68..0000000
--- a/bp2build/cc_library_static_conversion_test.go
+++ /dev/null
@@ -1,2295 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"fmt"
-	"testing"
-
-	"android/soong/android"
-	"android/soong/cc"
-	"android/soong/genrule"
-)
-
-const (
-	// See cc/testing.go for more context
-	soongCcLibraryStaticPreamble = `
-cc_defaults {
-    name: "linux_bionic_supported",
-}`
-)
-
-func TestCcLibraryStaticLoadStatement(t *testing.T) {
-	testCases := []struct {
-		bazelTargets           BazelTargets
-		expectedLoadStatements string
-	}{
-		{
-			bazelTargets: BazelTargets{
-				BazelTarget{
-					name:      "cc_library_static_target",
-					ruleClass: "cc_library_static",
-					// NOTE: No bzlLoadLocation for native rules
-				},
-			},
-			expectedLoadStatements: ``,
-		},
-	}
-
-	for _, testCase := range testCases {
-		actual := testCase.bazelTargets.LoadStatements()
-		expected := testCase.expectedLoadStatements
-		if actual != expected {
-			t.Fatalf("Expected load statements to be %s, got %s", expected, actual)
-		}
-	}
-}
-
-func registerCcLibraryStaticModuleTypes(ctx android.RegistrationContext) {
-	cc.RegisterCCBuildComponents(ctx)
-	ctx.RegisterModuleType("cc_library_headers", cc.LibraryHeaderFactory)
-	ctx.RegisterModuleType("genrule", genrule.GenRuleFactory)
-	// Required for system_shared_libs dependencies.
-	ctx.RegisterModuleType("cc_library", cc.LibraryFactory)
-}
-
-func runCcLibraryStaticTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-
-	(&tc).ModuleTypeUnderTest = "cc_library_static"
-	(&tc).ModuleTypeUnderTestFactory = cc.LibraryStaticFactory
-	RunBp2BuildTestCase(t, registerCcLibraryStaticModuleTypes, tc)
-}
-
-func TestCcLibraryStaticSimple(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static test",
-		Filesystem: map[string]string{
-			// NOTE: include_dir headers *should not* appear in Bazel hdrs later (?)
-			"include_dir_1/include_dir_1_a.h": "",
-			"include_dir_1/include_dir_1_b.h": "",
-			"include_dir_2/include_dir_2_a.h": "",
-			"include_dir_2/include_dir_2_b.h": "",
-			// NOTE: local_include_dir headers *should not* appear in Bazel hdrs later (?)
-			"local_include_dir_1/local_include_dir_1_a.h": "",
-			"local_include_dir_1/local_include_dir_1_b.h": "",
-			"local_include_dir_2/local_include_dir_2_a.h": "",
-			"local_include_dir_2/local_include_dir_2_b.h": "",
-			// NOTE: export_include_dir headers *should* appear in Bazel hdrs later
-			"export_include_dir_1/export_include_dir_1_a.h": "",
-			"export_include_dir_1/export_include_dir_1_b.h": "",
-			"export_include_dir_2/export_include_dir_2_a.h": "",
-			"export_include_dir_2/export_include_dir_2_b.h": "",
-			// NOTE: Soong implicitly includes headers in the current directory
-			"implicit_include_1.h": "",
-			"implicit_include_2.h": "",
-		},
-		StubbedBuildDefinitions: []string{"header_lib_1", "header_lib_2",
-			"static_lib_1", "static_lib_2", "whole_static_lib_1", "whole_static_lib_2"},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_headers {
-    name: "header_lib_1",
-    export_include_dirs: ["header_lib_1"],
-}
-
-cc_library_headers {
-    name: "header_lib_2",
-    export_include_dirs: ["header_lib_2"],
-}
-
-cc_library_static {
-    name: "static_lib_1",
-    srcs: ["static_lib_1.cc"],
-}
-
-cc_library_static {
-    name: "static_lib_2",
-    srcs: ["static_lib_2.cc"],
-}
-
-cc_library_static {
-    name: "whole_static_lib_1",
-    srcs: ["whole_static_lib_1.cc"],
-}
-
-cc_library_static {
-    name: "whole_static_lib_2",
-    srcs: ["whole_static_lib_2.cc"],
-}
-
-cc_library_static {
-    name: "foo_static",
-    srcs: [
-        "foo_static1.cc",
-        "foo_static2.cc",
-    ],
-    cflags: [
-        "-Dflag1",
-        "-Dflag2"
-    ],
-    static_libs: [
-        "static_lib_1",
-        "static_lib_2"
-    ],
-    whole_static_libs: [
-        "whole_static_lib_1",
-        "whole_static_lib_2"
-    ],
-    include_dirs: [
-        "include_dir_1",
-        "include_dir_2",
-    ],
-    local_include_dirs: [
-        "local_include_dir_1",
-        "local_include_dir_2",
-    ],
-    export_include_dirs: [
-        "export_include_dir_1",
-        "export_include_dir_2"
-    ],
-    header_libs: [
-        "header_lib_1",
-        "header_lib_2"
-    ],
-    sdk_version: "current",
-    min_sdk_version: "29",
-
-    // TODO: Also support export_header_lib_headers
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"absolute_includes": `[
-        "include_dir_1",
-        "include_dir_2",
-    ]`,
-				"copts": `[
-        "-Dflag1",
-        "-Dflag2",
-    ]`,
-				"export_includes": `[
-        "export_include_dir_1",
-        "export_include_dir_2",
-    ]`,
-				"implementation_deps": `[
-        ":header_lib_1",
-        ":header_lib_2",
-        ":static_lib_1",
-        ":static_lib_2",
-    ]`,
-				"local_includes": `[
-        "local_include_dir_1",
-        "local_include_dir_2",
-        ".",
-    ]`,
-				"srcs": `[
-        "foo_static1.cc",
-        "foo_static2.cc",
-    ]`,
-				"whole_archive_deps": `[
-        ":whole_static_lib_1",
-        ":whole_static_lib_2",
-    ]`,
-				"sdk_version":     `"current"`,
-				"min_sdk_version": `"29"`,
-				"deps": `select({
-        "//build/bazel/rules/apex:unbundled_app": ["//build/bazel/rules/cc:ndk_sysroot"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticSubpackage(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static subpackage test",
-		Filesystem: map[string]string{
-			// subpackage with subdirectory
-			"subpackage/Android.bp":                         "",
-			"subpackage/subpackage_header.h":                "",
-			"subpackage/subdirectory/subdirectory_header.h": "",
-			// subsubpackage with subdirectory
-			"subpackage/subsubpackage/Android.bp":                         "",
-			"subpackage/subsubpackage/subsubpackage_header.h":             "",
-			"subpackage/subsubpackage/subdirectory/subdirectory_header.h": "",
-			// subsubsubpackage with subdirectory
-			"subpackage/subsubpackage/subsubsubpackage/Android.bp":                         "",
-			"subpackage/subsubpackage/subsubsubpackage/subsubsubpackage_header.h":          "",
-			"subpackage/subsubpackage/subsubsubpackage/subdirectory/subdirectory_header.h": "",
-		},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "foo_static",
-    srcs: [],
-    include_dirs: [
-        "subpackage",
-    ],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"absolute_includes": `["subpackage"]`,
-				"local_includes":    `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticExportIncludeDir(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static export include dir",
-		Filesystem: map[string]string{
-			// subpackage with subdirectory
-			"subpackage/Android.bp":                         "",
-			"subpackage/subpackage_header.h":                "",
-			"subpackage/subdirectory/subdirectory_header.h": "",
-		},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "foo_static",
-    export_include_dirs: ["subpackage"],
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"export_includes": `["subpackage"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticExportSystemIncludeDir(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static export system include dir",
-		Filesystem: map[string]string{
-			// subpackage with subdirectory
-			"subpackage/Android.bp":                         "",
-			"subpackage/subpackage_header.h":                "",
-			"subpackage/subdirectory/subdirectory_header.h": "",
-		},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "foo_static",
-    export_system_include_dirs: ["subpackage"],
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"export_system_includes": `["subpackage"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticManyIncludeDirs(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static include_dirs, local_include_dirs, export_include_dirs (b/183742505)",
-		Dir:         "subpackage",
-		Filesystem: map[string]string{
-			// subpackage with subdirectory
-			"subpackage/Android.bp": `
-cc_library_static {
-    name: "foo_static",
-    // include_dirs are workspace/root relative
-    include_dirs: [
-        "subpackage/subsubpackage",
-        "subpackage2",
-        "subpackage3/subsubpackage"
-    ],
-    local_include_dirs: ["subsubpackage2"], // module dir relative
-    export_include_dirs: ["./exported_subsubpackage"], // module dir relative
-    include_build_directory: true,
-    bazel_module: { bp2build_available: true },
-}`,
-			"subpackage/subsubpackage/header.h":          "",
-			"subpackage/subsubpackage2/header.h":         "",
-			"subpackage/exported_subsubpackage/header.h": "",
-			"subpackage2/header.h":                       "",
-			"subpackage3/subsubpackage/header.h":         "",
-		},
-		Blueprint: soongCcLibraryStaticPreamble,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"absolute_includes": `[
-        "subpackage/subsubpackage",
-        "subpackage2",
-        "subpackage3/subsubpackage",
-    ]`,
-				"export_includes": `["./exported_subsubpackage"]`,
-				"local_includes": `[
-        "subsubpackage2",
-        ".",
-    ]`,
-			})},
-	})
-}
-
-func TestCcLibraryStaticIncludeBuildDirectoryDisabled(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static include_build_directory disabled",
-		Filesystem: map[string]string{
-			// subpackage with subdirectory
-			"subpackage/Android.bp":                         "",
-			"subpackage/subpackage_header.h":                "",
-			"subpackage/subdirectory/subdirectory_header.h": "",
-		},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "foo_static",
-    include_dirs: ["subpackage"], // still used, but local_include_dirs is recommended
-    local_include_dirs: ["subpackage2"],
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"absolute_includes": `["subpackage"]`,
-				"local_includes":    `["subpackage2"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticIncludeBuildDirectoryEnabled(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static include_build_directory enabled",
-		Filesystem: map[string]string{
-			// subpackage with subdirectory
-			"subpackage/Android.bp":                         "",
-			"subpackage/subpackage_header.h":                "",
-			"subpackage2/Android.bp":                        "",
-			"subpackage2/subpackage2_header.h":              "",
-			"subpackage/subdirectory/subdirectory_header.h": "",
-		},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "foo_static",
-    include_dirs: ["subpackage"], // still used, but local_include_dirs is recommended
-    local_include_dirs: ["subpackage2"],
-    include_build_directory: true,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"absolute_includes": `["subpackage"]`,
-				"local_includes": `[
-        "subpackage2",
-        ".",
-    ]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticArchSpecificStaticLib(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_static arch-specific static_libs",
-		Filesystem:              map[string]string{},
-		StubbedBuildDefinitions: []string{"static_dep", "static_dep2"},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "static_dep",
-}
-cc_library_static {
-    name: "static_dep2",
-}
-cc_library_static {
-    name: "foo_static",
-    arch: { arm64: { static_libs: ["static_dep"], whole_static_libs: ["static_dep2"] } },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"implementation_deps": `select({
-        "//build/bazel_common_rules/platforms/arch:arm64": [":static_dep"],
-        "//conditions:default": [],
-    })`,
-				"whole_archive_deps": `select({
-        "//build/bazel_common_rules/platforms/arch:arm64": [":static_dep2"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticOsSpecificStaticLib(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_static os-specific static_libs",
-		Filesystem:              map[string]string{},
-		StubbedBuildDefinitions: []string{"static_dep", "static_dep2"},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "static_dep",
-}
-cc_library_static {
-    name: "static_dep2",
-}
-cc_library_static {
-    name: "foo_static",
-    target: { android: { static_libs: ["static_dep"], whole_static_libs: ["static_dep2"] } },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"implementation_deps": `select({
-        "//build/bazel_common_rules/platforms/os:android": [":static_dep"],
-        "//conditions:default": [],
-    })`,
-				"whole_archive_deps": `select({
-        "//build/bazel_common_rules/platforms/os:android": [":static_dep2"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticBaseArchOsSpecificStaticLib(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static base, arch and os-specific static_libs",
-		Filesystem:  map[string]string{},
-		StubbedBuildDefinitions: []string{"static_dep", "static_dep2", "static_dep3",
-			"static_dep4"},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "static_dep",
-}
-cc_library_static {
-    name: "static_dep2",
-}
-cc_library_static {
-    name: "static_dep3",
-}
-cc_library_static {
-    name: "static_dep4",
-}
-cc_library_static {
-    name: "foo_static",
-    static_libs: ["static_dep"],
-    whole_static_libs: ["static_dep2"],
-    target: { android: { static_libs: ["static_dep3"] } },
-    arch: { arm64: { static_libs: ["static_dep4"] } },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"implementation_deps": `[":static_dep"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm64": [":static_dep4"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel_common_rules/platforms/os:android": [":static_dep3"],
-        "//conditions:default": [],
-    })`,
-				"whole_archive_deps": `[":static_dep2"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticSimpleExcludeSrcs(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static simple exclude_srcs",
-		Filesystem: map[string]string{
-			"common.c":       "",
-			"foo-a.c":        "",
-			"foo-excluded.c": "",
-		},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "foo_static",
-    srcs: ["common.c", "foo-*.c"],
-    exclude_srcs: ["foo-excluded.c"],
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"srcs_c": `[
-        "common.c",
-        "foo-a.c",
-    ]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticOneArchSrcs(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static one arch specific srcs",
-		Filesystem: map[string]string{
-			"common.c":  "",
-			"foo-arm.c": "",
-		},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "foo_static",
-    srcs: ["common.c"],
-    arch: { arm: { srcs: ["foo-arm.c"] } },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"srcs_c": `["common.c"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["foo-arm.c"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticOneArchSrcsExcludeSrcs(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static one arch specific srcs and exclude_srcs",
-		Filesystem: map[string]string{
-			"common.c":           "",
-			"for-arm.c":          "",
-			"not-for-arm.c":      "",
-			"not-for-anything.c": "",
-		},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "foo_static",
-    srcs: ["common.c", "not-for-*.c"],
-    exclude_srcs: ["not-for-anything.c"],
-    arch: {
-        arm: { srcs: ["for-arm.c"], exclude_srcs: ["not-for-arm.c"] },
-    },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"srcs_c": `["common.c"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["for-arm.c"],
-        "//conditions:default": ["not-for-arm.c"],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticTwoArchExcludeSrcs(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static arch specific exclude_srcs for 2 architectures",
-		Filesystem: map[string]string{
-			"common.c":      "",
-			"for-arm.c":     "",
-			"for-x86.c":     "",
-			"not-for-arm.c": "",
-			"not-for-x86.c": "",
-		},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "foo_static",
-    srcs: ["common.c", "not-for-*.c"],
-    exclude_srcs: ["not-for-everything.c"],
-    arch: {
-        arm: { srcs: ["for-arm.c"], exclude_srcs: ["not-for-arm.c"] },
-        x86: { srcs: ["for-x86.c"], exclude_srcs: ["not-for-x86.c"] },
-    },
-    include_build_directory: false,
-} `,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"srcs_c": `["common.c"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": [
-            "not-for-x86.c",
-            "for-arm.c",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86": [
-            "not-for-arm.c",
-            "for-x86.c",
-        ],
-        "//conditions:default": [
-            "not-for-arm.c",
-            "not-for-x86.c",
-        ],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticFourArchExcludeSrcs(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static arch specific exclude_srcs for 4 architectures",
-		Filesystem: map[string]string{
-			"common.c":             "",
-			"for-arm.c":            "",
-			"for-arm64.c":          "",
-			"for-x86.c":            "",
-			"for-x86_64.c":         "",
-			"not-for-arm.c":        "",
-			"not-for-arm64.c":      "",
-			"not-for-x86.c":        "",
-			"not-for-x86_64.c":     "",
-			"not-for-everything.c": "",
-		},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "foo_static",
-    srcs: ["common.c", "not-for-*.c"],
-    exclude_srcs: ["not-for-everything.c"],
-    arch: {
-        arm: { srcs: ["for-arm.c"], exclude_srcs: ["not-for-arm.c"] },
-        arm64: { srcs: ["for-arm64.c"], exclude_srcs: ["not-for-arm64.c"] },
-        x86: { srcs: ["for-x86.c"], exclude_srcs: ["not-for-x86.c"] },
-        x86_64: { srcs: ["for-x86_64.c"], exclude_srcs: ["not-for-x86_64.c"] },
-  },
-    include_build_directory: false,
-} `,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"srcs_c": `["common.c"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": [
-            "not-for-arm64.c",
-            "not-for-x86.c",
-            "not-for-x86_64.c",
-            "for-arm.c",
-        ],
-        "//build/bazel_common_rules/platforms/arch:arm64": [
-            "not-for-arm.c",
-            "not-for-x86.c",
-            "not-for-x86_64.c",
-            "for-arm64.c",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86": [
-            "not-for-arm.c",
-            "not-for-arm64.c",
-            "not-for-x86_64.c",
-            "for-x86.c",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86_64": [
-            "not-for-arm.c",
-            "not-for-arm64.c",
-            "not-for-x86.c",
-            "for-x86_64.c",
-        ],
-        "//conditions:default": [
-            "not-for-arm.c",
-            "not-for-arm64.c",
-            "not-for-x86.c",
-            "not-for-x86_64.c",
-        ],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticOneArchEmpty(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static one arch empty",
-		Filesystem: map[string]string{
-			"common.cc":       "",
-			"foo-no-arm.cc":   "",
-			"foo-excluded.cc": "",
-		},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "foo_static",
-    srcs: ["common.cc", "foo-*.cc"],
-    exclude_srcs: ["foo-excluded.cc"],
-    arch: {
-        arm: { exclude_srcs: ["foo-no-arm.cc"] },
-    },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"srcs": `["common.cc"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": [],
-        "//conditions:default": ["foo-no-arm.cc"],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticOneArchEmptyOtherSet(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static one arch empty other set",
-		Filesystem: map[string]string{
-			"common.cc":       "",
-			"foo-no-arm.cc":   "",
-			"x86-only.cc":     "",
-			"foo-excluded.cc": "",
-		},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "foo_static",
-    srcs: ["common.cc", "foo-*.cc"],
-    exclude_srcs: ["foo-excluded.cc"],
-    arch: {
-        arm: { exclude_srcs: ["foo-no-arm.cc"] },
-        x86: { srcs: ["x86-only.cc"] },
-    },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"srcs": `["common.cc"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": [],
-        "//build/bazel_common_rules/platforms/arch:x86": [
-            "foo-no-arm.cc",
-            "x86-only.cc",
-        ],
-        "//conditions:default": ["foo-no-arm.cc"],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticMultipleDepSameName(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_static multiple dep same name panic",
-		Filesystem:              map[string]string{},
-		StubbedBuildDefinitions: []string{"static_dep"},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "static_dep",
-}
-cc_library_static {
-    name: "foo_static",
-    static_libs: ["static_dep", "static_dep"],
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"implementation_deps": `[":static_dep"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticOneMultilibSrcsExcludeSrcs(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static 1 multilib srcs and exclude_srcs",
-		Filesystem: map[string]string{
-			"common.c":        "",
-			"for-lib32.c":     "",
-			"not-for-lib32.c": "",
-		},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "foo_static",
-    srcs: ["common.c", "not-for-*.c"],
-    multilib: {
-        lib32: { srcs: ["for-lib32.c"], exclude_srcs: ["not-for-lib32.c"] },
-    },
-    include_build_directory: false,
-} `,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"srcs_c": `["common.c"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["for-lib32.c"],
-        "//build/bazel_common_rules/platforms/arch:x86": ["for-lib32.c"],
-        "//conditions:default": ["not-for-lib32.c"],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticTwoMultilibSrcsExcludeSrcs(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static 2 multilib srcs and exclude_srcs",
-		Filesystem: map[string]string{
-			"common.c":        "",
-			"for-lib32.c":     "",
-			"for-lib64.c":     "",
-			"not-for-lib32.c": "",
-			"not-for-lib64.c": "",
-		},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "foo_static",
-    srcs: ["common.c", "not-for-*.c"],
-    multilib: {
-        lib32: { srcs: ["for-lib32.c"], exclude_srcs: ["not-for-lib32.c"] },
-        lib64: { srcs: ["for-lib64.c"], exclude_srcs: ["not-for-lib64.c"] },
-    },
-    include_build_directory: false,
-} `,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"srcs_c": `["common.c"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": [
-            "not-for-lib64.c",
-            "for-lib32.c",
-        ],
-        "//build/bazel_common_rules/platforms/arch:arm64": [
-            "not-for-lib32.c",
-            "for-lib64.c",
-        ],
-        "//build/bazel_common_rules/platforms/arch:riscv64": [
-            "not-for-lib32.c",
-            "for-lib64.c",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86": [
-            "not-for-lib64.c",
-            "for-lib32.c",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86_64": [
-            "not-for-lib32.c",
-            "for-lib64.c",
-        ],
-        "//conditions:default": [
-            "not-for-lib32.c",
-            "not-for-lib64.c",
-        ],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarySTaticArchMultilibSrcsExcludeSrcs(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static arch and multilib srcs and exclude_srcs",
-		Filesystem: map[string]string{
-			"common.c":             "",
-			"for-arm.c":            "",
-			"for-arm64.c":          "",
-			"for-x86.c":            "",
-			"for-x86_64.c":         "",
-			"for-lib32.c":          "",
-			"for-lib64.c":          "",
-			"not-for-arm.c":        "",
-			"not-for-arm64.c":      "",
-			"not-for-riscv64.c":    "",
-			"not-for-x86.c":        "",
-			"not-for-x86_64.c":     "",
-			"not-for-lib32.c":      "",
-			"not-for-lib64.c":      "",
-			"not-for-everything.c": "",
-		},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-   name: "foo_static",
-   srcs: ["common.c", "not-for-*.c"],
-   exclude_srcs: ["not-for-everything.c"],
-   arch: {
-       arm: { srcs: ["for-arm.c"], exclude_srcs: ["not-for-arm.c"] },
-       arm64: { srcs: ["for-arm64.c"], exclude_srcs: ["not-for-arm64.c"] },
-       riscv64: { srcs: ["for-riscv64.c"], exclude_srcs: ["not-for-riscv64.c"] },
-       x86: { srcs: ["for-x86.c"], exclude_srcs: ["not-for-x86.c"] },
-       x86_64: { srcs: ["for-x86_64.c"], exclude_srcs: ["not-for-x86_64.c"] },
-   },
-   multilib: {
-       lib32: { srcs: ["for-lib32.c"], exclude_srcs: ["not-for-lib32.c"] },
-       lib64: { srcs: ["for-lib64.c"], exclude_srcs: ["not-for-lib64.c"] },
-   },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"srcs_c": `["common.c"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": [
-            "not-for-arm64.c",
-            "not-for-lib64.c",
-            "not-for-riscv64.c",
-            "not-for-x86.c",
-            "not-for-x86_64.c",
-            "for-arm.c",
-            "for-lib32.c",
-        ],
-        "//build/bazel_common_rules/platforms/arch:arm64": [
-            "not-for-arm.c",
-            "not-for-lib32.c",
-            "not-for-riscv64.c",
-            "not-for-x86.c",
-            "not-for-x86_64.c",
-            "for-arm64.c",
-            "for-lib64.c",
-        ],
-        "//build/bazel_common_rules/platforms/arch:riscv64": [
-            "not-for-arm.c",
-            "not-for-arm64.c",
-            "not-for-lib32.c",
-            "not-for-x86.c",
-            "not-for-x86_64.c",
-            "for-riscv64.c",
-            "for-lib64.c",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86": [
-            "not-for-arm.c",
-            "not-for-arm64.c",
-            "not-for-lib64.c",
-            "not-for-riscv64.c",
-            "not-for-x86_64.c",
-            "for-x86.c",
-            "for-lib32.c",
-        ],
-        "//build/bazel_common_rules/platforms/arch:x86_64": [
-            "not-for-arm.c",
-            "not-for-arm64.c",
-            "not-for-lib32.c",
-            "not-for-riscv64.c",
-            "not-for-x86.c",
-            "for-x86_64.c",
-            "for-lib64.c",
-        ],
-        "//conditions:default": [
-            "not-for-arm.c",
-            "not-for-arm64.c",
-            "not-for-lib32.c",
-            "not-for-lib64.c",
-            "not-for-riscv64.c",
-            "not-for-x86.c",
-            "not-for-x86_64.c",
-        ],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticGeneratedHeadersAllPartitions(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		StubbedBuildDefinitions: []string{"generated_hdr", "export_generated_hdr"},
-		Blueprint: soongCcLibraryStaticPreamble + `
-genrule {
-    name: "generated_hdr",
-    cmd: "nothing to see here",
-}
-
-genrule {
-    name: "export_generated_hdr",
-    cmd: "nothing to see here",
-}
-
-cc_library_static {
-    name: "foo_static",
-    srcs: ["cpp_src.cpp", "as_src.S", "c_src.c"],
-    generated_headers: ["generated_hdr", "export_generated_hdr"],
-    export_generated_headers: ["export_generated_hdr"],
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"export_includes": `["."]`,
-				"local_includes":  `["."]`,
-				"hdrs":            `[":export_generated_hdr"]`,
-				"srcs": `[
-        "cpp_src.cpp",
-        ":generated_hdr",
-    ]`,
-				"srcs_as": `[
-        "as_src.S",
-        ":generated_hdr",
-    ]`,
-				"srcs_c": `[
-        "c_src.c",
-        ":generated_hdr",
-    ]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticGeneratedHeadersMultipleExports(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		StubbedBuildDefinitions: []string{"generated_hdr", "export_generated_hdr"},
-		Blueprint: soongCcLibraryStaticPreamble + `
-genrule {
-    name: "generated_hdr",
-    cmd: "nothing to see here",
-    export_include_dirs: ["foo", "bar"],
-}
-
-genrule {
-    name: "export_generated_hdr",
-    cmd: "nothing to see here",
-    export_include_dirs: ["a", "b"],
-}
-
-cc_library_static {
-    name: "foo_static",
-    generated_headers: ["generated_hdr", "export_generated_hdr"],
-    export_generated_headers: ["export_generated_hdr"],
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"deps":                `[":export_generated_hdr__header_library"]`,
-				"implementation_deps": `[":generated_hdr__header_library"]`,
-			}),
-		},
-	})
-}
-
-// generated_headers has "variant_prepend" tag. In bp2build output,
-// variant info(select) should go before general info.
-func TestCcLibraryStaticArchSrcsExcludeSrcsGeneratedFiles(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static arch srcs/exclude_srcs with generated files",
-		StubbedBuildDefinitions: []string{"//dep:generated_src_other_pkg", "//dep:generated_hdr_other_pkg",
-			"//dep:generated_src_other_pkg_x86", "//dep:generated_hdr_other_pkg_x86", "//dep:generated_hdr_other_pkg_android",
-			"generated_src", "generated_src_not_x86", "generated_src_android", "generated_hdr",
-		},
-		Filesystem: map[string]string{
-			"common.cpp":             "",
-			"for-x86.cpp":            "",
-			"not-for-x86.cpp":        "",
-			"not-for-everything.cpp": "",
-			"dep/Android.bp": simpleModule("genrule", "generated_src_other_pkg") +
-				simpleModule("genrule", "generated_hdr_other_pkg") +
-				simpleModule("genrule", "generated_src_other_pkg_x86") +
-				simpleModule("genrule", "generated_hdr_other_pkg_x86") +
-				simpleModule("genrule", "generated_hdr_other_pkg_android"),
-		},
-		Blueprint: soongCcLibraryStaticPreamble +
-			simpleModule("genrule", "generated_src") +
-			simpleModule("genrule", "generated_src_not_x86") +
-			simpleModule("genrule", "generated_src_android") +
-			simpleModule("genrule", "generated_hdr") + `
-cc_library_static {
-    name: "foo_static",
-    srcs: ["common.cpp", "not-for-*.cpp"],
-    exclude_srcs: ["not-for-everything.cpp"],
-    generated_sources: ["generated_src", "generated_src_other_pkg", "generated_src_not_x86"],
-    generated_headers: ["generated_hdr", "generated_hdr_other_pkg"],
-    export_generated_headers: ["generated_hdr_other_pkg"],
-    arch: {
-        x86: {
-          srcs: ["for-x86.cpp"],
-          exclude_srcs: ["not-for-x86.cpp"],
-          generated_headers: ["generated_hdr_other_pkg_x86"],
-          exclude_generated_sources: ["generated_src_not_x86"],
-    export_generated_headers: ["generated_hdr_other_pkg_x86"],
-        },
-    },
-    target: {
-        android: {
-            generated_sources: ["generated_src_android"],
-            generated_headers: ["generated_hdr_other_pkg_android"],
-    export_generated_headers: ["generated_hdr_other_pkg_android"],
-        },
-    },
-
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"srcs": `[
-        "common.cpp",
-        ":generated_src",
-        "//dep:generated_src_other_pkg",
-        ":generated_hdr",
-    ] + select({
-        "//build/bazel_common_rules/platforms/arch:x86": ["for-x86.cpp"],
-        "//conditions:default": [
-            "not-for-x86.cpp",
-            ":generated_src_not_x86",
-        ],
-    }) + select({
-        "//build/bazel_common_rules/platforms/os:android": [":generated_src_android"],
-        "//conditions:default": [],
-    })`,
-				"hdrs": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["//dep:generated_hdr_other_pkg_android"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel_common_rules/platforms/arch:x86": ["//dep:generated_hdr_other_pkg_x86"],
-        "//conditions:default": [],
-    }) + ["//dep:generated_hdr_other_pkg"]`,
-				"local_includes":           `["."]`,
-				"export_absolute_includes": `["dep"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticGetTargetProperties(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-
-		Description: "cc_library_static complex GetTargetProperties",
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "foo_static",
-    target: {
-        android: {
-            srcs: ["android_src.c"],
-        },
-        android_arm: {
-            srcs: ["android_arm_src.c"],
-        },
-        android_arm64: {
-            srcs: ["android_arm64_src.c"],
-        },
-        android_x86: {
-            srcs: ["android_x86_src.c"],
-        },
-        android_x86_64: {
-            srcs: ["android_x86_64_src.c"],
-        },
-        linux_bionic_arm64: {
-            srcs: ["linux_bionic_arm64_src.c"],
-        },
-        linux_bionic_x86_64: {
-            srcs: ["linux_bionic_x86_64_src.c"],
-        },
-    },
-    include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"srcs_c": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["android_src.c"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm": ["android_arm_src.c"],
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": ["android_arm64_src.c"],
-        "//build/bazel_common_rules/platforms/os_arch:android_x86": ["android_x86_src.c"],
-        "//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["android_x86_64_src.c"],
-        "//build/bazel_common_rules/platforms/os_arch:linux_bionic_arm64": ["linux_bionic_arm64_src.c"],
-        "//build/bazel_common_rules/platforms/os_arch:linux_bionic_x86_64": ["linux_bionic_x86_64_src.c"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticProductVariableSelects(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static product variable selects",
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "foo_static",
-    srcs: ["common.c"],
-    product_variables: {
-      malloc_not_svelte: {
-        cflags: ["-Wmalloc_not_svelte"],
-      },
-      malloc_zero_contents: {
-        cflags: ["-Wmalloc_zero_contents"],
-      },
-      binder32bit: {
-        cflags: ["-Wbinder32bit"],
-      },
-    },
-    include_build_directory: false,
-} `,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"copts": `select({
-        "//build/bazel/product_config/config_settings:binder32bit": ["-Wbinder32bit"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel/product_config/config_settings:malloc_not_svelte": ["-Wmalloc_not_svelte"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel/product_config/config_settings:malloc_zero_contents": ["-Wmalloc_zero_contents"],
-        "//conditions:default": [],
-    })`,
-				"srcs_c": `["common.c"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticProductVariableArchSpecificSelects(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static arch-specific product variable selects",
-		Filesystem:  map[string]string{},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "foo_static",
-    srcs: ["common.c"],
-    product_variables: {
-      malloc_not_svelte: {
-        cflags: ["-Wmalloc_not_svelte"],
-      },
-    },
-    arch: {
-        arm64: {
-            product_variables: {
-                malloc_not_svelte: {
-                    cflags: ["-Warm64_malloc_not_svelte"],
-                },
-            },
-        },
-    },
-    multilib: {
-        lib32: {
-            product_variables: {
-                malloc_not_svelte: {
-                    cflags: ["-Wlib32_malloc_not_svelte"],
-                },
-            },
-        },
-    },
-    target: {
-        android: {
-            product_variables: {
-                malloc_not_svelte: {
-                    cflags: ["-Wandroid_malloc_not_svelte"],
-                },
-            },
-        }
-    },
-    include_build_directory: false,
-} `,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"copts": `select({
-        "//build/bazel/product_config/config_settings:malloc_not_svelte": ["-Wmalloc_not_svelte"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel/product_config/config_settings:malloc_not_svelte-android": ["-Wandroid_malloc_not_svelte"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel/product_config/config_settings:malloc_not_svelte-arm": ["-Wlib32_malloc_not_svelte"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel/product_config/config_settings:malloc_not_svelte-arm64": ["-Warm64_malloc_not_svelte"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel/product_config/config_settings:malloc_not_svelte-x86": ["-Wlib32_malloc_not_svelte"],
-        "//conditions:default": [],
-    })`,
-				"srcs_c": `["common.c"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticProductVariableStringReplacement(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static product variable string replacement",
-		Filesystem:  map[string]string{},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "foo_static",
-    srcs: ["common.S"],
-    product_variables: {
-      platform_sdk_version: {
-          asflags: ["-DPLATFORM_SDK_VERSION=%d"],
-      },
-    },
-    include_build_directory: false,
-} `,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
-				"asflags": `select({
-        "//build/bazel/product_config/config_settings:platform_sdk_version": ["-DPLATFORM_SDK_VERSION=$(Platform_sdk_version)"],
-        "//conditions:default": [],
-    })`,
-				"srcs_as": `["common.S"]`,
-			}),
-		},
-	})
-}
-
-func TestStaticLibrary_SystemSharedLibsRootEmpty(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static system_shared_lib empty root",
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static {
-    name: "root_empty",
-    system_shared_libs: [],
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "root_empty", AttrNameToString{
-				"system_dynamic_deps": `[]`,
-			}),
-		},
-	})
-}
-
-func TestStaticLibrary_SystemSharedLibsStaticEmpty(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static system_shared_lib empty static default",
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_defaults {
-    name: "static_empty_defaults",
-    static: {
-        system_shared_libs: [],
-    },
-    include_build_directory: false,
-}
-cc_library_static {
-    name: "static_empty",
-    defaults: ["static_empty_defaults"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "static_empty", AttrNameToString{
-				"system_dynamic_deps": `[]`,
-			}),
-		},
-	})
-}
-
-func TestStaticLibrary_SystemSharedLibsBionicEmpty(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_static system_shared_lib empty for bionic variant",
-		StubbedBuildDefinitions: []string{"libc_musl"},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library {
-		name: "libc_musl",
-}
-
-cc_library_static {
-    name: "target_bionic_empty",
-    target: {
-        bionic: {
-            system_shared_libs: [],
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "target_bionic_empty", AttrNameToString{
-				"system_dynamic_deps": `select({
-        "//build/bazel_common_rules/platforms/os:linux_musl": [":libc_musl"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestStaticLibrary_SystemSharedLibsLinuxBionicEmpty(t *testing.T) {
-	// Note that this behavior is technically incorrect (it's a simplification).
-	// The correct behavior would be if bp2build wrote `system_dynamic_deps = []`
-	// only for linux_bionic, but `android` had `["libc", "libdl", "libm"].
-	// b/195791252 tracks the fix.
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_static system_shared_lib empty for linux_bionic variant",
-		StubbedBuildDefinitions: []string{"libc_musl"},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library {
-		name: "libc_musl",
-}
-
-cc_library_static {
-    name: "target_linux_bionic_empty",
-    target: {
-        linux_bionic: {
-            system_shared_libs: [],
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "target_linux_bionic_empty", AttrNameToString{
-				"system_dynamic_deps": `select({
-        "//build/bazel_common_rules/platforms/os:linux_musl": [":libc_musl"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestStaticLibrary_SystemSharedLibsMuslEmpty(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_static system_shared_lib empty for musl variant",
-		StubbedBuildDefinitions: []string{"libc_musl"},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library {
-		name: "libc_musl",
-}
-
-cc_library_static {
-    name: "target_musl_empty",
-    target: {
-        musl: {
-            system_shared_libs: [],
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "target_musl_empty", AttrNameToString{
-				"system_dynamic_deps": `[]`,
-			}),
-		},
-	})
-}
-
-func TestStaticLibrary_SystemSharedLibsLinuxMuslEmpty(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_static system_shared_lib empty for linux_musl variant",
-		StubbedBuildDefinitions: []string{"libc_musl"},
-		Blueprint: soongCcLibraryStaticPreamble + `
-cc_library {
-		name: "libc_musl",
-}
-
-cc_library_static {
-    name: "target_linux_musl_empty",
-    target: {
-        linux_musl: {
-            system_shared_libs: [],
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "target_linux_musl_empty", AttrNameToString{
-				"system_dynamic_deps": `[]`,
-			}),
-		},
-	})
-}
-
-func TestStaticLibrary_SystemSharedLibsBionic(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_static system_shared_libs set for bionic variant",
-		StubbedBuildDefinitions: []string{"libc", "libc_musl"},
-		Blueprint: soongCcLibraryStaticPreamble +
-			simpleModule("cc_library", "libc") + `
-cc_library {
-	name: "libc_musl",
-}
-
-cc_library_static {
-    name: "target_bionic",
-    target: {
-        bionic: {
-            system_shared_libs: ["libc"],
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "target_bionic", AttrNameToString{
-				"system_dynamic_deps": `select({
-        "//build/bazel_common_rules/platforms/os:android": [":libc"],
-        "//build/bazel_common_rules/platforms/os:linux_bionic": [":libc"],
-        "//build/bazel_common_rules/platforms/os:linux_musl": [":libc_musl"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestStaticLibrary_SystemSharedLibsLinuxRootAndLinuxBionic(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_static system_shared_libs set for root and linux_bionic variant",
-		StubbedBuildDefinitions: []string{"libc", "libm", "libc_musl"},
-		Blueprint: soongCcLibraryStaticPreamble +
-			simpleModule("cc_library", "libc") +
-			simpleModule("cc_library", "libm") + `
-cc_library {
-	name: "libc_musl",
-}
-
-cc_library_static {
-    name: "target_linux_bionic",
-    system_shared_libs: ["libc"],
-    target: {
-        linux_bionic: {
-            system_shared_libs: ["libm"],
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "target_linux_bionic", AttrNameToString{
-				"system_dynamic_deps": `[":libc"] + select({
-        "//build/bazel_common_rules/platforms/os:linux_bionic": [":libm"],
-        "//build/bazel_common_rules/platforms/os:linux_musl": [":libc_musl"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibrarystatic_SystemSharedLibUsedAsDep(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description:             "cc_library_static system_shared_lib empty for linux_bionic variant",
-		StubbedBuildDefinitions: []string{"libc", "libm"},
-		Blueprint: soongCcLibraryStaticPreamble +
-			simpleModule("cc_library", "libc") + `
-
-cc_library {
-    name: "libm",
-    stubs: {
-        symbol_file: "libm.map.txt",
-        versions: ["current"],
-    },
-    apex_available: ["com.android.runtime"],
-}
-
-cc_library_static {
-    name: "used_in_bionic_oses",
-    target: {
-        android: {
-            shared_libs: ["libc"],
-        },
-        linux_bionic: {
-            shared_libs: ["libc"],
-        },
-    },
-    include_build_directory: false,
-    apex_available: ["foo"],
-}
-
-cc_library_static {
-    name: "all",
-    shared_libs: ["libc"],
-    include_build_directory: false,
-    apex_available: ["foo"],
-}
-
-cc_library_static {
-    name: "keep_for_empty_system_shared_libs",
-    shared_libs: ["libc"],
-    system_shared_libs: [],
-    include_build_directory: false,
-    apex_available: ["foo"],
-}
-
-cc_library_static {
-    name: "used_with_stubs",
-    shared_libs: ["libm"],
-    include_build_directory: false,
-    apex_available: ["foo"],
-}
-
-cc_library_static {
-    name: "keep_with_stubs",
-    shared_libs: ["libm"],
-    system_shared_libs: [],
-    include_build_directory: false,
-    apex_available: ["foo"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "all", AttrNameToString{
-				"tags": `["apex_available=foo"]`,
-			}),
-			MakeBazelTarget("cc_library_static", "keep_for_empty_system_shared_libs", AttrNameToString{
-				"implementation_dynamic_deps": `[":libc"]`,
-				"system_dynamic_deps":         `[]`,
-				"tags":                        `["apex_available=foo"]`,
-			}),
-			MakeBazelTarget("cc_library_static", "keep_with_stubs", AttrNameToString{
-				"implementation_dynamic_deps": `select({
-        "//build/bazel/rules/apex:foo": ["@api_surfaces//module-libapi/current:libm"],
-        "//build/bazel/rules/apex:system": ["@api_surfaces//module-libapi/current:libm"],
-        "//conditions:default": [":libm"],
-    })`,
-				"system_dynamic_deps": `[]`,
-				"tags":                `["apex_available=foo"]`,
-			}),
-			MakeBazelTarget("cc_library_static", "used_in_bionic_oses", AttrNameToString{
-				"tags": `["apex_available=foo"]`,
-			}),
-			MakeBazelTarget("cc_library_static", "used_with_stubs", AttrNameToString{
-				"tags": `["apex_available=foo"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticProto(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		StubbedBuildDefinitions: []string{"libprotobuf-cpp-full", "libprotobuf-cpp-lite"},
-		Blueprint: soongCcProtoPreamble + `cc_library_static {
-	name: "foo",
-	srcs: ["foo.proto"],
-	proto: {
-		export_proto_headers: true,
-	},
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-				"srcs": `["foo.proto"]`,
-			}), MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
-				"deps": `[":foo_proto"]`,
-			}), MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"deps":               `[":libprotobuf-cpp-lite"]`,
-				"whole_archive_deps": `[":foo_cc_proto_lite"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticUseVersionLib(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Filesystem: map[string]string{
-			soongCcVersionLibBpPath: soongCcVersionLibBp,
-		},
-		StubbedBuildDefinitions: []string{"//build/soong/cc/libbuildversion:libbuildversion", "libprotobuf-cpp-full", "libprotobuf-cpp-lite"},
-		Blueprint: soongCcProtoPreamble + `cc_library_static {
-	name: "foo",
-	use_version_lib: true,
-	static_libs: ["libbuildversion"],
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"whole_archive_deps": `["//build/soong/cc/libbuildversion:libbuildversion"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticUseVersionLibHasDep(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Filesystem: map[string]string{
-			soongCcVersionLibBpPath: soongCcVersionLibBp,
-		},
-		StubbedBuildDefinitions: []string{"//build/soong/cc/libbuildversion:libbuildversion", "libprotobuf-cpp-full", "libprotobuf-cpp-lite"},
-
-		Blueprint: soongCcProtoPreamble + `cc_library_static {
-	name: "foo",
-	use_version_lib: true,
-	whole_static_libs: ["libbuildversion"],
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"whole_archive_deps": `["//build/soong/cc/libbuildversion:libbuildversion"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticStdInFlags(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		StubbedBuildDefinitions: []string{"libprotobuf-cpp-full", "libprotobuf-cpp-lite"},
-		Blueprint: soongCcProtoPreamble + `cc_library_static {
-	name: "foo",
-	cflags: ["-std=candcpp"],
-	conlyflags: ["-std=conly"],
-	cppflags: ["-std=cpp"],
-	include_build_directory: false,
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"conlyflags": `["-std=conly"]`,
-				"cppflags":   `["-std=cpp"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticStl(t *testing.T) {
-	testCases := []struct {
-		desc string
-		prop string
-		attr AttrNameToString
-	}{
-		{
-			desc: "c++_shared deduped to libc++",
-			prop: `stl: "c++_shared",`,
-			attr: AttrNameToString{
-				"stl": `"libc++"`,
-			},
-		},
-		{
-			desc: "libc++ to libc++",
-			prop: `stl: "libc++",`,
-			attr: AttrNameToString{
-				"stl": `"libc++"`,
-			},
-		},
-		{
-			desc: "c++_static to libc++_static",
-			prop: `stl: "c++_static",`,
-			attr: AttrNameToString{
-				"stl": `"libc++_static"`,
-			},
-		},
-		{
-			desc: "libc++_static to libc++_static",
-			prop: `stl: "libc++_static",`,
-			attr: AttrNameToString{
-				"stl": `"libc++_static"`,
-			},
-		},
-		{
-			desc: "system to system",
-			prop: `stl: "system",`,
-			attr: AttrNameToString{
-				"stl": `"system"`,
-			},
-		},
-		{
-			desc: "none to none",
-			prop: `stl: "none",`,
-			attr: AttrNameToString{
-				"stl": `"none"`,
-			},
-		},
-		{
-			desc: "empty to empty",
-			attr: AttrNameToString{},
-		},
-	}
-	for _, tc := range testCases {
-		t.Run(tc.desc, func(*testing.T) {
-			runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-				Blueprint: fmt.Sprintf(`cc_library_static {
-	name: "foo",
-	include_build_directory: false,
-	%s
-}`, tc.prop),
-				ExpectedBazelTargets: []string{
-					MakeBazelTarget("cc_library_static", "foo", tc.attr),
-				},
-			})
-		})
-	}
-}
-
-func TestCCLibraryStaticRuntimeDeps(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Blueprint: `cc_library_shared {
-	name: "bar",
-}
-
-cc_library_static {
-  name: "foo",
-  runtime_libs: ["bar"],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_shared", "bar", AttrNameToString{
-				"local_includes": `["."]`,
-			}),
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"runtime_deps":   `[":bar"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticWithSyspropSrcs(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static with sysprop sources",
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	srcs: [
-		"bar.sysprop",
-		"baz.sysprop",
-		"blah.cpp",
-	],
-	min_sdk_version: "5",
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("sysprop_library", "foo_sysprop_library", AttrNameToString{
-				"srcs": `[
-        "bar.sysprop",
-        "baz.sysprop",
-    ]`,
-			}),
-			MakeBazelTarget("cc_sysprop_library_static", "foo_cc_sysprop_library_static", AttrNameToString{
-				"dep":             `":foo_sysprop_library"`,
-				"min_sdk_version": `"5"`,
-			}),
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"srcs":               `["blah.cpp"]`,
-				"local_includes":     `["."]`,
-				"min_sdk_version":    `"5"`,
-				"whole_archive_deps": `[":foo_cc_sysprop_library_static"]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticWithSyspropSrcsSomeConfigs(t *testing.T) {
-	runCcLibraryTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static with sysprop sources in some configs but not others",
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	srcs: [
-		"blah.cpp",
-	],
-	target: {
-		android: {
-			srcs: ["bar.sysprop"],
-		},
-	},
-	min_sdk_version: "5",
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("sysprop_library", "foo_sysprop_library", AttrNameToString{
-				"srcs": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["bar.sysprop"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("cc_sysprop_library_static", "foo_cc_sysprop_library_static", AttrNameToString{
-				"dep":             `":foo_sysprop_library"`,
-				"min_sdk_version": `"5"`,
-			}),
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"srcs":            `["blah.cpp"]`,
-				"local_includes":  `["."]`,
-				"min_sdk_version": `"5"`,
-				"whole_archive_deps": `select({
-        "//build/bazel_common_rules/platforms/os:android": [":foo_cc_sysprop_library_static"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticWithIntegerOverflowProperty(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static has correct features when integer_overflow property is provided",
-		Blueprint: `
-cc_library_static {
-		name: "foo",
-		sanitize: {
-				integer_overflow: true,
-		},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"features":       `["ubsan_integer_overflow"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticWithMiscUndefinedProperty(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static has correct features when misc_undefined property is provided",
-		Blueprint: `
-cc_library_static {
-		name: "foo",
-		sanitize: {
-				misc_undefined: ["undefined", "nullability"],
-		},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"features": `[
-        "ubsan_undefined",
-        "ubsan_nullability",
-    ]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticWithUBSanPropertiesArchSpecific(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static has correct feature select when UBSan props are specified in arch specific blocks",
-		Blueprint: `
-cc_library_static {
-		name: "foo",
-		sanitize: {
-				misc_undefined: ["undefined", "nullability"],
-		},
-		target: {
-				android: {
-						sanitize: {
-								misc_undefined: ["alignment"],
-						},
-				},
-				linux_glibc: {
-						sanitize: {
-								integer_overflow: true,
-						},
-				},
-		},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"features": `[
-        "ubsan_undefined",
-        "ubsan_nullability",
-    ] + select({
-        "//build/bazel_common_rules/platforms/os:android": ["ubsan_alignment"],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticWithSanitizerBlocklist(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static has correct features when sanitize.blocklist is provided",
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	sanitize: {
-		blocklist: "foo_blocklist.txt",
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"copts": `select({
-        "//build/bazel/rules/cc:sanitizers_enabled": ["-fsanitize-ignorelist=$(location foo_blocklist.txt)"],
-        "//conditions:default": [],
-    })`,
-				"additional_compiler_inputs": `select({
-        "//build/bazel/rules/cc:sanitizers_enabled": [":foo_blocklist.txt"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticWithThinLto(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static has correct features when thin lto is enabled",
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	lto: {
-		thin: true,
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"features":       `["android_thin_lto"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticWithLtoNever(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static has correct features when thin lto is enabled",
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	lto: {
-		never: true,
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"features":       `["-android_thin_lto"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticWithThinLtoArchSpecific(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static has correct features when LTO differs across arch and os variants",
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	target: {
-		android: {
-			lto: {
-				thin: true,
-			},
-		},
-	},
-	arch: {
-		riscv64: {
-			lto: {
-				thin: false,
-			},
-		},
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm": ["android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": ["android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_riscv64": ["-android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_x86": ["android_thin_lto"],
-        "//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["android_thin_lto"],
-        "//conditions:default": [],
-    })`}),
-		},
-	})
-}
-
-func TestCcLibraryStaticWithThinLtoDisabledDefaultEnabledVariant(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static has correct features when LTO disabled by default but enabled on a particular variant",
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	lto: {
-		never: true,
-	},
-	target: {
-		android: {
-			lto: {
-				thin: true,
-				never: false,
-			},
-		},
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"local_includes": `["."]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["android_thin_lto"],
-        "//conditions:default": ["-android_thin_lto"],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticWithThinLtoAndWholeProgramVtables(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static has correct features when thin lto is enabled with whole_program_vtables",
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	lto: {
-		thin: true,
-	},
-	whole_program_vtables: true,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"features": `[
-        "android_thin_lto",
-        "android_thin_lto_whole_program_vtables",
-    ]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticHiddenVisibilityConvertedToFeature(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static changes hidden visibility flag to feature",
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	cflags: ["-fvisibility=hidden"],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"features":       `["visibility_hidden"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticHiddenVisibilityConvertedToFeatureOsSpecific(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static changes hidden visibility flag to feature for specific os",
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	target: {
-		android: {
-			cflags: ["-fvisibility=hidden"],
-		},
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["visibility_hidden"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticWithCfi(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static has correct features when cfi is enabled",
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	sanitize: {
-		cfi: true,
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"features":       `["android_cfi"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticWithCfiOsSpecific(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static has correct features when cfi is enabled for specific variants",
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	target: {
-		android: {
-			sanitize: {
-				cfi: true,
-			},
-		},
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["android_cfi"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticWithCfiAndCfiAssemblySupport(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static has correct features when cfi is enabled with cfi_assembly_support",
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	sanitize: {
-		cfi: true,
-		config: {
-			cfi_assembly_support: true,
-		},
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"features": `[
-        "android_cfi",
-        "android_cfi_assembly_support",
-    ]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCcLibraryStaticExplicitlyDisablesCfiWhenFalse(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_library_static disables cfi when explciitly set to false in the bp",
-		Blueprint: `
-cc_library_static {
-	name: "foo",
-	sanitize: {
-		cfi: false,
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"features":       `["-android_cfi"]`,
-				"local_includes": `["."]`,
-			}),
-		},
-	})
-}
-
-func TestCCLibraryStaticRscriptSrc(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: `cc_library_static with rscript files in sources`,
-		Blueprint: `
-cc_library_static{
-    name : "foo",
-    srcs : [
-        "ccSrc.cc",
-        "rsSrc.rscript",
-    ],
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("rscript_to_cpp", "foo_renderscript", AttrNameToString{
-				"srcs": `["rsSrc.rscript"]`,
-			}),
-			MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
-				"absolute_includes": `[
-        "frameworks/rs",
-        "frameworks/rs/cpp",
-    ]`,
-				"local_includes": `["."]`,
-				"srcs": `[
-        "ccSrc.cc",
-        "foo_renderscript",
-    ]`,
-			})}})
-}
-
-func TestCcLibraryWithProtoInGeneratedSrcs(t *testing.T) {
-	runCcLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library with a .proto file generated from a genrule",
-		ModuleTypeUnderTest:        "cc_library_static",
-		ModuleTypeUnderTestFactory: cc.LibraryStaticFactory,
-		StubbedBuildDefinitions:    []string{"libprotobuf-cpp-lite"},
-		Blueprint: soongCcLibraryPreamble + `
-cc_library_static {
-	name: "mylib",
-	generated_sources: ["myprotogen"],
-}
-genrule {
-	name: "myprotogen",
-	out: ["myproto.proto"],
-}
-` + simpleModule("cc_library", "libprotobuf-cpp-lite"),
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_library_static", "mylib", AttrNameToString{
-				"local_includes":                    `["."]`,
-				"deps":                              `[":libprotobuf-cpp-lite"]`,
-				"implementation_whole_archive_deps": `[":mylib_cc_proto_lite"]`,
-			}),
-			MakeBazelTarget("cc_lite_proto_library", "mylib_cc_proto_lite", AttrNameToString{
-				"deps": `[":mylib_proto"]`,
-			}),
-			MakeBazelTarget("proto_library", "mylib_proto", AttrNameToString{
-				"srcs": `[":myprotogen"]`,
-			}),
-			MakeBazelTargetNoRestrictions("genrule", "myprotogen", AttrNameToString{
-				"cmd":  `""`,
-				"outs": `["myproto.proto"]`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/cc_object_conversion_test.go b/bp2build/cc_object_conversion_test.go
deleted file mode 100644
index 4d44db7..0000000
--- a/bp2build/cc_object_conversion_test.go
+++ /dev/null
@@ -1,478 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/cc"
-)
-
-func registerCcObjectModuleTypes(ctx android.RegistrationContext) {
-	// Always register cc_defaults module factory
-	ctx.RegisterModuleType("cc_defaults", func() android.Module { return cc.DefaultsFactory() })
-	ctx.RegisterModuleType("cc_library_headers", cc.LibraryHeaderFactory)
-}
-
-func runCcObjectTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "cc_object"
-	(&tc).ModuleTypeUnderTestFactory = cc.ObjectFactory
-	RunBp2BuildTestCase(t, registerCcObjectModuleTypes, tc)
-}
-
-func TestCcObjectSimple(t *testing.T) {
-	runCcObjectTestCase(t, Bp2buildTestCase{
-		Description: "simple cc_object generates cc_object with include header dep",
-		Filesystem: map[string]string{
-			"a/b/foo.h":     "",
-			"a/b/bar.h":     "",
-			"a/b/exclude.c": "",
-			"a/b/c.c":       "",
-		},
-		Blueprint: `cc_object {
-    name: "foo",
-    local_include_dirs: ["include"],
-    system_shared_libs: [],
-    cflags: [
-        "-Wno-gcc-compat",
-        "-Wall",
-        "-Werror",
-    ],
-    srcs: [
-        "a/b/*.c"
-    ],
-    exclude_srcs: ["a/b/exclude.c"],
-    sdk_version: "current",
-    min_sdk_version: "29",
-	crt: true,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_object", "foo", AttrNameToString{
-				"copts": `[
-        "-fno-addrsig",
-        "-Wno-gcc-compat",
-        "-Wall",
-        "-Werror",
-    ]`,
-				"local_includes": `[
-        "include",
-        ".",
-    ]`,
-				"srcs":                `["a/b/c.c"]`,
-				"system_dynamic_deps": `[]`,
-				"sdk_version":         `"current"`,
-				"min_sdk_version":     `"29"`,
-				"crt":                 "True",
-			}),
-		},
-	})
-}
-
-func TestCcObjectDefaults(t *testing.T) {
-	runCcObjectTestCase(t, Bp2buildTestCase{
-		Blueprint: `cc_object {
-    name: "foo",
-    system_shared_libs: [],
-    srcs: [
-        "a/b/*.h",
-        "a/b/c.c"
-    ],
-
-    defaults: ["foo_defaults"],
-}
-
-cc_defaults {
-    name: "foo_defaults",
-    defaults: ["foo_bar_defaults"],
-}
-
-cc_defaults {
-    name: "foo_bar_defaults",
-    cflags: [
-        "-Werror",
-    ],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_object", "foo", AttrNameToString{
-				"copts": `[
-        "-Werror",
-        "-fno-addrsig",
-    ]`,
-				"local_includes":      `["."]`,
-				"srcs":                `["a/b/c.c"]`,
-				"system_dynamic_deps": `[]`,
-			}),
-		}})
-}
-
-func TestCcObjectCcObjetDepsInObjs(t *testing.T) {
-	runCcObjectTestCase(t, Bp2buildTestCase{
-		Description: "cc_object with cc_object deps in objs props",
-		Filesystem: map[string]string{
-			"a/b/c.c": "",
-			"x/y/z.c": "",
-		},
-		Blueprint: `cc_object {
-    name: "foo",
-    system_shared_libs: [],
-    srcs: ["a/b/c.c"],
-    objs: ["bar"],
-    include_build_directory: false,
-}
-
-cc_object {
-    name: "bar",
-    system_shared_libs: [],
-    srcs: ["x/y/z.c"],
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_object", "bar", AttrNameToString{
-				"copts":               `["-fno-addrsig"]`,
-				"srcs":                `["x/y/z.c"]`,
-				"system_dynamic_deps": `[]`,
-			}), MakeBazelTarget("cc_object", "foo", AttrNameToString{
-				"copts":               `["-fno-addrsig"]`,
-				"objs":                `[":bar"]`,
-				"srcs":                `["a/b/c.c"]`,
-				"system_dynamic_deps": `[]`,
-			}),
-		},
-	})
-}
-
-func TestCcObjectIncludeBuildDirFalse(t *testing.T) {
-	runCcObjectTestCase(t, Bp2buildTestCase{
-		Description: "cc_object with include_build_dir: false",
-		Filesystem: map[string]string{
-			"a/b/c.c": "",
-			"x/y/z.c": "",
-		},
-		Blueprint: `cc_object {
-    name: "foo",
-    system_shared_libs: [],
-    srcs: ["a/b/c.c"],
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_object", "foo", AttrNameToString{
-				"copts":               `["-fno-addrsig"]`,
-				"srcs":                `["a/b/c.c"]`,
-				"system_dynamic_deps": `[]`,
-			}),
-		},
-	})
-}
-
-func TestCcObjectProductVariable(t *testing.T) {
-	runCcObjectTestCase(t, Bp2buildTestCase{
-		Description: "cc_object with product variable",
-		Blueprint: `cc_object {
-    name: "foo",
-    system_shared_libs: [],
-    include_build_directory: false,
-    product_variables: {
-        platform_sdk_version: {
-            asflags: ["-DPLATFORM_SDK_VERSION=%d"],
-        },
-    },
-    srcs: ["src.S"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_object", "foo", AttrNameToString{
-				"asflags": `select({
-        "//build/bazel/product_config/config_settings:platform_sdk_version": ["-DPLATFORM_SDK_VERSION=$(Platform_sdk_version)"],
-        "//conditions:default": [],
-    })`,
-				"copts":               `["-fno-addrsig"]`,
-				"srcs_as":             `["src.S"]`,
-				"system_dynamic_deps": `[]`,
-			}),
-		},
-	})
-}
-
-func TestCcObjectCflagsOneArch(t *testing.T) {
-	runCcObjectTestCase(t, Bp2buildTestCase{
-		Description: "cc_object setting cflags for one arch",
-		Blueprint: `cc_object {
-    name: "foo",
-    system_shared_libs: [],
-    srcs: ["a.cpp"],
-    arch: {
-        x86: {
-            cflags: ["-fPIC"], // string list
-        },
-        arm: {
-            srcs: ["arch/arm/file.cpp"], // label list
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_object", "foo", AttrNameToString{
-				"copts": `["-fno-addrsig"] + select({
-        "//build/bazel_common_rules/platforms/arch:x86": ["-fPIC"],
-        "//conditions:default": [],
-    })`,
-				"srcs": `["a.cpp"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["arch/arm/file.cpp"],
-        "//conditions:default": [],
-    })`,
-				"system_dynamic_deps": `[]`,
-			}),
-		},
-	})
-}
-
-func TestCcObjectCflagsFourArch(t *testing.T) {
-	runCcObjectTestCase(t, Bp2buildTestCase{
-		Description: "cc_object setting cflags for 4 architectures",
-		Blueprint: `cc_object {
-    name: "foo",
-    system_shared_libs: [],
-    srcs: ["base.cpp"],
-    arch: {
-        x86: {
-            srcs: ["x86.cpp"],
-            cflags: ["-fPIC"],
-        },
-        x86_64: {
-            srcs: ["x86_64.cpp"],
-            cflags: ["-fPIC"],
-        },
-        arm: {
-            srcs: ["arm.cpp"],
-            cflags: ["-Wall"],
-        },
-        arm64: {
-            srcs: ["arm64.cpp"],
-            cflags: ["-Wall"],
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_object", "foo", AttrNameToString{
-				"copts": `["-fno-addrsig"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["-Wall"],
-        "//build/bazel_common_rules/platforms/arch:arm64": ["-Wall"],
-        "//build/bazel_common_rules/platforms/arch:x86": ["-fPIC"],
-        "//build/bazel_common_rules/platforms/arch:x86_64": ["-fPIC"],
-        "//conditions:default": [],
-    })`,
-				"srcs": `["base.cpp"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["arm.cpp"],
-        "//build/bazel_common_rules/platforms/arch:arm64": ["arm64.cpp"],
-        "//build/bazel_common_rules/platforms/arch:x86": ["x86.cpp"],
-        "//build/bazel_common_rules/platforms/arch:x86_64": ["x86_64.cpp"],
-        "//conditions:default": [],
-    })`,
-				"system_dynamic_deps": `[]`,
-			}),
-		},
-	})
-}
-
-func TestCcObjectLinkerScript(t *testing.T) {
-	runCcObjectTestCase(t, Bp2buildTestCase{
-		Description: "cc_object setting linker_script",
-		Blueprint: `cc_object {
-    name: "foo",
-    srcs: ["base.cpp"],
-    linker_script: "bunny.lds",
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_object", "foo", AttrNameToString{
-				"copts":         `["-fno-addrsig"]`,
-				"linker_script": `"bunny.lds"`,
-				"srcs":          `["base.cpp"]`,
-			}),
-		},
-	})
-}
-
-func TestCcObjectDepsAndLinkerScriptSelects(t *testing.T) {
-	runCcObjectTestCase(t, Bp2buildTestCase{
-		Description:             "cc_object setting deps and linker_script across archs",
-		StubbedBuildDefinitions: []string{"x86_obj", "x86_64_obj", "arm_obj"},
-		Blueprint: `cc_object {
-    name: "foo",
-    srcs: ["base.cpp"],
-    arch: {
-        x86: {
-            objs: ["x86_obj"],
-            linker_script: "x86.lds",
-        },
-        x86_64: {
-            objs: ["x86_64_obj"],
-            linker_script: "x86_64.lds",
-        },
-        arm: {
-            objs: ["arm_obj"],
-            linker_script: "arm.lds",
-        },
-    },
-    include_build_directory: false,
-}
-
-cc_object {
-    name: "x86_obj",
-    system_shared_libs: [],
-    srcs: ["x86.cpp"],
-    include_build_directory: false,
-}
-
-cc_object {
-    name: "x86_64_obj",
-    system_shared_libs: [],
-    srcs: ["x86_64.cpp"],
-    include_build_directory: false,
-}
-
-cc_object {
-    name: "arm_obj",
-    system_shared_libs: [],
-    srcs: ["arm.cpp"],
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_object", "foo", AttrNameToString{
-				"copts": `["-fno-addrsig"]`,
-				"objs": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": [":arm_obj"],
-        "//build/bazel_common_rules/platforms/arch:x86": [":x86_obj"],
-        "//build/bazel_common_rules/platforms/arch:x86_64": [":x86_64_obj"],
-        "//conditions:default": [],
-    })`,
-				"linker_script": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "arm.lds",
-        "//build/bazel_common_rules/platforms/arch:x86": "x86.lds",
-        "//build/bazel_common_rules/platforms/arch:x86_64": "x86_64.lds",
-        "//conditions:default": None,
-    })`,
-				"srcs": `["base.cpp"]`,
-			}),
-		},
-	})
-}
-
-func TestCcObjectSelectOnLinuxAndBionicArchs(t *testing.T) {
-	runCcObjectTestCase(t, Bp2buildTestCase{
-		Description: "cc_object setting srcs based on linux and bionic archs",
-		Blueprint: `cc_object {
-    name: "foo",
-    srcs: ["base.cpp"],
-    target: {
-        linux_arm64: {
-            srcs: ["linux_arm64.cpp",]
-        },
-        linux_x86: {
-            srcs: ["linux_x86.cpp",]
-        },
-        bionic_arm64: {
-            srcs: ["bionic_arm64.cpp",]
-        },
-    },
-    include_build_directory: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_object", "foo", AttrNameToString{
-				"copts": `["-fno-addrsig"]`,
-				"srcs": `["base.cpp"] + select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
-            "linux_arm64.cpp",
-            "bionic_arm64.cpp",
-        ],
-        "//build/bazel_common_rules/platforms/os_arch:android_x86": ["linux_x86.cpp"],
-        "//build/bazel_common_rules/platforms/os_arch:linux_bionic_arm64": [
-            "linux_arm64.cpp",
-            "bionic_arm64.cpp",
-        ],
-        "//build/bazel_common_rules/platforms/os_arch:linux_glibc_x86": ["linux_x86.cpp"],
-        "//build/bazel_common_rules/platforms/os_arch:linux_musl_arm64": ["linux_arm64.cpp"],
-        "//build/bazel_common_rules/platforms/os_arch:linux_musl_x86": ["linux_x86.cpp"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestCcObjectHeaderLib(t *testing.T) {
-	runCcObjectTestCase(t, Bp2buildTestCase{
-		Description: "simple cc_object generates cc_object with include header dep",
-		Filesystem: map[string]string{
-			"a/b/foo.h":     "",
-			"a/b/bar.h":     "",
-			"a/b/exclude.c": "",
-			"a/b/c.c":       "",
-		},
-		Blueprint: `cc_object {
-    name: "foo",
-	header_libs: ["libheaders"],
-    system_shared_libs: [],
-    cflags: [
-        "-Wno-gcc-compat",
-        "-Wall",
-        "-Werror",
-    ],
-    srcs: [
-        "a/b/*.c"
-    ],
-    exclude_srcs: ["a/b/exclude.c"],
-    sdk_version: "current",
-    min_sdk_version: "29",
-}
-
-cc_library_headers {
-    name: "libheaders",
-	export_include_dirs: ["include"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_object", "foo", AttrNameToString{
-				"copts": `[
-        "-fno-addrsig",
-        "-Wno-gcc-compat",
-        "-Wall",
-        "-Werror",
-    ]`,
-				"deps":                `[":libheaders"]`,
-				"local_includes":      `["."]`,
-				"srcs":                `["a/b/c.c"]`,
-				"system_dynamic_deps": `[]`,
-				"sdk_version":         `"current"`,
-				"min_sdk_version":     `"29"`,
-			}),
-			MakeBazelTarget("cc_library_headers", "libheaders", AttrNameToString{
-				"export_includes": `["include"]`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/cc_prebuilt_binary_conversion_test.go b/bp2build/cc_prebuilt_binary_conversion_test.go
deleted file mode 100644
index 9adaf32..0000000
--- a/bp2build/cc_prebuilt_binary_conversion_test.go
+++ /dev/null
@@ -1,125 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//	http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package bp2build
-
-import (
-	"fmt"
-	"testing"
-
-	"android/soong/cc"
-)
-
-func runCcPrebuiltBinaryTestCase(t *testing.T, testCase Bp2buildTestCase) {
-	t.Helper()
-	description := fmt.Sprintf("cc_prebuilt_binary: %s", testCase.Description)
-	testCase.ModuleTypeUnderTest = "cc_prebuilt_binary"
-	testCase.ModuleTypeUnderTestFactory = cc.PrebuiltBinaryFactory
-	testCase.Description = description
-	t.Run(description, func(t *testing.T) {
-		t.Helper()
-		RunBp2BuildTestCaseSimple(t, testCase)
-	})
-}
-
-func TestPrebuiltBinary(t *testing.T) {
-	runCcPrebuiltBinaryTestCase(t,
-		Bp2buildTestCase{
-			Description: "simple",
-			Filesystem: map[string]string{
-				"bin": "",
-			},
-			Blueprint: `
-cc_prebuilt_binary {
-	name: "bintest",
-	srcs: ["bin"],
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_binary", "bintest", AttrNameToString{
-					"src": `"bin"`,
-				})},
-		})
-}
-
-func TestPrebuiltBinaryWithStrip(t *testing.T) {
-	runCcPrebuiltBinaryTestCase(t,
-		Bp2buildTestCase{
-			Description: "with strip",
-			Filesystem: map[string]string{
-				"bin": "",
-			},
-			Blueprint: `
-cc_prebuilt_binary {
-	name: "bintest",
-	srcs: ["bin"],
-	strip: { all: true },
-	bazel_module: { bp2build_available: true },
-}`, ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_binary", "bintest", AttrNameToString{
-					"src": `"bin"`,
-					"strip": `{
-        "all": True,
-    }`,
-				}),
-			},
-		})
-}
-
-func TestPrebuiltBinaryWithArchVariance(t *testing.T) {
-	runCcPrebuiltBinaryTestCase(t,
-		Bp2buildTestCase{
-			Description: "with arch variance",
-			Filesystem: map[string]string{
-				"bina": "",
-				"binb": "",
-			},
-			Blueprint: `
-cc_prebuilt_binary {
-	name: "bintest",
-	arch: {
-		arm64: { srcs: ["bina"], },
-		arm: { srcs: ["binb"], },
-	},
-	bazel_module: { bp2build_available: true },
-}`, ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_binary", "bintest", AttrNameToString{
-					"src": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "binb",
-        "//build/bazel_common_rules/platforms/arch:arm64": "bina",
-        "//conditions:default": None,
-    })`,
-				}),
-			},
-		})
-}
-
-func TestPrebuiltBinaryMultipleSrcsFails(t *testing.T) {
-	runCcPrebuiltBinaryTestCase(t,
-		Bp2buildTestCase{
-			Description: "fails because multiple sources",
-			Filesystem: map[string]string{
-				"bina": "",
-				"binb": "",
-			},
-			Blueprint: `
-cc_prebuilt_binary {
-	name: "bintest",
-	srcs: ["bina", "binb"],
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedErr: fmt.Errorf("Expected at most one source file"),
-		})
-}
-
-// TODO: nosrcs test
diff --git a/bp2build/cc_prebuilt_library_conversion_test.go b/bp2build/cc_prebuilt_library_conversion_test.go
deleted file mode 100644
index a7f0c7b..0000000
--- a/bp2build/cc_prebuilt_library_conversion_test.go
+++ /dev/null
@@ -1,412 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//	http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package bp2build
-
-import (
-	"fmt"
-	"testing"
-
-	"android/soong/android"
-	"android/soong/cc"
-)
-
-func runCcPrebuiltLibraryTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "cc_prebuilt_library"
-	(&tc).ModuleTypeUnderTestFactory = cc.PrebuiltLibraryFactory
-	RunBp2BuildTestCaseSimple(t, tc)
-}
-
-func TestPrebuiltLibraryStaticAndSharedSimple(t *testing.T) {
-	runCcPrebuiltLibraryTestCase(t,
-		Bp2buildTestCase{
-			Description: "prebuilt library static and shared simple",
-			Filesystem: map[string]string{
-				"libf.so": "",
-			},
-			Blueprint: `
-cc_prebuilt_library {
-	name: "libtest",
-	srcs: ["libf.so"],
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
-					"static_library": `"libf.so"`,
-				}),
-				MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static_alwayslink", AttrNameToString{
-					"static_library": `"libf.so"`,
-					"alwayslink":     "True",
-				}),
-				MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
-					"shared_library": `"libf.so"`,
-				}),
-			},
-		})
-}
-
-func TestPrebuiltLibraryWithArchVariance(t *testing.T) {
-	runCcPrebuiltLibraryTestCase(t,
-		Bp2buildTestCase{
-			Description: "prebuilt library with arch variance",
-			Filesystem: map[string]string{
-				"libf.so": "",
-				"libg.so": "",
-			},
-			Blueprint: `
-cc_prebuilt_library {
-	name: "libtest",
-	arch: {
-		arm64: { srcs: ["libf.so"], },
-		arm: { srcs: ["libg.so"], },
-	},
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
-					"static_library": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "libg.so",
-        "//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
-        "//conditions:default": None,
-    })`}),
-				MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static_alwayslink", AttrNameToString{
-					"alwayslink": "True",
-					"static_library": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "libg.so",
-        "//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
-        "//conditions:default": None,
-    })`}),
-				MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
-					"shared_library": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "libg.so",
-        "//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
-        "//conditions:default": None,
-    })`,
-				}),
-			},
-		})
-}
-
-func TestPrebuiltLibraryAdditionalAttrs(t *testing.T) {
-	runCcPrebuiltLibraryTestCase(t,
-		Bp2buildTestCase{
-			Description: "prebuilt library additional attributes",
-			Filesystem: map[string]string{
-				"libf.so":             "",
-				"testdir/1/include.h": "",
-				"testdir/2/other.h":   "",
-			},
-			Blueprint: `
-cc_prebuilt_library {
-	name: "libtest",
-	srcs: ["libf.so"],
-	export_include_dirs: ["testdir/1/"],
-	export_system_include_dirs: ["testdir/2/"],
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
-					"static_library":         `"libf.so"`,
-					"export_includes":        `["testdir/1/"]`,
-					"export_system_includes": `["testdir/2/"]`,
-				}),
-				MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static_alwayslink", AttrNameToString{
-					"static_library":         `"libf.so"`,
-					"export_includes":        `["testdir/1/"]`,
-					"export_system_includes": `["testdir/2/"]`,
-					"alwayslink":             "True",
-				}),
-				MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
-					"shared_library":         `"libf.so"`,
-					"export_includes":        `["testdir/1/"]`,
-					"export_system_includes": `["testdir/2/"]`,
-				}),
-			},
-		})
-}
-
-func TestPrebuiltLibrarySharedStanzaFails(t *testing.T) {
-	runCcPrebuiltLibraryTestCase(t,
-		Bp2buildTestCase{
-			Description: "prebuilt library with shared stanza fails because multiple sources",
-			Filesystem: map[string]string{
-				"libf.so": "",
-				"libg.so": "",
-			},
-			Blueprint: `
-cc_prebuilt_library {
-	name: "libtest",
-	srcs: ["libf.so"],
-	shared: {
-		srcs: ["libg.so"],
-	},
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedErr: fmt.Errorf("Expected at most one source file"),
-		})
-}
-
-func TestPrebuiltLibraryStaticStanzaFails(t *testing.T) {
-	RunBp2BuildTestCaseSimple(t,
-		Bp2buildTestCase{
-			Description:                "prebuilt library with static stanza fails because multiple sources",
-			ModuleTypeUnderTest:        "cc_prebuilt_library",
-			ModuleTypeUnderTestFactory: cc.PrebuiltLibraryFactory,
-			Filesystem: map[string]string{
-				"libf.so": "",
-				"libg.so": "",
-			},
-			Blueprint: `
-cc_prebuilt_library {
-	name: "libtest",
-	srcs: ["libf.so"],
-	static: {
-		srcs: ["libg.so"],
-	},
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedErr: fmt.Errorf("Expected at most one source file"),
-		})
-}
-
-func TestPrebuiltLibrarySharedAndStaticStanzas(t *testing.T) {
-	runCcPrebuiltLibraryTestCase(t,
-		Bp2buildTestCase{
-			Description: "prebuilt library with both shared and static stanzas",
-			Filesystem: map[string]string{
-				"libf.so": "",
-				"libg.so": "",
-			},
-			Blueprint: `
-cc_prebuilt_library {
-	name: "libtest",
-	static: {
-		srcs: ["libf.so"],
-	},
-	shared: {
-		srcs: ["libg.so"],
-	},
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
-					"static_library": `"libf.so"`,
-				}),
-				MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static_alwayslink", AttrNameToString{
-					"static_library": `"libf.so"`,
-					"alwayslink":     "True",
-				}),
-				MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
-					"shared_library": `"libg.so"`,
-				}),
-			},
-		})
-}
-
-// TODO(b/228623543): When this bug is fixed, enable this test
-//func TestPrebuiltLibraryOnlyShared(t *testing.T) {
-//	runCcPrebuiltLibraryTestCase(t,
-//		bp2buildTestCase{
-//			description:                "prebuilt library shared only",
-//			filesystem: map[string]string{
-//				"libf.so": "",
-//			},
-//			blueprint: `
-//cc_prebuilt_library {
-//	name: "libtest",
-//	srcs: ["libf.so"],
-//	static: {
-//		enabled: false,
-//	},
-//	bazel_module: { bp2build_available: true },
-//}`,
-//			expectedBazelTargets: []string{
-//				makeBazelTarget("cc_prebuilt_library_shared", "libtest", attrNameToString{
-//					"shared_library": `"libf.so"`,
-//				}),
-//			},
-//		})
-//}
-
-// TODO(b/228623543): When this bug is fixed, enable this test
-//func TestPrebuiltLibraryOnlyStatic(t *testing.T) {
-//	runCcPrebuiltLibraryTestCase(t,
-//		bp2buildTestCase{
-//			description:                "prebuilt library static only",
-//			filesystem: map[string]string{
-//				"libf.so": "",
-//			},
-//			blueprint: `
-//cc_prebuilt_library {
-//	name: "libtest",
-//	srcs: ["libf.so"],
-//	shared: {
-//		enabled: false,
-//	},
-//	bazel_module: { bp2build_available: true },
-//}`,
-//			expectedBazelTargets: []string{
-//				makeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static", attrNameToString{
-//					"static_library": `"libf.so"`,
-//				}),
-//				makeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static_always", attrNameToString{
-//					"static_library": `"libf.so"`,
-//					"alwayslink": "True",
-//				}),
-//			},
-//		})
-//}
-
-func TestPrebuiltLibraryWithExportIncludesArchVariant(t *testing.T) {
-	runCcPrebuiltLibraryTestCase(t, Bp2buildTestCase{
-		Description: "cc_prebuilt_library correctly translates export_includes with arch variance",
-		Filesystem: map[string]string{
-			"libf.so": "",
-			"libg.so": "",
-		},
-		Blueprint: `
-cc_prebuilt_library {
-	name: "libtest",
-	srcs: ["libf.so"],
-	arch: {
-		arm: { export_include_dirs: ["testdir/1/"], },
-		arm64: { export_include_dirs: ["testdir/2/"], },
-	},
-	bazel_module: { bp2build_available: true },
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
-				"shared_library": `"libf.so"`,
-				"export_includes": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
-				"static_library": `"libf.so"`,
-				"export_includes": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static_alwayslink", AttrNameToString{
-				"alwayslink":     "True",
-				"static_library": `"libf.so"`,
-				"export_includes": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestPrebuiltLibraryWithExportSystemIncludesArchVariant(t *testing.T) {
-	runCcPrebuiltLibraryTestCase(t, Bp2buildTestCase{
-		Description: "cc_prebuilt_ibrary correctly translates export_system_includes with arch variance",
-		Filesystem: map[string]string{
-			"libf.so": "",
-			"libg.so": "",
-		},
-		Blueprint: `
-cc_prebuilt_library {
-	name: "libtest",
-	srcs: ["libf.so"],
-	arch: {
-		arm: { export_system_include_dirs: ["testdir/1/"], },
-		arm64: { export_system_include_dirs: ["testdir/2/"], },
-	},
-	bazel_module: { bp2build_available: true },
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
-				"shared_library": `"libf.so"`,
-				"export_system_includes": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
-				"static_library": `"libf.so"`,
-				"export_system_includes": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static_alwayslink", AttrNameToString{
-				"alwayslink":     "True",
-				"static_library": `"libf.so"`,
-				"export_system_includes": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestPrebuiltNdkStlConversion(t *testing.T) {
-	registerNdkStlModuleTypes := func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("ndk_prebuilt_static_stl", cc.NdkPrebuiltStaticStlFactory)
-		ctx.RegisterModuleType("ndk_prebuilt_shared_stl", cc.NdkPrebuiltSharedStlFactory)
-	}
-	RunBp2BuildTestCase(t, registerNdkStlModuleTypes, Bp2buildTestCase{
-		Description: "TODO",
-		Blueprint: `
-ndk_prebuilt_static_stl {
-	name: "ndk_libfoo_static",
-	export_include_dirs: ["dir1", "dir2"],
-}
-ndk_prebuilt_shared_stl {
-	name: "ndk_libfoo_shared",
-	export_include_dirs: ["dir1", "dir2"],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_prebuilt_library_static", "ndk_libfoo_static", AttrNameToString{
-				"static_library": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm": "current/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libfoo_static.a",
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": "current/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libfoo_static.a",
-        "//build/bazel_common_rules/platforms/os_arch:android_riscv64": "current/sources/cxx-stl/llvm-libc++/libs/riscv64/libfoo_static.a",
-        "//build/bazel_common_rules/platforms/os_arch:android_x86": "current/sources/cxx-stl/llvm-libc++/libs/x86/libfoo_static.a",
-        "//build/bazel_common_rules/platforms/os_arch:android_x86_64": "current/sources/cxx-stl/llvm-libc++/libs/x86_64/libfoo_static.a",
-        "//conditions:default": None,
-    })`,
-				"export_system_includes": `[
-        "dir1",
-        "dir2",
-    ]`,
-			}),
-			MakeBazelTarget("cc_prebuilt_library_shared", "ndk_libfoo_shared", AttrNameToString{
-				"shared_library": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm": "current/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libfoo_shared.so",
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": "current/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libfoo_shared.so",
-        "//build/bazel_common_rules/platforms/os_arch:android_riscv64": "current/sources/cxx-stl/llvm-libc++/libs/riscv64/libfoo_shared.so",
-        "//build/bazel_common_rules/platforms/os_arch:android_x86": "current/sources/cxx-stl/llvm-libc++/libs/x86/libfoo_shared.so",
-        "//build/bazel_common_rules/platforms/os_arch:android_x86_64": "current/sources/cxx-stl/llvm-libc++/libs/x86_64/libfoo_shared.so",
-        "//conditions:default": None,
-    })`,
-				"export_system_includes": `[
-        "dir1",
-        "dir2",
-    ]`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/cc_prebuilt_library_shared_conversion_test.go b/bp2build/cc_prebuilt_library_shared_conversion_test.go
deleted file mode 100644
index 2242758..0000000
--- a/bp2build/cc_prebuilt_library_shared_conversion_test.go
+++ /dev/null
@@ -1,165 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//	http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/cc"
-)
-
-func runCcPrebuiltLibrarySharedTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Parallel()
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "cc_prebuilt_library_shared"
-	(&tc).ModuleTypeUnderTestFactory = cc.PrebuiltSharedLibraryFactory
-	RunBp2BuildTestCaseSimple(t, tc)
-}
-
-func TestPrebuiltLibrarySharedSimple(t *testing.T) {
-	runCcPrebuiltLibrarySharedTestCase(t,
-		Bp2buildTestCase{
-			Description: "prebuilt library shared simple",
-			Filesystem: map[string]string{
-				"libf.so": "",
-			},
-			Blueprint: `
-cc_prebuilt_library_shared {
-	name: "libtest",
-	srcs: ["libf.so"],
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
-					"shared_library": `"libf.so"`,
-				}),
-			},
-		})
-}
-
-func TestPrebuiltLibrarySharedWithArchVariance(t *testing.T) {
-	runCcPrebuiltLibrarySharedTestCase(t,
-		Bp2buildTestCase{
-			Description: "prebuilt library shared with arch variance",
-			Filesystem: map[string]string{
-				"libf.so": "",
-				"libg.so": "",
-			},
-			Blueprint: `
-cc_prebuilt_library_shared {
-	name: "libtest",
-	arch: {
-		arm64: { srcs: ["libf.so"], },
-		arm: { srcs: ["libg.so"], },
-	},
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
-					"shared_library": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "libg.so",
-        "//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
-        "//conditions:default": None,
-    })`,
-				}),
-			},
-		})
-}
-
-func TestPrebuiltLibrarySharedAdditionalAttrs(t *testing.T) {
-	runCcPrebuiltLibrarySharedTestCase(t,
-		Bp2buildTestCase{
-			Description: "prebuilt library shared additional attributes",
-			Filesystem: map[string]string{
-				"libf.so":             "",
-				"testdir/1/include.h": "",
-				"testdir/2/other.h":   "",
-			},
-			Blueprint: `
-cc_prebuilt_library_shared {
-	name: "libtest",
-	srcs: ["libf.so"],
-	export_include_dirs: ["testdir/1/"],
-	export_system_include_dirs: ["testdir/2/"],
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
-					"shared_library":         `"libf.so"`,
-					"export_includes":        `["testdir/1/"]`,
-					"export_system_includes": `["testdir/2/"]`,
-				}),
-			},
-		})
-}
-
-func TestPrebuiltLibrarySharedWithExportIncludesArchVariant(t *testing.T) {
-	runCcPrebuiltLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_prebuilt_library_shared correctly translates export_includes with arch variance",
-		Filesystem: map[string]string{
-			"libf.so": "",
-			"libg.so": "",
-		},
-		Blueprint: `
-cc_prebuilt_library_shared {
-	name: "libtest",
-	srcs: ["libf.so"],
-	arch: {
-		arm: { export_include_dirs: ["testdir/1/"], },
-		arm64: { export_include_dirs: ["testdir/2/"], },
-	},
-	bazel_module: { bp2build_available: true },
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
-				"shared_library": `"libf.so"`,
-				"export_includes": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestPrebuiltLibrarySharedWithExportSystemIncludesArchVariant(t *testing.T) {
-	runCcPrebuiltLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description: "cc_prebuilt_library_shared correctly translates export_system_includes with arch variance",
-		Filesystem: map[string]string{
-			"libf.so": "",
-			"libg.so": "",
-		},
-		Blueprint: `
-cc_prebuilt_library_shared {
-	name: "libtest",
-	srcs: ["libf.so"],
-	arch: {
-		arm: { export_system_include_dirs: ["testdir/1/"], },
-		arm64: { export_system_include_dirs: ["testdir/2/"], },
-	},
-	bazel_module: { bp2build_available: true },
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
-				"shared_library": `"libf.so"`,
-				"export_system_includes": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/cc_prebuilt_library_shared_test.go b/bp2build/cc_prebuilt_library_shared_test.go
deleted file mode 100644
index 1a9579a..0000000
--- a/bp2build/cc_prebuilt_library_shared_test.go
+++ /dev/null
@@ -1,85 +0,0 @@
-package bp2build
-
-import (
-	"fmt"
-	"testing"
-
-	"android/soong/cc"
-)
-
-func TestSharedPrebuiltLibrary(t *testing.T) {
-	RunBp2BuildTestCaseSimple(t,
-		Bp2buildTestCase{
-			Description:                "prebuilt library shared simple",
-			ModuleTypeUnderTest:        "cc_prebuilt_library_shared",
-			ModuleTypeUnderTestFactory: cc.PrebuiltSharedLibraryFactory,
-			Filesystem: map[string]string{
-				"libf.so": "",
-			},
-			Blueprint: `
-cc_prebuilt_library_shared {
-	name: "libtest",
-	srcs: ["libf.so"],
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
-					"shared_library": `"libf.so"`,
-				}),
-			},
-		})
-}
-
-func TestSharedPrebuiltLibraryWithArchVariance(t *testing.T) {
-	RunBp2BuildTestCaseSimple(t,
-		Bp2buildTestCase{
-			Description:                "prebuilt library shared with arch variance",
-			ModuleTypeUnderTest:        "cc_prebuilt_library_shared",
-			ModuleTypeUnderTestFactory: cc.PrebuiltSharedLibraryFactory,
-			Filesystem: map[string]string{
-				"libf.so": "",
-				"libg.so": "",
-			},
-			Blueprint: `
-cc_prebuilt_library_shared {
-	name: "libtest",
-	arch: {
-		arm64: { srcs: ["libf.so"], },
-		arm: { srcs: ["libg.so"], },
-	},
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
-					"shared_library": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "libg.so",
-        "//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
-        "//conditions:default": None,
-    })`,
-				}),
-			},
-		})
-}
-
-func TestSharedPrebuiltLibrarySharedStanzaFails(t *testing.T) {
-	RunBp2BuildTestCaseSimple(t,
-		Bp2buildTestCase{
-			Description:                "prebuilt library shared with shared stanza fails because multiple sources",
-			ModuleTypeUnderTest:        "cc_prebuilt_library_shared",
-			ModuleTypeUnderTestFactory: cc.PrebuiltSharedLibraryFactory,
-			Filesystem: map[string]string{
-				"libf.so": "",
-				"libg.so": "",
-			},
-			Blueprint: `
-cc_prebuilt_library_shared {
-	name: "libtest",
-	srcs: ["libf.so"],
-	shared: {
-		srcs: ["libg.so"],
-	},
-	bazel_module: { bp2build_available: true},
-}`,
-			ExpectedErr: fmt.Errorf("Expected at most one source file"),
-		})
-}
diff --git a/bp2build/cc_prebuilt_library_static_conversion_test.go b/bp2build/cc_prebuilt_library_static_conversion_test.go
deleted file mode 100644
index fb408b5..0000000
--- a/bp2build/cc_prebuilt_library_static_conversion_test.go
+++ /dev/null
@@ -1,199 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//	http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/cc"
-)
-
-func runCcPrebuiltLibraryStaticTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Parallel()
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "cc_prebuilt_library_static"
-	(&tc).ModuleTypeUnderTestFactory = cc.PrebuiltStaticLibraryFactory
-	RunBp2BuildTestCaseSimple(t, tc)
-}
-
-func TestPrebuiltLibraryStaticSimple(t *testing.T) {
-	runCcPrebuiltLibraryStaticTestCase(t,
-		Bp2buildTestCase{
-			Description: "prebuilt library static simple",
-			Filesystem: map[string]string{
-				"libf.so": "",
-			},
-			Blueprint: `
-cc_prebuilt_library_static {
-	name: "libtest",
-	srcs: ["libf.so"],
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_library_static", "libtest", AttrNameToString{
-					"static_library": `"libf.so"`,
-				}),
-				MakeBazelTarget("cc_prebuilt_library_static", "libtest_alwayslink", AttrNameToString{
-					"static_library": `"libf.so"`,
-					"alwayslink":     "True",
-				}),
-			},
-		})
-}
-
-func TestPrebuiltLibraryStaticWithArchVariance(t *testing.T) {
-	runCcPrebuiltLibraryStaticTestCase(t,
-		Bp2buildTestCase{
-			Description: "prebuilt library with arch variance",
-			Filesystem: map[string]string{
-				"libf.so": "",
-				"libg.so": "",
-			},
-			Blueprint: `
-cc_prebuilt_library_static {
-	name: "libtest",
-	arch: {
-		arm64: { srcs: ["libf.so"], },
-		arm: { srcs: ["libg.so"], },
-	},
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_library_static", "libtest", AttrNameToString{
-					"static_library": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "libg.so",
-        "//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
-        "//conditions:default": None,
-    })`}),
-				MakeBazelTarget("cc_prebuilt_library_static", "libtest_alwayslink", AttrNameToString{
-					"alwayslink": "True",
-					"static_library": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "libg.so",
-        "//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
-        "//conditions:default": None,
-    })`}),
-			},
-		})
-}
-
-func TestPrebuiltLibraryStaticAdditionalAttrs(t *testing.T) {
-	runCcPrebuiltLibraryStaticTestCase(t,
-		Bp2buildTestCase{
-			Description: "prebuilt library additional attributes",
-			Filesystem: map[string]string{
-				"libf.so":             "",
-				"testdir/1/include.h": "",
-				"testdir/2/other.h":   "",
-			},
-			Blueprint: `
-cc_prebuilt_library_static {
-	name: "libtest",
-	srcs: ["libf.so"],
-	export_include_dirs: ["testdir/1/"],
-	export_system_include_dirs: ["testdir/2/"],
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_library_static", "libtest", AttrNameToString{
-					"static_library":         `"libf.so"`,
-					"export_includes":        `["testdir/1/"]`,
-					"export_system_includes": `["testdir/2/"]`,
-				}),
-				MakeBazelTarget("cc_prebuilt_library_static", "libtest_alwayslink", AttrNameToString{
-					"static_library":         `"libf.so"`,
-					"export_includes":        `["testdir/1/"]`,
-					"export_system_includes": `["testdir/2/"]`,
-					"alwayslink":             "True",
-				}),
-			},
-		})
-}
-
-func TestPrebuiltLibraryStaticWithExportIncludesArchVariant(t *testing.T) {
-	runCcPrebuiltLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_prebuilt_library_static correctly translates export_includes with arch variance",
-		Filesystem: map[string]string{
-			"libf.so": "",
-			"libg.so": "",
-		},
-		Blueprint: `
-cc_prebuilt_library_static {
-	name: "libtest",
-	srcs: ["libf.so"],
-	arch: {
-		arm: { export_include_dirs: ["testdir/1/"], },
-		arm64: { export_include_dirs: ["testdir/2/"], },
-	},
-	bazel_module: { bp2build_available: true },
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_prebuilt_library_static", "libtest", AttrNameToString{
-				"static_library": `"libf.so"`,
-				"export_includes": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("cc_prebuilt_library_static", "libtest_alwayslink", AttrNameToString{
-				"alwayslink":     "True",
-				"static_library": `"libf.so"`,
-				"export_includes": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestPrebuiltLibraryStaticWithExportSystemIncludesArchVariant(t *testing.T) {
-	runCcPrebuiltLibraryStaticTestCase(t, Bp2buildTestCase{
-		Description: "cc_prebuilt_library_static correctly translates export_system_includes with arch variance",
-		Filesystem: map[string]string{
-			"libf.so": "",
-			"libg.so": "",
-		},
-		Blueprint: `
-cc_prebuilt_library_static {
-	name: "libtest",
-	srcs: ["libf.so"],
-	arch: {
-		arm: { export_system_include_dirs: ["testdir/1/"], },
-		arm64: { export_system_include_dirs: ["testdir/2/"], },
-	},
-	bazel_module: { bp2build_available: true },
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_prebuilt_library_static", "libtest", AttrNameToString{
-				"static_library": `"libf.so"`,
-				"export_system_includes": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("cc_prebuilt_library_static", "libtest_alwayslink", AttrNameToString{
-				"alwayslink":     "True",
-				"static_library": `"libf.so"`,
-				"export_system_includes": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["testdir/1/"],
-        "//build/bazel_common_rules/platforms/arch:arm64": ["testdir/2/"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/cc_prebuilt_library_static_test.go b/bp2build/cc_prebuilt_library_static_test.go
deleted file mode 100644
index 7d0ab28..0000000
--- a/bp2build/cc_prebuilt_library_static_test.go
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//	http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package bp2build
-
-import (
-	"fmt"
-	"testing"
-
-	"android/soong/cc"
-)
-
-func TestStaticPrebuiltLibrary(t *testing.T) {
-	RunBp2BuildTestCaseSimple(t,
-		Bp2buildTestCase{
-			Description:                "prebuilt library static simple",
-			ModuleTypeUnderTest:        "cc_prebuilt_library_static",
-			ModuleTypeUnderTestFactory: cc.PrebuiltStaticLibraryFactory,
-			Filesystem: map[string]string{
-				"libf.so": "",
-			},
-			Blueprint: `
-cc_prebuilt_library_static {
-	name: "libtest",
-	srcs: ["libf.so"],
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_library_static", "libtest", AttrNameToString{
-					"static_library": `"libf.so"`,
-				}),
-				MakeBazelTarget("cc_prebuilt_library_static", "libtest_alwayslink", AttrNameToString{
-					"static_library": `"libf.so"`,
-					"alwayslink":     "True",
-				}),
-			},
-		})
-}
-
-func TestStaticPrebuiltLibraryWithArchVariance(t *testing.T) {
-	RunBp2BuildTestCaseSimple(t,
-		Bp2buildTestCase{
-			Description:                "prebuilt library static with arch variance",
-			ModuleTypeUnderTest:        "cc_prebuilt_library_static",
-			ModuleTypeUnderTestFactory: cc.PrebuiltStaticLibraryFactory,
-			Filesystem: map[string]string{
-				"libf.so": "",
-				"libg.so": "",
-			},
-			Blueprint: `
-cc_prebuilt_library_static {
-	name: "libtest",
-	arch: {
-		arm64: { srcs: ["libf.so"], },
-		arm: { srcs: ["libg.so"], },
-	},
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_library_static", "libtest", AttrNameToString{
-					"static_library": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "libg.so",
-        "//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
-        "//conditions:default": None,
-    })`}),
-				MakeBazelTarget("cc_prebuilt_library_static", "libtest_alwayslink", AttrNameToString{
-					"alwayslink": "True",
-					"static_library": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "libg.so",
-        "//build/bazel_common_rules/platforms/arch:arm64": "libf.so",
-        "//conditions:default": None,
-    })`}),
-			},
-		})
-}
-
-func TestStaticPrebuiltLibraryStaticStanzaFails(t *testing.T) {
-	RunBp2BuildTestCaseSimple(t,
-		Bp2buildTestCase{
-			Description:                "prebuilt library with static stanza fails because multiple sources",
-			ModuleTypeUnderTest:        "cc_prebuilt_library_static",
-			ModuleTypeUnderTestFactory: cc.PrebuiltStaticLibraryFactory,
-			Filesystem: map[string]string{
-				"libf.so": "",
-				"libg.so": "",
-			},
-			Blueprint: `
-cc_prebuilt_library_static {
-	name: "libtest",
-	srcs: ["libf.so"],
-	static: {
-		srcs: ["libg.so"],
-	},
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedErr: fmt.Errorf("Expected at most one source file"),
-		})
-}
-
-func TestCcLibraryStaticConvertLex(t *testing.T) {
-	runCcLibrarySharedTestCase(t, Bp2buildTestCase{
-		Description:                "cc_library_static with lex files",
-		ModuleTypeUnderTest:        "cc_library_static",
-		ModuleTypeUnderTestFactory: cc.LibraryStaticFactory,
-		Filesystem: map[string]string{
-			"foo.c":   "",
-			"bar.cc":  "",
-			"foo1.l":  "",
-			"bar1.ll": "",
-			"foo2.l":  "",
-			"bar2.ll": "",
-		},
-		Blueprint: `cc_library_static {
-	name: "foo_lib",
-	srcs: ["foo.c", "bar.cc", "foo1.l", "foo2.l", "bar1.ll", "bar2.ll"],
-	lex: { flags: ["--foo_flags"] },
-	include_build_directory: false,
-	bazel_module: { bp2build_available: true },
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("genlex", "foo_lib_genlex_l", AttrNameToString{
-				"srcs": `[
-        "foo1.l",
-        "foo2.l",
-    ]`,
-				"lexopts": `["--foo_flags"]`,
-			}),
-			MakeBazelTarget("genlex", "foo_lib_genlex_ll", AttrNameToString{
-				"srcs": `[
-        "bar1.ll",
-        "bar2.ll",
-    ]`,
-				"lexopts": `["--foo_flags"]`,
-			}),
-			MakeBazelTarget("cc_library_static", "foo_lib", AttrNameToString{
-				"srcs": `[
-        "bar.cc",
-        ":foo_lib_genlex_ll",
-    ]`,
-				"srcs_c": `[
-        "foo.c",
-        ":foo_lib_genlex_l",
-    ]`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/cc_prebuilt_object_conversion_test.go b/bp2build/cc_prebuilt_object_conversion_test.go
deleted file mode 100644
index 068e4e2..0000000
--- a/bp2build/cc_prebuilt_object_conversion_test.go
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//	http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package bp2build
-
-import (
-	"fmt"
-	"testing"
-
-	"android/soong/cc"
-)
-
-func runCcPrebuiltObjectTestCase(t *testing.T, testCase Bp2buildTestCase) {
-	t.Helper()
-	description := fmt.Sprintf("cc_prebuilt_object: %s", testCase.Description)
-	testCase.ModuleTypeUnderTest = "cc_prebuilt_object"
-	testCase.ModuleTypeUnderTestFactory = cc.PrebuiltObjectFactory
-	testCase.Description = description
-	t.Run(description, func(t *testing.T) {
-		t.Helper()
-		RunBp2BuildTestCaseSimple(t, testCase)
-	})
-}
-
-func TestPrebuiltObject(t *testing.T) {
-	runCcPrebuiltObjectTestCase(t,
-		Bp2buildTestCase{
-			Description: "simple",
-			Filesystem: map[string]string{
-				"obj.o": "",
-			},
-			Blueprint: `
-cc_prebuilt_object {
-	name: "objtest",
-	srcs: ["obj.o"],
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_object", "objtest", AttrNameToString{
-					"src": `"obj.o"`,
-				})},
-		})
-}
-
-func TestPrebuiltObjectWithArchVariance(t *testing.T) {
-	runCcPrebuiltObjectTestCase(t,
-		Bp2buildTestCase{
-			Description: "with arch variance",
-			Filesystem: map[string]string{
-				"obja.o": "",
-				"objb.o": "",
-			},
-			Blueprint: `
-cc_prebuilt_object {
-	name: "objtest",
-	arch: {
-		arm64: { srcs: ["obja.o"], },
-		arm: { srcs: ["objb.o"], },
-	},
-	bazel_module: { bp2build_available: true },
-}`, ExpectedBazelTargets: []string{
-				MakeBazelTarget("cc_prebuilt_object", "objtest", AttrNameToString{
-					"src": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "objb.o",
-        "//build/bazel_common_rules/platforms/arch:arm64": "obja.o",
-        "//conditions:default": None,
-    })`,
-				}),
-			},
-		})
-}
-
-func TestPrebuiltObjectMultipleSrcsFails(t *testing.T) {
-	runCcPrebuiltObjectTestCase(t,
-		Bp2buildTestCase{
-			Description: "fails because multiple sources",
-			Filesystem: map[string]string{
-				"obja": "",
-				"objb": "",
-			},
-			Blueprint: `
-cc_prebuilt_object {
-	name: "objtest",
-	srcs: ["obja.o", "objb.o"],
-	bazel_module: { bp2build_available: true },
-}`,
-			ExpectedErr: fmt.Errorf("Expected at most one source file"),
-		})
-}
-
-// TODO: nosrcs test
diff --git a/bp2build/cc_test_conversion_test.go b/bp2build/cc_test_conversion_test.go
deleted file mode 100644
index c5f5f79..0000000
--- a/bp2build/cc_test_conversion_test.go
+++ /dev/null
@@ -1,633 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"fmt"
-	"testing"
-
-	"android/soong/android"
-	"android/soong/cc"
-	"android/soong/genrule"
-)
-
-type ccTestBp2buildTestCase struct {
-	description             string
-	blueprint               string
-	filesystem              map[string]string
-	targets                 []testBazelTarget
-	stubbedBuildDefinitions []string
-}
-
-func registerCcTestModuleTypes(ctx android.RegistrationContext) {
-	cc.RegisterCCBuildComponents(ctx)
-	ctx.RegisterModuleType("cc_binary", cc.BinaryFactory)
-	ctx.RegisterModuleType("cc_library_static", cc.LibraryStaticFactory)
-	ctx.RegisterModuleType("cc_library", cc.LibraryFactory)
-	ctx.RegisterModuleType("cc_test_library", cc.TestLibraryFactory)
-	ctx.RegisterModuleType("genrule", genrule.GenRuleFactory)
-}
-
-func runCcTestTestCase(t *testing.T, testCase ccTestBp2buildTestCase) {
-	t.Helper()
-	moduleTypeUnderTest := "cc_test"
-	description := fmt.Sprintf("%s %s", moduleTypeUnderTest, testCase.description)
-	t.Run(description, func(t *testing.T) {
-		t.Helper()
-		RunBp2BuildTestCase(t, registerCcTestModuleTypes, Bp2buildTestCase{
-			ExpectedBazelTargets:       generateBazelTargetsForTest(testCase.targets, android.HostAndDeviceSupported),
-			Filesystem:                 testCase.filesystem,
-			ModuleTypeUnderTest:        moduleTypeUnderTest,
-			ModuleTypeUnderTestFactory: cc.TestFactory,
-			Description:                description,
-			Blueprint:                  testCase.blueprint,
-			StubbedBuildDefinitions:    testCase.stubbedBuildDefinitions,
-		})
-	})
-}
-
-func TestBasicCcTest(t *testing.T) {
-	runCcTestTestCase(t, ccTestBp2buildTestCase{
-		description: "basic cc_test with commonly used attributes",
-		stubbedBuildDefinitions: []string{"libbuildversion", "libprotobuf-cpp-lite", "libprotobuf-cpp-full",
-			"foolib", "hostlib", "data_mod", "cc_bin", "cc_lib", "cc_test_lib2", "libgtest_main", "libgtest"},
-		blueprint: `
-cc_test {
-    name: "mytest",
-    host_supported: true,
-    srcs: ["test.cpp"],
-    target: {
-        android: {
-            srcs: ["android.cpp"],
-            shared_libs: ["foolib"],
-        },
-        linux: {
-            srcs: ["linux.cpp"],
-        },
-        host: {
-            static_libs: ["hostlib"],
-        },
-    },
-    static_libs: ["cc_test_lib1"],
-    shared_libs: ["cc_test_lib2"],
-    data: [":data_mod", "file.txt"],
-    data_bins: [":cc_bin"],
-    data_libs: [":cc_lib"],
-    cflags: ["-Wall"],
-}
-
-cc_test_library {
-    name: "cc_test_lib1",
-    host_supported: true,
-    include_build_directory: false,
-}
-` + simpleModule("cc_library", "foolib") +
-			simpleModule("cc_library_static", "hostlib") +
-			simpleModule("genrule", "data_mod") +
-			simpleModule("cc_binary", "cc_bin") +
-			simpleModule("cc_library", "cc_lib") +
-			simpleModule("cc_test_library", "cc_test_lib2") +
-			simpleModule("cc_library_static", "libgtest_main") +
-			simpleModule("cc_library_static", "libgtest"),
-		targets: []testBazelTarget{
-			{"cc_library_shared", "cc_test_lib1", AttrNameToString{}},
-			{"cc_library_static", "cc_test_lib1_bp2build_cc_library_static", AttrNameToString{}},
-			{"cc_test", "mytest", AttrNameToString{
-				"copts": `["-Wall"]`,
-				"data": `[
-        ":data_mod",
-        "file.txt",
-        ":cc_bin",
-        ":cc_lib",
-    ]`,
-				"deps": `[
-        ":cc_test_lib1_bp2build_cc_library_static",
-        ":libgtest_main",
-        ":libgtest",
-    ] + select({
-        "//build/bazel_common_rules/platforms/os:darwin": [":hostlib"],
-        "//build/bazel_common_rules/platforms/os:linux_bionic": [":hostlib"],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": [":hostlib"],
-        "//build/bazel_common_rules/platforms/os:linux_musl": [":hostlib"],
-        "//build/bazel_common_rules/platforms/os:windows": [":hostlib"],
-        "//conditions:default": [],
-    })`,
-				"local_includes": `["."]`,
-				"dynamic_deps": `[":cc_test_lib2"] + select({
-        "//build/bazel_common_rules/platforms/os:android": [":foolib"],
-        "//conditions:default": [],
-    })`,
-				"srcs": `["test.cpp"] + select({
-        "//build/bazel_common_rules/platforms/os:android": [
-            "linux.cpp",
-            "android.cpp",
-        ],
-        "//build/bazel_common_rules/platforms/os:linux_bionic": ["linux.cpp"],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": ["linux.cpp"],
-        "//build/bazel_common_rules/platforms/os:linux_musl": ["linux.cpp"],
-        "//conditions:default": [],
-    })`,
-				"runs_on": `[
-        "host_without_device",
-        "device",
-    ]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
-            "memtag_heap",
-            "diag_memtag_heap",
-        ],
-        "//conditions:default": [],
-    })`,
-			},
-			},
-		},
-	})
-}
-
-func TestBasicCcTestGtestIsolatedDisabled(t *testing.T) {
-	runCcTestTestCase(t, ccTestBp2buildTestCase{
-		description: "cc test with disabled gtest and isolated props",
-		blueprint: `
-cc_test {
-    name: "mytest",
-    host_supported: true,
-    srcs: ["test.cpp"],
-    gtest: false,
-    isolated: false,
-}
-`,
-		targets: []testBazelTarget{
-			{"cc_test", "mytest", AttrNameToString{
-				"gtest":          "False",
-				"local_includes": `["."]`,
-				"srcs":           `["test.cpp"]`,
-				"runs_on": `[
-        "host_without_device",
-        "device",
-    ]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
-            "memtag_heap",
-            "diag_memtag_heap",
-        ],
-        "//conditions:default": [],
-    })`,
-			},
-			},
-		},
-	})
-}
-
-func TestCcTest_TestOptions_Tags(t *testing.T) {
-	runCcTestTestCase(t, ccTestBp2buildTestCase{
-		description:             "cc test with test_options.tags converted to tags",
-		stubbedBuildDefinitions: []string{"libgtest_main", "libgtest"},
-		blueprint: `
-cc_test {
-    name: "mytest",
-    host_supported: true,
-    srcs: ["test.cpp"],
-    test_options: { tags: ["no-remote"] },
-}
-` + simpleModule("cc_library_static", "libgtest_main") +
-			simpleModule("cc_library_static", "libgtest"),
-		targets: []testBazelTarget{
-			{"cc_test", "mytest", AttrNameToString{
-				"tags":           `["no-remote"]`,
-				"local_includes": `["."]`,
-				"srcs":           `["test.cpp"]`,
-				"deps": `[
-        ":libgtest_main",
-        ":libgtest",
-    ]`,
-				"runs_on": `[
-        "host_without_device",
-        "device",
-    ]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
-            "memtag_heap",
-            "diag_memtag_heap",
-        ],
-        "//conditions:default": [],
-    })`,
-			},
-			},
-		},
-	})
-}
-
-func TestCcTest_TestConfig(t *testing.T) {
-	runCcTestTestCase(t, ccTestBp2buildTestCase{
-		description: "cc test that sets a test_config",
-		filesystem: map[string]string{
-			"test_config.xml": "",
-		},
-		stubbedBuildDefinitions: []string{"libgtest_main", "libgtest"},
-		blueprint: `
-cc_test {
-	name: "mytest",
-	srcs: ["test.cpp"],
-	test_config: "test_config.xml",
-}
-` + simpleModule("cc_library_static", "libgtest_main") +
-			simpleModule("cc_library_static", "libgtest"),
-		targets: []testBazelTarget{
-			{"cc_test", "mytest", AttrNameToString{
-				"local_includes":         `["."]`,
-				"srcs":                   `["test.cpp"]`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-				"test_config":            `"test_config.xml"`,
-				"deps": `[
-        ":libgtest_main",
-        ":libgtest",
-    ]`,
-				"runs_on": `["device"]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
-            "memtag_heap",
-            "diag_memtag_heap",
-        ],
-        "//conditions:default": [],
-    })`,
-			},
-			},
-		},
-	})
-}
-
-func TestCcTest_TestConfigAndroidTestXML(t *testing.T) {
-	runCcTestTestCase(t, ccTestBp2buildTestCase{
-		description: "cc test that defaults to test config AndroidTest.xml",
-		filesystem: map[string]string{
-			"AndroidTest.xml":   "",
-			"DynamicConfig.xml": "",
-		},
-		stubbedBuildDefinitions: []string{"libgtest_main", "libgtest"},
-		blueprint: `
-cc_test {
-	name: "mytest",
-	srcs: ["test.cpp"],
-}
-` + simpleModule("cc_library_static", "libgtest_main") +
-			simpleModule("cc_library_static", "libgtest"),
-		targets: []testBazelTarget{
-			{"cc_test", "mytest", AttrNameToString{
-				"local_includes":         `["."]`,
-				"srcs":                   `["test.cpp"]`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-				"test_config":            `"AndroidTest.xml"`,
-				"dynamic_config":         `"DynamicConfig.xml"`,
-				"deps": `[
-        ":libgtest_main",
-        ":libgtest",
-    ]`,
-				"runs_on": `["device"]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
-            "memtag_heap",
-            "diag_memtag_heap",
-        ],
-        "//conditions:default": [],
-    })`,
-			},
-			},
-		},
-	})
-}
-
-func TestCcTest_TestConfigTemplateOptions(t *testing.T) {
-	runCcTestTestCase(t, ccTestBp2buildTestCase{
-		description: "cc test that sets test config template attributes",
-		filesystem: map[string]string{
-			"test_config_template.xml": "",
-		},
-		stubbedBuildDefinitions: []string{"libgtest_isolated_main", "liblog"},
-		blueprint: `
-cc_test {
-	name: "mytest",
-	srcs: ["test.cpp"],
-	test_config_template: "test_config_template.xml",
-	auto_gen_config: true,
-	isolated: true,
-}
-` + simpleModule("cc_library_static", "libgtest_isolated_main") +
-			simpleModule("cc_library", "liblog"),
-		targets: []testBazelTarget{
-			{"cc_test", "mytest", AttrNameToString{
-				"auto_generate_test_config": "True",
-				"local_includes":            `["."]`,
-				"srcs":                      `["test.cpp"]`,
-				"target_compatible_with":    `["//build/bazel_common_rules/platforms/os:android"]`,
-				"template_configs": `[
-        "'<target_preparer class=\"com.android.tradefed.targetprep.RootTargetPreparer\">\\n        <option name=\"force-root\" value=\"false\" />\\n    </target_preparer>'",
-        "'<option name=\"not-shardable\" value=\"true\" />'",
-    ]`,
-				"template_install_base": `"/data/local/tmp"`,
-				"template_test_config":  `"test_config_template.xml"`,
-				"deps":                  `[":libgtest_isolated_main"]`,
-				"dynamic_deps":          `[":liblog"]`,
-				"runs_on":               `["device"]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
-            "memtag_heap",
-            "diag_memtag_heap",
-        ],
-        "//conditions:default": [],
-    })`,
-			},
-			},
-		},
-	})
-}
-
-func TestCcTest_WithExplicitGTestDepInAndroidBp(t *testing.T) {
-	runCcTestTestCase(t, ccTestBp2buildTestCase{
-		description:             "cc test that lists libgtest in Android.bp should not have dups of libgtest in BUILD file",
-		stubbedBuildDefinitions: []string{"libgtest_main", "libgtest"},
-		blueprint: `
-cc_test {
-	name: "mytest",
-	srcs: ["test.cpp"],
-	static_libs: ["libgtest"],
-}
-` + simpleModule("cc_library_static", "libgtest_main") +
-			simpleModule("cc_library_static", "libgtest"),
-		targets: []testBazelTarget{
-			{"cc_test", "mytest", AttrNameToString{
-				"local_includes":         `["."]`,
-				"srcs":                   `["test.cpp"]`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-				"deps": `[
-        ":libgtest",
-        ":libgtest_main",
-    ]`,
-				"runs_on": `["device"]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
-            "memtag_heap",
-            "diag_memtag_heap",
-        ],
-        "//conditions:default": [],
-    })`,
-			},
-			},
-		},
-	})
-
-}
-
-func TestCcTest_WithIsolatedTurnedOn(t *testing.T) {
-	runCcTestTestCase(t, ccTestBp2buildTestCase{
-		description:             "cc test that sets `isolated: true` should run with ligtest_isolated_main instead of libgtest_main",
-		stubbedBuildDefinitions: []string{"libgtest_isolated_main", "liblog"},
-		blueprint: `
-cc_test {
-	name: "mytest",
-	srcs: ["test.cpp"],
-	isolated: true,
-}
-` + simpleModule("cc_library_static", "libgtest_isolated_main") +
-			simpleModule("cc_library", "liblog"),
-		targets: []testBazelTarget{
-			{"cc_test", "mytest", AttrNameToString{
-				"local_includes":         `["."]`,
-				"srcs":                   `["test.cpp"]`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-				"deps":                   `[":libgtest_isolated_main"]`,
-				"dynamic_deps":           `[":liblog"]`,
-				"runs_on":                `["device"]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
-            "memtag_heap",
-            "diag_memtag_heap",
-        ],
-        "//conditions:default": [],
-    })`,
-			},
-			},
-		},
-	})
-
-}
-
-func TestCcTest_GtestExplicitlySpecifiedInAndroidBp(t *testing.T) {
-	runCcTestTestCase(t, ccTestBp2buildTestCase{
-		description:             "If `gtest` is explicit in Android.bp, it should be explicit in BUILD files as well",
-		stubbedBuildDefinitions: []string{"libgtest_main", "libgtest"},
-		blueprint: `
-cc_test {
-	name: "mytest_with_gtest",
-	gtest: true,
-}
-cc_test {
-	name: "mytest_with_no_gtest",
-	gtest: false,
-}
-` + simpleModule("cc_library_static", "libgtest_main") +
-			simpleModule("cc_library_static", "libgtest"),
-		targets: []testBazelTarget{
-			{"cc_test", "mytest_with_gtest", AttrNameToString{
-				"local_includes": `["."]`,
-				"deps": `[
-        ":libgtest_main",
-        ":libgtest",
-    ]`,
-				"gtest":                  "True",
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-				"runs_on":                `["device"]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
-            "memtag_heap",
-            "diag_memtag_heap",
-        ],
-        "//conditions:default": [],
-    })`,
-			},
-			},
-			{"cc_test", "mytest_with_no_gtest", AttrNameToString{
-				"local_includes":         `["."]`,
-				"gtest":                  "False",
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-				"runs_on":                `["device"]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
-            "memtag_heap",
-            "diag_memtag_heap",
-        ],
-        "//conditions:default": [],
-    })`,
-			},
-			},
-		},
-	})
-}
-
-func TestCcTest_DisableMemtagHeap(t *testing.T) {
-	runCcTestTestCase(t, ccTestBp2buildTestCase{
-		description:             "cc test that disable memtag_heap",
-		stubbedBuildDefinitions: []string{"libgtest_isolated_main", "liblog"},
-		blueprint: `
-cc_test {
-	name: "mytest",
-	srcs: ["test.cpp"],
-	isolated: true,
-	sanitize: {
-		cfi: true,
-		memtag_heap: false,
-	},
-}
-` + simpleModule("cc_library_static", "libgtest_isolated_main") +
-			simpleModule("cc_library", "liblog"),
-		targets: []testBazelTarget{
-			{"cc_test", "mytest", AttrNameToString{
-				"local_includes":         `["."]`,
-				"srcs":                   `["test.cpp"]`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-				"deps":                   `[":libgtest_isolated_main"]`,
-				"dynamic_deps":           `[":liblog"]`,
-				"runs_on":                `["device"]`,
-				"features": `["android_cfi"] + select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": ["-memtag_heap"],
-        "//conditions:default": [],
-    })`,
-			},
-			},
-		},
-	})
-}
-
-func TestCcTest_RespectArm64MemtagHeap(t *testing.T) {
-	runCcTestTestCase(t, ccTestBp2buildTestCase{
-		description:             "cc test that disable memtag_heap",
-		stubbedBuildDefinitions: []string{"libgtest_isolated_main", "liblog"},
-		blueprint: `
-cc_test {
-	name: "mytest",
-	srcs: ["test.cpp"],
-	isolated: true,
-	target: {
-		android_arm64: {
-			sanitize: {
-				memtag_heap: false,
-			}
-		}
-	},
-}
-` + simpleModule("cc_library_static", "libgtest_isolated_main") +
-			simpleModule("cc_library", "liblog"),
-		targets: []testBazelTarget{
-			{"cc_test", "mytest", AttrNameToString{
-				"local_includes":         `["."]`,
-				"srcs":                   `["test.cpp"]`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-				"deps":                   `[":libgtest_isolated_main"]`,
-				"dynamic_deps":           `[":liblog"]`,
-				"runs_on":                `["device"]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": ["-memtag_heap"],
-        "//conditions:default": [],
-    })`,
-			},
-			},
-		},
-	})
-}
-
-func TestCcTest_IgnoreNoneArm64MemtagHeap(t *testing.T) {
-	runCcTestTestCase(t, ccTestBp2buildTestCase{
-		description:             "cc test that disable memtag_heap",
-		stubbedBuildDefinitions: []string{"libgtest_isolated_main", "liblog"},
-		blueprint: `
-cc_test {
-	name: "mytest",
-	srcs: ["test.cpp"],
-	isolated: true,
-	arch: {
-		x86: {
-			sanitize: {
-				memtag_heap: false,
-			}
-		}
-	},
-}
-` + simpleModule("cc_library_static", "libgtest_isolated_main") +
-			simpleModule("cc_library", "liblog"),
-		targets: []testBazelTarget{
-			{"cc_test", "mytest", AttrNameToString{
-				"local_includes":         `["."]`,
-				"srcs":                   `["test.cpp"]`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-				"deps":                   `[":libgtest_isolated_main"]`,
-				"dynamic_deps":           `[":liblog"]`,
-				"runs_on":                `["device"]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
-            "memtag_heap",
-            "diag_memtag_heap",
-        ],
-        "//conditions:default": [],
-    })`,
-			},
-			},
-		},
-	})
-}
-
-func TestCcTest_Arm64MemtagHeapOverrideNoConfigOne(t *testing.T) {
-	runCcTestTestCase(t, ccTestBp2buildTestCase{
-		description:             "cc test that disable memtag_heap",
-		stubbedBuildDefinitions: []string{"libgtest_isolated_main", "liblog"},
-		blueprint: `
-cc_test {
-	name: "mytest",
-	srcs: ["test.cpp"],
-	isolated: true,
-	sanitize: {
-		memtag_heap: true,
-	},
-	target: {
-		android_arm64: {
-			sanitize: {
-				memtag_heap: false,
-				diag: {
-					memtag_heap: false,
-				},
-			}
-		}
-	},
-}
-` + simpleModule("cc_library_static", "libgtest_isolated_main") +
-			simpleModule("cc_library", "liblog"),
-		targets: []testBazelTarget{
-			{"cc_test", "mytest", AttrNameToString{
-				"local_includes":         `["."]`,
-				"srcs":                   `["test.cpp"]`,
-				"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-				"deps":                   `[":libgtest_isolated_main"]`,
-				"dynamic_deps":           `[":liblog"]`,
-				"runs_on":                `["device"]`,
-				"features": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": [
-            "-memtag_heap",
-            "-diag_memtag_heap",
-        ],
-        "//conditions:default": [],
-    })`,
-			},
-			},
-		},
-	})
-}
diff --git a/bp2build/cc_yasm_conversion_test.go b/bp2build/cc_yasm_conversion_test.go
deleted file mode 100644
index c98e1a1..0000000
--- a/bp2build/cc_yasm_conversion_test.go
+++ /dev/null
@@ -1,179 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//	http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/cc"
-)
-
-func runYasmTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, registerYasmModuleTypes, tc)
-}
-
-func registerYasmModuleTypes(ctx android.RegistrationContext) {
-	cc.RegisterCCBuildComponents(ctx)
-	ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-	ctx.RegisterModuleType("cc_library_static", cc.LibraryStaticFactory)
-	ctx.RegisterModuleType("cc_prebuilt_library_static", cc.PrebuiltStaticLibraryFactory)
-	ctx.RegisterModuleType("cc_library_headers", cc.LibraryHeaderFactory)
-}
-
-func TestYasmSimple(t *testing.T) {
-	runYasmTestCase(t, Bp2buildTestCase{
-		Description:                "Simple yasm test",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"main.cpp":   "",
-			"myfile.asm": "",
-		},
-		Blueprint: `
-cc_library {
-  name: "foo",
-  srcs: ["main.cpp", "myfile.asm"],
-}`,
-		ExpectedBazelTargets: append([]string{
-			MakeBazelTarget("yasm", "foo_yasm", map[string]string{
-				"include_dirs": `["."]`,
-				"srcs":         `["myfile.asm"]`,
-			}),
-		}, makeCcLibraryTargets("foo", map[string]string{
-			"local_includes": `["."]`,
-			"srcs": `[
-        "main.cpp",
-        ":foo_yasm",
-    ]`,
-		})...),
-	})
-}
-
-func TestYasmWithIncludeDirs(t *testing.T) {
-	runYasmTestCase(t, Bp2buildTestCase{
-		Description:                "Simple yasm test",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"main.cpp":                    "",
-			"myfile.asm":                  "",
-			"include1/foo/myinclude.inc":  "",
-			"include2/foo/myinclude2.inc": "",
-		},
-		Blueprint: `
-cc_library {
-  name: "foo",
-  local_include_dirs: ["include1/foo"],
-  export_include_dirs: ["include2/foo"],
-  srcs: ["main.cpp", "myfile.asm"],
-}`,
-		ExpectedBazelTargets: append([]string{
-			MakeBazelTarget("yasm", "foo_yasm", map[string]string{
-				"include_dirs": `[
-        "include1/foo",
-        ".",
-        "include2/foo",
-    ]`,
-				"srcs": `["myfile.asm"]`,
-			}),
-		}, makeCcLibraryTargets("foo", map[string]string{
-			"local_includes": `[
-        "include1/foo",
-        ".",
-    ]`,
-			"export_includes": `["include2/foo"]`,
-			"srcs": `[
-        "main.cpp",
-        ":foo_yasm",
-    ]`,
-		})...),
-	})
-}
-
-func TestYasmConditionalBasedOnArch(t *testing.T) {
-	runYasmTestCase(t, Bp2buildTestCase{
-		Description:                "Simple yasm test",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"main.cpp":   "",
-			"myfile.asm": "",
-		},
-		Blueprint: `
-cc_library {
-  name: "foo",
-  srcs: ["main.cpp"],
-  arch: {
-    x86: {
-      srcs: ["myfile.asm"],
-    },
-  },
-}`,
-		ExpectedBazelTargets: append([]string{
-			MakeBazelTarget("yasm", "foo_yasm", map[string]string{
-				"include_dirs": `["."]`,
-				"srcs": `select({
-        "//build/bazel_common_rules/platforms/arch:x86": ["myfile.asm"],
-        "//conditions:default": [],
-    })`,
-			}),
-		}, makeCcLibraryTargets("foo", map[string]string{
-			"local_includes": `["."]`,
-			"srcs": `["main.cpp"] + select({
-        "//build/bazel_common_rules/platforms/arch:x86": [":foo_yasm"],
-        "//conditions:default": [],
-    })`,
-		})...),
-	})
-}
-
-func TestYasmPartiallyConditional(t *testing.T) {
-	runYasmTestCase(t, Bp2buildTestCase{
-		Description:                "Simple yasm test",
-		ModuleTypeUnderTest:        "cc_library",
-		ModuleTypeUnderTestFactory: cc.LibraryFactory,
-		Filesystem: map[string]string{
-			"main.cpp":         "",
-			"myfile.asm":       "",
-			"mysecondfile.asm": "",
-		},
-		Blueprint: `
-cc_library {
-  name: "foo",
-  srcs: ["main.cpp", "myfile.asm"],
-  arch: {
-    x86: {
-      srcs: ["mysecondfile.asm"],
-    },
-  },
-}`,
-		ExpectedBazelTargets: append([]string{
-			MakeBazelTarget("yasm", "foo_yasm", map[string]string{
-				"include_dirs": `["."]`,
-				"srcs": `["myfile.asm"] + select({
-        "//build/bazel_common_rules/platforms/arch:x86": ["mysecondfile.asm"],
-        "//conditions:default": [],
-    })`,
-			}),
-		}, makeCcLibraryTargets("foo", map[string]string{
-			"local_includes": `["."]`,
-			"srcs": `[
-        "main.cpp",
-        ":foo_yasm",
-    ]`,
-		})...),
-	})
-}
diff --git a/bp2build/conversion.go b/bp2build/conversion.go
index b2792e6..9f1aa09 100644
--- a/bp2build/conversion.go
+++ b/bp2build/conversion.go
@@ -1,20 +1,10 @@
 package bp2build
 
 import (
-	"encoding/json"
-	"fmt"
 	"reflect"
-	"strconv"
 	"strings"
 
 	"android/soong/android"
-	"android/soong/apex"
-	"android/soong/cc"
-	cc_config "android/soong/cc/config"
-	java_config "android/soong/java/config"
-	rust_config "android/soong/rust/config"
-	"android/soong/starlark_fmt"
-
 	"github.com/google/blueprint/proptools"
 )
 
@@ -24,96 +14,6 @@
 	Contents string
 }
 
-// createSoongInjectionDirFiles returns most of the files to write to the soong_injection directory.
-// Some other files also come from CreateProductConfigFiles
-func createSoongInjectionDirFiles(ctx *CodegenContext, metrics CodegenMetrics) ([]BazelFile, error) {
-	cfg := ctx.Config()
-	var files []BazelFile
-
-	files = append(files, newFile("android", GeneratedBuildFileName, "")) // Creates a //cc_toolchain package.
-	files = append(files, newFile("android", "constants.bzl", android.BazelCcToolchainVars(cfg)))
-
-	files = append(files, newFile("cc_toolchain", GeneratedBuildFileName, "")) // Creates a //cc_toolchain package.
-	files = append(files, newFile("cc_toolchain", "config_constants.bzl", cc_config.BazelCcToolchainVars(cfg)))
-	files = append(files, newFile("cc_toolchain", "sanitizer_constants.bzl", cc.BazelCcSanitizerToolchainVars(cfg)))
-
-	files = append(files, newFile("java_toolchain", GeneratedBuildFileName, "")) // Creates a //java_toolchain package.
-	files = append(files, newFile("java_toolchain", "constants.bzl", java_config.BazelJavaToolchainVars(cfg)))
-
-	files = append(files, newFile("rust_toolchain", GeneratedBuildFileName, "")) // Creates a //rust_toolchain package.
-	files = append(files, newFile("rust_toolchain", "constants.bzl", rust_config.BazelRustToolchainVars(cfg)))
-
-	files = append(files, newFile("apex_toolchain", GeneratedBuildFileName, "")) // Creates a //apex_toolchain package.
-	apexToolchainVars, err := apex.BazelApexToolchainVars()
-	if err != nil {
-		return nil, err
-	}
-	files = append(files, newFile("apex_toolchain", "constants.bzl", apexToolchainVars))
-
-	if buf, err := json.MarshalIndent(metrics.convertedModuleWithType, "", "  "); err != nil {
-		return []BazelFile{}, err
-	} else {
-		files = append(files, newFile("metrics", "converted_modules.json", string(buf)))
-	}
-
-	convertedModulePathMap, err := json.MarshalIndent(metrics.convertedModulePathMap, "", "\t")
-	if err != nil {
-		panic(err)
-	}
-	files = append(files, newFile("metrics", GeneratedBuildFileName, "")) // Creates a //metrics package.
-	files = append(files, newFile("metrics", "converted_modules_path_map.json", string(convertedModulePathMap)))
-	files = append(files, newFile("metrics", "converted_modules_path_map.bzl", "modules = "+strings.ReplaceAll(string(convertedModulePathMap), "\\", "\\\\")))
-
-	files = append(files, newFile("product_config", "soong_config_variables.bzl", cfg.Bp2buildSoongConfigDefinitions.String()))
-
-	files = append(files, newFile("product_config", "arch_configuration.bzl", android.StarlarkArchConfigurations()))
-
-	apiLevelsMap, err := android.GetApiLevelsMap(cfg)
-	if err != nil {
-		return nil, err
-	}
-	apiLevelsContent, err := json.Marshal(apiLevelsMap)
-	if err != nil {
-		return nil, err
-	}
-	files = append(files, newFile("api_levels", GeneratedBuildFileName, `exports_files(["api_levels.json"])`))
-	// TODO(b/269691302)  value of apiLevelsContent is product variable dependent and should be avoided for soong injection
-	files = append(files, newFile("api_levels", "api_levels.json", string(apiLevelsContent)))
-	files = append(files, newFile("api_levels", "platform_versions.bzl", platformVersionContents(cfg)))
-
-	files = append(files, newFile("allowlists", GeneratedBuildFileName, ""))
-	// TODO(b/262781701): Create an alternate soong_build entrypoint for writing out these files only when requested
-	files = append(files, newFile("allowlists", "mixed_build_prod_allowlist.txt", strings.Join(android.GetBazelEnabledModules(android.BazelProdMode), "\n")+"\n"))
-	files = append(files, newFile("allowlists", "mixed_build_staging_allowlist.txt", strings.Join(android.GetBazelEnabledModules(android.BazelStagingMode), "\n")+"\n"))
-
-	return files, nil
-}
-
-func platformVersionContents(cfg android.Config) string {
-	// Despite these coming from cfg.productVariables, they are actually hardcoded in global
-	// makefiles, not set in individual product config makesfiles, so they're safe to just export
-	// and load() directly.
-
-	platformVersionActiveCodenames := make([]string, 0, len(cfg.PlatformVersionActiveCodenames()))
-	for _, codename := range cfg.PlatformVersionActiveCodenames() {
-		platformVersionActiveCodenames = append(platformVersionActiveCodenames, fmt.Sprintf("%q", codename))
-	}
-
-	platformSdkVersion := "None"
-	if cfg.RawPlatformSdkVersion() != nil {
-		platformSdkVersion = strconv.Itoa(*cfg.RawPlatformSdkVersion())
-	}
-
-	return fmt.Sprintf(`
-platform_versions = struct(
-    platform_sdk_final = %s,
-    platform_sdk_version = %s,
-    platform_sdk_codename = %q,
-    platform_version_active_codenames = [%s],
-)
-`, starlark_fmt.PrintBool(cfg.PlatformSdkFinal()), platformSdkVersion, cfg.PlatformSdkCodename(), strings.Join(platformVersionActiveCodenames, ", "))
-}
-
 func CreateBazelFiles(ruleShims map[string]RuleShim, buildToTargets map[string]BazelTargets, mode CodegenMode) []BazelFile {
 	var files []BazelFile
 
@@ -147,20 +47,7 @@
 		targets.sort()
 
 		var content string
-		if mode == Bp2Build {
-			content = `# READ THIS FIRST:
-# This file was automatically generated by bp2build for the Bazel migration project.
-# Feel free to edit or test it, but do *not* check it into your version control system.
-`
-			content += targets.LoadStatements()
-			content += "\n\n"
-			// Get package rule from the handcrafted BUILD file, otherwise emit the default one.
-			prText := "package(default_visibility = [\"//visibility:public\"])\n"
-			if pr := targets.packageRule(); pr != nil {
-				prText = pr.content
-			}
-			content += prText
-		} else if mode == QueryView {
+		if mode == QueryView {
 			content = soongModuleLoad
 		}
 		if content != "" {
@@ -183,14 +70,6 @@
 
 const (
 	bazelRulesSubDir = "build/bazel/queryview_rules"
-
-	// additional files:
-	//  * workspace file
-	//  * base BUILD file
-	//  * rules BUILD file
-	//  * rules providers.bzl file
-	//  * rules soong_module.bzl file
-	numAdditionalFiles = 5
 )
 
 var (
diff --git a/bp2build/conversion_test.go b/bp2build/conversion_test.go
index 51675ce..2f806fa 100644
--- a/bp2build/conversion_test.go
+++ b/bp2build/conversion_test.go
@@ -17,8 +17,6 @@
 import (
 	"sort"
 	"testing"
-
-	"android/soong/android"
 )
 
 type bazelFilepath struct {
@@ -80,148 +78,3 @@
 		}
 	}
 }
-
-func TestCreateBazelFiles_Bp2Build_CreatesDefaultFiles(t *testing.T) {
-	testConfig := android.TestConfig("", make(map[string]string), "", make(map[string][]byte))
-	codegenCtx := NewCodegenContext(testConfig, android.NewTestContext(testConfig).Context, Bp2Build, "")
-	files, err := createSoongInjectionDirFiles(codegenCtx, CreateCodegenMetrics())
-	if err != nil {
-		t.Error(err)
-	}
-	expectedFilePaths := []bazelFilepath{
-		{
-			dir:      "android",
-			basename: GeneratedBuildFileName,
-		},
-		{
-			dir:      "android",
-			basename: "constants.bzl",
-		},
-		{
-			dir:      "cc_toolchain",
-			basename: GeneratedBuildFileName,
-		},
-		{
-			dir:      "cc_toolchain",
-			basename: "config_constants.bzl",
-		},
-		{
-			dir:      "cc_toolchain",
-			basename: "sanitizer_constants.bzl",
-		},
-		{
-			dir:      "java_toolchain",
-			basename: GeneratedBuildFileName,
-		},
-		{
-			dir:      "java_toolchain",
-			basename: "constants.bzl",
-		},
-		{
-			dir:      "rust_toolchain",
-			basename: GeneratedBuildFileName,
-		},
-		{
-			dir:      "rust_toolchain",
-			basename: "constants.bzl",
-		},
-		{
-			dir:      "apex_toolchain",
-			basename: GeneratedBuildFileName,
-		},
-		{
-			dir:      "apex_toolchain",
-			basename: "constants.bzl",
-		},
-		{
-			dir:      "metrics",
-			basename: "converted_modules.json",
-		},
-		{
-			dir:      "metrics",
-			basename: "BUILD.bazel",
-		},
-		{
-			dir:      "metrics",
-			basename: "converted_modules_path_map.json",
-		},
-		{
-			dir:      "metrics",
-			basename: "converted_modules_path_map.bzl",
-		},
-		{
-			dir:      "product_config",
-			basename: "soong_config_variables.bzl",
-		},
-		{
-			dir:      "product_config",
-			basename: "arch_configuration.bzl",
-		},
-		{
-			dir:      "api_levels",
-			basename: GeneratedBuildFileName,
-		},
-		{
-			dir:      "api_levels",
-			basename: "api_levels.json",
-		},
-		{
-			dir:      "api_levels",
-			basename: "platform_versions.bzl",
-		},
-		{
-			dir:      "allowlists",
-			basename: GeneratedBuildFileName,
-		},
-		{
-			dir:      "allowlists",
-			basename: "mixed_build_prod_allowlist.txt",
-		},
-		{
-			dir:      "allowlists",
-			basename: "mixed_build_staging_allowlist.txt",
-		},
-	}
-
-	less := func(a bazelFilepath, b bazelFilepath) bool {
-		return a.dir+"/"+a.basename < b.dir+"/"+b.basename
-	}
-
-	fileToFilepath := func(a BazelFile) bazelFilepath {
-		return bazelFilepath{basename: a.Basename, dir: a.Dir}
-	}
-
-	sort.Slice(expectedFilePaths, func(i, j int) bool {
-		return less(expectedFilePaths[i], expectedFilePaths[j])
-	})
-	sort.Slice(files, func(i, j int) bool {
-		return less(fileToFilepath(files[i]), fileToFilepath(files[j]))
-	})
-
-	i := 0
-	j := 0
-	for i < len(expectedFilePaths) && j < len(files) {
-		expectedFile, actualFile := expectedFilePaths[i], files[j]
-
-		if actualFile.Dir == expectedFile.dir && actualFile.Basename == expectedFile.basename {
-			i++
-			j++
-		} else if less(expectedFile, fileToFilepath(actualFile)) {
-			t.Errorf("Did not find expected file %s/%s", expectedFile.dir, expectedFile.basename)
-			i++
-		} else {
-			t.Errorf("Found unexpected file %s/%s", actualFile.Dir, actualFile.Basename)
-			j++
-		}
-	}
-	for i < len(expectedFilePaths) {
-		expectedFile := expectedFilePaths[i]
-		t.Errorf("Did not find expected file %s/%s", expectedFile.dir, expectedFile.basename)
-		i++
-	}
-	for j < len(files) {
-		actualFile := files[j]
-		t.Errorf("Found unexpected file %s/%s", actualFile.Dir, actualFile.Basename)
-		j++
-	}
-}
diff --git a/bp2build/droiddoc_exported_dir_conversion_test.go b/bp2build/droiddoc_exported_dir_conversion_test.go
deleted file mode 100644
index dee67f4..0000000
--- a/bp2build/droiddoc_exported_dir_conversion_test.go
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"regexp"
-	"testing"
-
-	"android/soong/java"
-)
-
-func TestDroiddocExportedDir(t *testing.T) {
-	bp := `
-	droiddoc_exported_dir {
-		name: "test-module",
-		path: "docs",
-	}
-	`
-	p := regexp.MustCompile(`\t*\|`)
-	dedent := func(s string) string {
-		return p.ReplaceAllString(s, "")
-	}
-	expectedBazelTargets := []string{
-		MakeBazelTargetNoRestrictions(
-			"droiddoc_exported_dir",
-			"test-module",
-			AttrNameToString{
-				"dir": `"docs"`,
-				"srcs": dedent(`[
-				|        "docs/android/1.txt",
-				|        "docs/android/nested-1/2.txt",
-				|        "//docs/android/nested-2:3.txt",
-				|        "//docs/android/nested-2:Android.bp",
-				|    ]`),
-			}),
-		//note we are not excluding Android.bp files from subpackages for now
-	}
-	RunBp2BuildTestCase(t, java.RegisterDocsBuildComponents, Bp2buildTestCase{
-		Blueprint:            bp,
-		ExpectedBazelTargets: expectedBazelTargets,
-		Filesystem: map[string]string{
-			"docs/android/1.txt":               "",
-			"docs/android/nested-1/2.txt":      "",
-			"docs/android/nested-2/Android.bp": "",
-			"docs/android/nested-2/3.txt":      "",
-		},
-	})
-}
diff --git a/bp2build/fdo_profile_conversion_test.go b/bp2build/fdo_profile_conversion_test.go
deleted file mode 100644
index 918b27c..0000000
--- a/bp2build/fdo_profile_conversion_test.go
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/cc"
-)
-
-func runFdoProfileTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "fdo_profile"
-	(&tc).ModuleTypeUnderTestFactory = cc.FdoProfileFactory
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, tc)
-}
-
-func TestFdoProfile(t *testing.T) {
-	testcases := []struct {
-		name               string
-		bp                 string
-		expectedBazelAttrs AttrNameToString
-	}{
-		{
-			name: "fdo_profile with arch-specific profiles",
-			bp: `
-fdo_profile {
-	name: "foo",
-	arch: {
-		arm: {
-			profile: "foo_arm.afdo",
-		},
-		arm64: {
-			profile: "foo_arm64.afdo",
-		}
-	}
-}`,
-			expectedBazelAttrs: AttrNameToString{
-				"profile": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "foo_arm.afdo",
-        "//build/bazel_common_rules/platforms/arch:arm64": "foo_arm64.afdo",
-        "//conditions:default": None,
-    })`,
-			},
-		},
-		{
-			name: "fdo_profile with arch-agnostic profile",
-			bp: `
-fdo_profile {
-	name: "foo",
-	profile: "foo.afdo",
-}`,
-			expectedBazelAttrs: AttrNameToString{
-				"profile": `"foo.afdo"`,
-			},
-		},
-	}
-
-	for _, test := range testcases {
-		t.Run(test.name, func(t *testing.T) {
-			expectedBazelTargets := []string{
-				// TODO(b/276287371): Add device-only restriction back to fdo_profile targets
-				MakeBazelTargetNoRestrictions("fdo_profile", "foo", test.expectedBazelAttrs),
-			}
-			runFdoProfileTestCase(t, Bp2buildTestCase{
-				Description:          test.name,
-				Blueprint:            test.bp,
-				ExpectedBazelTargets: expectedBazelTargets,
-			})
-		})
-	}
-}
diff --git a/bp2build/filegroup_conversion_test.go b/bp2build/filegroup_conversion_test.go
deleted file mode 100644
index 9c49dac..0000000
--- a/bp2build/filegroup_conversion_test.go
+++ /dev/null
@@ -1,205 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"fmt"
-	"testing"
-
-	"android/soong/android"
-)
-
-func runFilegroupTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "filegroup"
-	(&tc).ModuleTypeUnderTestFactory = android.FileGroupFactory
-	RunBp2BuildTestCase(t, registerFilegroupModuleTypes, tc)
-}
-
-func registerFilegroupModuleTypes(ctx android.RegistrationContext) {}
-
-func TestFilegroupSameNameAsFile_OneFile(t *testing.T) {
-	runFilegroupTestCase(t, Bp2buildTestCase{
-		Description: "filegroup - same name as file, with one file",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-filegroup {
-    name: "foo",
-    srcs: ["foo"],
-}
-`,
-		ExpectedBazelTargets:       []string{},
-		ExpectedHandcraftedModules: []string{"foo"}},
-	)
-}
-
-func TestFilegroupSameNameAsFile_MultipleFiles(t *testing.T) {
-	runFilegroupTestCase(t, Bp2buildTestCase{
-		Description: "filegroup - same name as file, with multiple files",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-filegroup {
-	name: "foo",
-	srcs: ["foo", "bar"],
-}
-`,
-		ExpectedErr: fmt.Errorf("filegroup 'foo' cannot contain a file with the same name"),
-	})
-}
-
-func TestFilegroupWithAidlSrcs(t *testing.T) {
-	testcases := []struct {
-		name               string
-		bp                 string
-		expectedBazelAttrs AttrNameToString
-	}{
-		{
-			name: "filegroup with only aidl srcs",
-			bp: `
-	filegroup {
-		name: "foo",
-		srcs: ["aidl/foo.aidl"],
-		path: "aidl",
-	}`,
-			expectedBazelAttrs: AttrNameToString{
-				"srcs":                `["aidl/foo.aidl"]`,
-				"strip_import_prefix": `"aidl"`,
-				"tags":                `["apex_available=//apex_available:anyapex"]`,
-			},
-		},
-		{
-			name: "filegroup without path",
-			bp: `
-	filegroup {
-		name: "foo",
-		srcs: ["aidl/foo.aidl"],
-	}`,
-			expectedBazelAttrs: AttrNameToString{
-				"srcs": `["aidl/foo.aidl"]`,
-				"tags": `["apex_available=//apex_available:anyapex"]`,
-			},
-		},
-	}
-
-	for _, test := range testcases {
-		t.Run(test.name, func(t *testing.T) {
-			expectedBazelTargets := []string{
-				MakeBazelTargetNoRestrictions("aidl_library", "foo", test.expectedBazelAttrs),
-			}
-			runFilegroupTestCase(t, Bp2buildTestCase{
-				Description:          test.name,
-				Blueprint:            test.bp,
-				ExpectedBazelTargets: expectedBazelTargets,
-			})
-		})
-	}
-}
-
-func TestFilegroupWithAidlAndNonAidlSrcs(t *testing.T) {
-	runFilegroupTestCase(t, Bp2buildTestCase{
-		Description: "filegroup with aidl and non-aidl srcs",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-filegroup {
-    name: "foo",
-    srcs: [
-		"aidl/foo.aidl",
-		"buf.proto",
-	],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTargetNoRestrictions("filegroup", "foo", AttrNameToString{
-				"srcs": `[
-        "aidl/foo.aidl",
-        "buf.proto",
-    ]`}),
-		}})
-}
-
-func TestFilegroupWithProtoSrcs(t *testing.T) {
-	runFilegroupTestCase(t, Bp2buildTestCase{
-		Description: "filegroup with proto and non-proto srcs",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-filegroup {
-		name: "foo",
-		srcs: ["proto/foo.proto"],
-		path: "proto",
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTargetNoRestrictions("proto_library", "foo_proto", AttrNameToString{
-				"srcs":                `["proto/foo.proto"]`,
-				"strip_import_prefix": `"proto"`,
-				"tags": `[
-        "apex_available=//apex_available:anyapex",
-        "manual",
-    ]`,
-			}),
-			MakeBazelTargetNoRestrictions("alias", "foo_bp2build_converted", AttrNameToString{
-				"actual": `"//.:foo_proto"`,
-				"tags": `[
-        "apex_available=//apex_available:anyapex",
-        "manual",
-    ]`,
-			}),
-			MakeBazelTargetNoRestrictions("filegroup", "foo", AttrNameToString{
-				"srcs": `["proto/foo.proto"]`}),
-		}})
-}
-
-func TestFilegroupWithProtoAndNonProtoSrcs(t *testing.T) {
-	runFilegroupTestCase(t, Bp2buildTestCase{
-		Description: "filegroup with proto and non-proto srcs",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-filegroup {
-    name: "foo",
-    srcs: [
-		"foo.proto",
-		"buf.cpp",
-	],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTargetNoRestrictions("filegroup", "foo", AttrNameToString{
-				"srcs": `[
-        "foo.proto",
-        "buf.cpp",
-    ]`}),
-		}})
-}
-
-func TestFilegroupWithProtoInDifferentPackage(t *testing.T) {
-	runFilegroupTestCase(t, Bp2buildTestCase{
-		Description: "filegroup with .proto in different package",
-		Filesystem: map[string]string{
-			"subdir/Android.bp": "",
-		},
-		Blueprint: `
-filegroup {
-    name: "foo",
-    srcs: ["subdir/foo.proto"],
-}`,
-		Dir: "subdir", // check in subdir
-		ExpectedBazelTargets: []string{
-			MakeBazelTargetNoRestrictions("proto_library", "foo_proto", AttrNameToString{
-				"srcs":                `["//subdir:foo.proto"]`,
-				"import_prefix":       `"subdir"`,
-				"strip_import_prefix": `""`,
-				"tags": `[
-        "apex_available=//apex_available:anyapex",
-        "manual",
-    ]`}),
-		}})
-}
diff --git a/bp2build/genrule_conversion_test.go b/bp2build/genrule_conversion_test.go
deleted file mode 100644
index af03dff..0000000
--- a/bp2build/genrule_conversion_test.go
+++ /dev/null
@@ -1,959 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"fmt"
-	"path/filepath"
-	"testing"
-
-	"android/soong/android"
-	"android/soong/cc"
-	"android/soong/genrule"
-	"android/soong/java"
-)
-
-func registerGenruleModuleTypes(ctx android.RegistrationContext) {
-	ctx.RegisterModuleType("genrule_defaults", func() android.Module { return genrule.DefaultsFactory() })
-	ctx.RegisterModuleType("cc_binary", func() android.Module { return cc.BinaryFactory() })
-	ctx.RegisterModuleType("soong_namespace", func() android.Module { return android.NamespaceFactory() })
-}
-
-func runGenruleTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "genrule"
-	(&tc).ModuleTypeUnderTestFactory = genrule.GenRuleFactory
-	RunBp2BuildTestCase(t, registerGenruleModuleTypes, tc)
-}
-
-func otherGenruleBp(genruleTarget string) map[string]string {
-	return map[string]string{
-		"other/Android.bp": fmt.Sprintf(`%s {
-    name: "foo.tool",
-    out: ["foo_tool.out"],
-    srcs: ["foo_tool.in"],
-    cmd: "cp $(in) $(out)",
-}
-%s {
-    name: "other.tool",
-    out: ["other_tool.out"],
-    srcs: ["other_tool.in"],
-    cmd: "cp $(in) $(out)",
-}`, genruleTarget, genruleTarget),
-		"other/file.txt": "",
-	}
-}
-
-func TestGenruleCliVariableReplacement(t *testing.T) {
-	testCases := []struct {
-		moduleType string
-		factory    android.ModuleFactory
-		genDir     string
-		hod        android.HostOrDeviceSupported
-	}{
-		{
-			moduleType: "genrule",
-			factory:    genrule.GenRuleFactory,
-			genDir:     "$(RULEDIR)",
-		},
-		{
-			moduleType: "cc_genrule",
-			factory:    cc.GenRuleFactory,
-			genDir:     "$(RULEDIR)",
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule",
-			factory:    java.GenRuleFactory,
-			genDir:     "$(RULEDIR)",
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule_host",
-			factory:    java.GenRuleFactoryHost,
-			genDir:     "$(RULEDIR)",
-			hod:        android.HostSupported,
-		},
-	}
-
-	bp := `%s {
-    name: "foo.tool",
-    out: ["foo_tool.out"],
-    srcs: ["foo_tool.in"],
-    cmd: "cp $(in) $(out)",
-}
-
-%s {
-    name: "foo",
-    out: ["foo.out"],
-    srcs: ["foo.in"],
-    tools: [":foo.tool"],
-    cmd: "$(location :foo.tool) --genDir=$(genDir) arg $(in) $(out)",
-    bazel_module: { bp2build_available: true },
-}`
-
-	for _, tc := range testCases {
-		moduleAttrs := AttrNameToString{
-			"cmd":   fmt.Sprintf(`"$(location :foo.tool) --genDir=%s arg $(SRCS) $(OUTS)"`, tc.genDir),
-			"outs":  `["foo.out"]`,
-			"srcs":  `["foo.in"]`,
-			"tools": `[":foo.tool"]`,
-		}
-
-		expectedBazelTargets := []string{
-			makeBazelTargetHostOrDevice("genrule", "foo", moduleAttrs, tc.hod),
-		}
-
-		t.Run(tc.moduleType, func(t *testing.T) {
-			RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {},
-				Bp2buildTestCase{
-					ModuleTypeUnderTest:        tc.moduleType,
-					ModuleTypeUnderTestFactory: tc.factory,
-					Blueprint:                  fmt.Sprintf(bp, tc.moduleType, tc.moduleType),
-					ExpectedBazelTargets:       expectedBazelTargets,
-					StubbedBuildDefinitions:    []string{"foo.tool", "other.tool"},
-				})
-		})
-	}
-}
-
-func TestGenruleLocationsLabel(t *testing.T) {
-	testCases := []struct {
-		moduleType string
-		factory    android.ModuleFactory
-		hod        android.HostOrDeviceSupported
-	}{
-		{
-			moduleType: "genrule",
-			factory:    genrule.GenRuleFactory,
-		},
-		{
-			moduleType: "cc_genrule",
-			factory:    cc.GenRuleFactory,
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule",
-			factory:    java.GenRuleFactory,
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule_host",
-			factory:    java.GenRuleFactoryHost,
-			hod:        android.HostSupported,
-		},
-	}
-
-	bp := `%s {
-    name: "foo.tools",
-    out: ["foo_tool.out", "foo_tool2.out"],
-    srcs: ["foo_tool.in"],
-    cmd: "cp $(in) $(out)",
-    bazel_module: { bp2build_available: true },
-}
-
-%s {
-    name: "foo",
-    out: ["foo.out"],
-    srcs: ["foo.in"],
-    tools: [":foo.tools"],
-    cmd: "$(locations :foo.tools) -s $(out) $(in)",
-    bazel_module: { bp2build_available: true },
-}`
-
-	for _, tc := range testCases {
-		fooAttrs := AttrNameToString{
-			"cmd":   `"$(locations :foo.tools) -s $(OUTS) $(SRCS)"`,
-			"outs":  `["foo.out"]`,
-			"srcs":  `["foo.in"]`,
-			"tools": `[":foo.tools"]`,
-		}
-		fooToolsAttrs := AttrNameToString{
-			"cmd": `"cp $(SRCS) $(OUTS)"`,
-			"outs": `[
-        "foo_tool.out",
-        "foo_tool2.out",
-    ]`,
-			"srcs": `["foo_tool.in"]`,
-		}
-
-		expectedBazelTargets := []string{
-			makeBazelTargetHostOrDevice("genrule", "foo", fooAttrs, tc.hod),
-			makeBazelTargetHostOrDevice("genrule", "foo.tools", fooToolsAttrs, tc.hod),
-		}
-
-		t.Run(tc.moduleType, func(t *testing.T) {
-			RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {},
-				Bp2buildTestCase{
-					ModuleTypeUnderTest:        tc.moduleType,
-					ModuleTypeUnderTestFactory: tc.factory,
-					Blueprint:                  fmt.Sprintf(bp, tc.moduleType, tc.moduleType),
-					ExpectedBazelTargets:       expectedBazelTargets,
-				})
-		})
-	}
-}
-
-func TestGenruleLocationsAbsoluteLabel(t *testing.T) {
-	testCases := []struct {
-		moduleType string
-		factory    android.ModuleFactory
-		hod        android.HostOrDeviceSupported
-	}{
-		{
-			moduleType: "genrule",
-			factory:    genrule.GenRuleFactory,
-		},
-		{
-			moduleType: "cc_genrule",
-			factory:    cc.GenRuleFactory,
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule",
-			factory:    java.GenRuleFactory,
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule_host",
-			factory:    java.GenRuleFactoryHost,
-			hod:        android.HostSupported,
-		},
-	}
-
-	bp := `%s {
-    name: "foo",
-    out: ["foo.out"],
-    srcs: ["foo.in"],
-    tool_files: [":foo.tool"],
-    cmd: "$(locations :foo.tool) -s $(out) $(in)",
-    bazel_module: { bp2build_available: true },
-}`
-
-	for _, tc := range testCases {
-		moduleAttrs := AttrNameToString{
-			"cmd":   `"$(locations //other:foo.tool) -s $(OUTS) $(SRCS)"`,
-			"outs":  `["foo.out"]`,
-			"srcs":  `["foo.in"]`,
-			"tools": `["//other:foo.tool"]`,
-		}
-
-		expectedBazelTargets := []string{
-			makeBazelTargetHostOrDevice("genrule", "foo", moduleAttrs, tc.hod),
-		}
-
-		t.Run(tc.moduleType, func(t *testing.T) {
-			RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {},
-				Bp2buildTestCase{
-					ModuleTypeUnderTest:        tc.moduleType,
-					ModuleTypeUnderTestFactory: tc.factory,
-					Blueprint:                  fmt.Sprintf(bp, tc.moduleType),
-					ExpectedBazelTargets:       expectedBazelTargets,
-					Filesystem:                 otherGenruleBp(tc.moduleType),
-					StubbedBuildDefinitions:    []string{"//other:foo.tool"},
-				})
-		})
-	}
-}
-
-func TestGenruleSrcsLocationsAbsoluteLabel(t *testing.T) {
-	testCases := []struct {
-		moduleType string
-		factory    android.ModuleFactory
-		hod        android.HostOrDeviceSupported
-	}{
-		{
-			moduleType: "genrule",
-			factory:    genrule.GenRuleFactory,
-		},
-		{
-			moduleType: "cc_genrule",
-			factory:    cc.GenRuleFactory,
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule",
-			factory:    java.GenRuleFactory,
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule_host",
-			factory:    java.GenRuleFactoryHost,
-			hod:        android.HostSupported,
-		},
-	}
-
-	bp := `%s {
-    name: "foo",
-    out: ["foo.out"],
-    srcs: [":other.tool", "other/file.txt",],
-    tool_files: [":foo.tool"],
-    cmd: "$(locations :foo.tool) $(location other/file.txt) -s $(out) $(location :other.tool)",
-    bazel_module: { bp2build_available: true },
-}`
-
-	for _, tc := range testCases {
-		moduleAttrs := AttrNameToString{
-			"cmd":  `"$(locations //other:foo.tool) $(location //other:file.txt) -s $(OUTS) $(location //other:other.tool)"`,
-			"outs": `["foo.out"]`,
-			"srcs": `[
-        "//other:other.tool",
-        "//other:file.txt",
-    ]`,
-			"tools": `["//other:foo.tool"]`,
-		}
-
-		expectedBazelTargets := []string{
-			makeBazelTargetHostOrDevice("genrule", "foo", moduleAttrs, tc.hod),
-		}
-
-		t.Run(tc.moduleType, func(t *testing.T) {
-			RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {},
-				Bp2buildTestCase{
-					ModuleTypeUnderTest:        tc.moduleType,
-					ModuleTypeUnderTestFactory: tc.factory,
-					Blueprint:                  fmt.Sprintf(bp, tc.moduleType),
-					ExpectedBazelTargets:       expectedBazelTargets,
-					Filesystem:                 otherGenruleBp(tc.moduleType),
-					StubbedBuildDefinitions:    []string{"//other:foo.tool", "//other:other.tool"},
-				})
-		})
-	}
-}
-
-func TestGenruleLocationLabelShouldSubstituteFirstToolLabel(t *testing.T) {
-	testCases := []struct {
-		moduleType string
-		factory    android.ModuleFactory
-		hod        android.HostOrDeviceSupported
-	}{
-		{
-			moduleType: "genrule",
-			factory:    genrule.GenRuleFactory,
-		},
-		{
-			moduleType: "cc_genrule",
-			factory:    cc.GenRuleFactory,
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule",
-			factory:    java.GenRuleFactory,
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule_host",
-			factory:    java.GenRuleFactoryHost,
-			hod:        android.HostSupported,
-		},
-	}
-
-	bp := `%s {
-    name: "foo",
-    out: ["foo.out"],
-    srcs: ["foo.in"],
-    tool_files: [":foo.tool", ":other.tool"],
-    cmd: "$(location) -s $(out) $(in)",
-    bazel_module: { bp2build_available: true },
-}`
-
-	for _, tc := range testCases {
-		moduleAttrs := AttrNameToString{
-			"cmd":  `"$(location //other:foo.tool) -s $(OUTS) $(SRCS)"`,
-			"outs": `["foo.out"]`,
-			"srcs": `["foo.in"]`,
-			"tools": `[
-        "//other:foo.tool",
-        "//other:other.tool",
-    ]`,
-		}
-
-		expectedBazelTargets := []string{
-			makeBazelTargetHostOrDevice("genrule", "foo", moduleAttrs, tc.hod),
-		}
-
-		t.Run(tc.moduleType, func(t *testing.T) {
-			RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {},
-				Bp2buildTestCase{
-					ModuleTypeUnderTest:        tc.moduleType,
-					ModuleTypeUnderTestFactory: tc.factory,
-					Blueprint:                  fmt.Sprintf(bp, tc.moduleType),
-					ExpectedBazelTargets:       expectedBazelTargets,
-					Filesystem:                 otherGenruleBp(tc.moduleType),
-					StubbedBuildDefinitions:    []string{"//other:foo.tool", "//other:other.tool"},
-				})
-		})
-	}
-}
-
-func TestGenruleLocationsLabelShouldSubstituteFirstToolLabel(t *testing.T) {
-	testCases := []struct {
-		moduleType string
-		factory    android.ModuleFactory
-		hod        android.HostOrDeviceSupported
-	}{
-		{
-			moduleType: "genrule",
-			factory:    genrule.GenRuleFactory,
-		},
-		{
-			moduleType: "cc_genrule",
-			factory:    cc.GenRuleFactory,
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule",
-			factory:    java.GenRuleFactory,
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule_host",
-			factory:    java.GenRuleFactoryHost,
-			hod:        android.HostSupported,
-		},
-	}
-
-	bp := `%s {
-    name: "foo",
-    out: ["foo.out"],
-    srcs: ["foo.in"],
-    tool_files: [":foo.tool", ":other.tool"],
-    cmd: "$(locations) -s $(out) $(in)",
-    bazel_module: { bp2build_available: true },
-}`
-
-	for _, tc := range testCases {
-		moduleAttrs := AttrNameToString{
-			"cmd":  `"$(locations //other:foo.tool) -s $(OUTS) $(SRCS)"`,
-			"outs": `["foo.out"]`,
-			"srcs": `["foo.in"]`,
-			"tools": `[
-        "//other:foo.tool",
-        "//other:other.tool",
-    ]`,
-		}
-
-		expectedBazelTargets := []string{
-			makeBazelTargetHostOrDevice("genrule", "foo", moduleAttrs, tc.hod),
-		}
-
-		t.Run(tc.moduleType, func(t *testing.T) {
-			RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {},
-				Bp2buildTestCase{
-					ModuleTypeUnderTest:        tc.moduleType,
-					ModuleTypeUnderTestFactory: tc.factory,
-					Blueprint:                  fmt.Sprintf(bp, tc.moduleType),
-					ExpectedBazelTargets:       expectedBazelTargets,
-					Filesystem:                 otherGenruleBp(tc.moduleType),
-					StubbedBuildDefinitions:    []string{"//other:foo.tool", "//other:other.tool"},
-				})
-		})
-	}
-}
-
-func TestGenruleWithoutToolsOrToolFiles(t *testing.T) {
-	testCases := []struct {
-		moduleType string
-		factory    android.ModuleFactory
-		hod        android.HostOrDeviceSupported
-	}{
-		{
-			moduleType: "genrule",
-			factory:    genrule.GenRuleFactory,
-		},
-		{
-			moduleType: "cc_genrule",
-			factory:    cc.GenRuleFactory,
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule",
-			factory:    java.GenRuleFactory,
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule_host",
-			factory:    java.GenRuleFactoryHost,
-			hod:        android.HostSupported,
-		},
-	}
-
-	bp := `%s {
-    name: "foo",
-    out: ["foo.out"],
-    srcs: ["foo.in"],
-    cmd: "cp $(in) $(out)",
-    bazel_module: { bp2build_available: true },
-}`
-
-	for _, tc := range testCases {
-		moduleAttrs := AttrNameToString{
-			"cmd":  `"cp $(SRCS) $(OUTS)"`,
-			"outs": `["foo.out"]`,
-			"srcs": `["foo.in"]`,
-		}
-
-		expectedBazelTargets := []string{
-			makeBazelTargetHostOrDevice("genrule", "foo", moduleAttrs, tc.hod),
-		}
-
-		t.Run(tc.moduleType, func(t *testing.T) {
-			RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {},
-				Bp2buildTestCase{
-					ModuleTypeUnderTest:        tc.moduleType,
-					ModuleTypeUnderTestFactory: tc.factory,
-					Blueprint:                  fmt.Sprintf(bp, tc.moduleType),
-					ExpectedBazelTargets:       expectedBazelTargets,
-				})
-		})
-	}
-}
-
-func TestGenruleBp2BuildInlinesDefaults(t *testing.T) {
-	testCases := []Bp2buildTestCase{
-		{
-			Description: "genrule applies properties from a genrule_defaults dependency if not specified",
-			Blueprint: `genrule_defaults {
-    name: "gen_defaults",
-    cmd: "do-something $(in) $(out)",
-}
-genrule {
-    name: "gen",
-    out: ["out"],
-    srcs: ["in1"],
-    defaults: ["gen_defaults"],
-    bazel_module: { bp2build_available: true },
-}
-`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("genrule", "gen", AttrNameToString{
-					"cmd":  `"do-something $(SRCS) $(OUTS)"`,
-					"outs": `["out"]`,
-					"srcs": `["in1"]`,
-				}),
-			},
-		},
-		{
-			Description: "genrule does merges properties from a genrule_defaults dependency, latest-first",
-			Blueprint: `genrule_defaults {
-    name: "gen_defaults",
-    out: ["out-from-defaults"],
-    srcs: ["in-from-defaults"],
-    cmd: "cmd-from-defaults",
-}
-genrule {
-    name: "gen",
-    out: ["out"],
-    srcs: ["in1"],
-    defaults: ["gen_defaults"],
-    cmd: "do-something $(in) $(out)",
-    bazel_module: { bp2build_available: true },
-}
-`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("genrule", "gen", AttrNameToString{
-					"cmd": `"do-something $(SRCS) $(OUTS)"`,
-					"outs": `[
-        "out-from-defaults",
-        "out",
-    ]`,
-					"srcs": `[
-        "in-from-defaults",
-        "in1",
-    ]`,
-				}),
-			},
-		},
-		{
-			Description: "genrule applies properties from list of genrule_defaults",
-			Blueprint: `genrule_defaults {
-    name: "gen_defaults1",
-    cmd: "cp $(in) $(out)",
-}
-
-genrule_defaults {
-    name: "gen_defaults2",
-    srcs: ["in1"],
-}
-
-genrule {
-    name: "gen",
-    out: ["out"],
-    defaults: ["gen_defaults1", "gen_defaults2"],
-    bazel_module: { bp2build_available: true },
-}
-`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("genrule", "gen", AttrNameToString{
-					"cmd":  `"cp $(SRCS) $(OUTS)"`,
-					"outs": `["out"]`,
-					"srcs": `["in1"]`,
-				}),
-			},
-		},
-		{
-			Description: "genrule applies properties from genrule_defaults transitively",
-			Blueprint: `genrule_defaults {
-    name: "gen_defaults1",
-    defaults: ["gen_defaults2"],
-    cmd: "cmd1 $(in) $(out)", // overrides gen_defaults2's cmd property value.
-}
-
-genrule_defaults {
-    name: "gen_defaults2",
-    defaults: ["gen_defaults3"],
-    cmd: "cmd2 $(in) $(out)",
-    out: ["out-from-2"],
-    srcs: ["in1"],
-}
-
-genrule_defaults {
-    name: "gen_defaults3",
-    out: ["out-from-3"],
-    srcs: ["srcs-from-3"],
-}
-
-genrule {
-    name: "gen",
-    out: ["out"],
-    defaults: ["gen_defaults1"],
-    bazel_module: { bp2build_available: true },
-}
-`,
-			ExpectedBazelTargets: []string{
-				MakeBazelTargetNoRestrictions("genrule", "gen", AttrNameToString{
-					"cmd": `"cmd1 $(SRCS) $(OUTS)"`,
-					"outs": `[
-        "out-from-3",
-        "out-from-2",
-        "out",
-    ]`,
-					"srcs": `[
-        "srcs-from-3",
-        "in1",
-    ]`,
-				}),
-			},
-		},
-	}
-
-	for _, testCase := range testCases {
-		t.Run(testCase.Description, func(t *testing.T) {
-			runGenruleTestCase(t, testCase)
-		})
-	}
-}
-
-func TestCcGenruleArchAndExcludeSrcs(t *testing.T) {
-	name := "cc_genrule with arch"
-	bp := `
-	cc_genrule {
-		name: "foo",
-		srcs: [
-			"foo1.in",
-			"foo2.in",
-		],
-		exclude_srcs: ["foo2.in"],
-		arch: {
-			arm: {
-				srcs: [
-					"foo1_arch.in",
-					"foo2_arch.in",
-				],
-				exclude_srcs: ["foo2_arch.in"],
-			},
-		},
-		cmd: "cat $(in) > $(out)",
-		bazel_module: { bp2build_available: true },
-	}`
-
-	expectedBazelAttrs := AttrNameToString{
-		"srcs": `["foo1.in"] + select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["foo1_arch.in"],
-        "//conditions:default": [],
-    })`,
-		"cmd":                    `"cat $(SRCS) > $(OUTS)"`,
-		"target_compatible_with": `["//build/bazel_common_rules/platforms/os:android"]`,
-	}
-
-	expectedBazelTargets := []string{
-		MakeBazelTargetNoRestrictions("genrule", "foo", expectedBazelAttrs),
-	}
-
-	t.Run(name, func(t *testing.T) {
-		RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {},
-			Bp2buildTestCase{
-				ModuleTypeUnderTest:        "cc_genrule",
-				ModuleTypeUnderTestFactory: cc.GenRuleFactory,
-				Blueprint:                  bp,
-				ExpectedBazelTargets:       expectedBazelTargets,
-			})
-	})
-}
-
-func TestGenruleWithExportIncludeDirs(t *testing.T) {
-	testCases := []struct {
-		moduleType string
-		factory    android.ModuleFactory
-		hod        android.HostOrDeviceSupported
-	}{
-		{
-			moduleType: "genrule",
-			factory:    genrule.GenRuleFactory,
-		},
-		{
-			moduleType: "cc_genrule",
-			factory:    cc.GenRuleFactory,
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule",
-			factory:    java.GenRuleFactory,
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule_host",
-			factory:    java.GenRuleFactoryHost,
-			hod:        android.HostSupported,
-		},
-	}
-
-	dir := "baz"
-
-	bp := `%s {
-    name: "foo",
-    out: ["foo.out.h"],
-    srcs: ["foo.in"],
-    cmd: "cp $(in) $(out)",
-    export_include_dirs: ["foo", "bar", "."],
-    bazel_module: { bp2build_available: true },
-}`
-
-	for _, tc := range testCases {
-		moduleAttrs := AttrNameToString{
-			"cmd":  `"cp $(SRCS) $(OUTS)"`,
-			"outs": `["foo.out.h"]`,
-			"srcs": `["foo.in"]`,
-		}
-
-		expectedBazelTargets := []string{
-			makeBazelTargetHostOrDevice("genrule", "foo", moduleAttrs, tc.hod),
-			makeBazelTargetHostOrDevice("cc_library_headers", "foo__header_library", AttrNameToString{
-				"hdrs": `[":foo"]`,
-				"export_includes": `[
-        "foo",
-        "baz/foo",
-        "bar",
-        "baz/bar",
-        ".",
-        "baz",
-    ]`,
-			},
-				tc.hod),
-		}
-
-		t.Run(tc.moduleType, func(t *testing.T) {
-			RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {},
-				Bp2buildTestCase{
-					ModuleTypeUnderTest:        tc.moduleType,
-					ModuleTypeUnderTestFactory: tc.factory,
-					Filesystem: map[string]string{
-						filepath.Join(dir, "Android.bp"): fmt.Sprintf(bp, tc.moduleType),
-					},
-					Dir:                  dir,
-					ExpectedBazelTargets: expectedBazelTargets,
-				})
-		})
-	}
-}
-
-func TestGenruleWithSoongConfigVariableConfiguredCmd(t *testing.T) {
-	testCases := []struct {
-		moduleType string
-		factory    android.ModuleFactory
-		hod        android.HostOrDeviceSupported
-	}{
-		{
-			moduleType: "genrule",
-			factory:    genrule.GenRuleFactory,
-		},
-		{
-			moduleType: "cc_genrule",
-			factory:    cc.GenRuleFactory,
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule",
-			factory:    java.GenRuleFactory,
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule_host",
-			factory:    java.GenRuleFactoryHost,
-			hod:        android.HostSupported,
-		},
-	}
-
-	bp := `
-soong_config_module_type {
-    name: "my_genrule",
-    module_type: "%s",
-    config_namespace: "my_namespace",
-    bool_variables: ["my_variable"],
-    properties: ["cmd"],
-}
-
-my_genrule {
-    name: "foo",
-    out: ["foo.txt"],
-    cmd: "echo 'no variable' > $(out)",
-    soong_config_variables: {
-        my_variable: {
-            cmd: "echo 'with variable' > $(out)",
-        },
-    },
-    bazel_module: { bp2build_available: true },
-}
-`
-
-	for _, tc := range testCases {
-		moduleAttrs := AttrNameToString{
-			"cmd": `select({
-        "//build/bazel/product_config/config_settings:my_namespace__my_variable": "echo 'with variable' > $(OUTS)",
-        "//conditions:default": "echo 'no variable' > $(OUTS)",
-    })`,
-			"outs": `["foo.txt"]`,
-		}
-
-		expectedBazelTargets := []string{
-			makeBazelTargetHostOrDevice("genrule", "foo", moduleAttrs, tc.hod),
-		}
-
-		t.Run(tc.moduleType, func(t *testing.T) {
-			RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) { android.RegisterSoongConfigModuleBuildComponents(ctx) },
-				Bp2buildTestCase{
-					Blueprint:                  fmt.Sprintf(bp, tc.moduleType),
-					ModuleTypeUnderTest:        tc.moduleType,
-					ModuleTypeUnderTestFactory: tc.factory,
-					ExpectedBazelTargets:       expectedBazelTargets,
-				})
-		})
-	}
-}
-
-func TestGenruleWithProductVariableConfiguredCmd(t *testing.T) {
-	testCases := []struct {
-		moduleType string
-		factory    android.ModuleFactory
-		hod        android.HostOrDeviceSupported
-	}{
-		{
-			moduleType: "genrule",
-			factory:    genrule.GenRuleFactory,
-		},
-		{
-			moduleType: "cc_genrule",
-			factory:    cc.GenRuleFactory,
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule",
-			factory:    java.GenRuleFactory,
-			hod:        android.DeviceSupported,
-		},
-		{
-			moduleType: "java_genrule_host",
-			factory:    java.GenRuleFactoryHost,
-			hod:        android.HostSupported,
-		},
-	}
-
-	bp := `
-
-%s {
-    name: "foo",
-    out: ["foo.txt"],
-    cmd: "echo 'no variable' > $(out)",
-    product_variables: {
-        debuggable: {
-            cmd: "echo 'with variable' > $(out)",
-        },
-    },
-    bazel_module: { bp2build_available: true },
-}
-`
-
-	for _, tc := range testCases {
-		moduleAttrs := AttrNameToString{
-			"cmd": `select({
-        "//build/bazel/product_config/config_settings:debuggable": "echo 'with variable' > $(OUTS)",
-        "//conditions:default": "echo 'no variable' > $(OUTS)",
-    })`,
-			"outs": `["foo.txt"]`,
-		}
-
-		expectedBazelTargets := []string{
-			makeBazelTargetHostOrDevice("genrule", "foo", moduleAttrs, tc.hod),
-		}
-
-		t.Run(tc.moduleType, func(t *testing.T) {
-			RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) { android.RegisterSoongConfigModuleBuildComponents(ctx) },
-				Bp2buildTestCase{
-					Blueprint:                  fmt.Sprintf(bp, tc.moduleType),
-					ModuleTypeUnderTest:        tc.moduleType,
-					ModuleTypeUnderTestFactory: tc.factory,
-					ExpectedBazelTargets:       expectedBazelTargets,
-				})
-		})
-	}
-}
-
-func TestGenruleWithModulesInNamespaces(t *testing.T) {
-	bp := `
-genrule {
-	name: "mygenrule",
-	cmd: "echo $(location //mynamespace:mymodule) > $(out)",
-	srcs: ["//mynamespace:mymodule"],
-	out: ["myout"],
-}
-`
-	fs := map[string]string{
-		"mynamespace/Android.bp":     `soong_namespace {}`,
-		"mynamespace/dir/Android.bp": `cc_binary {name: "mymodule"}`,
-	}
-	expectedBazelTargets := []string{
-		MakeBazelTargetNoRestrictions("genrule", "mygenrule", AttrNameToString{
-			// The fully qualified soong label is <namespace>:<module_name>
-			// - here the prefix is mynamespace
-			// The fully qualifed bazel label is <package>:<module_name>
-			// - here the prefix is mynamespace/dir, since there is a BUILD file at each level of this FS path
-			"cmd":  `"echo $(location //mynamespace/dir:mymodule) > $(OUTS)"`,
-			"outs": `["myout"]`,
-			"srcs": `["//mynamespace/dir:mymodule"]`,
-		}),
-	}
-
-	t.Run("genrule that uses module from a different namespace", func(t *testing.T) {
-		runGenruleTestCase(t, Bp2buildTestCase{
-			Blueprint:                  bp,
-			Filesystem:                 fs,
-			ModuleTypeUnderTest:        "genrule",
-			ModuleTypeUnderTestFactory: genrule.GenRuleFactory,
-			ExpectedBazelTargets:       expectedBazelTargets,
-			StubbedBuildDefinitions:    []string{"//mynamespace/dir:mymodule"},
-		})
-	})
-
-}
diff --git a/bp2build/gensrcs_conversion_test.go b/bp2build/gensrcs_conversion_test.go
deleted file mode 100644
index e9fc61d..0000000
--- a/bp2build/gensrcs_conversion_test.go
+++ /dev/null
@@ -1,96 +0,0 @@
-// Copyright 2020 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/genrule"
-)
-
-func registerModulesForGensrcsTests(ctx android.RegistrationContext) {
-	ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-}
-
-func TestGensrcs(t *testing.T) {
-	testcases := []struct {
-		name                    string
-		bp                      string
-		expectedBazelAttrs      AttrNameToString
-		stubbedBuildDefinitions []string
-	}{
-		{
-			name: "gensrcs with common usage of properties",
-			bp: `
-			gensrcs {
-                name: "foo",
-                srcs: ["test/input.txt", ":external_files"],
-                tool_files: ["program.py"],
-                cmd: "$(location program.py) $(in) $(out) $(location foo/file.txt) $(location :external_files)",
-                data: ["foo/file.txt", ":external_files"],
-                output_extension: "out",
-                bazel_module: { bp2build_available: true },
-			}
-      filegroup {
-                name: "external_files",
-			}`,
-			stubbedBuildDefinitions: []string{"external_files"},
-			expectedBazelAttrs: AttrNameToString{
-				"srcs": `[
-        "test/input.txt",
-        ":external_files",
-    ]`,
-				"tools":            `["program.py"]`,
-				"output_extension": `"out"`,
-				"cmd":              `"$(location program.py) $(SRC) $(OUT) $(location foo/file.txt) $(location :external_files)"`,
-				"data": `[
-        "foo/file.txt",
-        ":external_files",
-    ]`,
-			},
-		},
-		{
-			name: "gensrcs with out_extension unset",
-			bp: `
-			gensrcs {
-                name: "foo",
-                srcs: ["input.txt"],
-                cmd: "cat $(in) > $(out)",
-                bazel_module: { bp2build_available: true },
-			}`,
-			expectedBazelAttrs: AttrNameToString{
-				"srcs": `["input.txt"]`,
-				"cmd":  `"cat $(SRC) > $(OUT)"`,
-			},
-		},
-	}
-
-	for _, test := range testcases {
-		expectedBazelTargets := []string{
-			MakeBazelTargetNoRestrictions("gensrcs", "foo", test.expectedBazelAttrs),
-		}
-		t.Run(test.name, func(t *testing.T) {
-			RunBp2BuildTestCase(t, registerModulesForGensrcsTests,
-				Bp2buildTestCase{
-					ModuleTypeUnderTest:        "gensrcs",
-					ModuleTypeUnderTestFactory: genrule.GenSrcsFactory,
-					Blueprint:                  test.bp,
-					ExpectedBazelTargets:       expectedBazelTargets,
-					StubbedBuildDefinitions:    test.stubbedBuildDefinitions,
-				})
-		})
-	}
-}
diff --git a/bp2build/go_conversion_test.go b/bp2build/go_conversion_test.go
deleted file mode 100644
index ebd241d..0000000
--- a/bp2build/go_conversion_test.go
+++ /dev/null
@@ -1,208 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"github.com/google/blueprint/bootstrap"
-
-	"android/soong/android"
-)
-
-func runGoTests(t *testing.T, tc Bp2buildTestCase) {
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {
-		tCtx := ctx.(*android.TestContext)
-		bootstrap.RegisterGoModuleTypes(tCtx.Context.Context) // android.TestContext --> android.Context --> blueprint.Context
-	}, tc)
-}
-
-func TestConvertGoPackage(t *testing.T) {
-	bp := `
-bootstrap_go_package {
-	name: "foo",
-	pkgPath: "android/foo",
-	deps: [
-		"bar",
-	],
-	srcs: [
-		"foo1.go",
-		"foo2.go",
-	],
-	linux: {
-		srcs: [
-			"foo_linux.go",
-		],
-		testSrcs: [
-			"foo_linux_test.go",
-		],
-	},
-	darwin: {
-		srcs: [
-			"foo_darwin.go",
-		],
-		testSrcs: [
-			"foo_darwin_test.go",
-		],
-	},
-	testSrcs: [
-		"foo1_test.go",
-		"foo2_test.go",
-	],
-}
-`
-	depBp := `
-bootstrap_go_package {
-	name: "bar",
-}
-`
-	t.Parallel()
-	runGoTests(t, Bp2buildTestCase{
-		Description:         "Convert bootstrap_go_package to go_library",
-		ModuleTypeUnderTest: "bootrstap_go_package",
-		Blueprint:           bp,
-		Filesystem: map[string]string{
-			"bar/Android.bp": depBp, // Put dep in Android.bp to reduce boilerplate in ExpectedBazelTargets
-		},
-		ExpectedBazelTargets: []string{makeBazelTargetHostOrDevice("go_library", "foo",
-			AttrNameToString{
-				"deps":       `["//bar:bar"]`,
-				"importpath": `"android/foo"`,
-				"srcs": `[
-        "foo1.go",
-        "foo2.go",
-    ] + select({
-        "//build/bazel_common_rules/platforms/os:darwin": ["foo_darwin.go"],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": ["foo_linux.go"],
-        "//conditions:default": [],
-    })`,
-			},
-			android.HostSupported,
-		),
-			makeBazelTargetHostOrDevice("go_test", "foo-test",
-				AttrNameToString{
-					"embed": `[":foo"]`,
-					"srcs": `[
-        "foo1_test.go",
-        "foo2_test.go",
-    ] + select({
-        "//build/bazel_common_rules/platforms/os:darwin": ["foo_darwin_test.go"],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": ["foo_linux_test.go"],
-        "//conditions:default": [],
-    })`,
-				},
-				android.HostSupported,
-			)},
-	})
-}
-
-func TestConvertGoBinaryWithTransitiveDeps(t *testing.T) {
-	bp := `
-blueprint_go_binary {
-	name: "foo",
-	srcs: ["main.go"],
-	deps: ["bar"],
-}
-`
-	depBp := `
-bootstrap_go_package {
-	name: "bar",
-	deps: ["baz"],
-}
-bootstrap_go_package {
-	name: "baz",
-}
-`
-	t.Parallel()
-	runGoTests(t, Bp2buildTestCase{
-		Description: "Convert blueprint_go_binary to go_binary",
-		Blueprint:   bp,
-		Filesystem: map[string]string{
-			"bar/Android.bp": depBp, // Put dep in Android.bp to reduce boilerplate in ExpectedBazelTargets
-		},
-		ExpectedBazelTargets: []string{makeBazelTargetHostOrDevice("go_binary", "foo",
-			AttrNameToString{
-				"deps": `[
-        "//bar:bar",
-        "//bar:baz",
-    ]`,
-				"srcs": `["main.go"]`,
-			},
-			android.HostSupported,
-		)},
-	})
-}
-
-func TestConvertGoBinaryWithTestSrcs(t *testing.T) {
-	bp := `
-blueprint_go_binary {
-	name: "foo",
-	srcs: ["main.go"],
-	testSrcs: ["main_test.go"],
-}
-`
-	t.Parallel()
-	runGoTests(t, Bp2buildTestCase{
-		Description: "Convert blueprint_go_binary with testSrcs",
-		Blueprint:   bp,
-		ExpectedBazelTargets: []string{
-			makeBazelTargetHostOrDevice("go_binary", "foo",
-				AttrNameToString{
-					"deps":  `[]`,
-					"embed": `[":foo-source"]`,
-				},
-				android.HostSupported,
-			),
-			makeBazelTargetHostOrDevice("go_source", "foo-source",
-				AttrNameToString{
-					"deps": `[]`,
-					"srcs": `["main.go"]`,
-				},
-				android.HostSupported,
-			),
-			makeBazelTargetHostOrDevice("go_test", "foo-test",
-				AttrNameToString{
-					"embed": `[":foo-source"]`,
-					"srcs":  `["main_test.go"]`,
-				},
-				android.HostSupported,
-			),
-		},
-	})
-}
-
-func TestConvertGoBinaryWithSrcInDifferentPackage(t *testing.T) {
-	bp := `
-blueprint_go_binary {
-	name: "foo",
-	srcs: ["subdir/main.go"],
-}
-`
-	t.Parallel()
-	runGoTests(t, Bp2buildTestCase{
-		Description: "Convert blueprint_go_binary with src in different package",
-		Blueprint:   bp,
-		Filesystem: map[string]string{
-			"subdir/Android.bp": "",
-		},
-		ExpectedBazelTargets: []string{makeBazelTargetHostOrDevice("go_binary", "foo",
-			AttrNameToString{
-				"deps": `[]`,
-				"srcs": `["//subdir:main.go"]`,
-			},
-			android.HostSupported,
-		)},
-	})
-}
diff --git a/bp2build/java_binary_host_conversion_test.go b/bp2build/java_binary_host_conversion_test.go
deleted file mode 100644
index 29c0e44..0000000
--- a/bp2build/java_binary_host_conversion_test.go
+++ /dev/null
@@ -1,338 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/cc"
-	"android/soong/java"
-)
-
-func runJavaBinaryHostTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "java_binary_host"
-	(&tc).ModuleTypeUnderTestFactory = java.BinaryHostFactory
-	tc.StubbedBuildDefinitions = append(tc.StubbedBuildDefinitions, "//other:jni-lib-1")
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("cc_library_host_shared", cc.LibraryHostSharedFactory)
-		ctx.RegisterModuleType("java_library", java.LibraryFactory)
-		ctx.RegisterModuleType("java_import_host", java.ImportFactory)
-	}, tc)
-}
-
-var testFs = map[string]string{
-	"test.mf": "Main-Class: com.android.test.MainClass",
-	"other/Android.bp": `cc_library_host_shared {
-    name: "jni-lib-1",
-    stl: "none",
-}`,
-}
-
-func TestJavaBinaryHost(t *testing.T) {
-	runJavaBinaryHostTestCase(t, Bp2buildTestCase{
-		Description: "java_binary_host with srcs, exclude_srcs, jni_libs, javacflags, and manifest.",
-		Filesystem:  testFs,
-		Blueprint: `java_binary_host {
-    name: "java-binary-host-1",
-    srcs: ["a.java", "b.java"],
-    exclude_srcs: ["b.java"],
-    manifest: "test.mf",
-    jni_libs: ["jni-lib-1"],
-    javacflags: ["-Xdoclint:all/protected"],
-    bazel_module: { bp2build_available: true },
-    java_version: "8",
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-binary-host-1_lib", AttrNameToString{
-				"srcs":         `["a.java"]`,
-				"deps":         `["//other:jni-lib-1"]`,
-				"java_version": `"8"`,
-				"javacopts":    `["-Xdoclint:all/protected"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("java_binary", "java-binary-host-1", AttrNameToString{
-				"main_class": `"com.android.test.MainClass"`,
-				"jvm_flags":  `["-Djava.library.path=$${RUNPATH}other/jni-lib-1"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-				"runtime_deps": `[":java-binary-host-1_lib"]`,
-			}),
-		},
-	})
-}
-
-func TestJavaBinaryHostRuntimeDeps(t *testing.T) {
-	runJavaBinaryHostTestCase(t, Bp2buildTestCase{
-		Description:             "java_binary_host with srcs, exclude_srcs, jni_libs, javacflags, and manifest.",
-		Filesystem:              testFs,
-		StubbedBuildDefinitions: []string{"java-dep-1"},
-		Blueprint: `java_binary_host {
-    name: "java-binary-host-1",
-    static_libs: ["java-dep-1"],
-    manifest: "test.mf",
-    bazel_module: { bp2build_available: true },
-}
-
-java_library {
-    name: "java-dep-1",
-    srcs: ["a.java"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_binary", "java-binary-host-1", AttrNameToString{
-				"main_class":   `"com.android.test.MainClass"`,
-				"runtime_deps": `[":java-dep-1"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestJavaBinaryHostLibs(t *testing.T) {
-	runJavaBinaryHostTestCase(t, Bp2buildTestCase{
-		Description:             "java_binary_host with srcs, libs.",
-		Filesystem:              testFs,
-		StubbedBuildDefinitions: []string{"java-lib-dep-1", "java-lib-dep-1-neverlink"},
-		Blueprint: `java_binary_host {
-    name: "java-binary-host-libs",
-    libs: ["java-lib-dep-1"],
-    manifest: "test.mf",
-    srcs: ["a.java"],
-}
-
-java_import_host{
-    name: "java-lib-dep-1",
-    jars: ["foo.jar"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-binary-host-libs_lib", AttrNameToString{
-				"srcs": `["a.java"]`,
-				"deps": `[":java-lib-dep-1-neverlink"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("java_binary", "java-binary-host-libs", AttrNameToString{
-				"main_class": `"com.android.test.MainClass"`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-				"runtime_deps": `[":java-binary-host-libs_lib"]`,
-			}),
-		},
-	})
-}
-
-func TestJavaBinaryHostKotlinSrcs(t *testing.T) {
-	runJavaBinaryHostTestCase(t, Bp2buildTestCase{
-		Description: "java_binary_host with srcs, libs.",
-		Filesystem:  testFs,
-		Blueprint: `java_binary_host {
-    name: "java-binary-host",
-    manifest: "test.mf",
-    srcs: ["a.java", "b.kt"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("kt_jvm_library", "java-binary-host_lib", AttrNameToString{
-				"srcs": `[
-        "a.java",
-        "b.kt",
-    ]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("java_binary", "java-binary-host", AttrNameToString{
-				"main_class":   `"com.android.test.MainClass"`,
-				"runtime_deps": `[":java-binary-host_lib"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestJavaBinaryHostKotlinCommonSrcs(t *testing.T) {
-	runJavaBinaryHostTestCase(t, Bp2buildTestCase{
-		Description: "java_binary_host with common_srcs",
-		Filesystem:  testFs,
-		Blueprint: `java_binary_host {
-    name: "java-binary-host",
-    manifest: "test.mf",
-    srcs: ["a.java"],
-    common_srcs: ["b.kt"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("kt_jvm_library", "java-binary-host_lib", AttrNameToString{
-				"srcs":        `["a.java"]`,
-				"common_srcs": `["b.kt"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("java_binary", "java-binary-host", AttrNameToString{
-				"main_class":   `"com.android.test.MainClass"`,
-				"runtime_deps": `[":java-binary-host_lib"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestJavaBinaryHostKotlinWithResourceDir(t *testing.T) {
-	runJavaBinaryHostTestCase(t, Bp2buildTestCase{
-		Description: "java_binary_host with srcs, libs, resource dir  .",
-		Filesystem: map[string]string{
-			"test.mf":        "Main-Class: com.android.test.MainClass",
-			"res/a.res":      "",
-			"res/dir1/b.res": "",
-		},
-		Blueprint: `java_binary_host {
-    name: "java-binary-host",
-    manifest: "test.mf",
-    srcs: ["a.java", "b.kt"],
-    java_resource_dirs: ["res"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("kt_jvm_library", "java-binary-host_lib", AttrNameToString{
-				"srcs": `[
-        "a.java",
-        "b.kt",
-    ]`,
-				"resources": `[
-        "res/a.res",
-        "res/dir1/b.res",
-    ]`,
-				"resource_strip_prefix": `"res"`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("java_binary", "java-binary-host", AttrNameToString{
-				"main_class":   `"com.android.test.MainClass"`,
-				"runtime_deps": `[":java-binary-host_lib"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestJavaBinaryHostKotlinWithResources(t *testing.T) {
-	runJavaBinaryHostTestCase(t, Bp2buildTestCase{
-		Description: "java_binary_host with srcs, libs, resources.",
-		Filesystem: map[string]string{
-			"adir/test.mf":   "Main-Class: com.android.test.MainClass",
-			"adir/res/a.res": "",
-			"adir/res/b.res": "",
-			"adir/Android.bp": `java_binary_host {
-    name: "java-binary-host",
-    manifest: "test.mf",
-    srcs: ["a.java", "b.kt"],
-    java_resources: ["res/a.res", "res/b.res"],
-    bazel_module: { bp2build_available: true },
-}
-`,
-		},
-		Dir:       "adir",
-		Blueprint: "",
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("kt_jvm_library", "java-binary-host_lib", AttrNameToString{
-				"srcs": `[
-        "a.java",
-        "b.kt",
-    ]`,
-				"resources": `[
-        "res/a.res",
-        "res/b.res",
-    ]`,
-				"resource_strip_prefix": `"adir"`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("java_binary", "java-binary-host", AttrNameToString{
-				"main_class":   `"com.android.test.MainClass"`,
-				"runtime_deps": `[":java-binary-host_lib"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestJavaBinaryHostKotlinCflags(t *testing.T) {
-	runJavaBinaryHostTestCase(t, Bp2buildTestCase{
-		Description: "java_binary_host with kotlincflags",
-		Filesystem:  testFs,
-		Blueprint: `java_binary_host {
-    name: "java-binary-host",
-    manifest: "test.mf",
-    srcs: ["a.kt"],
-    kotlincflags: ["-flag1", "-flag2"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("kt_jvm_library", "java-binary-host_lib", AttrNameToString{
-				"srcs": `["a.kt"]`,
-				"kotlincflags": `[
-        "-flag1",
-        "-flag2",
-    ]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("java_binary", "java-binary-host", AttrNameToString{
-				"main_class":   `"com.android.test.MainClass"`,
-				"runtime_deps": `[":java-binary-host_lib"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/java_host_for_device_conversion_test.go b/bp2build/java_host_for_device_conversion_test.go
deleted file mode 100644
index 1fa7126..0000000
--- a/bp2build/java_host_for_device_conversion_test.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/java"
-)
-
-func runJavaHostForDeviceTestCaseWithRegistrationCtxFunc(t *testing.T, tc Bp2buildTestCase, registrationCtxFunc func(ctx android.RegistrationContext)) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "java_host_for_device"
-	(&tc).ModuleTypeUnderTestFactory = java.HostForDeviceFactory
-	RunBp2BuildTestCase(t, registrationCtxFunc, tc)
-}
-
-func runJavaHostForDeviceTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	runJavaHostForDeviceTestCaseWithRegistrationCtxFunc(t, tc, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("java_library", java.LibraryFactory)
-	})
-}
-
-func TestJavaHostForDevice(t *testing.T) {
-	runJavaHostForDeviceTestCase(t, Bp2buildTestCase{
-		Description: "java_host_for_device test",
-		Blueprint: `java_host_for_device {
-    name: "java-lib-1",
-    libs: ["java-lib-2"],
-    bazel_module: { bp2build_available: true },
-}
-
-java_library {
-    name: "java-lib-2",
-    srcs: ["b.java"],
-    bazel_module: { bp2build_available: true },
-    sdk_version: "current",
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_host_for_device", "java-lib-1", AttrNameToString{
-				"exports": `[":java-lib-2"]`,
-			}),
-			MakeNeverlinkDuplicateTargetWithAttrs("java_library", "java-lib-1", AttrNameToString{
-				"sdk_version": `"none"`,
-			}),
-			MakeBazelTarget("java_library", "java-lib-2", AttrNameToString{
-				"srcs":        `["b.java"]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-2"),
-		},
-	})
-}
diff --git a/bp2build/java_import_conversion_test.go b/bp2build/java_import_conversion_test.go
deleted file mode 100644
index bba2f50..0000000
--- a/bp2build/java_import_conversion_test.go
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"android/soong/android"
-	"android/soong/java"
-
-	"testing"
-)
-
-func runJavaImportTestCaseWithRegistrationCtxFunc(t *testing.T, tc Bp2buildTestCase, registrationCtxFunc func(ctx android.RegistrationContext)) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "java_import"
-	(&tc).ModuleTypeUnderTestFactory = java.ImportFactory
-	RunBp2BuildTestCase(t, registrationCtxFunc, tc)
-}
-
-func runJavaImportTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, registerJavaImportModuleTypes, tc)
-}
-
-func registerJavaImportModuleTypes(ctx android.RegistrationContext) {
-}
-
-func TestJavaImportMinimal(t *testing.T) {
-	runJavaImportTestCase(t, Bp2buildTestCase{
-		Description:                "Java import - simple example",
-		ModuleTypeUnderTest:        "java_import",
-		ModuleTypeUnderTestFactory: java.ImportFactory,
-		Filesystem: map[string]string{
-			"import.jar": "",
-		},
-		Blueprint: `
-java_import {
-        name: "example_import",
-        jars: ["import.jar"],
-        bazel_module: { bp2build_available: true },
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_import", "example_import", AttrNameToString{
-				"jars": `["import.jar"]`,
-			}),
-			MakeBazelTarget("java_library", "example_import-neverlink", AttrNameToString{
-				"exports":     `[":example_import"]`,
-				"neverlink":   `True`,
-				"sdk_version": `"none"`,
-			}),
-		}})
-}
-
-func TestJavaImportArchVariant(t *testing.T) {
-	runJavaImportTestCase(t, Bp2buildTestCase{
-		Description:                "Java import - simple example",
-		ModuleTypeUnderTest:        "java_import",
-		ModuleTypeUnderTestFactory: java.ImportFactory,
-		Filesystem: map[string]string{
-			"import.jar": "",
-		},
-		Blueprint: `
-java_import {
-        name: "example_import",
-		target: {
-			android: {
-				jars: ["android.jar"],
-			},
-			linux_glibc: {
-				jars: ["linux.jar"],
-			},
-		},
-        bazel_module: { bp2build_available: true },
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_import", "example_import", AttrNameToString{
-				"jars": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["android.jar"],
-        "//build/bazel_common_rules/platforms/os:linux_glibc": ["linux.jar"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("java_library", "example_import-neverlink", AttrNameToString{
-				"exports":     `[":example_import"]`,
-				"neverlink":   `True`,
-				"sdk_version": `"none"`,
-			}),
-		}})
-}
-
-func TestJavaImportHost(t *testing.T) {
-	runJavaImportTestCase(t, Bp2buildTestCase{
-		Description:                "Java import host- simple example",
-		ModuleTypeUnderTest:        "java_import_host",
-		ModuleTypeUnderTestFactory: java.ImportFactory,
-		Filesystem: map[string]string{
-			"import.jar": "",
-		},
-		Blueprint: `
-java_import_host {
-        name: "example_import",
-        jars: ["import.jar"],
-        bazel_module: { bp2build_available: true },
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_import", "example_import", AttrNameToString{
-				"jars": `["import.jar"]`,
-			}),
-			MakeBazelTarget("java_library", "example_import-neverlink", AttrNameToString{
-				"exports":     `[":example_import"]`,
-				"neverlink":   `True`,
-				"sdk_version": `"none"`,
-			}),
-		}})
-}
-
-func TestJavaImportSameNameAsJavaLibrary(t *testing.T) {
-	runJavaImportTestCaseWithRegistrationCtxFunc(t, Bp2buildTestCase{
-		Description: "java_import has the same name as other package java_library's",
-		Filesystem: map[string]string{
-			"foo/bar/Android.bp": simpleModule("java_library", "test_lib"),
-			"test.jar":           "",
-		},
-		Blueprint: `java_import {
-    name: "test_lib",
-    jars: ["test.jar"],
-    bazel_module: { bp2build_available: true },
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_import", "test_lib", AttrNameToString{
-				"jars": `["test.jar"]`,
-			}),
-			MakeBazelTarget("java_library", "test_lib-neverlink", AttrNameToString{
-				"exports":     `[":test_lib"]`,
-				"neverlink":   `True`,
-				"sdk_version": `"none"`,
-			}),
-		},
-	}, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("java_library", java.LibraryFactory)
-	})
-}
diff --git a/bp2build/java_library_conversion_test.go b/bp2build/java_library_conversion_test.go
deleted file mode 100644
index 5099b49..0000000
--- a/bp2build/java_library_conversion_test.go
+++ /dev/null
@@ -1,1131 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/java"
-)
-
-func runJavaLibraryTestCaseWithRegistrationCtxFunc(t *testing.T, tc Bp2buildTestCase, registrationCtxFunc func(ctx android.RegistrationContext)) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "java_library"
-	(&tc).ModuleTypeUnderTestFactory = java.LibraryFactory
-	RunBp2BuildTestCase(t, registrationCtxFunc, tc)
-}
-
-func runJavaLibraryTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	runJavaLibraryTestCaseWithRegistrationCtxFunc(t, tc, func(ctx android.RegistrationContext) {})
-}
-
-func TestJavaLibrary(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Description: "java_library with srcs, exclude_srcs and libs",
-		Blueprint: `java_library {
-    name: "java-lib-1",
-    srcs: ["a.java", "b.java"],
-    exclude_srcs: ["b.java"],
-    libs: ["java-lib-2"],
-    sdk_version: "current",
-    bazel_module: { bp2build_available: true },
-}
-
-java_library {
-    name: "java-lib-2",
-    srcs: ["b.java"],
-    sdk_version: "current",
-    bazel_module: { bp2build_available: true },
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"srcs":        `["a.java"]`,
-				"deps":        `[":java-lib-2-neverlink"]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
-			MakeBazelTarget("java_library", "java-lib-2", AttrNameToString{
-				"srcs":        `["b.java"]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-2"),
-		},
-	})
-}
-
-func TestJavaLibraryConvertsStaticLibsToDepsAndExports(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		StubbedBuildDefinitions: []string{"java-lib-2", "java-lib-3"},
-		Blueprint: `java_library {
-    name: "java-lib-1",
-    srcs: ["a.java"],
-    libs: ["java-lib-2"],
-    static_libs: ["java-lib-3"],
-    sdk_version: "current",
-    bazel_module: { bp2build_available: true },
-}
-
-java_library {
-    name: "java-lib-2",
-    srcs: ["b.java"],
-    sdk_version: "current",
-}
-
-java_library {
-    name: "java-lib-3",
-    srcs: ["c.java"],
-    sdk_version: "current",
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"srcs": `["a.java"]`,
-				"deps": `[
-        ":java-lib-2-neverlink",
-        ":java-lib-3",
-    ]`,
-				"exports":     `[":java-lib-3"]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
-		},
-	})
-}
-
-func TestJavaLibraryConvertsStaticLibsToExportsIfNoSrcs(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		StubbedBuildDefinitions: []string{"java-lib-2"},
-		Blueprint: `java_library {
-    name: "java-lib-1",
-    static_libs: ["java-lib-2"],
-    sdk_version: "current",
-    bazel_module: { bp2build_available: true },
-}
-
-java_library {
-    name: "java-lib-2",
-    srcs: ["a.java"],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"exports":     `[":java-lib-2"]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
-		},
-	})
-}
-
-func TestJavaLibraryFailsToConvertNoSdkVersion(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Blueprint: `
-java_library {
-    name: "lib",
-    bazel_module: { bp2build_available: true },
-}
-`,
-		ExpectedBazelTargets: []string{}, // no targets expected because sdk_version is not set
-	})
-}
-
-func TestJavaLibraryPlugins(t *testing.T) {
-	runJavaLibraryTestCaseWithRegistrationCtxFunc(t, Bp2buildTestCase{
-		StubbedBuildDefinitions: []string{"java-plugin-1"},
-		Blueprint: `java_library {
-    name: "java-lib-1",
-    plugins: ["java-plugin-1"],
-    sdk_version: "current",
-    bazel_module: { bp2build_available: true },
-}
-
-java_plugin {
-    name: "java-plugin-1",
-    srcs: ["a.java"],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"plugins":     `[":java-plugin-1"]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
-		},
-	}, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("java_plugin", java.PluginFactory)
-	})
-}
-
-func TestJavaLibraryJavaVersion(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Blueprint: `java_library {
-    name: "java-lib-1",
-    srcs: ["a.java"],
-    java_version: "11",
-    sdk_version: "current",
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"srcs":         `["a.java"]`,
-				"java_version": `"11"`,
-				"sdk_version":  `"current"`,
-			}),
-			MakeNeverlinkDuplicateTargetWithAttrs(
-				"java_library",
-				"java-lib-1",
-				AttrNameToString{
-					"java_version": `"11"`,
-					"sdk_version":  `"current"`,
-				}),
-		},
-	})
-}
-
-func TestJavaLibraryOpenjdk9(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Blueprint: `java_library {
-			name: "java-lib-1",
-		srcs: ["a.java"],
-		exclude_srcs: ["b.java"],
-		javacflags: ["flag"],
-		target: {
-			android: {
-				srcs: ["android.java"],
-			},
-		},
-		openjdk9: {
-			srcs: ["b.java", "foo.java"],
-			javacflags: ["extraflag"],
-		},
-		sdk_version: "current",
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"srcs": `[
-        "a.java",
-        "foo.java",
-    ] + select({
-        "//build/bazel_common_rules/platforms/os:android": ["android.java"],
-        "//conditions:default": [],
-    })`,
-				"sdk_version": `"current"`,
-				"javacopts": `[
-        "flag",
-        "extraflag",
-    ]`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
-		},
-	})
-
-}
-
-func TestJavaLibraryErrorproneEnabledManually(t *testing.T) {
-	runJavaLibraryTestCaseWithRegistrationCtxFunc(t, Bp2buildTestCase{
-		StubbedBuildDefinitions: []string{"plugin2"},
-		Blueprint: `java_library {
-    name: "java-lib-1",
-    srcs: ["a.java"],
-    javacflags: ["-Xsuper-fast"],
-    sdk_version: "current",
-    errorprone: {
-        enabled: true,
-        javacflags: ["-Xep:SpeedLimit:OFF"],
-        extra_check_modules: ["plugin2"],
-    },
-}
-java_plugin {
-    name: "plugin2",
-    srcs: ["a.java"],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"javacopts": `[
-        "-Xsuper-fast",
-        "-Xep:SpeedLimit:OFF",
-    ]`,
-				"plugins":                 `[":plugin2"]`,
-				"srcs":                    `["a.java"]`,
-				"errorprone_force_enable": `True`,
-				"sdk_version":             `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
-		},
-	}, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("java_plugin", java.PluginFactory)
-	})
-}
-
-func TestJavaLibraryErrorproneJavacflagsErrorproneDisabledByDefault(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Blueprint: `java_library {
-    name: "java-lib-1",
-    srcs: ["a.java"],
-    sdk_version: "current",
-    javacflags: ["-Xsuper-fast"],
-    errorprone: {
-        javacflags: ["-Xep:SpeedLimit:OFF"],
-    },
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"javacopts":   `["-Xsuper-fast"]`,
-				"srcs":        `["a.java"]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
-		},
-	})
-}
-
-func TestJavaLibraryErrorproneDisabledManually(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Blueprint: `java_library {
-    name: "java-lib-1",
-    srcs: ["a.java"],
-    javacflags: ["-Xsuper-fast"],
-    sdk_version: "current",
-    errorprone: {
-    enabled: false,
-    },
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"javacopts": `[
-        "-Xsuper-fast",
-        "-XepDisableAllChecks",
-    ]`,
-				"srcs":        `["a.java"]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
-		},
-	})
-}
-
-func TestJavaLibraryLogTags(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "Java library - logtags creates separate dependency",
-		ModuleTypeUnderTest:        "java_library",
-		ModuleTypeUnderTestFactory: java.LibraryFactory,
-		Blueprint: `java_library {
-	name: "example_lib",
-	srcs: [
-		"a.java",
-		"b.java",
-		"a.logtag",
-		"b.logtag",
-	],
-	sdk_version: "current",
-	bazel_module: { bp2build_available: true },
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("event_log_tags", "example_lib_logtags", AttrNameToString{
-				"srcs": `[
-        "a.logtag",
-        "b.logtag",
-    ]`,
-			}),
-			MakeBazelTarget("java_library", "example_lib", AttrNameToString{
-				"srcs": `[
-        "a.java",
-        "b.java",
-        ":example_lib_logtags",
-    ]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "example_lib"),
-		}})
-}
-
-func TestJavaLibraryResources(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Dir: "adir",
-		Filesystem: map[string]string{
-			"adir/res/a.res":      "",
-			"adir/res/b.res":      "",
-			"adir/res/dir1/b.res": "",
-			"adir/Android.bp": `java_library {
-	name: "java-lib-1",
-	java_resources: ["res/a.res", "res/b.res"],
-	sdk_version: "current",
-	bazel_module: { bp2build_available: true },
-}`,
-		},
-		Blueprint: "",
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"resources": `[
-        "res/a.res",
-        "res/b.res",
-    ]`,
-				"resource_strip_prefix": `"adir"`,
-				"sdk_version":           `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
-		},
-	})
-}
-
-func TestJavaLibraryResourceDirs(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Filesystem: map[string]string{
-			"res/a.res":      "",
-			"res/b.res":      "",
-			"res/dir1/b.res": "",
-		},
-		Blueprint: `java_library {
-	name: "java-lib-1",
-	java_resource_dirs: ["res"],
-	sdk_version: "current",
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"resource_strip_prefix": `"res"`,
-				"resources": `[
-        "res/a.res",
-        "res/b.res",
-        "res/dir1/b.res",
-    ]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
-		},
-	})
-}
-
-func TestJavaLibraryResourcesExcludeDir(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Filesystem: map[string]string{
-			"res/a.res":         "",
-			"res/exclude/b.res": "",
-		},
-		Blueprint: `java_library {
-	name: "java-lib-1",
-	java_resource_dirs: ["res"],
-	sdk_version: "current",
-	exclude_java_resource_dirs: ["res/exclude"],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"resource_strip_prefix": `"res"`,
-				"resources":             `["res/a.res"]`,
-				"sdk_version":           `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
-		},
-	})
-}
-
-func TestJavaLibraryResourcesExcludeFile(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Filesystem: map[string]string{
-			"res/a.res":            "",
-			"res/dir1/b.res":       "",
-			"res/dir1/exclude.res": "",
-		},
-		Blueprint: `java_library {
-	name: "java-lib-1",
-	java_resource_dirs: ["res"],
-	sdk_version: "current",
-	exclude_java_resources: ["res/dir1/exclude.res"],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"resource_strip_prefix": `"res"`,
-				"resources": `[
-        "res/a.res",
-        "res/dir1/b.res",
-    ]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
-		},
-	})
-}
-
-func TestJavaLibraryResourcesWithMultipleDirs(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Filesystem: map[string]string{
-			"res/a.res":  "",
-			"res1/b.res": "",
-		},
-		Blueprint: `java_library {
-	name: "java-lib-1",
-	srcs: ["foo.java"],
-	java_resource_dirs: ["res", "res1"],
-	sdk_version: "current",
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_resources", "java-lib-1_resource_dir_res1", AttrNameToString{
-				"resource_strip_prefix": `"res1"`,
-				"resources":             `["res1/b.res"]`,
-			}),
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"deps":                  `["java-lib-1_resource_dir_res1"]`,
-				"resources":             `["res/a.res"]`,
-				"resource_strip_prefix": `"res"`,
-				"srcs":                  `["foo.java"]`,
-				"sdk_version":           `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
-		},
-	})
-}
-
-func TestJavaLibraryJavaResourcesAndResourceDirs(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Filesystem: map[string]string{
-			"resdir/a.res": "",
-		},
-		Blueprint: `java_library {
-		name: "java-lib-1",
-		java_resources: ["res1", "res2"],
-		java_resource_dirs: ["resdir"],
-		sdk_version: "current",
-		srcs: ["foo.java"],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_resources", "java-lib-1_resource_dir_resdir", AttrNameToString{
-				"resource_strip_prefix": `"resdir"`,
-				"resources":             `["resdir/a.res"]`,
-			}),
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"deps":                  `["java-lib-1_resource_dir_resdir"]`,
-				"resource_strip_prefix": `"."`,
-				"resources": `[
-        "res1",
-        "res2",
-    ]`,
-				"srcs":        `["foo.java"]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
-		},
-	})
-}
-
-func TestJavaLibraryAidl(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Description:                "Java library - aidl creates separate dependency",
-		ModuleTypeUnderTest:        "java_library",
-		ModuleTypeUnderTestFactory: java.LibraryFactory,
-		Blueprint: `java_library {
-	name: "example_lib",
-	srcs: [
-		"a.java",
-		"b.java",
-		"a.aidl",
-		"b.aidl",
-	],
-	bazel_module: { bp2build_available: true },
-	sdk_version: "current",
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("aidl_library", "example_lib_aidl_library", AttrNameToString{
-				"srcs": `[
-        "a.aidl",
-        "b.aidl",
-    ]`,
-			}),
-			MakeBazelTarget("java_aidl_library", "example_lib_java_aidl_library", AttrNameToString{
-				"deps": `[":example_lib_aidl_library"]`,
-			}),
-			MakeBazelTarget("java_library", "example_lib", AttrNameToString{
-				"deps":    `[":example_lib_java_aidl_library"]`,
-				"exports": `[":example_lib_java_aidl_library"]`,
-				"srcs": `[
-        "a.java",
-        "b.java",
-    ]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "example_lib"),
-		}})
-}
-
-func TestJavaLibraryAidlSrcsNoFileGroup(t *testing.T) {
-	runJavaLibraryTestCaseWithRegistrationCtxFunc(t, Bp2buildTestCase{
-		Description:                "Java library - aidl filegroup is parsed",
-		ModuleTypeUnderTest:        "java_library",
-		ModuleTypeUnderTestFactory: java.LibraryFactory,
-		Blueprint: `
-java_library {
-	name: "example_lib",
-	srcs: [
-		"a.java",
-		"b.aidl",
-	],
-	sdk_version: "current",
-	bazel_module: { bp2build_available: true },
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("aidl_library", "example_lib_aidl_library", AttrNameToString{
-				"srcs": `["b.aidl"]`,
-			}),
-			MakeBazelTarget("java_aidl_library", "example_lib_java_aidl_library", AttrNameToString{
-				"deps": `[":example_lib_aidl_library"]`,
-			}),
-			MakeBazelTarget("java_library", "example_lib", AttrNameToString{
-				"deps":        `[":example_lib_java_aidl_library"]`,
-				"exports":     `[":example_lib_java_aidl_library"]`,
-				"srcs":        `["a.java"]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "example_lib"),
-		},
-	}, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-	})
-}
-
-func TestJavaLibraryAidlFilegroup(t *testing.T) {
-	runJavaLibraryTestCaseWithRegistrationCtxFunc(t, Bp2buildTestCase{
-		Description:                "Java library - aidl filegroup is parsed",
-		ModuleTypeUnderTest:        "java_library",
-		ModuleTypeUnderTestFactory: java.LibraryFactory,
-		Blueprint: `
-filegroup {
-	name: "random_other_files",
-	srcs: [
-		"a.java",
-		"b.java",
-	],
-}
-filegroup {
-	name: "aidl_files",
-	srcs: [
-		"a.aidl",
-		"b.aidl",
-	],
-}
-filegroup {
-	name: "aidls_files",
-	srcs: [
-		"a.aidl",
-		"b.aidl",
-	],
-}
-java_library {
-	name: "example_lib",
-	srcs: [
-		"a.java",
-		"b.java",
-		":aidl_files",
-		":aidls_files",
-		":random_other_files",
-	],
-	sdk_version: "current",
-	bazel_module: { bp2build_available: true },
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTargetNoRestrictions("aidl_library", "aidl_files", AttrNameToString{
-				"srcs": `[
-        "a.aidl",
-        "b.aidl",
-    ]`,
-				"tags": `["apex_available=//apex_available:anyapex"]`,
-			}),
-			MakeBazelTargetNoRestrictions("aidl_library", "aidls_files", AttrNameToString{
-				"srcs": `[
-        "a.aidl",
-        "b.aidl",
-    ]`,
-				"tags": `["apex_available=//apex_available:anyapex"]`,
-			}),
-			MakeBazelTarget("java_aidl_library", "example_lib_java_aidl_library", AttrNameToString{
-				"deps": `[
-        ":aidl_files",
-        ":aidls_files",
-    ]`,
-			}),
-			MakeBazelTarget("java_library", "example_lib", AttrNameToString{
-				"deps":    `[":example_lib_java_aidl_library"]`,
-				"exports": `[":example_lib_java_aidl_library"]`,
-				"srcs": `[
-        "a.java",
-        "b.java",
-        ":random_other_files",
-    ]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "example_lib"),
-			MakeBazelTargetNoRestrictions("filegroup", "random_other_files", AttrNameToString{
-				"srcs": `[
-        "a.java",
-        "b.java",
-    ]`,
-			}),
-		},
-	}, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-	})
-}
-
-func TestJavaLibraryAidlNonAdjacentAidlFilegroup(t *testing.T) {
-	runJavaLibraryTestCaseWithRegistrationCtxFunc(t, Bp2buildTestCase{
-		Description:                "java_library with non adjacent aidl filegroup",
-		ModuleTypeUnderTest:        "java_library",
-		ModuleTypeUnderTestFactory: java.LibraryFactory,
-		StubbedBuildDefinitions:    []string{"//path/to/A:A_aidl"},
-		Filesystem: map[string]string{
-			"path/to/A/Android.bp": `
-filegroup {
-  name: "A_aidl",
-  srcs: ["aidl/A.aidl"],
-  path: "aidl",
-}`,
-		},
-		Blueprint: `
-java_library {
-  name: "foo",
-  srcs: [
-    ":A_aidl",
-  ],
-  sdk_version: "current",
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_aidl_library", "foo_java_aidl_library", AttrNameToString{
-				"deps": `["//path/to/A:A_aidl"]`,
-			}),
-			MakeBazelTarget("java_library", "foo", AttrNameToString{
-				"exports":     `[":foo_java_aidl_library"]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "foo"),
-		},
-	}, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-	})
-}
-
-func TestConvertArmNeonVariant(t *testing.T) {
-	t.Helper()
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, Bp2buildTestCase{
-		Description:                "Android Library - simple arch feature",
-		ModuleTypeUnderTest:        "android_library",
-		ModuleTypeUnderTestFactory: java.AndroidLibraryFactory,
-		Blueprint: simpleModule("android_library", "static_lib_dep") + `
-android_library {
-  name: "TestLib",
-  manifest: "manifest/AndroidManifest.xml",
-  srcs: ["lib.java"],
-  sdk_version: "current",
-  arch: {
-    arm: {
-      neon: {
-        srcs: ["arm_neon.java"],
-      },
-    },
-  },
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget(
-				"android_library",
-				"TestLib",
-				AttrNameToString{
-					"srcs": `["lib.java"] + select({
-        "//build/bazel/platforms/arch/variants:arm-neon": ["arm_neon.java"],
-        "//conditions:default": [],
-    })`,
-					"manifest":       `"manifest/AndroidManifest.xml"`,
-					"resource_files": `[]`,
-					"sdk_version":    `"current"`, // use as default
-				}),
-			MakeNeverlinkDuplicateTarget("android_library", "TestLib"),
-		}})
-}
-
-func TestConvertMultipleArchFeatures(t *testing.T) {
-	t.Helper()
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, Bp2buildTestCase{
-		Description:                "Android Library - multiple arch features",
-		ModuleTypeUnderTest:        "android_library",
-		ModuleTypeUnderTestFactory: java.AndroidLibraryFactory,
-		Blueprint: simpleModule("android_library", "static_lib_dep") + `
-android_library {
-  name: "TestLib",
-  manifest: "manifest/AndroidManifest.xml",
-  srcs: ["lib.java"],
-  sdk_version: "current",
-  arch: {
-    x86: {
-      ssse3: {
-        srcs: ["ssse3.java"],
-      },
-      sse4_1: {
-        srcs: ["sse4_1.java"],
-      },
-    },
-  },
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget(
-				"android_library",
-				"TestLib",
-				AttrNameToString{
-					"srcs": `["lib.java"] + select({
-        "//build/bazel/platforms/arch/variants:x86-sse4_1": ["sse4_1.java"],
-        "//build/bazel/platforms/arch/variants:x86-sse4_1-ssse3": [
-            "sse4_1.java",
-            "ssse3.java",
-        ],
-        "//build/bazel/platforms/arch/variants:x86-ssse3": ["ssse3.java"],
-        "//conditions:default": [],
-    })`,
-					"manifest":       `"manifest/AndroidManifest.xml"`,
-					"resource_files": `[]`,
-					"sdk_version":    `"current"`,
-				}),
-			MakeNeverlinkDuplicateTarget("android_library", "TestLib"),
-		}})
-}
-
-func TestConvertExcludeSrcsArchFeature(t *testing.T) {
-	t.Helper()
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, Bp2buildTestCase{
-		Description:                "Android Library - exclude_srcs with arch feature",
-		ModuleTypeUnderTest:        "android_library",
-		ModuleTypeUnderTestFactory: java.AndroidLibraryFactory,
-		Blueprint: simpleModule("android_library", "static_lib_dep") + `
-android_library {
-  name: "TestLib",
-  manifest: "manifest/AndroidManifest.xml",
-  srcs: ["lib.java"],
-  arch: {
-    arm: {
-      srcs: ["arm_non_neon.java"],
-      neon: {
-        exclude_srcs: ["arm_non_neon.java"],
-      },
-    },
-  },
-  sdk_version: "current",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget(
-				"android_library",
-				"TestLib",
-				AttrNameToString{
-					"srcs": `["lib.java"] + select({
-        "//build/bazel/platforms/arch/variants:arm-neon": [],
-        "//build/bazel_common_rules/platforms/arch:arm": ["arm_non_neon.java"],
-        "//conditions:default": [],
-    })`,
-					"manifest":       `"manifest/AndroidManifest.xml"`,
-					"resource_files": `[]`,
-					"sdk_version":    `"current"`, // use as default
-				}),
-			MakeNeverlinkDuplicateTarget("android_library", "TestLib"),
-		}})
-}
-
-func TestJavaLibraryKotlinSrcs(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Description: "java_library with kotlin srcs",
-		Blueprint: `java_library {
-    name: "java-lib-1",
-    srcs: ["a.java", "b.java", "c.kt"],
-    bazel_module: { bp2build_available: true },
-    sdk_version: "current",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("kt_jvm_library", "java-lib-1", AttrNameToString{
-				"srcs": `[
-        "a.java",
-        "b.java",
-        "c.kt",
-    ]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("kt_jvm_library", "java-lib-1"),
-		},
-	})
-}
-
-func TestJavaLibraryKotlincflags(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Description: "java_library with kotlincfalgs",
-		Blueprint: `java_library {
-    name: "java-lib-1",
-    srcs: [ "a.kt"],
-    kotlincflags: ["-flag1", "-flag2"],
-    bazel_module: { bp2build_available: true },
-    sdk_version: "current",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("kt_jvm_library", "java-lib-1", AttrNameToString{
-				"srcs": `["a.kt"]`,
-				"kotlincflags": `[
-        "-flag1",
-        "-flag2",
-    ]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("kt_jvm_library", "java-lib-1"),
-		},
-	})
-}
-
-func TestJavaLibraryKotlinCommonSrcs(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Description: "java_library with kotlin common_srcs",
-		Blueprint: `java_library {
-    name: "java-lib-1",
-    srcs: ["a.java", "b.java"],
-    common_srcs: ["c.kt"],
-    bazel_module: { bp2build_available: true },
-    sdk_version: "current",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("kt_jvm_library", "java-lib-1", AttrNameToString{
-				"srcs": `[
-        "a.java",
-        "b.java",
-    ]`,
-				"common_srcs": `["c.kt"]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("kt_jvm_library", "java-lib-1"),
-		},
-	})
-}
-
-func TestJavaLibraryArchVariantDeps(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Description:             "java_library with arch variant libs",
-		StubbedBuildDefinitions: []string{"java-lib-2", "java-lib-3", "java-lib-4"},
-		Blueprint: `java_library {
-    name: "java-lib-1",
-    srcs: ["a.java"],
-    libs: ["java-lib-2"],
-    sdk_version: "current",
-    target: {
-        android: {
-            libs: ["java-lib-3"],
-            static_libs: ["java-lib-4"],
-        },
-    },
-    bazel_module: { bp2build_available: true },
-}
-
-  java_library{
-    name: "java-lib-2",
-}
-
-  java_library{
-    name: "java-lib-3",
-}
-
-  java_library{
-    name: "java-lib-4",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"srcs": `["a.java"]`,
-				"exports": `select({
-        "//build/bazel_common_rules/platforms/os:android": [":java-lib-4"],
-        "//conditions:default": [],
-    })`,
-				"deps": `[":java-lib-2-neverlink"] + select({
-        "//build/bazel_common_rules/platforms/os:android": [
-            ":java-lib-3-neverlink",
-            ":java-lib-4",
-        ],
-        "//conditions:default": [],
-    })`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
-		},
-	})
-}
-
-func TestJavaLibraryArchVariantSrcsWithExcludes(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Description: "java_library with arch variant libs",
-		Blueprint: `java_library {
-    name: "java-lib-1",
-    srcs: ["a.java", "b.java"],
-    sdk_version: "current",
-    target: {
-        android: {
-            exclude_srcs: ["a.java"],
-        },
-    },
-    bazel_module: { bp2build_available: true },
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"srcs": `["b.java"] + select({
-        "//build/bazel_common_rules/platforms/os:android": [],
-        "//conditions:default": ["a.java"],
-    })`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
-		},
-	})
-}
-
-func TestJavaLibraryJavaResourcesSingleFilegroup(t *testing.T) {
-	runJavaLibraryTestCaseWithRegistrationCtxFunc(t, Bp2buildTestCase{
-		Filesystem: map[string]string{
-			"res/a.res":      "",
-			"res/b.res":      "",
-			"res/dir1/b.res": "",
-		},
-		Description: "java_library",
-		Blueprint: `java_library {
-    name: "java-lib-1",
-    srcs: ["a.java"],
-    sdk_version: "current",
-    java_resources: [":filegroup1"],
-    bazel_module: { bp2build_available: true },
-}
-
-filegroup {
-    name: "filegroup1",
-    path: "foo",
-    srcs: ["foo/a", "foo/b"],
-}
-
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"srcs":                  `["a.java"]`,
-				"resources":             `[":filegroup1"]`,
-				"resource_strip_prefix": `"foo"`,
-				"sdk_version":           `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
-			MakeBazelTargetNoRestrictions("filegroup", "filegroup1", AttrNameToString{
-				"srcs": `[
-        "foo/a",
-        "foo/b",
-    ]`}),
-		},
-	}, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-	})
-}
-
-func TestJavaLibraryJavaResourcesMultipleFilegroup(t *testing.T) {
-	runJavaLibraryTestCaseWithRegistrationCtxFunc(t, Bp2buildTestCase{
-		Filesystem: map[string]string{
-			"a.res": "",
-		},
-		Description: "with java_resources that has multiple filegroups",
-		Blueprint: `java_library {
-    name: "java-lib-1",
-    srcs: ["a.java"],
-    java_resources: ["a.res", ":filegroup1", ":filegroup2"],
-    sdk_version: "current",
-    bazel_module: { bp2build_available: true },
-}
-
-filegroup {
-    name: "filegroup1",
-    path: "foo",
-    srcs: ["foo/a"],
-}
-
-filegroup {
-    name: "filegroup2",
-    path: "bar",
-    srcs: ["bar/a"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_resources", "java-lib-1_filegroup_resources_filegroup1", AttrNameToString{
-				"resource_strip_prefix": `"foo"`,
-				"resources":             `[":filegroup1"]`,
-			}),
-			MakeBazelTarget("java_resources", "java-lib-1_filegroup_resources_filegroup2", AttrNameToString{
-				"resource_strip_prefix": `"bar"`,
-				"resources":             `[":filegroup2"]`,
-			}),
-			MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
-				"srcs":                  `["a.java"]`,
-				"resources":             `["a.res"]`,
-				"resource_strip_prefix": `"."`,
-				"deps": `[
-        "java-lib-1_filegroup_resources_filegroup1",
-        "java-lib-1_filegroup_resources_filegroup2",
-    ]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
-			MakeBazelTargetNoRestrictions("filegroup", "filegroup1", AttrNameToString{
-				"srcs": `["foo/a"]`}),
-			MakeBazelTargetNoRestrictions("filegroup", "filegroup2", AttrNameToString{
-				"srcs": `["bar/a"]`}),
-		},
-	}, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-	})
-}
-
-func TestJavaLibrarySameNameAsPrebuilt(t *testing.T) {
-	runJavaLibraryTestCaseWithRegistrationCtxFunc(t, Bp2buildTestCase{
-		Description: "java_library and prebuilt module have the same name",
-		Filesystem: map[string]string{
-			"foo/bar/Android.bp": simpleModule("java_import", "test_lib"),
-		},
-		Blueprint: `java_library {
-    name: "test_lib",
-    srcs: ["a.java"],
-    sdk_version: "current",
-    bazel_module: { bp2build_available: true },
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "test_lib", AttrNameToString{
-				"srcs":        `["a.java"]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "test_lib"),
-		},
-	}, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("java_import", java.ImportFactory)
-	})
-}
-
-func TestJavaLibrarySharding(t *testing.T) {
-	runJavaLibraryTestCase(t, Bp2buildTestCase{
-		Description: "java library with sharded compilation",
-		Blueprint: `java_library {
-			name: "lib1",
-			srcs: ["a.java"],
-			javac_shard_size: 3,
-			sdk_version: "current",
-		}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "lib1", AttrNameToString{
-				"srcs":             `["a.java"]`,
-				"sdk_version":      `"current"`,
-				"javac_shard_size": "3",
-			}),
-			MakeNeverlinkDuplicateTarget("java_library", "lib1"),
-		},
-	})
-}
diff --git a/bp2build/java_library_host_conversion_test.go b/bp2build/java_library_host_conversion_test.go
deleted file mode 100644
index d0fdec6..0000000
--- a/bp2build/java_library_host_conversion_test.go
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/java"
-)
-
-func runJavaLibraryHostTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "java_library_host"
-	(&tc).ModuleTypeUnderTestFactory = java.LibraryHostFactory
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, tc)
-}
-
-func TestJavaLibraryHost(t *testing.T) {
-	runJavaLibraryHostTestCase(t, Bp2buildTestCase{
-		Description: "java_library_host with srcs, exclude_srcs and libs",
-		Blueprint: `java_library_host {
-    name: "java-lib-host-1",
-    srcs: ["a.java", "b.java"],
-    exclude_srcs: ["b.java"],
-    libs: ["java-lib-host-2"],
-    bazel_module: { bp2build_available: true },
-}
-
-java_library_host {
-    name: "java-lib-host-2",
-    srcs: ["c.java"],
-    bazel_module: { bp2build_available: true },
-    java_version: "9",
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java-lib-host-1", AttrNameToString{
-				"srcs": `["a.java"]`,
-				"deps": `[":java-lib-host-2-neverlink"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("java_library", "java-lib-host-1-neverlink", AttrNameToString{
-				"exports":   `[":java-lib-host-1"]`,
-				"neverlink": `True`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("java_library", "java-lib-host-2", AttrNameToString{
-				"java_version": `"9"`,
-				"srcs":         `["c.java"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("java_library", "java-lib-host-2-neverlink", AttrNameToString{
-				"exports":   `[":java-lib-host-2"]`,
-				"neverlink": `True`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-				"java_version": `"9"`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/java_plugin_conversion_test.go b/bp2build/java_plugin_conversion_test.go
deleted file mode 100644
index e63cc55..0000000
--- a/bp2build/java_plugin_conversion_test.go
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/java"
-)
-
-func runJavaPluginTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "java_plugin"
-	(&tc).ModuleTypeUnderTestFactory = java.PluginFactory
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("java_library", java.LibraryFactory)
-	}, tc)
-}
-
-func TestJavaPlugin(t *testing.T) {
-	runJavaPluginTestCase(t, Bp2buildTestCase{
-		Description:             "java_plugin with srcs, libs, static_libs",
-		StubbedBuildDefinitions: []string{"java-lib-1", "java-lib-2"},
-		Blueprint: `java_plugin {
-    name: "java-plug-1",
-    srcs: ["a.java", "b.java"],
-    libs: ["java-lib-1"],
-    static_libs: ["java-lib-2"],
-    bazel_module: { bp2build_available: true },
-    java_version: "7",
-}
-
-java_library {
-    name: "java-lib-1",
-    srcs: ["b.java"],
-}
-
-java_library {
-    name: "java-lib-2",
-    srcs: ["c.java"],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_plugin", "java-plug-1", AttrNameToString{
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-				"deps": `[
-        ":java-lib-1-neverlink",
-        ":java-lib-2",
-    ]`,
-				"srcs": `[
-        "a.java",
-        "b.java",
-    ]`,
-				"java_version": `"7"`,
-			}),
-		},
-	})
-}
-
-func TestJavaPluginNoSrcs(t *testing.T) {
-	runJavaPluginTestCase(t, Bp2buildTestCase{
-		Description:             "java_plugin without srcs converts (static) libs to deps",
-		StubbedBuildDefinitions: []string{"java-lib-1", "java-lib-2"},
-		Blueprint: `java_plugin {
-    name: "java-plug-1",
-    libs: ["java-lib-1"],
-    static_libs: ["java-lib-2"],
-    bazel_module: { bp2build_available: true },
-}
-
-java_library {
-    name: "java-lib-1",
-    srcs: ["b.java"],
-}
-
-java_library {
-    name: "java-lib-2",
-    srcs: ["c.java"],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_plugin", "java-plug-1", AttrNameToString{
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-				"deps": `[
-        ":java-lib-1-neverlink",
-        ":java-lib-2",
-    ]`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/java_proto_conversion_test.go b/bp2build/java_proto_conversion_test.go
deleted file mode 100644
index cd89978..0000000
--- a/bp2build/java_proto_conversion_test.go
+++ /dev/null
@@ -1,238 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"fmt"
-	"testing"
-
-	"android/soong/android"
-	"android/soong/java"
-)
-
-func runJavaProtoTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "java_library_static"
-	(&tc).ModuleTypeUnderTestFactory = java.LibraryFactory
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, tc)
-}
-
-func TestJavaProto(t *testing.T) {
-	testCases := []struct {
-		protoType                string
-		javaLibraryType          string
-		javaLibraryNameExtension string
-	}{
-		{
-			protoType:                "nano",
-			javaLibraryType:          "java_nano_proto_library",
-			javaLibraryNameExtension: "java_proto_nano",
-		},
-		{
-			protoType:                "micro",
-			javaLibraryType:          "java_micro_proto_library",
-			javaLibraryNameExtension: "java_proto_micro",
-		},
-		{
-			protoType:                "lite",
-			javaLibraryType:          "java_lite_proto_library",
-			javaLibraryNameExtension: "java_proto_lite",
-		},
-		{
-			protoType:                "stream",
-			javaLibraryType:          "java_stream_proto_library",
-			javaLibraryNameExtension: "java_proto_stream",
-		},
-		{
-			protoType:                "full",
-			javaLibraryType:          "java_proto_library",
-			javaLibraryNameExtension: "java_proto",
-		},
-	}
-
-	bp := `java_library_static {
-    name: "java-protos",
-    proto: {
-        type: "%s",
-    },
-    srcs: ["a.proto"],
-    sdk_version: "current",
-}`
-
-	protoLibrary := MakeBazelTarget("proto_library", "java-protos_proto", AttrNameToString{
-		"srcs": `["a.proto"]`,
-	})
-
-	for _, tc := range testCases {
-		javaLibraryName := fmt.Sprintf("java-protos_%s", tc.javaLibraryNameExtension)
-
-		runJavaProtoTestCase(t, Bp2buildTestCase{
-			Description: fmt.Sprintf("java_proto %s", tc.protoType),
-			Blueprint:   fmt.Sprintf(bp, tc.protoType),
-			ExpectedBazelTargets: []string{
-				protoLibrary,
-				MakeBazelTarget(
-					tc.javaLibraryType,
-					javaLibraryName,
-					AttrNameToString{
-						"deps":        `[":java-protos_proto"]`,
-						"sdk_version": `"current"`,
-					}),
-				MakeBazelTarget("java_library", "java-protos", AttrNameToString{
-					"exports":     fmt.Sprintf(`[":%s"]`, javaLibraryName),
-					"sdk_version": `"current"`,
-				}),
-				MakeNeverlinkDuplicateTarget("java_library", "java-protos"),
-			},
-		})
-	}
-}
-
-func TestJavaProtoDefault(t *testing.T) {
-	runJavaProtoTestCase(t, Bp2buildTestCase{
-		Description: "java_library proto default",
-		Blueprint: `java_library_static {
-    name: "java-protos",
-    srcs: ["a.proto"],
-    java_version: "7",
-    sdk_version: "current",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("proto_library", "java-protos_proto", AttrNameToString{
-				"srcs": `["a.proto"]`,
-			}),
-			MakeBazelTarget(
-				"java_lite_proto_library",
-				"java-protos_java_proto_lite",
-				AttrNameToString{
-					"deps":         `[":java-protos_proto"]`,
-					"java_version": `"7"`,
-					"sdk_version":  `"current"`,
-				}),
-			MakeBazelTarget("java_library", "java-protos", AttrNameToString{
-				"exports":      `[":java-protos_java_proto_lite"]`,
-				"java_version": `"7"`,
-				"sdk_version":  `"current"`,
-			}),
-			MakeNeverlinkDuplicateTargetWithAttrs(
-				"java_library",
-				"java-protos",
-				AttrNameToString{
-					"java_version": `"7"`,
-					"sdk_version":  `"current"`,
-				}),
-		},
-	})
-}
-
-func TestJavaLibsAndOnlyProtoSrcs(t *testing.T) {
-	runJavaProtoTestCase(t, Bp2buildTestCase{
-		Description:             "java_library that has only proto srcs",
-		StubbedBuildDefinitions: []string{"java-lib-1", "java-lib-2"},
-		Blueprint: `java_library_static {
-    name: "java-protos",
-    srcs: ["a.proto"],
-    libs: ["java-lib-1"],
-    static_libs: ["java-lib-2"],
-    java_version: "7",
-    sdk_version: "current",
-}
-
-java_library_static {
-    name: "java-lib-1",
-}
-
-java_library_static {
-    name: "java-lib-2",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("proto_library", "java-protos_proto", AttrNameToString{
-				"srcs": `["a.proto"]`,
-			}),
-			MakeBazelTarget(
-				"java_lite_proto_library",
-				"java-protos_java_proto_lite",
-				AttrNameToString{
-					"deps": `[":java-protos_proto"]`,
-					"additional_proto_deps": `[
-        ":java-lib-1-neverlink",
-        ":java-lib-2",
-    ]`,
-					"java_version": `"7"`,
-					"sdk_version":  `"current"`,
-				}),
-			MakeBazelTarget("java_library", "java-protos", AttrNameToString{
-				"exports": `[
-        ":java-lib-2",
-        ":java-protos_java_proto_lite",
-    ]`,
-				"java_version": `"7"`,
-				"sdk_version":  `"current"`,
-			}),
-			MakeNeverlinkDuplicateTargetWithAttrs(
-				"java_library",
-				"java-protos",
-				AttrNameToString{
-					"java_version": `"7"`,
-					"sdk_version":  `"current"`,
-				}),
-		},
-	})
-}
-
-func TestJavaProtoPlugin(t *testing.T) {
-	runJavaProtoTestCase(t, Bp2buildTestCase{
-		Description:             "java_library proto plugin",
-		StubbedBuildDefinitions: []string{"protoc-gen-test-plugin"},
-		Blueprint: `java_library_static {
-    name: "java-protos",
-    srcs: ["a.proto"],
-    proto: {
-        plugin: "test-plugin",
-    },
-    sdk_version: "current",
-}
-
-java_library_static {
-    name: "protoc-gen-test-plugin",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("proto_library", "java-protos_proto", AttrNameToString{
-				"srcs": `["a.proto"]`,
-			}),
-			MakeBazelTarget(
-				"java_lite_proto_library",
-				"java-protos_java_proto_lite",
-				AttrNameToString{
-					"deps":        `[":java-protos_proto"]`,
-					"plugin":      `":protoc-gen-test-plugin"`,
-					"sdk_version": `"current"`,
-				}),
-			MakeBazelTarget("java_library", "java-protos", AttrNameToString{
-				"exports":     `[":java-protos_java_proto_lite"]`,
-				"sdk_version": `"current"`,
-			}),
-			MakeNeverlinkDuplicateTargetWithAttrs(
-				"java_library",
-				"java-protos",
-				AttrNameToString{
-					"sdk_version": `"current"`,
-				}),
-		},
-	})
-}
diff --git a/bp2build/java_sdk_library_conversion_test.go b/bp2build/java_sdk_library_conversion_test.go
deleted file mode 100644
index 9ce7446..0000000
--- a/bp2build/java_sdk_library_conversion_test.go
+++ /dev/null
@@ -1,148 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/java"
-)
-
-func runJavaSdkLibraryTestCaseWithRegistrationCtxFunc(t *testing.T, tc Bp2buildTestCase, registrationCtxFunc func(ctx android.RegistrationContext)) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "java_sdk_library"
-	(&tc).ModuleTypeUnderTestFactory = java.SdkLibraryFactory
-	RunBp2BuildTestCase(t, registrationCtxFunc, tc)
-}
-
-func runJavaSdkLibraryTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	runJavaSdkLibraryTestCaseWithRegistrationCtxFunc(t, tc, func(ctx android.RegistrationContext) {})
-}
-
-func TestJavaSdkLibraryApiSurfaceGeneral(t *testing.T) {
-	runJavaSdkLibraryTestCase(t, Bp2buildTestCase{
-		Description: "limited java_sdk_library for api surfaces, general conversion",
-		Filesystem: map[string]string{
-			"build/soong/scripts/gen-java-current-api-files.sh": "",
-			"api/current.txt":               "",
-			"api/system-current.txt":        "",
-			"api/test-current.txt":          "",
-			"api/module-lib-current.txt":    "",
-			"api/system-server-current.txt": "",
-			"api/removed.txt":               "",
-			"api/system-removed.txt":        "",
-			"api/test-removed.txt":          "",
-			"api/module-lib-removed.txt":    "",
-			"api/system-server-removed.txt": "",
-		},
-		Blueprint: `java_sdk_library {
-    name: "java-sdk-lib",
-    srcs: ["a.java"],
-    public: {enabled: true},
-    system: {enabled: true},
-    test: {enabled: true},
-    module_lib: {enabled: true},
-    system_server: {enabled: true},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_sdk_library", "java-sdk-lib", AttrNameToString{
-				"public":        `"api/current.txt"`,
-				"system":        `"api/system-current.txt"`,
-				"test":          `"api/test-current.txt"`,
-				"module_lib":    `"api/module-lib-current.txt"`,
-				"system_server": `"api/system-server-current.txt"`,
-			}),
-		},
-	})
-}
-
-func TestJavaSdkLibraryApiSurfacePublicDefault(t *testing.T) {
-	runJavaSdkLibraryTestCase(t, Bp2buildTestCase{
-		Description: "limited java_sdk_library for api surfaces, public prop uses default value",
-		Filesystem: map[string]string{
-			"build/soong/scripts/gen-java-current-api-files.sh": "",
-			"api/current.txt":               "",
-			"api/system-current.txt":        "",
-			"api/test-current.txt":          "",
-			"api/module-lib-current.txt":    "",
-			"api/system-server-current.txt": "",
-			"api/removed.txt":               "",
-			"api/system-removed.txt":        "",
-			"api/test-removed.txt":          "",
-			"api/module-lib-removed.txt":    "",
-			"api/system-server-removed.txt": "",
-		},
-		Blueprint: `java_sdk_library {
-    name: "java-sdk-lib",
-    srcs: ["a.java"],
-    system: {enabled: false},
-    test: {enabled: false},
-    module_lib: {enabled: false},
-    system_server: {enabled: false},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_sdk_library", "java-sdk-lib", AttrNameToString{
-				"public": `"api/current.txt"`,
-			}),
-		},
-	})
-}
-
-func TestJavaSdkLibraryApiSurfacePublicNotEnabled(t *testing.T) {
-	runJavaSdkLibraryTestCase(t, Bp2buildTestCase{
-		Description: "limited java_sdk_library for api surfaces, public enable is false",
-		Filesystem: map[string]string{
-			"build/soong/scripts/gen-java-current-api-files.sh": "",
-			"api/current.txt": "",
-			"api/removed.txt": "",
-		},
-		Blueprint: `java_sdk_library {
-   name: "java-sdk-lib",
-   srcs: ["a.java"],
-   public: {enabled: false},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_sdk_library", "java-sdk-lib", AttrNameToString{}),
-		},
-	})
-}
-
-func TestJavaSdkLibraryApiSurfaceNoScopeIsSet(t *testing.T) {
-	runJavaSdkLibraryTestCase(t, Bp2buildTestCase{
-		Description: "limited java_sdk_library for api surfaces, none of the api scopes is set",
-		Filesystem: map[string]string{
-			"build/soong/scripts/gen-java-current-api-files.sh": "",
-			"api/current.txt":        "",
-			"api/system-current.txt": "",
-			"api/test-current.txt":   "",
-			"api/removed.txt":        "",
-			"api/system-removed.txt": "",
-			"api/test-removed.txt":   "",
-		},
-		Blueprint: `java_sdk_library {
-   name: "java-sdk-lib",
-   srcs: ["a.java"],
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_sdk_library", "java-sdk-lib", AttrNameToString{
-				"public": `"api/current.txt"`,
-				"system": `"api/system-current.txt"`,
-				"test":   `"api/test-current.txt"`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/java_sdk_library_import_conversion_test.go b/bp2build/java_sdk_library_import_conversion_test.go
deleted file mode 100644
index 456f872..0000000
--- a/bp2build/java_sdk_library_import_conversion_test.go
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/java"
-)
-
-func runJavaSdkLibraryImportTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, java.RegisterSdkLibraryBuildComponents, tc)
-}
-
-func TestJavaSdkLibraryImport(t *testing.T) {
-	runJavaSdkLibraryImportTestCase(t, Bp2buildTestCase{
-		Blueprint: `
-java_sdk_library_import {
-	name : "foo",
-	public: {
-		current_api: "foo_current.txt",
-	},
-	system: {
-		current_api: "system_foo_current.txt",
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_sdk_library", "foo", AttrNameToString{
-				"public": `"foo_current.txt"`,
-				"system": `"system_foo_current.txt"`,
-			}),
-		},
-	})
-}
-
-func TestJavaSdkLibraryImportPrebuiltPrefixRemoved(t *testing.T) {
-	runJavaSdkLibraryImportTestCase(t, Bp2buildTestCase{
-		Filesystem: map[string]string{
-			"foobar/Android.bp": `
-java_sdk_library {
-	name: "foo",
-	srcs: ["**/*.java"],
-}
-`,
-			"foobar/api/current.txt":        "",
-			"foobar/api/system-current.txt": "",
-			"foobar/api/test-current.txt":   "",
-			"foobar/api/removed.txt":        "",
-			"foobar/api/system-removed.txt": "",
-			"foobar/api/test-removed.txt":   "",
-		},
-		Blueprint: `
-java_sdk_library_import {
-	name : "foo",
-	public: {
-		current_api: "foo_current.txt",
-	},
-	system: {
-		current_api: "system_foo_current.txt",
-	},
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_sdk_library", "foo", AttrNameToString{
-				"public": `"foo_current.txt"`,
-				"system": `"system_foo_current.txt"`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/java_test_host_conversion_test.go b/bp2build/java_test_host_conversion_test.go
deleted file mode 100644
index 5d93f58..0000000
--- a/bp2build/java_test_host_conversion_test.go
+++ /dev/null
@@ -1,156 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/java"
-)
-
-func runJavaTestHostTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "java_test_host"
-	(&tc).ModuleTypeUnderTestFactory = java.TestHostFactory
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("java_library", java.LibraryFactory)
-	}, tc)
-}
-
-func TestJavaTestHostGeneral(t *testing.T) {
-	runJavaTestHostTestCase(t, Bp2buildTestCase{
-		Description:             "java_test_host general",
-		Filesystem:              map[string]string{},
-		StubbedBuildDefinitions: []string{"lib_a", "static_libs_a"},
-		Blueprint: `
-java_test_host {
-    name: "java_test_host-1",
-    srcs: ["a.java", "b.java"],
-    libs: ["lib_a"],
-    static_libs: ["static_libs_a"],
-    exclude_srcs: ["b.java"],
-    javacflags: ["-Xdoclint:all/protected"],
-    java_version: "8",
-}
-
-java_library {
-    name: "lib_a",
-}
-
-java_library {
-    name: "static_libs_a",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_library", "java_test_host-1_lib", AttrNameToString{
-				"deps": `[
-        ":lib_a-neverlink",
-        ":static_libs_a",
-    ]`,
-				"java_version": `"8"`,
-				"javacopts":    `["-Xdoclint:all/protected"]`,
-				"srcs":         `["a.java"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("java_test", "java_test_host-1", AttrNameToString{
-				"runtime_deps": `[":java_test_host-1_lib"]`,
-				"deps": `[
-        ":lib_a-neverlink",
-        ":static_libs_a",
-    ]`,
-				"srcs": `["a.java"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestJavaTestHostNoSrcs(t *testing.T) {
-	runJavaTestHostTestCase(t, Bp2buildTestCase{
-		Description: "java_test_host without srcs",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-java_test_host {
-    name: "java_test_host-1",
-    libs: ["lib_a"],
-    static_libs: ["static_libs_a"],
-}
-
-java_library {
-    name: "lib_a",
-}
-
-java_library {
-    name: "static_libs_a",
-}
-`,
-		StubbedBuildDefinitions: []string{"lib_a", "static_libs_a"},
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_test", "java_test_host-1", AttrNameToString{
-				"runtime_deps": `[
-        ":lib_a-neverlink",
-        ":static_libs_a",
-    ]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestJavaTestHostKotlinSrcs(t *testing.T) {
-	runJavaTestHostTestCase(t, Bp2buildTestCase{
-		Description: "java_test_host with .kt in srcs",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-java_test_host {
-    name: "java_test_host-1",
-    srcs: ["a.java", "b.kt"],
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("java_test", "java_test_host-1", AttrNameToString{
-				"srcs": `[
-        "a.java",
-        "b.kt",
-    ]`,
-				"runtime_deps": `[":java_test_host-1_lib"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-			MakeBazelTarget("kt_jvm_library", "java_test_host-1_lib", AttrNameToString{
-				"srcs": `[
-        "a.java",
-        "b.kt",
-    ]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/license_conversion_test.go b/bp2build/license_conversion_test.go
deleted file mode 100644
index ea6b27a..0000000
--- a/bp2build/license_conversion_test.go
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"android/soong/android"
-	"testing"
-)
-
-func registerLicenseModuleTypes(_ android.RegistrationContext) {}
-
-func TestLicenseBp2Build(t *testing.T) {
-	tests := []struct {
-		description string
-		module      string
-		expected    ExpectedRuleTarget
-	}{
-		{
-			description: "license kind and text notice",
-			module: `
-license {
-    name: "my_license",
-    license_kinds: [ "SPDX-license-identifier-Apache-2.0"],
-    license_text: [ "NOTICE"],
-}`,
-			expected: ExpectedRuleTarget{
-				"android_license",
-				"my_license",
-				AttrNameToString{
-					"license_kinds": `["SPDX-license-identifier-Apache-2.0"]`,
-					"license_text":  `"NOTICE"`,
-				},
-				android.HostAndDeviceDefault,
-			},
-		},
-		{
-			description: "visibility, package_name, copyright_notice",
-			module: `
-license {
-	name: "my_license",
-    package_name: "my_package",
-    visibility: [":__subpackages__"],
-    copyright_notice: "Copyright © 2022",
-}`,
-			expected: ExpectedRuleTarget{
-				"android_license",
-				"my_license",
-				AttrNameToString{
-					"copyright_notice": `"Copyright © 2022"`,
-					"package_name":     `"my_package"`,
-					"visibility":       `[":__subpackages__"]`,
-				},
-				android.HostAndDeviceDefault,
-			},
-		},
-	}
-
-	for _, test := range tests {
-		RunBp2BuildTestCase(t,
-			registerLicenseModuleTypes,
-			Bp2buildTestCase{
-				Description:                test.description,
-				ModuleTypeUnderTest:        "license",
-				ModuleTypeUnderTestFactory: android.LicenseFactory,
-				Blueprint:                  test.module,
-				ExpectedBazelTargets:       []string{test.expected.String()},
-			})
-	}
-}
diff --git a/bp2build/license_kind_conversion_test.go b/bp2build/license_kind_conversion_test.go
deleted file mode 100644
index eda116c..0000000
--- a/bp2build/license_kind_conversion_test.go
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"android/soong/android"
-	"testing"
-)
-
-func registerLicenseKindModuleTypes(_ android.RegistrationContext) {}
-
-func TestLicenseKindBp2Build(t *testing.T) {
-	tests := []struct {
-		description string
-		module      string
-		expected    ExpectedRuleTarget
-	}{
-		{
-			description: "license_kind",
-			module: `
-license_kind {
-    name: "my_license",
-    conditions: [
-        "by_exception_only",
-        "not_allowed",
-    ],
-    url: "https://spdx.org/licenses/0BSD",
-    visibility: ["//visibility:public"],
-}`,
-			expected: ExpectedRuleTarget{
-				"license_kind",
-				"my_license",
-				AttrNameToString{
-					"conditions": `[
-        "by_exception_only",
-        "not_allowed",
-    ]`,
-					"url":        `"https://spdx.org/licenses/0BSD"`,
-					"visibility": `["//visibility:public"]`,
-				},
-				android.HostAndDeviceDefault,
-			},
-		},
-	}
-
-	for _, test := range tests {
-		RunBp2BuildTestCase(t,
-			registerLicenseKindModuleTypes,
-			Bp2buildTestCase{
-				Description:                test.description,
-				ModuleTypeUnderTest:        "license_kind",
-				ModuleTypeUnderTestFactory: android.LicenseKindFactory,
-				Blueprint:                  test.module,
-				ExpectedBazelTargets:       []string{test.expected.String()},
-			})
-	}
-}
diff --git a/bp2build/linker_config_conversion_test.go b/bp2build/linker_config_conversion_test.go
deleted file mode 100644
index 5e7bcd4..0000000
--- a/bp2build/linker_config_conversion_test.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"fmt"
-	"testing"
-
-	"android/soong/linkerconfig"
-)
-
-func runLinkerConfigTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "linker_config"
-	(&tc).ModuleTypeUnderTestFactory = linkerconfig.LinkerConfigFactory
-	RunBp2BuildTestCaseSimple(t, tc)
-}
-
-func TestLinkerConfigConvertsSrc(t *testing.T) {
-	runLinkerConfigTestCase(t,
-		Bp2buildTestCase{
-			Blueprint: `
-linker_config {
-	name: "foo",
-	src: "a.json",
-}
-`,
-			ExpectedBazelTargets: []string{MakeBazelTarget("linker_config", "foo", AttrNameToString{
-				"src": `"a.json"`,
-			})},
-		})
-
-}
-
-func TestLinkerConfigNoSrc(t *testing.T) {
-	runLinkerConfigTestCase(t,
-		Bp2buildTestCase{
-			Blueprint: `
-linker_config {
-	name: "foo",
-}
-`,
-			ExpectedBazelTargets: []string{},
-			ExpectedErr:          fmt.Errorf("Android.bp:2:1: module \"foo\": src: empty src is not supported"),
-		})
-
-}
diff --git a/bp2build/metrics.go b/bp2build/metrics.go
deleted file mode 100644
index 20002c6..0000000
--- a/bp2build/metrics.go
+++ /dev/null
@@ -1,231 +0,0 @@
-package bp2build
-
-import (
-	"fmt"
-	"os"
-	"path/filepath"
-	"strings"
-
-	"android/soong/android"
-	"android/soong/shared"
-	"android/soong/ui/metrics/bp2build_metrics_proto"
-
-	"google.golang.org/protobuf/proto"
-
-	"github.com/google/blueprint"
-)
-
-type moduleInfo struct {
-	Name string `json:"name"`
-	Type string `json:"type"`
-}
-
-// CodegenMetrics represents information about the Blueprint-to-BUILD
-// conversion process.
-// Use CreateCodegenMetrics() to get a properly initialized instance
-type CodegenMetrics struct {
-	serialized *bp2build_metrics_proto.Bp2BuildMetrics
-	// List of modules with unconverted deps
-	// NOTE: NOT in the .proto
-	moduleWithUnconvertedDepsMsgs []string
-
-	// List of modules with missing deps
-	// NOTE: NOT in the .proto
-	moduleWithMissingDepsMsgs []string
-
-	// Map of converted modules and paths to call
-	// NOTE: NOT in the .proto
-	convertedModulePathMap map[string]string
-
-	// Name and type of converted modules
-	convertedModuleWithType []moduleInfo
-}
-
-func CreateCodegenMetrics() CodegenMetrics {
-	return CodegenMetrics{
-		serialized: &bp2build_metrics_proto.Bp2BuildMetrics{
-			RuleClassCount:           make(map[string]uint64),
-			ConvertedModuleTypeCount: make(map[string]uint64),
-			TotalModuleTypeCount:     make(map[string]uint64),
-			UnconvertedModules:       make(map[string]*bp2build_metrics_proto.UnconvertedReason),
-		},
-		convertedModulePathMap: make(map[string]string),
-	}
-}
-
-// Serialize returns the protoized version of CodegenMetrics: bp2build_metrics_proto.Bp2BuildMetrics
-func (metrics *CodegenMetrics) Serialize() *bp2build_metrics_proto.Bp2BuildMetrics {
-	return metrics.serialized
-}
-
-// Print the codegen metrics to stdout.
-func (metrics *CodegenMetrics) Print() {
-	generatedTargetCount := uint64(0)
-	for _, ruleClass := range android.SortedKeys(metrics.serialized.RuleClassCount) {
-		count := metrics.serialized.RuleClassCount[ruleClass]
-		fmt.Printf("[bp2build] %s: %d targets\n", ruleClass, count)
-		generatedTargetCount += count
-	}
-	fmt.Printf(
-		`[bp2build] Converted %d Android.bp modules to %d total generated BUILD targets. Included %d handcrafted BUILD targets. There are %d total Android.bp modules.
-%d converted modules have unconverted deps:
-	%s
-%d converted modules have missing deps:
-	%s
-`,
-		metrics.serialized.GeneratedModuleCount,
-		generatedTargetCount,
-		metrics.serialized.HandCraftedModuleCount,
-		metrics.TotalModuleCount(),
-		len(metrics.moduleWithUnconvertedDepsMsgs),
-		strings.Join(metrics.moduleWithUnconvertedDepsMsgs, "\n\t"),
-		len(metrics.moduleWithMissingDepsMsgs),
-		strings.Join(metrics.moduleWithMissingDepsMsgs, "\n\t"),
-	)
-}
-
-const bp2buildMetricsFilename = "bp2build_metrics.pb"
-
-// fail prints $PWD to stderr, followed by the given printf string and args (vals),
-// then the given alert, and then exits with 1 for failure
-func fail(err error, alertFmt string, vals ...interface{}) {
-	cwd, wderr := os.Getwd()
-	if wderr != nil {
-		cwd = "FAILED TO GET $PWD: " + wderr.Error()
-	}
-	fmt.Fprintf(os.Stderr, "\nIn "+cwd+":\n"+alertFmt+"\n"+err.Error()+"\n", vals...)
-	os.Exit(1)
-}
-
-// Write the bp2build-protoized codegen metrics into the given directory
-func (metrics *CodegenMetrics) Write(dir string) {
-	if _, err := os.Stat(dir); os.IsNotExist(err) {
-		// The metrics dir doesn't already exist, so create it (and parents)
-		if err := os.MkdirAll(dir, 0755); err != nil { // rx for all; w for user
-			fail(err, "Failed to `mkdir -p` %s", dir)
-		}
-	} else if err != nil {
-		fail(err, "Failed to `stat` %s", dir)
-	}
-	metricsFile := filepath.Join(dir, bp2buildMetricsFilename)
-	if err := metrics.dump(metricsFile); err != nil {
-		fail(err, "Error outputting %s", metricsFile)
-	}
-	if _, err := os.Stat(metricsFile); err != nil {
-		if os.IsNotExist(err) {
-			fail(err, "MISSING BP2BUILD METRICS OUTPUT: %s", metricsFile)
-		} else {
-			fail(err, "FAILED TO `stat` BP2BUILD METRICS OUTPUT: %s", metricsFile)
-		}
-	}
-}
-
-// ReadCodegenMetrics loads CodegenMetrics from `dir`
-// returns a nil pointer if the file doesn't exist
-func ReadCodegenMetrics(dir string) *CodegenMetrics {
-	metricsFile := filepath.Join(dir, bp2buildMetricsFilename)
-	if _, err := os.Stat(metricsFile); err != nil {
-		if os.IsNotExist(err) {
-			return nil
-		} else {
-			fail(err, "FAILED TO `stat` BP2BUILD METRICS OUTPUT: %s", metricsFile)
-			panic("unreachable after fail")
-		}
-	}
-	if buf, err := os.ReadFile(metricsFile); err != nil {
-		fail(err, "FAILED TO READ BP2BUILD METRICS OUTPUT: %s", metricsFile)
-		panic("unreachable after fail")
-	} else {
-		bp2BuildMetrics := bp2build_metrics_proto.Bp2BuildMetrics{
-			RuleClassCount:           make(map[string]uint64),
-			ConvertedModuleTypeCount: make(map[string]uint64),
-			TotalModuleTypeCount:     make(map[string]uint64),
-		}
-		if err := proto.Unmarshal(buf, &bp2BuildMetrics); err != nil {
-			fail(err, "FAILED TO PARSE BP2BUILD METRICS OUTPUT: %s", metricsFile)
-		}
-		return &CodegenMetrics{
-			serialized:             &bp2BuildMetrics,
-			convertedModulePathMap: make(map[string]string),
-		}
-	}
-}
-
-func (metrics *CodegenMetrics) IncrementRuleClassCount(ruleClass string) {
-	metrics.serialized.RuleClassCount[ruleClass] += 1
-}
-
-func (metrics *CodegenMetrics) AddEvent(event *bp2build_metrics_proto.Event) {
-	metrics.serialized.Events = append(metrics.serialized.Events, event)
-}
-
-func (metrics *CodegenMetrics) SetSymlinkCount(n uint64) {
-	if m := metrics.serialized.WorkspaceSymlinkCount; m != 0 {
-		fmt.Fprintf(os.Stderr, "unexpected non-zero workspaceSymlinkCount of %d", m)
-	}
-	metrics.serialized.WorkspaceSymlinkCount = n
-}
-
-func (metrics *CodegenMetrics) SetMkDirCount(n uint64) {
-	if m := metrics.serialized.WorkspaceMkDirCount; m != 0 {
-		fmt.Fprintf(os.Stderr, "unexpected non-zero workspaceDirCount of %d", m)
-	}
-	metrics.serialized.WorkspaceMkDirCount = n
-}
-
-func (metrics *CodegenMetrics) TotalModuleCount() uint64 {
-	return metrics.serialized.HandCraftedModuleCount +
-		metrics.serialized.GeneratedModuleCount +
-		metrics.serialized.UnconvertedModuleCount
-}
-
-// Dump serializes the metrics to the given filename
-func (metrics *CodegenMetrics) dump(filename string) (err error) {
-	ser := metrics.Serialize()
-	return shared.Save(ser, filename)
-}
-
-type ConversionType int
-
-const (
-	Generated ConversionType = iota
-	Handcrafted
-)
-
-func (metrics *CodegenMetrics) AddConvertedModule(m blueprint.Module, moduleType string, dir string) {
-	//a package module has empty name
-	if moduleType == "package" {
-		return
-	}
-	// Undo prebuilt_ module name prefix modifications
-	moduleName := android.RemoveOptionalPrebuiltPrefix(m.Name())
-	metrics.serialized.ConvertedModules = append(metrics.serialized.ConvertedModules, moduleName)
-	metrics.convertedModuleWithType = append(metrics.convertedModuleWithType, moduleInfo{
-		moduleName,
-		moduleType,
-	})
-	metrics.convertedModulePathMap[moduleName] = "//" + dir
-	metrics.serialized.ConvertedModuleTypeCount[moduleType] += 1
-	metrics.serialized.TotalModuleTypeCount[moduleType] += 1
-	metrics.serialized.GeneratedModuleCount += 1
-}
-
-func (metrics *CodegenMetrics) AddUnconvertedModule(m blueprint.Module, moduleType string, dir string,
-	reason android.UnconvertedReason) {
-	//a package module has empty name
-	if moduleType == "package" {
-		return
-	}
-	// Undo prebuilt_ module name prefix modifications
-	moduleName := android.RemoveOptionalPrebuiltPrefix(m.Name())
-	metrics.serialized.UnconvertedModules[moduleName] = &bp2build_metrics_proto.UnconvertedReason{
-		Type:   bp2build_metrics_proto.UnconvertedReasonType(reason.ReasonType),
-		Detail: reason.Detail,
-	}
-	metrics.serialized.UnconvertedModuleCount += 1
-	metrics.serialized.TotalModuleTypeCount[moduleType] += 1
-
-	if reason.ReasonType == int(bp2build_metrics_proto.UnconvertedReasonType_DEFINED_IN_BUILD_FILE) {
-		metrics.serialized.HandCraftedModuleCount += 1
-	}
-}
diff --git a/bp2build/package_conversion_test.go b/bp2build/package_conversion_test.go
deleted file mode 100644
index ce848e4..0000000
--- a/bp2build/package_conversion_test.go
+++ /dev/null
@@ -1,139 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/genrule"
-)
-
-func registerDependentModules(ctx android.RegistrationContext) {
-	ctx.RegisterModuleType("license", android.LicenseFactory)
-	ctx.RegisterModuleType("genrule", genrule.GenRuleFactory)
-}
-
-func TestPackage(t *testing.T) {
-	tests := []struct {
-		description string
-		modules     string
-		fs          map[string]string
-		expected    []ExpectedRuleTarget
-	}{
-		{
-			description: "with default applicable licenses",
-			modules: `
-license {
-  name: "my_license",
-  visibility: [":__subpackages__"],
-  license_kinds: ["SPDX-license-identifier-Apache-2.0"],
-  license_text: ["NOTICE"],
-}
-
-package {
-  default_applicable_licenses: ["my_license"],
-}
-`,
-			expected: []ExpectedRuleTarget{
-				{
-					"package",
-					"",
-					AttrNameToString{
-						"default_package_metadata": `[":my_license"]`,
-						"default_visibility":       `["//visibility:public"]`,
-					},
-					android.HostAndDeviceDefault,
-				},
-				{
-					"android_license",
-					"my_license",
-					AttrNameToString{
-						"license_kinds": `["SPDX-license-identifier-Apache-2.0"]`,
-						"license_text":  `"NOTICE"`,
-						"visibility":    `[":__subpackages__"]`,
-					},
-					android.HostAndDeviceDefault,
-				},
-			},
-		},
-		{
-			description: "package has METADATA file",
-			fs: map[string]string{
-				"METADATA": ``,
-			},
-			modules: `
-license {
-  name: "my_license",
-  visibility: [":__subpackages__"],
-  license_kinds: ["SPDX-license-identifier-Apache-2.0"],
-  license_text: ["NOTICE"],
-}
-
-package {
-  default_applicable_licenses: ["my_license"],
-}
-`,
-			expected: []ExpectedRuleTarget{
-				{
-					"package",
-					"",
-					AttrNameToString{
-						"default_package_metadata": `[
-        ":my_license",
-        ":default_metadata_file",
-    ]`,
-						"default_visibility": `["//visibility:public"]`,
-					},
-					android.HostAndDeviceDefault,
-				},
-				{
-					"android_license",
-					"my_license",
-					AttrNameToString{
-						"license_kinds": `["SPDX-license-identifier-Apache-2.0"]`,
-						"license_text":  `"NOTICE"`,
-						"visibility":    `[":__subpackages__"]`,
-					},
-					android.HostAndDeviceDefault,
-				},
-				{
-					"filegroup",
-					"default_metadata_file",
-					AttrNameToString{
-						"applicable_licenses": `[]`,
-						"srcs":                `["METADATA"]`,
-					},
-					android.HostAndDeviceDefault,
-				},
-			},
-		},
-	}
-	for _, test := range tests {
-		expected := make([]string, 0, len(test.expected))
-		for _, e := range test.expected {
-			expected = append(expected, e.String())
-		}
-		RunBp2BuildTestCase(t, registerDependentModules,
-			Bp2buildTestCase{
-				Description:                test.description,
-				ModuleTypeUnderTest:        "package",
-				ModuleTypeUnderTestFactory: android.PackageFactory,
-				Blueprint:                  test.modules,
-				ExpectedBazelTargets:       expected,
-				Filesystem:                 test.fs,
-			})
-	}
-}
diff --git a/bp2build/performance_test.go b/bp2build/performance_test.go
deleted file mode 100644
index 5f80b83..0000000
--- a/bp2build/performance_test.go
+++ /dev/null
@@ -1,219 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-// to run the benchmarks in this file, you must run go test with the -bench.
-// The benchmarked portion will run for the specified time (can be set via -benchtime)
-// This can mean if you are benchmarking a faster portion of a larger operation, it will take
-// longer.
-// If you are seeing a small number of iterations for a specific run, the data is less reliable, to
-// run for longer, set -benchtime to a larger value.
-
-import (
-	"fmt"
-	"math"
-	"strings"
-	"testing"
-
-	"android/soong/android"
-)
-
-const (
-	performance_test_dir = "."
-)
-
-func genCustomModule(i int, convert bool) string {
-	var conversionString string
-	if convert {
-		conversionString = `bazel_module: { bp2build_available: true },`
-	}
-	return fmt.Sprintf(`
-custom {
-    name: "arch_paths_%[1]d",
-    string_list_prop: ["\t", "\n"],
-    string_prop: "a\t\n\r",
-    arch_paths: ["outer", ":outer_dep_%[1]d"],
-    arch: {
-      x86: {
-        arch_paths: ["abc", ":x86_dep_%[1]d"],
-      },
-      x86_64: {
-        arch_paths: ["64bit"],
-        arch_paths_exclude: ["outer"],
-      },
-    },
-		%[2]s
-}
-
-custom {
-    name: "outer_dep_%[1]d",
-		%[2]s
-}
-
-custom {
-    name: "x86_dep_%[1]d",
-		%[2]s
-}
-`, i, conversionString)
-}
-
-func genCustomModuleBp(pctConverted float64) string {
-	modules := 100
-
-	bp := make([]string, 0, modules)
-	toConvert := int(math.Round(float64(modules) * pctConverted))
-
-	for i := 0; i < modules; i++ {
-		bp = append(bp, genCustomModule(i, i < toConvert))
-	}
-	return strings.Join(bp, "\n\n")
-}
-
-type testConfig struct {
-	config     android.Config
-	ctx        *android.TestContext
-	codegenCtx *CodegenContext
-}
-
-func (tc testConfig) parse() []error {
-	_, errs := tc.ctx.ParseFileList(performance_test_dir, []string{"Android.bp"})
-	return errs
-}
-
-func (tc testConfig) resolveDependencies() []error {
-	_, errs := tc.ctx.ResolveDependencies(tc.config)
-	return errs
-}
-
-func (tc testConfig) convert() {
-	generateBazelTargetsForDir(tc.codegenCtx, performance_test_dir)
-}
-
-func setup(builddir string, tcSize float64) testConfig {
-	config := android.TestConfig(buildDir, nil, genCustomModuleBp(tcSize), nil)
-	ctx := android.NewTestContext(config)
-
-	registerCustomModuleForBp2buildConversion(ctx)
-	codegenCtx := NewCodegenContext(config, ctx.Context, Bp2Build, "")
-	return testConfig{
-		config,
-		ctx,
-		codegenCtx,
-	}
-}
-
-var pctToConvert = []float64{0.0, 0.01, 0.05, 0.10, 0.25, 0.5, 0.75, 1.0}
-
-// This is not intended to test performance, but to verify performance infra continues to work
-func TestConvertManyModulesFull(t *testing.T) {
-	for _, tcSize := range pctToConvert {
-
-		t.Run(fmt.Sprintf("pctConverted %f", tcSize), func(t *testing.T) {
-			testConfig := setup(buildDir, tcSize)
-
-			errs := testConfig.parse()
-			if len(errs) > 0 {
-				t.Fatalf("Unexpected errors: %s", errs)
-			}
-
-			errs = testConfig.resolveDependencies()
-			if len(errs) > 0 {
-				t.Fatalf("Unexpected errors: %s", errs)
-			}
-
-			testConfig.convert()
-		})
-	}
-}
-
-func BenchmarkManyModulesFull(b *testing.B) {
-	for _, tcSize := range pctToConvert {
-
-		b.Run(fmt.Sprintf("pctConverted %f", tcSize), func(b *testing.B) {
-			for n := 0; n < b.N; n++ {
-				b.StopTimer()
-				testConfig := setup(buildDir, tcSize)
-
-				b.StartTimer()
-				errs := testConfig.parse()
-				if len(errs) > 0 {
-					b.Fatalf("Unexpected errors: %s", errs)
-				}
-
-				errs = testConfig.resolveDependencies()
-				if len(errs) > 0 {
-					b.Fatalf("Unexpected errors: %s", errs)
-				}
-
-				testConfig.convert()
-				b.StopTimer()
-			}
-		})
-	}
-}
-
-func BenchmarkManyModulesResolveDependencies(b *testing.B) {
-	for _, tcSize := range pctToConvert {
-
-		b.Run(fmt.Sprintf("pctConverted %f", tcSize), func(b *testing.B) {
-			for n := 0; n < b.N; n++ {
-				b.StopTimer()
-				// setup we don't want to measure
-				testConfig := setup(buildDir, tcSize)
-
-				errs := testConfig.parse()
-				if len(errs) > 0 {
-					b.Fatalf("Unexpected errors: %s", errs)
-				}
-
-				b.StartTimer()
-				errs = testConfig.resolveDependencies()
-				b.StopTimer()
-				if len(errs) > 0 {
-					b.Fatalf("Unexpected errors: %s", errs)
-				}
-
-				testConfig.convert()
-			}
-		})
-	}
-}
-
-func BenchmarkManyModulesGenerateBazelTargetsForDir(b *testing.B) {
-	for _, tcSize := range pctToConvert {
-
-		b.Run(fmt.Sprintf("pctConverted %f", tcSize), func(b *testing.B) {
-			for n := 0; n < b.N; n++ {
-				b.StopTimer()
-				// setup we don't want to measure
-				testConfig := setup(buildDir, tcSize)
-
-				errs := testConfig.parse()
-				if len(errs) > 0 {
-					b.Fatalf("Unexpected errors: %s", errs)
-				}
-
-				errs = testConfig.resolveDependencies()
-				if len(errs) > 0 {
-					b.Fatalf("Unexpected errors: %s", errs)
-				}
-
-				b.StartTimer()
-				testConfig.convert()
-				b.StopTimer()
-			}
-		})
-	}
-}
diff --git a/bp2build/platform_compat_config_conversion_test.go b/bp2build/platform_compat_config_conversion_test.go
deleted file mode 100644
index d74db5d..0000000
--- a/bp2build/platform_compat_config_conversion_test.go
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/java"
-)
-
-func runPlatformCompatConfigTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("java_library", java.LibraryFactory)
-		ctx.RegisterModuleType("platform_compat_config", java.PlatformCompatConfigFactory)
-	}, tc)
-}
-
-func TestPlatformCompatConfig(t *testing.T) {
-	runPlatformCompatConfigTestCase(t, Bp2buildTestCase{
-		Description: "platform_compat_config - conversion test",
-		Blueprint: `
-		platform_compat_config {
-			name: "foo",
-			src: ":lib",
-		}`,
-		StubbedBuildDefinitions: []string{"//a/b:lib"},
-		Filesystem: map[string]string{
-			"a/b/Android.bp": `
-			java_library {
-				name: "lib",
-				srcs: ["a.java"],
-			}`,
-		},
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("platform_compat_config", "foo", AttrNameToString{
-				"src": `"//a/b:lib"`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/prebuilt_etc_conversion_test.go b/bp2build/prebuilt_etc_conversion_test.go
deleted file mode 100644
index c8cfd87..0000000
--- a/bp2build/prebuilt_etc_conversion_test.go
+++ /dev/null
@@ -1,396 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"fmt"
-	"testing"
-
-	"android/soong/android"
-	"android/soong/etc"
-)
-
-func runPrebuiltEtcTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "prebuilt_etc"
-	(&tc).ModuleTypeUnderTestFactory = etc.PrebuiltEtcFactory
-	RunBp2BuildTestCase(t, registerPrebuiltModuleTypes, tc)
-}
-
-func runPrebuiltRootHostTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "prebuilt_root_host"
-	(&tc).ModuleTypeUnderTestFactory = etc.PrebuiltRootHostFactory
-	RunBp2BuildTestCase(t, registerPrebuiltModuleTypes, tc)
-}
-
-func registerPrebuiltModuleTypes(ctx android.RegistrationContext) {
-}
-
-func TestPrebuiltEtcSimple(t *testing.T) {
-	runPrebuiltEtcTestCase(t, Bp2buildTestCase{
-		Description: "prebuilt_etc - simple example",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-prebuilt_etc {
-    name: "apex_tz_version",
-    src: "version/tz_version",
-    filename: "tz_version",
-    sub_dir: "tz",
-    installable: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("prebuilt_file", "apex_tz_version", AttrNameToString{
-				"filename":    `"tz_version"`,
-				"installable": `False`,
-				"src":         `"version/tz_version"`,
-				"dir":         `"etc/tz"`,
-			})}})
-}
-
-func TestPrebuiltEtcArchVariant(t *testing.T) {
-	runPrebuiltEtcTestCase(t, Bp2buildTestCase{
-		Description: "prebuilt_etc - arch variant",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-prebuilt_etc {
-    name: "apex_tz_version",
-    src: "version/tz_version",
-    filename: "tz_version",
-    sub_dir: "tz",
-    installable: false,
-    arch: {
-      arm: {
-        src: "arm",
-      },
-      arm64: {
-        src: "arm64",
-      },
-    }
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("prebuilt_file", "apex_tz_version", AttrNameToString{
-				"filename":    `"tz_version"`,
-				"installable": `False`,
-				"src": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "arm",
-        "//build/bazel_common_rules/platforms/arch:arm64": "arm64",
-        "//conditions:default": "version/tz_version",
-    })`,
-				"dir": `"etc/tz"`,
-			})}})
-}
-
-func TestPrebuiltEtcArchAndTargetVariant(t *testing.T) {
-	runPrebuiltEtcTestCase(t, Bp2buildTestCase{
-		Description: "prebuilt_etc - arch variant",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-prebuilt_etc {
-    name: "apex_tz_version",
-    src: "version/tz_version",
-    filename: "tz_version",
-    sub_dir: "tz",
-    installable: false,
-    arch: {
-      arm: {
-        src: "arm",
-      },
-      arm64: {
-        src: "darwin_or_arm64",
-      },
-    },
-    target: {
-      darwin: {
-        src: "darwin_or_arm64",
-      }
-    },
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("prebuilt_file", "apex_tz_version", AttrNameToString{
-				"filename":    `"tz_version"`,
-				"installable": `False`,
-				"src": `select({
-        "//build/bazel_common_rules/platforms/os_arch:android_arm": "arm",
-        "//build/bazel_common_rules/platforms/os_arch:android_arm64": "darwin_or_arm64",
-        "//build/bazel_common_rules/platforms/os_arch:darwin_arm64": "darwin_or_arm64",
-        "//build/bazel_common_rules/platforms/os_arch:darwin_x86_64": "darwin_or_arm64",
-        "//build/bazel_common_rules/platforms/os_arch:linux_bionic_arm64": "darwin_or_arm64",
-        "//conditions:default": "version/tz_version",
-    })`,
-				"dir": `"etc/tz"`,
-			})}})
-}
-func TestPrebuiltEtcProductVariables(t *testing.T) {
-	runPrebuiltEtcTestCase(t, Bp2buildTestCase{
-		Description: "prebuilt etc - product variables",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-prebuilt_etc {
-    name: "apex_tz_version",
-    src: "version/tz_version",
-    filename: "tz_version",
-    product_variables: {
-      native_coverage: {
-        src: "src1",
-      },
-    },
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("prebuilt_file", "apex_tz_version", AttrNameToString{
-				"filename": `"tz_version"`,
-				"src": `select({
-        "//build/bazel/product_config/config_settings:native_coverage": "src1",
-        "//conditions:default": "version/tz_version",
-    })`,
-				"dir": `"etc"`,
-			})}})
-}
-
-func runPrebuiltUsrShareTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "prebuilt_usr_share"
-	(&tc).ModuleTypeUnderTestFactory = etc.PrebuiltUserShareFactory
-	RunBp2BuildTestCase(t, registerPrebuiltModuleTypes, tc)
-}
-
-func registerPrebuiltUsrShareModuleTypes(ctx android.RegistrationContext) {
-}
-
-func TestPrebuiltUsrShareSimple(t *testing.T) {
-	runPrebuiltUsrShareTestCase(t, Bp2buildTestCase{
-		Description: "prebuilt_usr_share - simple example",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-prebuilt_usr_share {
-    name: "apex_tz_version",
-    src: "version/tz_version",
-    filename: "tz_version",
-    sub_dir: "tz",
-    installable: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("prebuilt_file", "apex_tz_version", AttrNameToString{
-				"filename":    `"tz_version"`,
-				"installable": `False`,
-				"src":         `"version/tz_version"`,
-				"dir":         `"usr/share/tz"`,
-			})}})
-}
-
-func TestPrebuiltEtcNoSubdir(t *testing.T) {
-	runPrebuiltEtcTestCase(t, Bp2buildTestCase{
-		Description: "prebuilt_etc - no subdir",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-prebuilt_etc {
-    name: "apex_tz_version",
-    src: "version/tz_version",
-    filename: "tz_version",
-    installable: false,
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("prebuilt_file", "apex_tz_version", AttrNameToString{
-				"filename":    `"tz_version"`,
-				"installable": `False`,
-				"src":         `"version/tz_version"`,
-				"dir":         `"etc"`,
-			})}})
-}
-
-func TestFilenameAsProperty(t *testing.T) {
-	runPrebuiltEtcTestCase(t, Bp2buildTestCase{
-		Description: "prebuilt_etc - filename is specified as a property ",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-prebuilt_etc {
-    name: "foo",
-    src: "fooSrc",
-    filename: "fooFileName",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("prebuilt_file", "foo", AttrNameToString{
-				"filename": `"fooFileName"`,
-				"src":      `"fooSrc"`,
-				"dir":      `"etc"`,
-			})}})
-}
-
-func TestFileNameFromSrc(t *testing.T) {
-	runPrebuiltEtcTestCase(t, Bp2buildTestCase{
-		Description: "prebuilt_etc - filename_from_src is true  ",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-prebuilt_etc {
-    name: "foo",
-    filename_from_src: true,
-    src: "fooSrc",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("prebuilt_file", "foo", AttrNameToString{
-				"filename": `"fooSrc"`,
-				"src":      `"fooSrc"`,
-				"dir":      `"etc"`,
-			})}})
-}
-
-func TestFileNameFromSrcMultipleSrcs(t *testing.T) {
-	runPrebuiltEtcTestCase(t, Bp2buildTestCase{
-		Description: "prebuilt_etc - filename_from_src is true but there are multiple srcs",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-prebuilt_etc {
-    name: "foo",
-    filename_from_src: true,
-		arch: {
-        arm: {
-            src: "barSrc",
-        },
-        arm64: {
-            src: "bazSrc",
-        },
-	  }
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("prebuilt_file", "foo", AttrNameToString{
-				"filename_from_src": `True`,
-				"dir":               `"etc"`,
-				"src": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "barSrc",
-        "//build/bazel_common_rules/platforms/arch:arm64": "bazSrc",
-        "//conditions:default": None,
-    })`,
-			})}})
-}
-
-func TestFilenameFromModuleName(t *testing.T) {
-	runPrebuiltEtcTestCase(t, Bp2buildTestCase{
-		Description: "prebuilt_etc - neither filename nor filename_from_src are specified ",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-prebuilt_etc {
-    name: "foo",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("prebuilt_file", "foo", AttrNameToString{
-				"filename": `"foo"`,
-				"dir":      `"etc"`,
-			})}})
-}
-
-func TestPrebuiltEtcProductVariableArchSrcs(t *testing.T) {
-	runPrebuiltEtcTestCase(t, Bp2buildTestCase{
-		Description: "prebuilt etc- SRcs from arch variant product variables",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-prebuilt_etc {
-    name: "foo",
-    filename: "fooFilename",
-    arch: {
-      arm: {
-        src: "armSrc",
-        product_variables: {
-          native_coverage: {
-            src: "nativeCoverageArmSrc",
-          },
-        },
-      },
-    },
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("prebuilt_file", "foo", AttrNameToString{
-				"filename": `"fooFilename"`,
-				"dir":      `"etc"`,
-				"src": `select({
-        "//build/bazel/product_config/config_settings:native_coverage-arm": "nativeCoverageArmSrc",
-        "//build/bazel_common_rules/platforms/arch:arm": "armSrc",
-        "//conditions:default": None,
-    })`,
-			})}})
-}
-
-func TestPrebuiltEtcProductVariableError(t *testing.T) {
-	runPrebuiltEtcTestCase(t, Bp2buildTestCase{
-		Description: "",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-prebuilt_etc {
-    name: "foo",
-    filename: "fooFilename",
-    arch: {
-      arm: {
-        src: "armSrc",
-      },
-    },
-    product_variables: {
-      native_coverage: {
-        src: "nativeCoverageArmSrc",
-      },
-    },
-}`,
-		ExpectedErr: fmt.Errorf("label attribute could not be collapsed"),
-	})
-}
-
-func TestPrebuiltEtcNoConversionIfSrcEqualsName(t *testing.T) {
-	runPrebuiltEtcTestCase(t, Bp2buildTestCase{
-		Description: "",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-prebuilt_etc {
-    name: "foo",
-    filename: "fooFilename",
-		src: "foo",
-}`,
-		ExpectedBazelTargets: []string{},
-	})
-}
-
-func TestPrebuiltRootHostWithWildCardInSrc(t *testing.T) {
-	runPrebuiltRootHostTestCase(t, Bp2buildTestCase{
-		Description: "prebuilt_root_host - src string has wild card",
-		Filesystem: map[string]string{
-			"prh.dat": "",
-		},
-		Blueprint: `
-prebuilt_root_host {
-    name: "prh_test",
-    src: "*.dat",
-    filename_from_src: true,
-    relative_install_path: "test/install/path",
-    bazel_module: { bp2build_available: true },
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("prebuilt_file", "prh_test", AttrNameToString{
-				"filename": `"prh.dat"`,
-				"src":      `"prh.dat"`,
-				"dir":      `"./test/install/path"`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			})}})
-}
diff --git a/bp2build/python_binary_conversion_test.go b/bp2build/python_binary_conversion_test.go
deleted file mode 100644
index eb993c2..0000000
--- a/bp2build/python_binary_conversion_test.go
+++ /dev/null
@@ -1,320 +0,0 @@
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/genrule"
-	"android/soong/python"
-)
-
-func runBp2BuildTestCaseWithPythonLibraries(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("python_library", python.PythonLibraryFactory)
-		ctx.RegisterModuleType("python_library_host", python.PythonLibraryHostFactory)
-		ctx.RegisterModuleType("genrule", genrule.GenRuleFactory)
-		ctx.RegisterModuleType("python_defaults", python.DefaultsFactory)
-	}, tc)
-}
-
-func TestPythonBinaryHostSimple(t *testing.T) {
-	runBp2BuildTestCaseWithPythonLibraries(t, Bp2buildTestCase{
-		Description:                "simple python_binary_host converts to a native py_binary",
-		ModuleTypeUnderTest:        "python_binary_host",
-		ModuleTypeUnderTestFactory: python.PythonBinaryHostFactory,
-		Filesystem: map[string]string{
-			"a.py":           "",
-			"b/c.py":         "",
-			"b/d.py":         "",
-			"b/e.py":         "",
-			"files/data.txt": "",
-		},
-		StubbedBuildDefinitions: []string{"bar"},
-		Blueprint: `python_binary_host {
-    name: "foo",
-    main: "a.py",
-    srcs: ["**/*.py"],
-    exclude_srcs: ["b/e.py"],
-    data: ["files/data.txt",],
-    libs: ["bar"],
-    bazel_module: { bp2build_available: true },
-}
-    python_library_host {
-      name: "bar",
-      srcs: ["b/e.py"],
-    }`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("py_binary", "foo", AttrNameToString{
-				"data":    `["files/data.txt"]`,
-				"deps":    `[":bar"]`,
-				"main":    `"a.py"`,
-				"imports": `["."]`,
-				"srcs": `[
-        "a.py",
-        "b/c.py",
-        "b/d.py",
-    ]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestPythonBinaryHostPy2(t *testing.T) {
-	RunBp2BuildTestCaseSimple(t, Bp2buildTestCase{
-		Description:                "py2 python_binary_host",
-		ModuleTypeUnderTest:        "python_binary_host",
-		ModuleTypeUnderTestFactory: python.PythonBinaryHostFactory,
-		Blueprint: `python_binary_host {
-    name: "foo",
-    srcs: ["a.py"],
-    version: {
-        py2: {
-            enabled: true,
-        },
-        py3: {
-            enabled: false,
-        },
-    },
-
-    bazel_module: { bp2build_available: true },
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("py_binary", "foo", AttrNameToString{
-				"python_version": `"PY2"`,
-				"imports":        `["."]`,
-				"srcs":           `["a.py"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestPythonBinaryHostPy3(t *testing.T) {
-	RunBp2BuildTestCaseSimple(t, Bp2buildTestCase{
-		Description:                "py3 python_binary_host",
-		ModuleTypeUnderTest:        "python_binary_host",
-		ModuleTypeUnderTestFactory: python.PythonBinaryHostFactory,
-		Blueprint: `python_binary_host {
-    name: "foo",
-    srcs: ["a.py"],
-    version: {
-        py2: {
-            enabled: false,
-        },
-        py3: {
-            enabled: true,
-        },
-    },
-
-    bazel_module: { bp2build_available: true },
-}
-`,
-		ExpectedBazelTargets: []string{
-			// python_version is PY3 by default.
-			MakeBazelTarget("py_binary", "foo", AttrNameToString{
-				"imports": `["."]`,
-				"srcs":    `["a.py"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestPythonBinaryHostArchVariance(t *testing.T) {
-	RunBp2BuildTestCaseSimple(t, Bp2buildTestCase{
-		Description:                "test arch variants",
-		ModuleTypeUnderTest:        "python_binary_host",
-		ModuleTypeUnderTestFactory: python.PythonBinaryHostFactory,
-		Filesystem: map[string]string{
-			"dir/arm.py": "",
-			"dir/x86.py": "",
-		},
-		Blueprint: `python_binary_host {
-					 name: "foo-arm",
-					 arch: {
-						 arm: {
-							 srcs: ["arm.py"],
-						 },
-						 x86: {
-							 srcs: ["x86.py"],
-						 },
-					},
-				 }`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("py_binary", "foo-arm", AttrNameToString{
-				"imports": `["."]`,
-				"srcs": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["arm.py"],
-        "//build/bazel_common_rules/platforms/arch:x86": ["x86.py"],
-        "//conditions:default": [],
-    })`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestPythonBinaryMainIsNotSpecified(t *testing.T) {
-	runBp2BuildTestCaseWithPythonLibraries(t, Bp2buildTestCase{
-		Description:                "python_binary_host main label in same package",
-		ModuleTypeUnderTest:        "python_binary_host",
-		ModuleTypeUnderTestFactory: python.PythonBinaryHostFactory,
-		Blueprint: `python_binary_host {
-    name: "foo",
-    bazel_module: { bp2build_available: true },
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("py_binary", "foo", AttrNameToString{
-				"imports": `["."]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestPythonBinaryMainIsLabel(t *testing.T) {
-	runBp2BuildTestCaseWithPythonLibraries(t, Bp2buildTestCase{
-		Description:                "python_binary_host main label in same package",
-		ModuleTypeUnderTest:        "python_binary_host",
-		ModuleTypeUnderTestFactory: python.PythonBinaryHostFactory,
-		StubbedBuildDefinitions:    []string{"a"},
-		Blueprint: `python_binary_host {
-    name: "foo",
-    main: ":a",
-    bazel_module: { bp2build_available: true },
-}
-
-genrule {
-		name: "a",
-}
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("py_binary", "foo", AttrNameToString{
-				"main":    `":a"`,
-				"imports": `["."]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestPythonBinaryMainIsSubpackageFile(t *testing.T) {
-	runBp2BuildTestCaseWithPythonLibraries(t, Bp2buildTestCase{
-		Description:                "python_binary_host main is subpackage file",
-		ModuleTypeUnderTest:        "python_binary_host",
-		ModuleTypeUnderTestFactory: python.PythonBinaryHostFactory,
-		Filesystem: map[string]string{
-			"a/Android.bp": "",
-			"a/b.py":       "",
-		},
-		Blueprint: `python_binary_host {
-    name: "foo",
-    main: "a/b.py",
-    bazel_module: { bp2build_available: true },
-}
-
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("py_binary", "foo", AttrNameToString{
-				"main":    `"//a:b.py"`,
-				"imports": `["."]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestPythonBinaryMainIsSubDirFile(t *testing.T) {
-	runBp2BuildTestCaseWithPythonLibraries(t, Bp2buildTestCase{
-		Description:                "python_binary_host main is file in sub directory that is not Bazel package",
-		ModuleTypeUnderTest:        "python_binary_host",
-		ModuleTypeUnderTestFactory: python.PythonBinaryHostFactory,
-		Filesystem: map[string]string{
-			"a/b.py": "",
-		},
-		Blueprint: `python_binary_host {
-    name: "foo",
-    main: "a/b.py",
-    bazel_module: { bp2build_available: true },
-}
-
-`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("py_binary", "foo", AttrNameToString{
-				"main":    `"a/b.py"`,
-				"imports": `["."]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
-
-func TestPythonBinaryDuplicatesInRequired(t *testing.T) {
-	runBp2BuildTestCaseWithPythonLibraries(t, Bp2buildTestCase{
-		Description:                "python_binary_host duplicates in required attribute of the module and its defaults",
-		ModuleTypeUnderTest:        "python_binary_host",
-		ModuleTypeUnderTestFactory: python.PythonBinaryHostFactory,
-		StubbedBuildDefinitions:    []string{"r1", "r2"},
-		Blueprint: `python_binary_host {
-    name: "foo",
-    main: "a.py",
-		defaults: ["d"],
-    required: [
-        "r1",
-    ],
-    bazel_module: { bp2build_available: true },
-}
-
-python_defaults {
-    name: "d",
-    required: [
-        "r1",
-        "r2",
-    ],
-}` + simpleModule("genrule", "r1") +
-			simpleModule("genrule", "r2"),
-
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("py_binary", "foo", AttrNameToString{
-				"main":    `"a.py"`,
-				"imports": `["."]`,
-				"data": `[
-        ":r1",
-        ":r2",
-    ]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/python_library_conversion_test.go b/bp2build/python_library_conversion_test.go
deleted file mode 100644
index ad6a27b..0000000
--- a/bp2build/python_library_conversion_test.go
+++ /dev/null
@@ -1,392 +0,0 @@
-package bp2build
-
-import (
-	"fmt"
-	"strings"
-	"testing"
-
-	"android/soong/android"
-	"android/soong/python"
-)
-
-// TODO(alexmarquez): Should be lifted into a generic Bp2Build file
-type PythonLibBp2Build func(ctx android.TopDownMutatorContext)
-
-type pythonLibBp2BuildTestCase struct {
-	description             string
-	filesystem              map[string]string
-	blueprint               string
-	expectedBazelTargets    []testBazelTarget
-	dir                     string
-	expectedError           error
-	stubbedBuildDefinitions []string
-}
-
-func convertPythonLibTestCaseToBp2build_Host(tc pythonLibBp2BuildTestCase) Bp2buildTestCase {
-	for i := range tc.expectedBazelTargets {
-		tc.expectedBazelTargets[i].attrs["target_compatible_with"] = `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`
-	}
-
-	return convertPythonLibTestCaseToBp2build(tc)
-}
-
-func convertPythonLibTestCaseToBp2build(tc pythonLibBp2BuildTestCase) Bp2buildTestCase {
-	var bp2BuildTargets []string
-	for _, t := range tc.expectedBazelTargets {
-		bp2BuildTargets = append(bp2BuildTargets, MakeBazelTarget(t.typ, t.name, t.attrs))
-	}
-	// Copy the filesystem so that we can change stuff in it later without it
-	// affecting the original pythonLibBp2BuildTestCase
-	filesystemCopy := make(map[string]string)
-	for k, v := range tc.filesystem {
-		filesystemCopy[k] = v
-	}
-	return Bp2buildTestCase{
-		Description:             tc.description,
-		Filesystem:              filesystemCopy,
-		Blueprint:               tc.blueprint,
-		ExpectedBazelTargets:    bp2BuildTargets,
-		Dir:                     tc.dir,
-		ExpectedErr:             tc.expectedError,
-		StubbedBuildDefinitions: tc.stubbedBuildDefinitions,
-	}
-}
-
-func runPythonLibraryTestCase(t *testing.T, tc pythonLibBp2BuildTestCase) {
-	t.Helper()
-	testCase := convertPythonLibTestCaseToBp2build(tc)
-	testCase.Description = fmt.Sprintf(testCase.Description, "python_library")
-	testCase.Blueprint = fmt.Sprintf(testCase.Blueprint, "python_library")
-	for name, contents := range testCase.Filesystem {
-		if strings.HasSuffix(name, "Android.bp") {
-			testCase.Filesystem[name] = fmt.Sprintf(contents, "python_library")
-		}
-	}
-	testCase.ModuleTypeUnderTest = "python_library"
-	testCase.ModuleTypeUnderTestFactory = python.PythonLibraryFactory
-
-	RunBp2BuildTestCaseSimple(t, testCase)
-}
-
-func runPythonLibraryHostTestCase(t *testing.T, tc pythonLibBp2BuildTestCase) {
-	t.Helper()
-	testCase := convertPythonLibTestCaseToBp2build_Host(tc)
-	testCase.Description = fmt.Sprintf(testCase.Description, "python_library_host")
-	testCase.Blueprint = fmt.Sprintf(testCase.Blueprint, "python_library_host")
-	for name, contents := range testCase.Filesystem {
-		if strings.HasSuffix(name, "Android.bp") {
-			testCase.Filesystem[name] = fmt.Sprintf(contents, "python_library_host")
-		}
-	}
-	testCase.ModuleTypeUnderTest = "python_library_host"
-	testCase.ModuleTypeUnderTestFactory = python.PythonLibraryHostFactory
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("python_library", python.PythonLibraryFactory)
-	},
-		testCase)
-}
-
-func runPythonLibraryTestCases(t *testing.T, tc pythonLibBp2BuildTestCase) {
-	t.Helper()
-	runPythonLibraryTestCase(t, tc)
-	runPythonLibraryHostTestCase(t, tc)
-}
-
-func TestSimplePythonLib(t *testing.T) {
-	testCases := []pythonLibBp2BuildTestCase{
-		{
-			description: "simple %s converts to a native py_library",
-			filesystem: map[string]string{
-				"a.py":           "",
-				"b/c.py":         "",
-				"b/d.py":         "",
-				"b/e.py":         "",
-				"files/data.txt": "",
-			},
-			stubbedBuildDefinitions: []string{"bar"},
-			blueprint: `%s {
-    name: "foo",
-    srcs: ["**/*.py"],
-    exclude_srcs: ["b/e.py"],
-    data: ["files/data.txt",],
-    libs: ["bar"],
-    bazel_module: { bp2build_available: true },
-}
-    python_library {
-      name: "bar",
-      srcs: ["b/e.py"],
-    }`,
-			expectedBazelTargets: []testBazelTarget{
-				{
-					typ:  "py_library",
-					name: "foo",
-					attrs: AttrNameToString{
-						"data": `["files/data.txt"]`,
-						"deps": `[":bar"]`,
-						"srcs": `[
-        "a.py",
-        "b/c.py",
-        "b/d.py",
-    ]`,
-						"srcs_version": `"PY3"`,
-						"imports":      `["."]`,
-					},
-				},
-			},
-		},
-		{
-			description: "py2 %s converts to a native py_library",
-			blueprint: `%s {
-    name: "foo",
-    srcs: ["a.py"],
-    version: {
-        py2: {
-            enabled: true,
-        },
-        py3: {
-            enabled: false,
-        },
-    },
-
-    bazel_module: { bp2build_available: true },
-}`,
-			expectedBazelTargets: []testBazelTarget{
-				{
-					typ:  "py_library",
-					name: "foo",
-					attrs: AttrNameToString{
-						"srcs":         `["a.py"]`,
-						"srcs_version": `"PY2"`,
-						"imports":      `["."]`,
-					},
-				},
-			},
-		},
-		{
-			description: "py3 %s converts to a native py_library",
-			blueprint: `%s {
-    name: "foo",
-    srcs: ["a.py"],
-    version: {
-        py2: {
-            enabled: false,
-        },
-        py3: {
-            enabled: true,
-        },
-    },
-
-    bazel_module: { bp2build_available: true },
-}`,
-			expectedBazelTargets: []testBazelTarget{
-				{
-					typ:  "py_library",
-					name: "foo",
-					attrs: AttrNameToString{
-						"srcs":         `["a.py"]`,
-						"srcs_version": `"PY3"`,
-						"imports":      `["."]`,
-					},
-				},
-			},
-		},
-		{
-			description: "py2&3 %s converts to a native py_library",
-			blueprint: `%s {
-    name: "foo",
-    srcs: ["a.py"],
-    version: {
-        py2: {
-            enabled: true,
-        },
-        py3: {
-            enabled: true,
-        },
-    },
-
-    bazel_module: { bp2build_available: true },
-}`,
-			expectedBazelTargets: []testBazelTarget{
-				{
-					// srcs_version is PY2ANDPY3 by default.
-					typ:  "py_library",
-					name: "foo",
-					attrs: AttrNameToString{
-						"srcs":    `["a.py"]`,
-						"imports": `["."]`,
-					},
-				},
-			},
-		},
-		{
-			description: "%s: pkg_path in a subdirectory of the same name converts correctly",
-			dir:         "mylib/subpackage",
-			filesystem: map[string]string{
-				"mylib/subpackage/a.py": "",
-				"mylib/subpackage/Android.bp": `%s {
-				name: "foo",
-				srcs: ["a.py"],
-				pkg_path: "mylib/subpackage",
-
-				bazel_module: { bp2build_available: true },
-			}`,
-			},
-			blueprint: `%s {name: "bar"}`,
-			expectedBazelTargets: []testBazelTarget{
-				{
-					// srcs_version is PY2ANDPY3 by default.
-					typ:  "py_library",
-					name: "foo",
-					attrs: AttrNameToString{
-						"srcs":         `["a.py"]`,
-						"imports":      `["../.."]`,
-						"srcs_version": `"PY3"`,
-					},
-				},
-			},
-		},
-		{
-			description: "%s: pkg_path in a subdirectory of a different name fails",
-			dir:         "mylib/subpackage",
-			filesystem: map[string]string{
-				"mylib/subpackage/a.py": "",
-				"mylib/subpackage/Android.bp": `%s {
-				name: "foo",
-				srcs: ["a.py"],
-				pkg_path: "mylib/subpackage2",
-				bazel_module: { bp2build_available: true },
-			}`,
-			},
-			blueprint:     `%s {name: "bar"}`,
-			expectedError: fmt.Errorf("Currently, bp2build only supports pkg_paths that are the same as the folders the Android.bp file is in."),
-		},
-	}
-
-	for _, tc := range testCases {
-		t.Run(tc.description, func(t *testing.T) {
-			runPythonLibraryTestCases(t, tc)
-		})
-	}
-}
-
-func TestPythonArchVariance(t *testing.T) {
-	runPythonLibraryTestCases(t, pythonLibBp2BuildTestCase{
-		description: "test %s arch variants",
-		filesystem: map[string]string{
-			"dir/arm.py": "",
-			"dir/x86.py": "",
-		},
-		blueprint: `%s {
-					 name: "foo",
-					 arch: {
-						 arm: {
-							 srcs: ["arm.py"],
-						 },
-						 x86: {
-							 srcs: ["x86.py"],
-						 },
-					},
-				 }`,
-		expectedBazelTargets: []testBazelTarget{
-			{
-				typ:  "py_library",
-				name: "foo",
-				attrs: AttrNameToString{
-					"srcs": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": ["arm.py"],
-        "//build/bazel_common_rules/platforms/arch:x86": ["x86.py"],
-        "//conditions:default": [],
-    })`,
-					"srcs_version": `"PY3"`,
-					"imports":      `["."]`,
-				},
-			},
-		},
-	})
-}
-
-func TestPythonLibraryWithProtobufs(t *testing.T) {
-	runPythonLibraryTestCases(t, pythonLibBp2BuildTestCase{
-		description: "test %s protobuf",
-		filesystem: map[string]string{
-			"dir/mylib.py":      "",
-			"dir/myproto.proto": "",
-		},
-		blueprint: `%s {
-					 name: "foo",
-					 srcs: [
-						"dir/mylib.py",
-						"dir/myproto.proto",
-					 ],
-				 }`,
-		expectedBazelTargets: []testBazelTarget{
-			{
-				typ:  "proto_library",
-				name: "foo_proto",
-				attrs: AttrNameToString{
-					"srcs": `["dir/myproto.proto"]`,
-				},
-			},
-			{
-				typ:  "py_proto_library",
-				name: "foo_py_proto",
-				attrs: AttrNameToString{
-					"deps": `[":foo_proto"]`,
-				},
-			},
-			{
-				typ:  "py_library",
-				name: "foo",
-				attrs: AttrNameToString{
-					"srcs":         `["dir/mylib.py"]`,
-					"srcs_version": `"PY3"`,
-					"imports":      `["."]`,
-					"deps":         `[":foo_py_proto"]`,
-				},
-			},
-		},
-	})
-}
-
-func TestPythonLibraryWithProtobufsAndPkgPath(t *testing.T) {
-	t.Parallel()
-	runBp2BuildTestCaseWithPythonLibraries(t, Bp2buildTestCase{
-		Description: "test python_library protobuf with pkg_path",
-		Filesystem: map[string]string{
-			"dir/foo.proto": "",
-			"dir/bar.proto": "", // bar contains "import dir/foo.proto"
-			"dir/Android.bp": `
-python_library {
-  name: "foo",
-  pkg_path: "dir",
-  srcs: [
-    "foo.proto",
-    "bar.proto",
-  ],
-  bazel_module: {bp2build_available: true},
-}`,
-		},
-		Dir: "dir",
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
-				"import_prefix":       `"dir"`,
-				"strip_import_prefix": `""`,
-				"srcs": `[
-        "foo.proto",
-        "bar.proto",
-    ]`,
-			}),
-			MakeBazelTarget("py_proto_library", "foo_py_proto", AttrNameToString{
-				"deps": `[":foo_proto"]`,
-			}),
-			MakeBazelTarget("py_library", "foo", AttrNameToString{
-				"srcs_version": `"PY3"`,
-				"imports":      `[".."]`,
-				"deps":         `[":foo_py_proto"]`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/python_test_conversion_test.go b/bp2build/python_test_conversion_test.go
deleted file mode 100644
index fca7efb..0000000
--- a/bp2build/python_test_conversion_test.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/python"
-)
-
-func TestPythonTestHostSimple(t *testing.T) {
-	runBp2BuildTestCaseWithPythonLibraries(t, Bp2buildTestCase{
-		Description:                "simple python_test_host converts to a native py_test",
-		ModuleTypeUnderTest:        "python_test_host",
-		ModuleTypeUnderTestFactory: python.PythonTestHostFactory,
-		Filesystem: map[string]string{
-			"a.py":           "",
-			"b/c.py":         "",
-			"b/d.py":         "",
-			"b/e.py":         "",
-			"files/data.txt": "",
-		},
-		StubbedBuildDefinitions: []string{"bar"},
-		Blueprint: `python_test_host {
-    name: "foo",
-    main: "a.py",
-    srcs: ["**/*.py"],
-    exclude_srcs: ["b/e.py"],
-    data: ["files/data.txt",],
-    libs: ["bar"],
-    bazel_module: { bp2build_available: true },
-}
-    python_library_host {
-      name: "bar",
-      srcs: ["b/e.py"],
-    }`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("py_test", "foo", AttrNameToString{
-				"data":    `["files/data.txt"]`,
-				"deps":    `[":bar"]`,
-				"main":    `"a.py"`,
-				"imports": `["."]`,
-				"srcs": `[
-        "a.py",
-        "b/c.py",
-        "b/d.py",
-    ]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			}),
-		},
-	})
-}
diff --git a/bp2build/rust_binary_conversion_test.go b/bp2build/rust_binary_conversion_test.go
deleted file mode 100644
index a5abbdb..0000000
--- a/bp2build/rust_binary_conversion_test.go
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"android/soong/android"
-	"android/soong/rust"
-	"testing"
-)
-
-func runRustBinaryTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, registerRustBinaryModuleTypes, tc)
-}
-
-func registerRustBinaryModuleTypes(ctx android.RegistrationContext) {
-	ctx.RegisterModuleType("rust_binary_host", rust.RustBinaryHostFactory)
-	ctx.RegisterModuleType("rust_library_host", rust.RustLibraryHostFactory)
-	ctx.RegisterModuleType("rust_proc_macro", rust.ProcMacroFactory)
-
-}
-
-func TestRustBinaryHost(t *testing.T) {
-	runRustBinaryTestCase(t, Bp2buildTestCase{
-		Dir:       "external/rust/crates/foo",
-		Blueprint: "",
-		Filesystem: map[string]string{
-			"external/rust/crates/foo/src/lib.rs":    "",
-			"external/rust/crates/foo/src/helper.rs": "",
-			"external/rust/crates/foo/Android.bp": `
-rust_binary_host {
-	name: "libfoo",
-	crate_name: "foo",
-	srcs: ["src/main.rs"],
-	edition: "2021",
-	features: ["bah-enabled"],
-	cfgs: ["baz"],
-	rustlibs: ["libbar"],
-	proc_macros: ["libbah"],
-    bazel_module: { bp2build_available: true },
-}
-`,
-			"external/rust/crates/bar/Android.bp": `
-rust_library_host {
-	name: "libbar",
-	crate_name: "bar",
-	srcs: ["src/lib.rs"],
-    bazel_module: { bp2build_available: true },
-}
-`,
-			"external/rust/crates/bah/Android.bp": `
-rust_proc_macro {
-	name: "libbah",
-	crate_name: "bah",
-	srcs: ["src/lib.rs"],
-    bazel_module: { bp2build_available: true },
-}
-`,
-		},
-		ExpectedBazelTargets: []string{
-			makeBazelTargetHostOrDevice("rust_binary", "libfoo", AttrNameToString{
-				"crate_name": `"foo"`,
-				"srcs": `[
-        "src/helper.rs",
-        "src/lib.rs",
-    ]`,
-				"deps":            `["//external/rust/crates/bar:libbar"]`,
-				"proc_macro_deps": `["//external/rust/crates/bah:libbah"]`,
-				"edition":         `"2021"`,
-				"crate_features":  `["bah-enabled"]`,
-				"rustc_flags":     `["--cfg=baz"]`,
-			}, android.HostSupported),
-		},
-	},
-	)
-}
diff --git a/bp2build/rust_ffi_conversion_test.go b/bp2build/rust_ffi_conversion_test.go
deleted file mode 100644
index 97fe297..0000000
--- a/bp2build/rust_ffi_conversion_test.go
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"android/soong/android"
-	"android/soong/rust"
-	"testing"
-)
-
-func runRustFfiTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, registerRustFfiModuleTypes, tc)
-}
-
-func registerRustFfiModuleTypes(ctx android.RegistrationContext) {
-	ctx.RegisterModuleType("rust_ffi_static", rust.RustFFIStaticFactory)
-	ctx.RegisterModuleType("rust_library", rust.RustLibraryFactory)
-}
-
-func TestRustFfiStatic(t *testing.T) {
-	runRustFfiTestCase(t, Bp2buildTestCase{
-		Dir:       "external/rust/crates/foo",
-		Blueprint: "",
-		Filesystem: map[string]string{
-			"external/rust/crates/foo/src/lib.rs":    "",
-			"external/rust/crates/foo/src/helper.rs": "",
-			"external/rust/crates/foo/Android.bp": `
-rust_ffi_static {
-	name: "libfoo",
-	crate_name: "foo",
-	host_supported: true,
-	srcs: ["src/lib.rs"],
-	edition: "2015",
-	include_dirs: [
-		"include",
-	],
-	rustlibs: ["libbar"],
-	bazel_module: { bp2build_available: true },
-}
-`,
-			"external/rust/crates/bar/Android.bp": `
-rust_library {
-	name: "libbar",
-	crate_name: "bar",
-	host_supported: true,
-	srcs: ["src/lib.rs"],
-	bazel_module: { bp2build_available: true },
-}
-`,
-		},
-		ExpectedBazelTargets: []string{
-			MakeBazelTargetNoRestrictions("rust_ffi_static", "libfoo", AttrNameToString{
-				"crate_name": `"foo"`,
-				"deps":       `["//external/rust/crates/bar:libbar"]`,
-				"srcs": `[
-        "src/helper.rs",
-        "src/lib.rs",
-    ]`,
-				"edition":         `"2015"`,
-				"export_includes": `["include"]`,
-			}),
-		},
-	},
-	)
-}
diff --git a/bp2build/rust_library_conversion_test.go b/bp2build/rust_library_conversion_test.go
deleted file mode 100644
index 09fc0ed..0000000
--- a/bp2build/rust_library_conversion_test.go
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"android/soong/android"
-	"android/soong/rust"
-	"testing"
-)
-
-func runRustLibraryTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, registerRustLibraryModuleTypes, tc)
-}
-
-func registerRustLibraryModuleTypes(ctx android.RegistrationContext) {
-	ctx.RegisterModuleType("rust_library", rust.RustLibraryFactory)
-	ctx.RegisterModuleType("rust_library_host", rust.RustLibraryHostFactory)
-}
-
-func TestLibProtobuf(t *testing.T) {
-	runRustLibraryTestCase(t, Bp2buildTestCase{
-		Dir:       "external/rust/crates/foo",
-		Blueprint: "",
-		Filesystem: map[string]string{
-			"external/rust/crates/foo/src/lib.rs": "",
-			"external/rust/crates/foo/Android.bp": `
-rust_library_host {
-	name: "libprotobuf",
-	crate_name: "protobuf",
-	srcs: ["src/lib.rs"],
-    bazel_module: { bp2build_available: true },
-}
-`,
-		},
-		ExpectedBazelTargets: []string{
-			// TODO(b/290790800): Remove the restriction when rust toolchain for android is implemented
-			makeBazelTargetHostOrDevice("rust_library", "libprotobuf", AttrNameToString{
-				"crate_name": `"protobuf"`,
-				"srcs":       `["src/lib.rs"]`,
-				"deps":       `[":libprotobuf_build_script"]`,
-			}, android.HostSupported),
-			makeBazelTargetHostOrDevice("cargo_build_script", "libprotobuf_build_script", AttrNameToString{
-				"srcs": `["build.rs"]`,
-			}, android.HostSupported),
-		},
-	},
-	)
-}
-
-func TestRustLibrary(t *testing.T) {
-	expectedAttrs := AttrNameToString{
-		"crate_name": `"foo"`,
-		"srcs": `[
-        "src/helper.rs",
-        "src/lib.rs",
-    ]`,
-		"crate_features": `["bah-enabled"]`,
-		"edition":        `"2021"`,
-		"rustc_flags":    `["--cfg=baz"]`,
-	}
-
-	runRustLibraryTestCase(t, Bp2buildTestCase{
-		Dir:       "external/rust/crates/foo",
-		Blueprint: "",
-		Filesystem: map[string]string{
-			"external/rust/crates/foo/src/lib.rs":    "",
-			"external/rust/crates/foo/src/helper.rs": "",
-			"external/rust/crates/foo/Android.bp": `
-rust_library {
-	name: "libfoo",
-	crate_name: "foo",
-    host_supported: true,
-	srcs: ["src/lib.rs"],
-	edition: "2021",
-	features: ["bah-enabled"],
-	cfgs: ["baz"],
-    bazel_module: { bp2build_available: true },
-}
-rust_library_host {
-    name: "libfoo_host",
-    crate_name: "foo",
-    srcs: ["src/lib.rs"],
-    edition: "2021",
-    features: ["bah-enabled"],
-    cfgs: ["baz"],
-    bazel_module: { bp2build_available: true },
-}
-`,
-		},
-		ExpectedBazelTargets: []string{
-			MakeBazelTargetNoRestrictions("rust_library", "libfoo", expectedAttrs),
-			makeBazelTargetHostOrDevice("rust_library", "libfoo_host", expectedAttrs, android.HostSupported),
-		},
-	},
-	)
-}
diff --git a/bp2build/rust_proc_macro_conversion_test.go b/bp2build/rust_proc_macro_conversion_test.go
deleted file mode 100644
index 7df37ec..0000000
--- a/bp2build/rust_proc_macro_conversion_test.go
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"android/soong/android"
-	"android/soong/rust"
-	"testing"
-)
-
-func rustRustProcMacroTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, registerRustProcMacroModuleTypes, tc)
-}
-
-func registerRustProcMacroModuleTypes(ctx android.RegistrationContext) {
-	ctx.RegisterModuleType("rust_library_host", rust.RustLibraryHostFactory)
-	ctx.RegisterModuleType("rust_proc_macro", rust.ProcMacroFactory)
-}
-
-func TestRustProcMacroLibrary(t *testing.T) {
-	rustRustProcMacroTestCase(t, Bp2buildTestCase{
-		Dir:       "external/rust/crates/foo",
-		Blueprint: "",
-		Filesystem: map[string]string{
-			"external/rust/crates/foo/src/lib.rs":    "",
-			"external/rust/crates/foo/src/helper.rs": "",
-			"external/rust/crates/foo/Android.bp": `
-rust_proc_macro {
-	name: "libfoo",
-	crate_name: "foo",
-	srcs: ["src/lib.rs"],
-	edition: "2021",
-	features: ["bah-enabled"],
-	cfgs: ["baz"],
-	rustlibs: ["libbar"],
-    bazel_module: { bp2build_available: true },
-}
-`,
-			"external/rust/crates/bar/src/lib.rs": "",
-			"external/rust/crates/bar/Android.bp": `
-rust_library_host {
-    name: "libbar",
-    crate_name: "bar",
-    srcs: ["src/lib.rs"],
-    bazel_module: { bp2build_available: true },
-}`,
-		},
-		ExpectedBazelTargets: []string{
-			makeBazelTargetHostOrDevice("rust_proc_macro", "libfoo", AttrNameToString{
-				"crate_name": `"foo"`,
-				"srcs": `[
-        "src/helper.rs",
-        "src/lib.rs",
-    ]`,
-				"crate_features": `["bah-enabled"]`,
-				"edition":        `"2021"`,
-				"rustc_flags":    `["--cfg=baz"]`,
-				"deps":           `["//external/rust/crates/bar:libbar"]`,
-			}, android.HostSupported),
-		},
-	},
-	)
-}
diff --git a/bp2build/rust_protobuf_conversion_test.go b/bp2build/rust_protobuf_conversion_test.go
deleted file mode 100644
index bd4f54b..0000000
--- a/bp2build/rust_protobuf_conversion_test.go
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"android/soong/android"
-	"android/soong/rust"
-	"testing"
-)
-
-func runRustProtobufTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, registerRustProtobufModuleTypes, tc)
-}
-
-func registerRustProtobufModuleTypes(ctx android.RegistrationContext) {
-	ctx.RegisterModuleType("rust_protobuf_host", rust.RustProtobufHostFactory)
-	ctx.RegisterModuleType("rust_protobuf", rust.RustProtobufHostFactory)
-}
-
-func TestRustProtobufHostTestCase(t *testing.T) {
-	runRustProtobufTestCase(t, Bp2buildTestCase{
-		Dir:       "external/rust/crates/foo",
-		Blueprint: "",
-		Filesystem: map[string]string{
-			"external/rust/crates/foo/src/lib.rs":    "",
-			"external/rust/crates/foo/src/helper.rs": "",
-			"external/rust/crates/foo/Android.bp": `
-rust_protobuf_host {
-	name: "libfoo",
-	crate_name: "foo",
-	protos: ["src/foo.proto"],
-    bazel_module: { bp2build_available: true },
-}
-`,
-		},
-		ExpectedBazelTargets: []string{
-			makeBazelTargetHostOrDevice("proto_library", "libfoo_proto", AttrNameToString{
-				"srcs": `["src/foo.proto"]`,
-			}, android.HostSupported),
-			makeBazelTargetHostOrDevice("rust_proto_library", "libfoo", AttrNameToString{
-				"crate_name": `"foo"`,
-				"deps":       `[":libfoo_proto"]`,
-			}, android.HostSupported),
-		},
-	},
-	)
-}
-
-func TestRustProtobufTestCase(t *testing.T) {
-	runRustProtobufTestCase(t, Bp2buildTestCase{
-		Dir:       "external/rust/crates/foo",
-		Blueprint: "",
-		Filesystem: map[string]string{
-			"external/rust/crates/foo/src/lib.rs":    "",
-			"external/rust/crates/foo/src/helper.rs": "",
-			"external/rust/crates/foo/Android.bp": `
-rust_protobuf {
-	name: "libfoo",
-	crate_name: "foo",
-	protos: ["src/foo.proto"],
-    bazel_module: { bp2build_available: true },
-}
-`,
-		},
-		ExpectedBazelTargets: []string{
-			makeBazelTargetHostOrDevice("proto_library", "libfoo_proto", AttrNameToString{
-				"srcs": `["src/foo.proto"]`,
-			}, android.HostSupported),
-			makeBazelTargetHostOrDevice("rust_proto_library", "libfoo", AttrNameToString{
-				"crate_name": `"foo"`,
-				"deps":       `[":libfoo_proto"]`,
-			}, android.HostSupported),
-		},
-	},
-	)
-}
diff --git a/bp2build/sh_conversion_test.go b/bp2build/sh_conversion_test.go
deleted file mode 100644
index 92b3a65..0000000
--- a/bp2build/sh_conversion_test.go
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/sh"
-)
-
-func TestShBinaryLoadStatement(t *testing.T) {
-	testCases := []struct {
-		bazelTargets           BazelTargets
-		expectedLoadStatements string
-	}{
-		{
-			bazelTargets: BazelTargets{
-				BazelTarget{
-					name:      "sh_binary_target",
-					ruleClass: "sh_binary",
-					// Note: no bzlLoadLocation for native rules
-					// TODO(ruperts): Could open source the existing, experimental Starlark sh_ rules?
-				},
-			},
-			expectedLoadStatements: ``,
-		},
-	}
-
-	for _, testCase := range testCases {
-		actual := testCase.bazelTargets.LoadStatements()
-		expected := testCase.expectedLoadStatements
-		if actual != expected {
-			t.Fatalf("Expected load statements to be %s, got %s", expected, actual)
-		}
-	}
-}
-
-func runShBinaryTestCase(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, tc)
-}
-
-func TestShBinarySimple(t *testing.T) {
-	runShBinaryTestCase(t, Bp2buildTestCase{
-		Description:                "sh_binary test",
-		ModuleTypeUnderTest:        "sh_binary",
-		ModuleTypeUnderTestFactory: sh.ShBinaryFactory,
-		Blueprint: `sh_binary {
-    name: "foo",
-    src: "foo.sh",
-    filename: "foo.exe",
-    sub_dir: "sub",
-    bazel_module: { bp2build_available: true },
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("sh_binary", "foo", AttrNameToString{
-				"srcs":     `["foo.sh"]`,
-				"filename": `"foo.exe"`,
-				"sub_dir":  `"sub"`,
-			})},
-	})
-}
-
-func TestShBinaryDefaults(t *testing.T) {
-	runShBinaryTestCase(t, Bp2buildTestCase{
-		Description:                "sh_binary test",
-		ModuleTypeUnderTest:        "sh_binary",
-		ModuleTypeUnderTestFactory: sh.ShBinaryFactory,
-		Blueprint: `sh_binary {
-    name: "foo",
-    src: "foo.sh",
-    bazel_module: { bp2build_available: true },
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("sh_binary", "foo", AttrNameToString{
-				"srcs": `["foo.sh"]`,
-			})},
-	})
-}
diff --git a/bp2build/sh_test_conversion_test.go b/bp2build/sh_test_conversion_test.go
deleted file mode 100644
index 4bea396..0000000
--- a/bp2build/sh_test_conversion_test.go
+++ /dev/null
@@ -1,340 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"testing"
-
-	"android/soong/android"
-	"android/soong/sh"
-)
-
-func TestShTestSimple(t *testing.T) {
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-	}, Bp2buildTestCase{
-		Description:         "sh_test test",
-		ModuleTypeUnderTest: "sh_test",
-		StubbedBuildDefinitions: []string{"android.hardware.bluetooth@1.1-service.sim",
-			"android.hardware.bluetooth@1.1-impl-sim", "libc++", "libcrypto"},
-		ModuleTypeUnderTestFactory: sh.ShTestFactory,
-		Blueprint: simpleModule("filegroup", "android.hardware.bluetooth@1.1-service.sim") +
-			simpleModule("filegroup", "android.hardware.bluetooth@1.1-impl-sim") +
-			simpleModule("filegroup", "libc++") +
-			simpleModule("filegroup", "libcrypto") + `sh_test{
-    name: "sts-rootcanal-sidebins",
-    src: "empty.sh",
-    test_suites: [
-        "sts",
-        "sts-lite",
-    ],
-    data_bins: [
-        "android.hardware.bluetooth@1.1-service.sim",
-        "android.hardware.bluetooth@1.1-impl-sim"
-    ],
-    data: ["android.hardware.bluetooth@1.1-service.sim.rc"],
-    data_libs: ["libc++","libcrypto"],
-		test_config: "art-gtests-target-install-apex.xml",
-		test_config_template: ":art-run-test-target-template",
-		auto_gen_config: false,
-    test_options:{tags: ["no-remote"],
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("sh_test", "sts-rootcanal-sidebins", AttrNameToString{
-				"srcs":    `["empty.sh"]`,
-				"runs_on": `["device"]`,
-				"data": `[
-        "android.hardware.bluetooth@1.1-service.sim.rc",
-        ":android.hardware.bluetooth@1.1-service.sim",
-        ":android.hardware.bluetooth@1.1-impl-sim",
-        ":libc++",
-        ":libcrypto",
-    ]`,
-				"data_bins": `[
-        ":android.hardware.bluetooth@1.1-service.sim",
-        ":android.hardware.bluetooth@1.1-impl-sim",
-    ]`,
-				"tags": `["no-remote"]`,
-			})},
-	})
-}
-
-func TestShTestHostSimple(t *testing.T) {
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-	}, Bp2buildTestCase{
-		Description:         "sh_test_host test",
-		ModuleTypeUnderTest: "sh_test_host",
-		StubbedBuildDefinitions: []string{"android.hardware.bluetooth@1.1-service.sim",
-			"android.hardware.bluetooth@1.1-impl-sim", "libc++", "libcrypto"},
-		ModuleTypeUnderTestFactory: sh.ShTestHostFactory,
-		Blueprint: simpleModule("filegroup", "android.hardware.bluetooth@1.1-service.sim") +
-			simpleModule("filegroup", "android.hardware.bluetooth@1.1-impl-sim") +
-			simpleModule("filegroup", "libc++") +
-			simpleModule("filegroup", "libcrypto") + `sh_test_host{
-    name: "sts-rootcanal-sidebins",
-    src: "empty.sh",
-    test_suites: [
-        "sts",
-        "sts-lite",
-    ],
-    data_bins: [
-        "android.hardware.bluetooth@1.1-service.sim",
-        "android.hardware.bluetooth@1.1-impl-sim"
-    ],
-    data: ["android.hardware.bluetooth@1.1-service.sim.rc"],
-    data_libs: ["libc++","libcrypto"],
-		test_config: "art-gtests-target-install-apex.xml",
-		test_config_template: ":art-run-test-target-template",
-		auto_gen_config: false,
-    test_options:{tags: ["no-remote"],
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("sh_test", "sts-rootcanal-sidebins", AttrNameToString{
-				"srcs":    `["empty.sh"]`,
-				"runs_on": `["host_without_device"]`,
-				"data": `[
-        "android.hardware.bluetooth@1.1-service.sim.rc",
-        ":android.hardware.bluetooth@1.1-service.sim",
-        ":android.hardware.bluetooth@1.1-impl-sim",
-        ":libc++",
-        ":libcrypto",
-    ]`,
-				"data_bins": `[
-        ":android.hardware.bluetooth@1.1-service.sim",
-        ":android.hardware.bluetooth@1.1-impl-sim",
-    ]`,
-				"tags": `["no-remote"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			})},
-	})
-}
-
-func TestShTestAutogen(t *testing.T) {
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-	}, Bp2buildTestCase{
-		Description:         "sh_test test",
-		ModuleTypeUnderTest: "sh_test",
-		StubbedBuildDefinitions: []string{"android.hardware.bluetooth@1.1-service.sim",
-			"android.hardware.bluetooth@1.1-impl-sim", "libc++", "libcrypto", "art-run-test-target-template"},
-		ModuleTypeUnderTestFactory: sh.ShTestFactory,
-		Blueprint: simpleModule("filegroup", "android.hardware.bluetooth@1.1-service.sim") +
-			simpleModule("filegroup", "android.hardware.bluetooth@1.1-impl-sim") +
-			simpleModule("filegroup", "libc++") +
-			simpleModule("filegroup", "libcrypto") +
-			simpleModule("filegroup", "art-run-test-target-template") + `sh_test{
-    name: "sts-rootcanal-sidebins",
-    src: "empty.sh",
-    test_suites: [
-        "sts",
-        "sts-lite",
-    ],
-    data_bins: [
-        "android.hardware.bluetooth@1.1-service.sim",
-        "android.hardware.bluetooth@1.1-impl-sim"
-    ],
-    data: ["android.hardware.bluetooth@1.1-service.sim.rc"],
-    data_libs: ["libc++","libcrypto"],
-		test_config: "art-gtests-target-install-apex.xml",
-		test_config_template: ":art-run-test-target-template",
-		auto_gen_config: true,
-    test_options:{tags: ["no-remote"],
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("sh_test", "sts-rootcanal-sidebins", AttrNameToString{
-				"srcs":                      `["empty.sh"]`,
-				"runs_on":                   `["device"]`,
-				"auto_generate_test_config": "True",
-				"target_compatible_with":    `["//build/bazel_common_rules/platforms/os:android"]`,
-				"template_test_config":      `":art-run-test-target-template"`,
-				"data": `[
-        "android.hardware.bluetooth@1.1-service.sim.rc",
-        ":android.hardware.bluetooth@1.1-service.sim",
-        ":android.hardware.bluetooth@1.1-impl-sim",
-        ":libc++",
-        ":libcrypto",
-    ]`,
-				"data_bins": `[
-        ":android.hardware.bluetooth@1.1-service.sim",
-        ":android.hardware.bluetooth@1.1-impl-sim",
-    ]`,
-				"tags": `["no-remote"]`,
-			})},
-	})
-}
-
-func TestShTestHostAutogen(t *testing.T) {
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-	}, Bp2buildTestCase{
-		Description:         "sh_test_host test",
-		ModuleTypeUnderTest: "sh_test_host",
-		StubbedBuildDefinitions: []string{"android.hardware.bluetooth@1.1-service.sim",
-			"android.hardware.bluetooth@1.1-impl-sim", "libc++", "libcrypto", "art-run-test-target-template"},
-		ModuleTypeUnderTestFactory: sh.ShTestHostFactory,
-		Blueprint: simpleModule("filegroup", "android.hardware.bluetooth@1.1-service.sim") +
-			simpleModule("filegroup", "android.hardware.bluetooth@1.1-impl-sim") +
-			simpleModule("filegroup", "libc++") +
-			simpleModule("filegroup", "libcrypto") +
-			simpleModule("filegroup", "art-run-test-target-template") + `sh_test_host{
-    name: "sts-rootcanal-sidebins",
-    src: "empty.sh",
-    test_suites: [
-        "sts",
-        "sts-lite",
-    ],
-    data_bins: [
-        "android.hardware.bluetooth@1.1-service.sim",
-        "android.hardware.bluetooth@1.1-impl-sim"
-    ],
-    data: ["android.hardware.bluetooth@1.1-service.sim.rc"],
-    data_libs: ["libc++","libcrypto"],
-		test_config: "art-gtests-target-install-apex.xml",
-		test_config_template: ":art-run-test-target-template",
-		auto_gen_config: true,
-    test_options:{tags: ["no-remote"],
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("sh_test", "sts-rootcanal-sidebins", AttrNameToString{
-				"srcs":                      `["empty.sh"]`,
-				"runs_on":                   `["host_without_device"]`,
-				"auto_generate_test_config": "True",
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-				"template_test_config": `":art-run-test-target-template"`,
-				"data": `[
-        "android.hardware.bluetooth@1.1-service.sim.rc",
-        ":android.hardware.bluetooth@1.1-service.sim",
-        ":android.hardware.bluetooth@1.1-impl-sim",
-        ":libc++",
-        ":libcrypto",
-    ]`,
-				"data_bins": `[
-        ":android.hardware.bluetooth@1.1-service.sim",
-        ":android.hardware.bluetooth@1.1-impl-sim",
-    ]`,
-				"tags": `["no-remote"]`,
-			})},
-	})
-}
-func TestShTestSimpleUnset(t *testing.T) {
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-	}, Bp2buildTestCase{
-		Description:         "sh_test test",
-		ModuleTypeUnderTest: "sh_test",
-		StubbedBuildDefinitions: []string{"android.hardware.bluetooth@1.1-service.sim",
-			"android.hardware.bluetooth@1.1-impl-sim", "libc++", "libcrypto"},
-		ModuleTypeUnderTestFactory: sh.ShTestFactory,
-		Blueprint: simpleModule("filegroup", "android.hardware.bluetooth@1.1-service.sim") +
-			simpleModule("filegroup", "android.hardware.bluetooth@1.1-impl-sim") +
-			simpleModule("filegroup", "libc++") +
-			simpleModule("filegroup", "libcrypto") + `sh_test{
-    name: "sts-rootcanal-sidebins",
-    src: "empty.sh",
-    test_suites: [
-        "sts",
-        "sts-lite",
-    ],
-    data_bins: [
-        "android.hardware.bluetooth@1.1-service.sim",
-        "android.hardware.bluetooth@1.1-impl-sim"
-    ],
-    data: ["android.hardware.bluetooth@1.1-service.sim.rc"],
-    data_libs: ["libc++","libcrypto"],
-    test_options:{tags: ["no-remote"],
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("sh_test", "sts-rootcanal-sidebins", AttrNameToString{
-				"srcs":    `["empty.sh"]`,
-				"runs_on": `["device"]`,
-				"data": `[
-        "android.hardware.bluetooth@1.1-service.sim.rc",
-        ":android.hardware.bluetooth@1.1-service.sim",
-        ":android.hardware.bluetooth@1.1-impl-sim",
-        ":libc++",
-        ":libcrypto",
-    ]`,
-				"data_bins": `[
-        ":android.hardware.bluetooth@1.1-service.sim",
-        ":android.hardware.bluetooth@1.1-impl-sim",
-    ]`,
-				"tags": `["no-remote"]`,
-			})},
-	})
-}
-
-func TestShTestHostSimpleUnset(t *testing.T) {
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {
-		ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
-	}, Bp2buildTestCase{
-		Description:                "sh_test_host test",
-		ModuleTypeUnderTest:        "sh_test_host",
-		ModuleTypeUnderTestFactory: sh.ShTestHostFactory,
-		StubbedBuildDefinitions: []string{"android.hardware.bluetooth@1.1-service.sim",
-			"android.hardware.bluetooth@1.1-impl-sim", "libc++", "libcrypto"},
-		Blueprint: simpleModule("filegroup", "android.hardware.bluetooth@1.1-service.sim") +
-			simpleModule("filegroup", "android.hardware.bluetooth@1.1-impl-sim") +
-			simpleModule("filegroup", "libc++") +
-			simpleModule("filegroup", "libcrypto") + `sh_test_host{
-    name: "sts-rootcanal-sidebins",
-    src: "empty.sh",
-    test_suites: [
-        "sts",
-        "sts-lite",
-    ],
-    data_bins: [
-        "android.hardware.bluetooth@1.1-service.sim",
-        "android.hardware.bluetooth@1.1-impl-sim"
-    ],
-    data: ["android.hardware.bluetooth@1.1-service.sim.rc"],
-    data_libs: ["libc++","libcrypto"],
-    test_options:{tags: ["no-remote"],
-	},
-}`,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("sh_test", "sts-rootcanal-sidebins", AttrNameToString{
-				"srcs":    `["empty.sh"]`,
-				"runs_on": `["host_without_device"]`,
-				"data": `[
-        "android.hardware.bluetooth@1.1-service.sim.rc",
-        ":android.hardware.bluetooth@1.1-service.sim",
-        ":android.hardware.bluetooth@1.1-impl-sim",
-        ":libc++",
-        ":libcrypto",
-    ]`,
-				"data_bins": `[
-        ":android.hardware.bluetooth@1.1-service.sim",
-        ":android.hardware.bluetooth@1.1-impl-sim",
-    ]`,
-				"tags": `["no-remote"]`,
-				"target_compatible_with": `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`,
-			})},
-	})
-}
diff --git a/bp2build/soong_config_module_type_conversion_test.go b/bp2build/soong_config_module_type_conversion_test.go
deleted file mode 100644
index 2535cf3..0000000
--- a/bp2build/soong_config_module_type_conversion_test.go
+++ /dev/null
@@ -1,1608 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"fmt"
-	"testing"
-
-	"android/soong/android"
-	"android/soong/cc"
-)
-
-func runSoongConfigModuleTypeTest(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, registerSoongConfigModuleTypes, tc)
-}
-
-func registerSoongConfigModuleTypes(ctx android.RegistrationContext) {
-	cc.RegisterCCBuildComponents(ctx)
-
-	android.RegisterSoongConfigModuleBuildComponents(ctx)
-
-	ctx.RegisterModuleType("cc_library", cc.LibraryFactory)
-	ctx.RegisterModuleType("custom", customModuleFactoryHostAndDevice)
-}
-
-func TestErrorInBpFileDoesNotPanic(t *testing.T) {
-	bp := `
-soong_config_module_type {
-    name: "library_linking_strategy_cc_defaults",
-    module_type: "cc_defaults",
-    config_namespace: "ANDROID",
-    variables: ["library_linking_strategy"],
-    properties: [
-        "shared_libs",
-        "static_libs",
-    ],
-}
-`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - generates selects for library_linking_strategy",
-		ModuleTypeUnderTest:        "cc_binary",
-		ModuleTypeUnderTestFactory: cc.BinaryFactory,
-		Blueprint:                  bp,
-		ExpectedErr:                fmt.Errorf(`unknown variable "library_linking_strategy" in module type "library_linking_strategy_cc_defaults`),
-	})
-}
-
-func TestSoongConfigModuleType(t *testing.T) {
-	bp := `
-soong_config_module_type {
-	name: "custom_cc_library_static",
-	module_type: "cc_library_static",
-	config_namespace: "acme",
-	bool_variables: ["feature1"],
-	properties: ["cflags"],
-}
-
-custom_cc_library_static {
-	name: "foo",
-	bazel_module: { bp2build_available: true },
-	host_supported: true,
-	soong_config_variables: {
-		feature1: {
-			conditions_default: {
-				cflags: ["-DDEFAULT1"],
-			},
-			cflags: ["-DFEATURE1"],
-		},
-	},
-}
-`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - soong_config_module_type is supported in bp2build",
-		ModuleTypeUnderTest:        "cc_library_static",
-		ModuleTypeUnderTestFactory: cc.LibraryStaticFactory,
-		Blueprint:                  bp,
-		ExpectedBazelTargets: []string{`cc_library_static(
-    name = "foo",
-    copts = select({
-        "//build/bazel/product_config/config_settings:acme__feature1": ["-DFEATURE1"],
-        "//conditions:default": ["-DDEFAULT1"],
-    }),
-    local_includes = ["."],
-)`}})
-}
-
-func TestSoongConfigModuleTypeImport(t *testing.T) {
-	configBp := `
-soong_config_module_type {
-	name: "custom_cc_library_static",
-	module_type: "cc_library_static",
-	config_namespace: "acme",
-	bool_variables: ["feature1"],
-	properties: ["cflags"],
-}
-`
-	bp := `
-soong_config_module_type_import {
-	from: "foo/bar/SoongConfig.bp",
-	module_types: ["custom_cc_library_static"],
-}
-
-custom_cc_library_static {
-	name: "foo",
-	bazel_module: { bp2build_available: true },
-	host_supported: true,
-	soong_config_variables: {
-		feature1: {
-			conditions_default: {
-				cflags: ["-DDEFAULT1"],
-			},
-			cflags: ["-DFEATURE1"],
-		},
-	},
-}
-`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - soong_config_module_type_import is supported in bp2build",
-		ModuleTypeUnderTest:        "cc_library_static",
-		ModuleTypeUnderTestFactory: cc.LibraryStaticFactory,
-		Filesystem: map[string]string{
-			"foo/bar/SoongConfig.bp": configBp,
-		},
-		Blueprint: bp,
-		ExpectedBazelTargets: []string{`cc_library_static(
-    name = "foo",
-    copts = select({
-        "//build/bazel/product_config/config_settings:acme__feature1": ["-DFEATURE1"],
-        "//conditions:default": ["-DDEFAULT1"],
-    }),
-    local_includes = ["."],
-)`}})
-}
-
-func TestSoongConfigModuleType_StringVar(t *testing.T) {
-	bp := `
-soong_config_string_variable {
-	name: "board",
-	values: ["soc_a", "soc_b", "soc_c"],
-}
-
-soong_config_module_type {
-	name: "custom_cc_library_static",
-	module_type: "cc_library_static",
-	config_namespace: "acme",
-	variables: ["board"],
-	properties: ["cflags"],
-}
-
-custom_cc_library_static {
-	name: "foo",
-	bazel_module: { bp2build_available: true },
-	host_supported: true,
-	soong_config_variables: {
-		board: {
-			soc_a: {
-				cflags: ["-DSOC_A"],
-			},
-			soc_b: {
-				cflags: ["-DSOC_B"],
-			},
-			soc_c: {},
-			conditions_default: {
-				cflags: ["-DSOC_DEFAULT"]
-			},
-		},
-	},
-}
-`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - generates selects for string vars",
-		ModuleTypeUnderTest:        "cc_library_static",
-		ModuleTypeUnderTestFactory: cc.LibraryStaticFactory,
-		Blueprint:                  bp,
-		ExpectedBazelTargets: []string{`cc_library_static(
-    name = "foo",
-    copts = select({
-        "//build/bazel/product_config/config_settings:acme__board__soc_a": ["-DSOC_A"],
-        "//build/bazel/product_config/config_settings:acme__board__soc_b": ["-DSOC_B"],
-        "//build/bazel/product_config/config_settings:acme__board__soc_c": [],
-        "//conditions:default": ["-DSOC_DEFAULT"],
-    }),
-    local_includes = ["."],
-)`}})
-}
-
-func TestSoongConfigModuleType_MultipleBoolVar_PartialUseNotPanic(t *testing.T) {
-	bp := `
-soong_config_bool_variable {
-	name: "feature1",
-}
-
-soong_config_bool_variable {
-	name: "feature2",
-}
-
-soong_config_module_type {
-	name: "custom_cc_library_static",
-	module_type: "cc_library_static",
-	config_namespace: "acme",
-	variables: ["feature1", "feature2",],
-	properties: ["cflags"],
-}
-
-custom_cc_library_static {
-	name: "foo",
-	bazel_module: { bp2build_available: true },
-	host_supported: true,
-	soong_config_variables: {
-		feature1: {
-			conditions_default: {
-				cflags: ["-DDEFAULT1"],
-			},
-			cflags: ["-DFEATURE1"],
-		},
-	},
-}`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - used part of multiple bool variable do not panic",
-		ModuleTypeUnderTest:        "cc_library_static",
-		ModuleTypeUnderTestFactory: cc.LibraryStaticFactory,
-		Blueprint:                  bp,
-		ExpectedBazelTargets: []string{`cc_library_static(
-    name = "foo",
-    copts = select({
-        "//build/bazel/product_config/config_settings:acme__feature1": ["-DFEATURE1"],
-        "//conditions:default": ["-DDEFAULT1"],
-    }),
-    local_includes = ["."],
-)`}})
-}
-
-func TestSoongConfigModuleType_StringAndBoolVar(t *testing.T) {
-	bp := `
-soong_config_bool_variable {
-	name: "feature1",
-}
-
-soong_config_bool_variable {
-	name: "feature2",
-}
-
-soong_config_string_variable {
-	name: "board",
-	values: ["soc_a", "soc_b", "soc_c", "soc_d"],
-}
-
-soong_config_module_type {
-	name: "custom_cc_library_static",
-	module_type: "cc_library_static",
-	config_namespace: "acme",
-	variables: ["feature1", "feature2", "board"],
-	properties: ["cflags"],
-}
-
-custom_cc_library_static {
-	name: "foo",
-	bazel_module: { bp2build_available: true },
-	host_supported: true,
-	soong_config_variables: {
-		feature1: {
-			conditions_default: {
-				cflags: ["-DDEFAULT1"],
-			},
-			cflags: ["-DFEATURE1"],
-		},
-		feature2: {
-			cflags: ["-DFEATURE2"],
-			conditions_default: {
-				cflags: ["-DDEFAULT2"],
-			},
-		},
-		board: {
-			soc_a: {
-				cflags: ["-DSOC_A"],
-			},
-			soc_b: {
-				cflags: ["-DSOC_B"],
-			},
-			soc_c: {},
-			conditions_default: {
-				cflags: ["-DSOC_DEFAULT"]
-			},
-		},
-	},
-}`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - generates selects for multiple variable types",
-		ModuleTypeUnderTest:        "cc_library_static",
-		ModuleTypeUnderTestFactory: cc.LibraryStaticFactory,
-		Blueprint:                  bp,
-		ExpectedBazelTargets: []string{`cc_library_static(
-    name = "foo",
-    copts = select({
-        "//build/bazel/product_config/config_settings:acme__board__soc_a": ["-DSOC_A"],
-        "//build/bazel/product_config/config_settings:acme__board__soc_b": ["-DSOC_B"],
-        "//build/bazel/product_config/config_settings:acme__board__soc_c": [],
-        "//conditions:default": ["-DSOC_DEFAULT"],
-    }) + select({
-        "//build/bazel/product_config/config_settings:acme__feature1": ["-DFEATURE1"],
-        "//conditions:default": ["-DDEFAULT1"],
-    }) + select({
-        "//build/bazel/product_config/config_settings:acme__feature2": ["-DFEATURE2"],
-        "//conditions:default": ["-DDEFAULT2"],
-    }),
-    local_includes = ["."],
-)`}})
-}
-
-func TestSoongConfigModuleType_StringVar_LabelListDeps(t *testing.T) {
-	bp := `
-soong_config_string_variable {
-	name: "board",
-	values: ["soc_a", "soc_b", "soc_c", "soc_d"],
-}
-
-soong_config_module_type {
-	name: "custom_cc_library_static",
-	module_type: "cc_library_static",
-	config_namespace: "acme",
-	variables: ["board"],
-	properties: ["cflags", "static_libs"],
-}
-
-custom_cc_library_static {
-	name: "foo",
-	bazel_module: { bp2build_available: true },
-	host_supported: true,
-	soong_config_variables: {
-		board: {
-			soc_a: {
-				cflags: ["-DSOC_A"],
-				static_libs: ["soc_a_dep"],
-			},
-			soc_b: {
-				cflags: ["-DSOC_B"],
-				static_libs: ["soc_b_dep"],
-			},
-			soc_c: {},
-			conditions_default: {
-				cflags: ["-DSOC_DEFAULT"],
-				static_libs: ["soc_default_static_dep"],
-			},
-		},
-	},
-}`
-
-	otherDeps := `
-cc_library_static { name: "soc_a_dep"}
-cc_library_static { name: "soc_b_dep"}
-cc_library_static { name: "soc_default_static_dep"}
-`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - generates selects for label list attributes",
-		ModuleTypeUnderTest:        "cc_library_static",
-		ModuleTypeUnderTestFactory: cc.LibraryStaticFactory,
-		Blueprint:                  bp,
-		Filesystem: map[string]string{
-			"foo/bar/Android.bp": otherDeps,
-		},
-		StubbedBuildDefinitions: []string{"//foo/bar:soc_a_dep", "//foo/bar:soc_b_dep", "//foo/bar:soc_default_static_dep"},
-		ExpectedBazelTargets: []string{`cc_library_static(
-    name = "foo",
-    copts = select({
-        "//build/bazel/product_config/config_settings:acme__board__soc_a": ["-DSOC_A"],
-        "//build/bazel/product_config/config_settings:acme__board__soc_b": ["-DSOC_B"],
-        "//build/bazel/product_config/config_settings:acme__board__soc_c": [],
-        "//conditions:default": ["-DSOC_DEFAULT"],
-    }),
-    implementation_deps = select({
-        "//build/bazel/product_config/config_settings:acme__board__soc_a": ["//foo/bar:soc_a_dep"],
-        "//build/bazel/product_config/config_settings:acme__board__soc_b": ["//foo/bar:soc_b_dep"],
-        "//build/bazel/product_config/config_settings:acme__board__soc_c": [],
-        "//conditions:default": ["//foo/bar:soc_default_static_dep"],
-    }),
-    local_includes = ["."],
-)`}})
-}
-
-func TestSoongConfigModuleType_Defaults_SingleNamespace(t *testing.T) {
-	bp := `
-soong_config_module_type {
-	name: "vendor_foo_cc_defaults",
-	module_type: "cc_defaults",
-	config_namespace: "vendor_foo",
-	bool_variables: ["feature"],
-	properties: ["cflags", "cppflags"],
-}
-
-vendor_foo_cc_defaults {
-	name: "foo_defaults_1",
-	soong_config_variables: {
-		feature: {
-			cflags: ["-cflag_feature_1"],
-			conditions_default: {
-				cflags: ["-cflag_default_1"],
-			},
-		},
-	},
-}
-
-vendor_foo_cc_defaults {
-	name: "foo_defaults_2",
-	defaults: ["foo_defaults_1"],
-	soong_config_variables: {
-		feature: {
-			cflags: ["-cflag_feature_2"],
-			conditions_default: {
-				cflags: ["-cflag_default_2"],
-			},
-		},
-	},
-}
-
-cc_library_static {
-	name: "lib",
-	defaults: ["foo_defaults_2"],
-	bazel_module: { bp2build_available: true },
-	host_supported: true,
-}
-`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - defaults with a single namespace",
-		ModuleTypeUnderTest:        "cc_library_static",
-		ModuleTypeUnderTestFactory: cc.LibraryStaticFactory,
-		Blueprint:                  bp,
-		ExpectedBazelTargets: []string{`cc_library_static(
-    name = "lib",
-    copts = select({
-        "//build/bazel/product_config/config_settings:vendor_foo__feature": [
-            "-cflag_feature_2",
-            "-cflag_feature_1",
-        ],
-        "//conditions:default": [
-            "-cflag_default_2",
-            "-cflag_default_1",
-        ],
-    }),
-    local_includes = ["."],
-)`}})
-}
-
-func TestSoongConfigModuleType_MultipleDefaults_SingleNamespace(t *testing.T) {
-	bp := `
-soong_config_module_type {
-	name: "foo_cc_defaults",
-	module_type: "cc_defaults",
-	config_namespace: "acme",
-	bool_variables: ["feature"],
-	properties: ["cflags"],
-}
-
-soong_config_module_type {
-	name: "bar_cc_defaults",
-	module_type: "cc_defaults",
-	config_namespace: "acme",
-	bool_variables: ["feature"],
-	properties: ["cflags", "asflags"],
-}
-
-foo_cc_defaults {
-	name: "foo_defaults",
-	soong_config_variables: {
-		feature: {
-			cflags: ["-cflag_foo"],
-			conditions_default: {
-				cflags: ["-cflag_default_foo"],
-			},
-		},
-	},
-}
-
-bar_cc_defaults {
-	name: "bar_defaults",
-	srcs: ["file.S"],
-	soong_config_variables: {
-		feature: {
-			cflags: ["-cflag_bar"],
-			asflags: ["-asflag_bar"],
-			conditions_default: {
-				asflags: ["-asflag_default_bar"],
-				cflags: ["-cflag_default_bar"],
-			},
-		},
-	},
-}
-
-cc_library_static {
-	name: "lib",
-	defaults: ["foo_defaults", "bar_defaults"],
-	bazel_module: { bp2build_available: true },
-	host_supported: true,
-}
-
-cc_library_static {
-	name: "lib2",
-	defaults: ["bar_defaults", "foo_defaults"],
-	bazel_module: { bp2build_available: true },
-	host_supported: true,
-}
-`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - multiple defaults with a single namespace",
-		ModuleTypeUnderTest:        "cc_library_static",
-		ModuleTypeUnderTestFactory: cc.LibraryStaticFactory,
-		Blueprint:                  bp,
-		ExpectedBazelTargets: []string{`cc_library_static(
-    name = "lib",
-    asflags = select({
-        "//build/bazel/product_config/config_settings:acme__feature": ["-asflag_bar"],
-        "//conditions:default": ["-asflag_default_bar"],
-    }),
-    copts = select({
-        "//build/bazel/product_config/config_settings:acme__feature": [
-            "-cflag_foo",
-            "-cflag_bar",
-        ],
-        "//conditions:default": [
-            "-cflag_default_foo",
-            "-cflag_default_bar",
-        ],
-    }),
-    local_includes = ["."],
-    srcs_as = ["file.S"],
-)`,
-			`cc_library_static(
-    name = "lib2",
-    asflags = select({
-        "//build/bazel/product_config/config_settings:acme__feature": ["-asflag_bar"],
-        "//conditions:default": ["-asflag_default_bar"],
-    }),
-    copts = select({
-        "//build/bazel/product_config/config_settings:acme__feature": [
-            "-cflag_bar",
-            "-cflag_foo",
-        ],
-        "//conditions:default": [
-            "-cflag_default_bar",
-            "-cflag_default_foo",
-        ],
-    }),
-    local_includes = ["."],
-    srcs_as = ["file.S"],
-)`}})
-}
-
-func TestSoongConfigModuleType_Defaults_MultipleNamespaces(t *testing.T) {
-	bp := `
-soong_config_module_type {
-	name: "vendor_foo_cc_defaults",
-	module_type: "cc_defaults",
-	config_namespace: "vendor_foo",
-	bool_variables: ["feature"],
-	properties: ["cflags"],
-}
-
-soong_config_module_type {
-	name: "vendor_bar_cc_defaults",
-	module_type: "cc_defaults",
-	config_namespace: "vendor_bar",
-	bool_variables: ["feature"],
-	properties: ["cflags"],
-}
-
-soong_config_module_type {
-	name: "vendor_qux_cc_defaults",
-	module_type: "cc_defaults",
-	config_namespace: "vendor_qux",
-	bool_variables: ["feature"],
-	properties: ["cflags"],
-}
-
-vendor_foo_cc_defaults {
-	name: "foo_defaults",
-	soong_config_variables: {
-		feature: {
-			cflags: ["-DVENDOR_FOO_FEATURE"],
-			conditions_default: {
-				cflags: ["-DVENDOR_FOO_DEFAULT"],
-			},
-		},
-	},
-}
-
-vendor_bar_cc_defaults {
-	name: "bar_defaults",
-	soong_config_variables: {
-		feature: {
-			cflags: ["-DVENDOR_BAR_FEATURE"],
-			conditions_default: {
-				cflags: ["-DVENDOR_BAR_DEFAULT"],
-			},
-		},
-	},
-}
-
-vendor_qux_cc_defaults {
-	name: "qux_defaults",
-	defaults: ["bar_defaults"],
-	soong_config_variables: {
-		feature: {
-			cflags: ["-DVENDOR_QUX_FEATURE"],
-			conditions_default: {
-				cflags: ["-DVENDOR_QUX_DEFAULT"],
-			},
-		},
-	},
-}
-
-cc_library_static {
-	name: "lib",
-	defaults: ["foo_defaults", "qux_defaults"],
-	bazel_module: { bp2build_available: true },
-	host_supported: true,
-}
-`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - defaults with multiple namespaces",
-		ModuleTypeUnderTest:        "cc_library_static",
-		ModuleTypeUnderTestFactory: cc.LibraryStaticFactory,
-		Blueprint:                  bp,
-		ExpectedBazelTargets: []string{`cc_library_static(
-    name = "lib",
-    copts = select({
-        "//build/bazel/product_config/config_settings:vendor_bar__feature": ["-DVENDOR_BAR_FEATURE"],
-        "//conditions:default": ["-DVENDOR_BAR_DEFAULT"],
-    }) + select({
-        "//build/bazel/product_config/config_settings:vendor_foo__feature": ["-DVENDOR_FOO_FEATURE"],
-        "//conditions:default": ["-DVENDOR_FOO_DEFAULT"],
-    }) + select({
-        "//build/bazel/product_config/config_settings:vendor_qux__feature": ["-DVENDOR_QUX_FEATURE"],
-        "//conditions:default": ["-DVENDOR_QUX_DEFAULT"],
-    }),
-    local_includes = ["."],
-)`}})
-}
-
-func TestSoongConfigModuleType_Defaults_UseBaselineValueForStringProp(t *testing.T) {
-	bp := `
-soong_config_string_variable {
-    name: "library_linking_strategy",
-    values: [
-        "prefer_static",
-    ],
-}
-
-soong_config_module_type {
-    name: "library_linking_strategy_custom",
-    module_type: "custom",
-    config_namespace: "ANDROID",
-    variables: ["library_linking_strategy"],
-    properties: [
-        "string_literal_prop",
-    ],
-}
-
-library_linking_strategy_custom {
-    name: "foo",
-    string_literal_prop: "29",
-    soong_config_variables: {
-        library_linking_strategy: {
-            prefer_static: {},
-            conditions_default: {
-              string_literal_prop: "30",
-            },
-        },
-    },
-}`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - generates selects for library_linking_strategy",
-		ModuleTypeUnderTest:        "cc_binary",
-		ModuleTypeUnderTestFactory: cc.BinaryFactory,
-		Blueprint:                  bp,
-		Filesystem:                 map[string]string{},
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("custom", "foo", AttrNameToString{
-				"string_literal_prop": `select({
-        "//build/bazel/product_config/config_settings:android__library_linking_strategy__prefer_static": "29",
-        "//conditions:default": "30",
-    })`,
-			}),
-		},
-	})
-}
-
-func TestSoongConfigModuleType_UnsetConditions(t *testing.T) {
-	bp := `
-soong_config_string_variable {
-    name: "library_linking_strategy",
-    values: [
-        "prefer_static",
-    ],
-}
-
-soong_config_module_type {
-    name: "library_linking_strategy_cc_defaults",
-    module_type: "cc_defaults",
-    config_namespace: "ANDROID",
-    variables: ["library_linking_strategy"],
-    properties: [
-        "shared_libs",
-        "static_libs",
-    ],
-}
-
-library_linking_strategy_cc_defaults {
-    name: "library_linking_strategy_lib_a_defaults",
-    soong_config_variables: {
-        library_linking_strategy: {
-            prefer_static: {},
-            conditions_default: {
-                shared_libs: [
-                    "lib_a",
-                ],
-            },
-        },
-    },
-}
-
-library_linking_strategy_cc_defaults {
-    name: "library_linking_strategy_merged_defaults",
-    defaults: ["library_linking_strategy_lib_a_defaults"],
-    host_supported: true,
-    soong_config_variables: {
-        library_linking_strategy: {
-            prefer_static: {},
-            conditions_default: {
-                shared_libs: [
-                    "lib_b",
-                ],
-            },
-        },
-    },
-}
-
-cc_binary {
-    name: "library_linking_strategy_sample_binary",
-    srcs: ["library_linking_strategy.cc"],
-    defaults: ["library_linking_strategy_merged_defaults"],
-    include_build_directory: false,
-}`
-
-	otherDeps := `
-cc_library { name: "lib_a"}
-cc_library { name: "lib_b"}
-cc_library { name: "lib_default"}
-`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - generates selects for library_linking_strategy",
-		ModuleTypeUnderTest:        "cc_binary",
-		ModuleTypeUnderTestFactory: cc.BinaryFactory,
-		Blueprint:                  bp,
-		StubbedBuildDefinitions:    []string{"//foo/bar:lib_a", "//foo/bar:lib_b", "//foo/bar:lib_default"},
-		Filesystem: map[string]string{
-			"foo/bar/Android.bp": otherDeps,
-		},
-		ExpectedBazelTargets: []string{`cc_binary(
-    name = "library_linking_strategy_sample_binary",
-    dynamic_deps = select({
-        "//build/bazel/product_config/config_settings:android__library_linking_strategy__prefer_static": [],
-        "//conditions:default": [
-            "//foo/bar:lib_b",
-            "//foo/bar:lib_a",
-        ],
-    }),
-    srcs = ["library_linking_strategy.cc"],
-)`}})
-}
-
-func TestSoongConfigModuleType_UnsetConditionsExcludeLibs(t *testing.T) {
-	bp := `
-soong_config_string_variable {
-    name: "library_linking_strategy",
-    values: [
-        "prefer_static",
-    ],
-}
-
-soong_config_module_type {
-    name: "library_linking_strategy_cc_defaults",
-    module_type: "cc_defaults",
-    config_namespace: "ANDROID",
-    variables: ["library_linking_strategy"],
-    properties: ["shared_libs"],
-}
-
-library_linking_strategy_cc_defaults {
-    name: "library_linking_strategy_lib_a_defaults",
-    soong_config_variables: {
-        library_linking_strategy: {
-            prefer_static: {},
-            conditions_default: {
-                shared_libs: [
-                    "lib_a",
-                ],
-            },
-        },
-    },
-}
-
-library_linking_strategy_cc_defaults {
-    name: "library_linking_strategy_merged_defaults",
-    defaults: ["library_linking_strategy_lib_a_defaults"],
-    host_supported: true,
-    soong_config_variables: {
-        library_linking_strategy: {
-            prefer_static: {},
-            conditions_default: {
-                shared_libs: [
-                    "lib_b",
-                    "lib_c",
-                ],
-            },
-        },
-    },
-    exclude_shared_libs: ["lib_a"],
-}
-
-cc_binary {
-    name: "library_linking_strategy_sample_binary",
-    defaults: ["library_linking_strategy_merged_defaults"],
-    include_build_directory: false,
-}
-
-cc_binary {
-    name: "library_linking_strategy_sample_binary_with_excludes",
-    defaults: ["library_linking_strategy_merged_defaults"],
-    exclude_shared_libs: ["lib_c"],
-    include_build_directory: false,
-}`
-
-	otherDeps := `
-cc_library { name: "lib_a"}
-cc_library { name: "lib_b"}
-cc_library { name: "lib_c"}
-`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - generates selects for library_linking_strategy",
-		ModuleTypeUnderTest:        "cc_binary",
-		ModuleTypeUnderTestFactory: cc.BinaryFactory,
-		StubbedBuildDefinitions:    []string{"//foo/bar:lib_a", "//foo/bar:lib_b", "//foo/bar:lib_c"},
-		Blueprint:                  bp,
-		Filesystem: map[string]string{
-			"foo/bar/Android.bp": otherDeps,
-		},
-		ExpectedBazelTargets: []string{
-			MakeBazelTargetNoRestrictions("cc_binary", "library_linking_strategy_sample_binary", AttrNameToString{
-				"dynamic_deps": `select({
-        "//build/bazel/product_config/config_settings:android__library_linking_strategy__prefer_static": [],
-        "//conditions:default": [
-            "//foo/bar:lib_b",
-            "//foo/bar:lib_c",
-        ],
-    })`,
-			}),
-			MakeBazelTargetNoRestrictions("cc_binary", "library_linking_strategy_sample_binary_with_excludes", AttrNameToString{
-				"dynamic_deps": `select({
-        "//build/bazel/product_config/config_settings:android__library_linking_strategy__prefer_static": [],
-        "//conditions:default": ["//foo/bar:lib_b"],
-    })`,
-			}),
-		}})
-}
-
-func TestSoongConfigModuleType_Defaults(t *testing.T) {
-	bp := `
-soong_config_string_variable {
-    name: "library_linking_strategy",
-    values: [
-        "prefer_static",
-    ],
-}
-
-soong_config_module_type {
-    name: "library_linking_strategy_cc_defaults",
-    module_type: "cc_defaults",
-    config_namespace: "ANDROID",
-    variables: ["library_linking_strategy"],
-    properties: [
-        "shared_libs",
-        "static_libs",
-    ],
-}
-
-library_linking_strategy_cc_defaults {
-    name: "library_linking_strategy_lib_a_defaults",
-    soong_config_variables: {
-        library_linking_strategy: {
-            prefer_static: {
-                static_libs: [
-                    "lib_a",
-                ],
-            },
-            conditions_default: {
-                shared_libs: [
-                    "lib_a",
-                ],
-            },
-        },
-    },
-}
-
-library_linking_strategy_cc_defaults {
-    name: "library_linking_strategy_merged_defaults",
-    defaults: ["library_linking_strategy_lib_a_defaults"],
-    host_supported: true,
-    soong_config_variables: {
-        library_linking_strategy: {
-            prefer_static: {
-                static_libs: [
-                    "lib_b",
-                ],
-            },
-            conditions_default: {
-                shared_libs: [
-                    "lib_b",
-                ],
-            },
-        },
-    },
-}
-
-cc_binary {
-    name: "library_linking_strategy_sample_binary",
-    srcs: ["library_linking_strategy.cc"],
-    defaults: ["library_linking_strategy_merged_defaults"],
-}`
-
-	otherDeps := `
-cc_library { name: "lib_a"}
-cc_library { name: "lib_b"}
-cc_library { name: "lib_default"}
-`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - generates selects for library_linking_strategy",
-		ModuleTypeUnderTest:        "cc_binary",
-		ModuleTypeUnderTestFactory: cc.BinaryFactory,
-		Blueprint:                  bp,
-		Filesystem: map[string]string{
-			"foo/bar/Android.bp": otherDeps,
-		},
-		StubbedBuildDefinitions: []string{"//foo/bar:lib_a", "//foo/bar:lib_b", "//foo/bar:lib_default"},
-		ExpectedBazelTargets: []string{`cc_binary(
-    name = "library_linking_strategy_sample_binary",
-    deps = select({
-        "//build/bazel/product_config/config_settings:android__library_linking_strategy__prefer_static": [
-            "//foo/bar:lib_b_bp2build_cc_library_static",
-            "//foo/bar:lib_a_bp2build_cc_library_static",
-        ],
-        "//conditions:default": [],
-    }),
-    dynamic_deps = select({
-        "//build/bazel/product_config/config_settings:android__library_linking_strategy__prefer_static": [],
-        "//conditions:default": [
-            "//foo/bar:lib_b",
-            "//foo/bar:lib_a",
-        ],
-    }),
-    local_includes = ["."],
-    srcs = ["library_linking_strategy.cc"],
-)`}})
-}
-
-func TestSoongConfigModuleType_Defaults_Another(t *testing.T) {
-	bp := `
-soong_config_string_variable {
-    name: "library_linking_strategy",
-    values: [
-        "prefer_static",
-    ],
-}
-
-soong_config_module_type {
-    name: "library_linking_strategy_cc_defaults",
-    module_type: "cc_defaults",
-    config_namespace: "ANDROID",
-    variables: ["library_linking_strategy"],
-    properties: [
-        "shared_libs",
-        "static_libs",
-    ],
-}
-
-library_linking_strategy_cc_defaults {
-    name: "library_linking_strategy_sample_defaults",
-    soong_config_variables: {
-        library_linking_strategy: {
-            prefer_static: {
-                static_libs: [
-                    "lib_a",
-                    "lib_b",
-                ],
-            },
-            conditions_default: {
-                shared_libs: [
-                    "lib_a",
-                    "lib_b",
-                ],
-            },
-        },
-    },
-}
-
-cc_binary {
-    name: "library_linking_strategy_sample_binary",
-    host_supported: true,
-    srcs: ["library_linking_strategy.cc"],
-    defaults: ["library_linking_strategy_sample_defaults"],
-}`
-
-	otherDeps := `
-cc_library { name: "lib_a"}
-cc_library { name: "lib_b"}
-`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - generates selects for library_linking_strategy",
-		ModuleTypeUnderTest:        "cc_binary",
-		ModuleTypeUnderTestFactory: cc.BinaryFactory,
-		Blueprint:                  bp,
-		StubbedBuildDefinitions:    []string{"//foo/bar:lib_a", "//foo/bar:lib_b"},
-		Filesystem: map[string]string{
-			"foo/bar/Android.bp": otherDeps,
-		},
-		ExpectedBazelTargets: []string{`cc_binary(
-    name = "library_linking_strategy_sample_binary",
-    deps = select({
-        "//build/bazel/product_config/config_settings:android__library_linking_strategy__prefer_static": [
-            "//foo/bar:lib_a_bp2build_cc_library_static",
-            "//foo/bar:lib_b_bp2build_cc_library_static",
-        ],
-        "//conditions:default": [],
-    }),
-    dynamic_deps = select({
-        "//build/bazel/product_config/config_settings:android__library_linking_strategy__prefer_static": [],
-        "//conditions:default": [
-            "//foo/bar:lib_a",
-            "//foo/bar:lib_b",
-        ],
-    }),
-    local_includes = ["."],
-    srcs = ["library_linking_strategy.cc"],
-)`}})
-}
-
-func TestSoongConfigModuleType_Defaults_UnusedProps(t *testing.T) {
-	bp := `
-soong_config_string_variable {
-    name: "alphabet",
-    values: [
-        "a",
-        "b",
-        "c", // unused
-    ],
-}
-
-soong_config_module_type {
-    name: "alphabet_cc_defaults",
-    module_type: "cc_defaults",
-    config_namespace: "ANDROID",
-    variables: ["alphabet"],
-    properties: [
-        "cflags", // unused
-        "shared_libs",
-        "static_libs",
-    ],
-}
-
-alphabet_cc_defaults {
-    name: "alphabet_sample_cc_defaults",
-    soong_config_variables: {
-        alphabet: {
-            a: {
-                shared_libs: [
-                    "lib_a",
-                ],
-            },
-            b: {
-                shared_libs: [
-                    "lib_b",
-                ],
-            },
-            conditions_default: {
-                static_libs: [
-                    "lib_default",
-                ],
-            },
-        },
-    },
-}
-
-cc_binary {
-    name: "alphabet_binary",
-    host_supported: true,
-    srcs: ["main.cc"],
-    defaults: ["alphabet_sample_cc_defaults"],
-}`
-
-	otherDeps := `
-cc_library { name: "lib_a"}
-cc_library { name: "lib_b"}
-cc_library { name: "lib_default"}
-`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - generates selects for library_linking_strategy",
-		ModuleTypeUnderTest:        "cc_binary",
-		ModuleTypeUnderTestFactory: cc.BinaryFactory,
-		Blueprint:                  bp,
-		Filesystem: map[string]string{
-			"foo/bar/Android.bp": otherDeps,
-		},
-		StubbedBuildDefinitions: []string{"//foo/bar:lib_a", "//foo/bar:lib_b", "//foo/bar:lib_default"},
-		ExpectedBazelTargets: []string{`cc_binary(
-    name = "alphabet_binary",
-    deps = select({
-        "//build/bazel/product_config/config_settings:android__alphabet__a": [],
-        "//build/bazel/product_config/config_settings:android__alphabet__b": [],
-        "//conditions:default": ["//foo/bar:lib_default_bp2build_cc_library_static"],
-    }),
-    dynamic_deps = select({
-        "//build/bazel/product_config/config_settings:android__alphabet__a": ["//foo/bar:lib_a"],
-        "//build/bazel/product_config/config_settings:android__alphabet__b": ["//foo/bar:lib_b"],
-        "//conditions:default": [],
-    }),
-    local_includes = ["."],
-    srcs = ["main.cc"],
-)`}})
-}
-
-func TestSoongConfigModuleType_ProductVariableConfigWithPlatformConfig(t *testing.T) {
-	bp := `
-soong_config_bool_variable {
-    name: "special_build",
-}
-
-soong_config_module_type {
-    name: "alphabet_cc_defaults",
-    module_type: "cc_defaults",
-    config_namespace: "alphabet_module",
-    bool_variables: ["special_build"],
-    properties: ["enabled"],
-}
-
-alphabet_cc_defaults {
-    name: "alphabet_sample_cc_defaults",
-    soong_config_variables: {
-        special_build: {
-            enabled: true,
-        },
-    },
-}
-
-cc_binary {
-    name: "alphabet_binary",
-    srcs: ["main.cc"],
-    host_supported: true,
-    defaults: ["alphabet_sample_cc_defaults"],
-    enabled: false,
-    arch: {
-        x86_64: {
-            enabled: false,
-        },
-    },
-    target: {
-        darwin: {
-            enabled: false,
-        },
-    },
-}`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - generates selects for library_linking_strategy",
-		ModuleTypeUnderTest:        "cc_binary",
-		ModuleTypeUnderTestFactory: cc.BinaryFactory,
-		Blueprint:                  bp,
-		Filesystem:                 map[string]string{},
-		ExpectedBazelTargets: []string{`cc_binary(
-    name = "alphabet_binary",
-    local_includes = ["."],
-    srcs = ["main.cc"],
-    target_compatible_with = select({
-        "//build/bazel_common_rules/platforms/os_arch:android_x86_64": ["@platforms//:incompatible"],
-        "//build/bazel_common_rules/platforms/os_arch:darwin_arm64": ["@platforms//:incompatible"],
-        "//build/bazel_common_rules/platforms/os_arch:darwin_x86_64": ["@platforms//:incompatible"],
-        "//build/bazel_common_rules/platforms/os_arch:linux_bionic_x86_64": ["@platforms//:incompatible"],
-        "//build/bazel_common_rules/platforms/os_arch:linux_glibc_x86_64": ["@platforms//:incompatible"],
-        "//build/bazel_common_rules/platforms/os_arch:linux_musl_x86_64": ["@platforms//:incompatible"],
-        "//build/bazel_common_rules/platforms/os_arch:windows_x86_64": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel/product_config/config_settings:alphabet_module__special_build": [],
-        "//conditions:default": ["@platforms//:incompatible"],
-    }),
-)`}})
-}
-
-func TestSoongConfigModuleType_ProductVariableConfigOverridesEnable(t *testing.T) {
-	bp := `
-soong_config_bool_variable {
-    name: "special_build",
-}
-
-soong_config_module_type {
-    name: "alphabet_cc_defaults",
-    module_type: "cc_defaults",
-    config_namespace: "alphabet_module",
-    bool_variables: ["special_build"],
-    properties: ["enabled"],
-}
-
-alphabet_cc_defaults {
-    name: "alphabet_sample_cc_defaults",
-    soong_config_variables: {
-        special_build: {
-            enabled: true,
-        },
-    },
-}
-
-cc_binary {
-    name: "alphabet_binary",
-    srcs: ["main.cc"],
-    defaults: ["alphabet_sample_cc_defaults"],
-    enabled: false,
-}
-
-alphabet_cc_defaults {
-    name: "alphabet_sample_cc_defaults_conditions_default",
-    soong_config_variables: {
-        special_build: {
-		conditions_default: {
-			enabled: false,
-		},
-	},
-    },
-}
-
-cc_binary {
-    name: "alphabet_binary_conditions_default",
-    srcs: ["main.cc"],
-    defaults: ["alphabet_sample_cc_defaults_conditions_default"],
-    enabled: false,
-}`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - generates selects for library_linking_strategy",
-		ModuleTypeUnderTest:        "cc_binary",
-		ModuleTypeUnderTestFactory: cc.BinaryFactory,
-		Blueprint:                  bp,
-		Filesystem:                 map[string]string{},
-		ExpectedBazelTargets: []string{`cc_binary(
-    name = "alphabet_binary",
-    local_includes = ["."],
-    srcs = ["main.cc"],
-    target_compatible_with = select({
-        "//build/bazel/product_config/config_settings:alphabet_module__special_build": [],
-        "//conditions:default": ["@platforms//:incompatible"],
-    }),
-)`,
-			MakeBazelTarget("cc_binary", "alphabet_binary_conditions_default", AttrNameToString{
-				"local_includes":         `["."]`,
-				"srcs":                   `["main.cc"]`,
-				"target_compatible_with": `["@platforms//:incompatible"]`,
-			}),
-		}})
-}
-
-func TestSoongConfigModuleType_ProductVariableIgnoredIfEnabledByDefault(t *testing.T) {
-	bp := `
-soong_config_bool_variable {
-    name: "special_build",
-}
-
-soong_config_module_type {
-    name: "alphabet_cc_defaults",
-    module_type: "cc_defaults",
-    config_namespace: "alphabet_module",
-    bool_variables: ["special_build"],
-    properties: ["enabled"],
-}
-
-alphabet_cc_defaults {
-    name: "alphabet_sample_cc_defaults",
-    host_supported: true,
-    soong_config_variables: {
-        special_build: {
-            enabled: true,
-        },
-    },
-}
-
-cc_binary {
-    name: "alphabet_binary",
-    srcs: ["main.cc"],
-    defaults: ["alphabet_sample_cc_defaults"],
-}`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - generates selects for library_linking_strategy",
-		ModuleTypeUnderTest:        "cc_binary",
-		ModuleTypeUnderTestFactory: cc.BinaryFactory,
-		Blueprint:                  bp,
-		Filesystem:                 map[string]string{},
-		ExpectedBazelTargets: []string{`cc_binary(
-    name = "alphabet_binary",
-    local_includes = ["."],
-    srcs = ["main.cc"],
-)`}})
-}
-
-func TestSoongConfigModuleType_CombinedWithArchVariantProperties(t *testing.T) {
-	bp := `
-soong_config_bool_variable {
-    name: "my_bool_variable",
-}
-
-soong_config_string_variable {
-    name: "my_string_variable",
-    values: [
-        "value1",
-        "value2",
-    ],
-}
-
-soong_config_module_type {
-    name: "special_build_cc_defaults",
-    module_type: "cc_defaults",
-    config_namespace: "my_namespace",
-    bool_variables: ["my_bool_variable"],
-    variables: ["my_string_variable"],
-    properties: ["target.android.cflags", "cflags"],
-}
-
-special_build_cc_defaults {
-    name: "sample_cc_defaults",
-    target: {
-        android: {
-            cflags: ["-DFOO"],
-        },
-    },
-    soong_config_variables: {
-        my_bool_variable: {
-            target: {
-                android: {
-                    cflags: ["-DBAR"],
-                },
-            },
-            conditions_default: {
-                target: {
-                    android: {
-                        cflags: ["-DBAZ"],
-                    },
-                },
-            },
-        },
-        my_string_variable: {
-            value1: {
-                cflags: ["-DVALUE1_NOT_ANDROID"],
-                target: {
-                    android: {
-                        cflags: ["-DVALUE1"],
-                    },
-                },
-            },
-            value2: {
-                target: {
-                    android: {
-                        cflags: ["-DVALUE2"],
-                    },
-                },
-            },
-            conditions_default: {
-                target: {
-                    android: {
-                        cflags: ["-DSTRING_VAR_CONDITIONS_DEFAULT"],
-                    },
-                },
-            },
-        },
-    },
-}
-
-cc_binary {
-    name: "my_binary",
-    srcs: ["main.cc"],
-    defaults: ["sample_cc_defaults"],
-}`
-
-	runSoongConfigModuleTypeTest(t, Bp2buildTestCase{
-		Description:                "soong config variables - generates selects for library_linking_strategy",
-		ModuleTypeUnderTest:        "cc_binary",
-		ModuleTypeUnderTestFactory: cc.BinaryFactory,
-		Blueprint:                  bp,
-		Filesystem:                 map[string]string{},
-		ExpectedBazelTargets: []string{`cc_binary(
-    name = "my_binary",
-    copts = select({
-        "//build/bazel_common_rules/platforms/os:android": ["-DFOO"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel/product_config/config_settings:my_namespace__my_bool_variable__android": ["-DBAR"],
-        "//build/bazel/product_config/config_settings:my_namespace__my_bool_variable__conditions_default__android": ["-DBAZ"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel/product_config/config_settings:my_namespace__my_string_variable__value1": ["-DVALUE1_NOT_ANDROID"],
-        "//conditions:default": [],
-    }) + select({
-        "//build/bazel/product_config/config_settings:my_namespace__my_string_variable__conditions_default__android": ["-DSTRING_VAR_CONDITIONS_DEFAULT"],
-        "//build/bazel/product_config/config_settings:my_namespace__my_string_variable__value1__android": ["-DVALUE1"],
-        "//build/bazel/product_config/config_settings:my_namespace__my_string_variable__value2__android": ["-DVALUE2"],
-        "//conditions:default": [],
-    }),
-    local_includes = ["."],
-    srcs = ["main.cc"],
-    target_compatible_with = ["//build/bazel_common_rules/platforms/os:android"],
-)`}})
-}
-
-// If we have
-// A. a soong_config_module_type with target.android_<arch>.* in properties
-// B. a module that uses this module type but does not set target.android_<arch>.* via soong config vars
-// Then we should not panic
-func TestPanicsIfSoongConfigModuleTypeHasArchSpecificProperties(t *testing.T) {
-	commonBp := `
-soong_config_bool_variable {
-	name: "my_bool_variable",
-}
-soong_config_module_type {
-	name: "special_cc_defaults",
-	module_type: "cc_defaults",
-	config_namespace: "my_namespace",
-	bool_variables: ["my_bool_variable"],
-	properties: [
-		"cflags",
-		"target.android_arm64.shared_libs",
-	],
-}
-cc_binary {
-	name: "my_binary",
-	defaults: ["my_special_cc_defaults"],
-}
-`
-	testCases := []struct {
-		desc            string
-		additionalBp    string
-		isPanicExpected bool
-	}{
-		{
-			desc: "target.android_arm64 is not set, bp2build should not panic",
-			additionalBp: `
-special_cc_defaults {
-	name: "my_special_cc_defaults",
-	soong_config_variables: {
-		my_bool_variable: {
-			cflags: ["-DFOO"],
-			conditions_default: {
-				cflags: ["-DBAR"],
-			}
-		}
-	},
-}
-			`,
-			isPanicExpected: false,
-		},
-		{
-			desc: "target.android_arm64 is set using the bool soong config var, bp2build should panic",
-			additionalBp: `
-special_cc_defaults {
-	name: "my_special_cc_defaults",
-	soong_config_variables: {
-		my_bool_variable: {
-			cflags: ["-DFOO"],
-			target: {
-				android_arm64: {
-					shared_libs: ["liblog"],
-				},
-			},
-			conditions_default: {
-				cflags: ["-DBAR"],
-			}
-		}
-	},
-}
-			`,
-			isPanicExpected: true,
-		},
-		{
-			desc: "target.android_arm64 is set using conditions_default for the bool soong config var, bp2build should panic",
-			additionalBp: `
-special_cc_defaults {
-	name: "my_special_cc_defaults",
-	soong_config_variables: {
-		my_bool_variable: {
-			cflags: ["-DFOO"],
-			conditions_default: {
-				cflags: ["-DBAR"],
-				target: {
-					android_arm64: {
-						shared_libs: ["liblog"],
-					},
-				},
-			}
-		}
-	},
-}
-			`,
-			isPanicExpected: true,
-		},
-	}
-	for _, tc := range testCases {
-		bp2buildTestCase := Bp2buildTestCase{
-			Description:                tc.desc,
-			ModuleTypeUnderTest:        "cc_binary",
-			ModuleTypeUnderTestFactory: cc.BinaryFactory,
-			Blueprint:                  commonBp + tc.additionalBp,
-			// Check in `foo` dir so that we can check whether it panics or not and not trip over an empty `ExpectedBazelTargets`
-			Dir:                  "foo",
-			ExpectedBazelTargets: []string{},
-		}
-		if tc.isPanicExpected {
-			bp2buildTestCase.ExpectedErr = fmt.Errorf("TODO: support other target types in soong config variable structs: Android_arm64")
-		}
-		runSoongConfigModuleTypeTest(t, bp2buildTestCase)
-	}
-}
-
-func TestNoPanicIfEnabledIsNotUsed(t *testing.T) {
-	bp := `
-soong_config_string_variable {
-	name: "my_string_variable",
-	values: ["val1", "val2"],
-}
-soong_config_module_type {
-	name: "special_cc_defaults",
-	module_type: "cc_defaults",
-	config_namespace: "my_namespace",
-	variables: ["my_string_variable"],
-	properties: [
-		"cflags",
-		"enabled",
-	],
-}
-special_cc_defaults {
-	name: "my_special_cc_defaults",
-	soong_config_variables: {
-		my_string_variable: {
-			val1: {
-				cflags: ["-DFOO"],
-			},
-			val2: {
-				cflags: ["-DBAR"],
-			},
-		},
-	},
-}
-cc_binary {
-	name: "my_binary",
-	enabled: false,
-	defaults: ["my_special_cc_defaults"],
-}
-`
-	tc := Bp2buildTestCase{
-		Description:                "Soong config vars is not used to set `enabled` property",
-		ModuleTypeUnderTest:        "cc_binary",
-		ModuleTypeUnderTestFactory: cc.BinaryFactory,
-		Blueprint:                  bp,
-		ExpectedBazelTargets: []string{
-			MakeBazelTarget("cc_binary", "my_binary", AttrNameToString{
-				"copts": `select({
-        "//build/bazel/product_config/config_settings:my_namespace__my_string_variable__val1": ["-DFOO"],
-        "//build/bazel/product_config/config_settings:my_namespace__my_string_variable__val2": ["-DBAR"],
-        "//conditions:default": [],
-    })`,
-				"local_includes":         `["."]`,
-				"target_compatible_with": `["@platforms//:incompatible"]`,
-			}),
-		},
-	}
-	runSoongConfigModuleTypeTest(t, tc)
-}
diff --git a/bp2build/symlink_forest.go b/bp2build/symlink_forest.go
deleted file mode 100644
index 15a6df0..0000000
--- a/bp2build/symlink_forest.go
+++ /dev/null
@@ -1,511 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"fmt"
-	"io/ioutil"
-	"os"
-	"path/filepath"
-	"regexp"
-	"sort"
-	"strconv"
-	"sync"
-	"sync/atomic"
-
-	"android/soong/shared"
-
-	"github.com/google/blueprint/pathtools"
-)
-
-// A tree structure that describes what to do at each directory in the created
-// symlink tree. Currently, it is used to enumerate which files/directories
-// should be excluded from symlinking. Each instance of "node" represents a file
-// or a directory. If excluded is true, then that file/directory should be
-// excluded from symlinking. Otherwise, the node is not excluded, but one of its
-// descendants is (otherwise the node in question would not exist)
-
-type instructionsNode struct {
-	name     string
-	excluded bool // If false, this is just an intermediate node
-	children map[string]*instructionsNode
-}
-
-type symlinkForestContext struct {
-	verbose bool
-	topdir  string // $TOPDIR
-
-	// State
-	wg           sync.WaitGroup
-	depCh        chan string
-	mkdirCount   atomic.Uint64
-	symlinkCount atomic.Uint64
-}
-
-// Ensures that the node for the given path exists in the tree and returns it.
-func ensureNodeExists(root *instructionsNode, path string) *instructionsNode {
-	if path == "" {
-		return root
-	}
-
-	if path[len(path)-1] == '/' {
-		path = path[:len(path)-1] // filepath.Split() leaves a trailing slash
-	}
-
-	dir, base := filepath.Split(path)
-
-	// First compute the parent node...
-	dn := ensureNodeExists(root, dir)
-
-	// then create the requested node as its direct child, if needed.
-	if child, ok := dn.children[base]; ok {
-		return child
-	} else {
-		dn.children[base] = &instructionsNode{base, false, make(map[string]*instructionsNode)}
-		return dn.children[base]
-	}
-}
-
-// Turns a list of paths to be excluded into a tree
-func instructionsFromExcludePathList(paths []string) *instructionsNode {
-	result := &instructionsNode{"", false, make(map[string]*instructionsNode)}
-
-	for _, p := range paths {
-		ensureNodeExists(result, p).excluded = true
-	}
-
-	return result
-}
-
-func mergeBuildFiles(output string, srcBuildFile string, generatedBuildFile string, verbose bool) error {
-
-	srcBuildFileContent, err := os.ReadFile(srcBuildFile)
-	if err != nil {
-		return err
-	}
-
-	generatedBuildFileContent, err := os.ReadFile(generatedBuildFile)
-	if err != nil {
-		return err
-	}
-
-	// There can't be a package() call in both the source and generated BUILD files.
-	// bp2build will generate a package() call for licensing information, but if
-	// there's no licensing information, it will still generate a package() call
-	// that just sets default_visibility=public. If the handcrafted build file
-	// also has a package() call, we'll allow it to override the bp2build
-	// generated one if it doesn't have any licensing information. If the bp2build
-	// one has licensing information and the handcrafted one exists, we'll leave
-	// them both in for bazel to throw an error.
-	packageRegex := regexp.MustCompile(`(?m)^package\s*\(`)
-	packageDefaultVisibilityRegex := regexp.MustCompile(`(?m)^package\s*\(\s*default_visibility\s*=\s*\[\s*"//visibility:public",?\s*]\s*\)`)
-	if packageRegex.Find(srcBuildFileContent) != nil {
-		if verbose && packageDefaultVisibilityRegex.Find(generatedBuildFileContent) != nil {
-			fmt.Fprintf(os.Stderr, "Both '%s' and '%s' have a package() target, removing the first one\n",
-				generatedBuildFile, srcBuildFile)
-		}
-		generatedBuildFileContent = packageDefaultVisibilityRegex.ReplaceAll(generatedBuildFileContent, []byte{})
-	}
-
-	newContents := generatedBuildFileContent
-	if newContents[len(newContents)-1] != '\n' {
-		newContents = append(newContents, '\n')
-	}
-	newContents = append(newContents, srcBuildFileContent...)
-
-	// Say you run bp2build 4 times:
-	// - The first time there's only an Android.bp file. bp2build will convert it to a build file
-	//   under out/soong/bp2build, then symlink from the forest to that generated file
-	// - Then you add a handcrafted BUILD file in the same directory. bp2build will merge this with
-	//   the generated one, and write the result to the output file in the forest. But the output
-	//   file was a symlink to out/soong/bp2build from the previous step! So we erroneously update
-	//   the file in out/soong/bp2build instead. So far this doesn't cause any problems...
-	// - You run a 3rd bp2build with no relevant changes. Everything continues to work.
-	// - You then add a comment to the handcrafted BUILD file. This causes a merge with the
-	//   generated file again. But since we wrote to the generated file in step 2, the generated
-	//   file has an old copy of the handcrafted file in it! This probably causes duplicate bazel
-	//   targets.
-	// To solve this, if we see that the output file is a symlink from a previous build, remove it.
-	stat, err := os.Lstat(output)
-	if err != nil && !os.IsNotExist(err) {
-		return err
-	} else if err == nil {
-		if stat.Mode()&os.ModeSymlink == os.ModeSymlink {
-			if verbose {
-				fmt.Fprintf(os.Stderr, "Removing symlink so that we can replace it with a merged file: %s\n", output)
-			}
-			err = os.Remove(output)
-			if err != nil {
-				return err
-			}
-		}
-	}
-
-	return pathtools.WriteFileIfChanged(output, newContents, 0666)
-}
-
-// Calls readdir() and returns it as a map from the basename of the files in dir
-// to os.FileInfo.
-func readdirToMap(dir string) map[string]os.FileInfo {
-	entryList, err := ioutil.ReadDir(dir)
-	result := make(map[string]os.FileInfo)
-
-	if err != nil {
-		if os.IsNotExist(err) {
-			// It's okay if a directory doesn't exist; it just means that one of the
-			// trees to be merged contains parts the other doesn't
-			return result
-		} else {
-			fmt.Fprintf(os.Stderr, "Cannot readdir '%s': %s\n", dir, err)
-			os.Exit(1)
-		}
-	}
-
-	for _, fi := range entryList {
-		result[fi.Name()] = fi
-	}
-
-	return result
-}
-
-// Creates a symbolic link at dst pointing to src
-func symlinkIntoForest(topdir, dst, src string) uint64 {
-	srcPath := shared.JoinPath(topdir, src)
-	dstPath := shared.JoinPath(topdir, dst)
-
-	// Check whether a symlink already exists.
-	if dstInfo, err := os.Lstat(dstPath); err != nil {
-		if !os.IsNotExist(err) {
-			fmt.Fprintf(os.Stderr, "Failed to lstat '%s': %s", dst, err)
-			os.Exit(1)
-		}
-	} else {
-		if dstInfo.Mode()&os.ModeSymlink != 0 {
-			// Assume that the link's target is correct, i.e. no manual tampering.
-			// E.g. OUT_DIR could have been previously used with a different source tree check-out!
-			return 0
-		} else {
-			if err := os.RemoveAll(dstPath); err != nil {
-				fmt.Fprintf(os.Stderr, "Failed to remove '%s': %s", dst, err)
-				os.Exit(1)
-			}
-		}
-	}
-
-	// Create symlink.
-	if err := os.Symlink(srcPath, dstPath); err != nil {
-		fmt.Fprintf(os.Stderr, "Cannot create symlink at '%s' pointing to '%s': %s", dst, src, err)
-		os.Exit(1)
-	}
-	return 1
-}
-
-func isDir(path string, fi os.FileInfo) bool {
-	if (fi.Mode() & os.ModeSymlink) != os.ModeSymlink {
-		return fi.IsDir()
-	}
-
-	fi2, statErr := os.Stat(path)
-	if statErr == nil {
-		return fi2.IsDir()
-	}
-
-	// Check if this is a dangling symlink. If so, treat it like a file, not a dir.
-	_, lstatErr := os.Lstat(path)
-	if lstatErr != nil {
-		fmt.Fprintf(os.Stderr, "Cannot stat or lstat '%s': %s\n%s\n", path, statErr, lstatErr)
-		os.Exit(1)
-	}
-
-	return false
-}
-
-// Returns the mtime of the soong_build binary to determine whether we should
-// force symlink_forest to re-execute
-func getSoongBuildMTime() (int64, error) {
-	binaryPath, err := os.Executable()
-	if err != nil {
-		return 0, err
-	}
-
-	info, err := os.Stat(binaryPath)
-	if err != nil {
-		return 0, err
-	}
-
-	return info.ModTime().UnixMilli(), nil
-}
-
-// cleanSymlinkForest will remove the whole symlink forest directory
-func cleanSymlinkForest(topdir, forest string) error {
-	return os.RemoveAll(shared.JoinPath(topdir, forest))
-}
-
-// This returns whether symlink forest should clean and replant symlinks.
-// It compares the mtime of this executable with the mtime of the last-run
-// soong_build binary. If they differ, then we should clean and replant.
-func shouldCleanSymlinkForest(topdir string, forest string, soongBuildMTime int64) (bool, error) {
-	mtimeFilePath := shared.JoinPath(topdir, forest, "soong_build_mtime")
-	mtimeFileContents, err := os.ReadFile(mtimeFilePath)
-	if err != nil {
-		if os.IsNotExist(err) {
-			// This is likely the first time this has run with this functionality - clean away!
-			return true, nil
-		} else {
-			return false, err
-		}
-	}
-	return strconv.FormatInt(soongBuildMTime, 10) != string(mtimeFileContents), nil
-}
-
-func writeSoongBuildMTimeFile(topdir, forest string, mtime int64) error {
-	mtimeFilePath := shared.JoinPath(topdir, forest, "soong_build_mtime")
-	contents := []byte(strconv.FormatInt(mtime, 10))
-
-	return os.WriteFile(mtimeFilePath, contents, 0666)
-}
-
-// Recursively plants a symlink forest at forestDir. The symlink tree will
-// contain every file in buildFilesDir and srcDir excluding the files in
-// instructions. Collects every directory encountered during the traversal of
-// srcDir .
-func plantSymlinkForestRecursive(context *symlinkForestContext, instructions *instructionsNode, forestDir string, buildFilesDir string, srcDir string) {
-	defer context.wg.Done()
-
-	if instructions != nil && instructions.excluded {
-		// Excluded paths are skipped at the level of the non-excluded parent.
-		fmt.Fprintf(os.Stderr, "may not specify a root-level exclude directory '%s'", srcDir)
-		os.Exit(1)
-	}
-
-	// We don't add buildFilesDir here because the bp2build files marker files is
-	// already a dependency which covers it. If we ever wanted to turn this into
-	// a generic symlink forest creation tool, we'd need to add it, too.
-	context.depCh <- srcDir
-
-	srcDirMap := readdirToMap(shared.JoinPath(context.topdir, srcDir))
-	buildFilesMap := readdirToMap(shared.JoinPath(context.topdir, buildFilesDir))
-
-	renamingBuildFile := false
-	if _, ok := srcDirMap["BUILD"]; ok {
-		if _, ok := srcDirMap["BUILD.bazel"]; !ok {
-			if _, ok := buildFilesMap["BUILD.bazel"]; ok {
-				renamingBuildFile = true
-				srcDirMap["BUILD.bazel"] = srcDirMap["BUILD"]
-				delete(srcDirMap, "BUILD")
-				if instructions != nil {
-					if _, ok := instructions.children["BUILD"]; ok {
-						instructions.children["BUILD.bazel"] = instructions.children["BUILD"]
-						delete(instructions.children, "BUILD")
-					}
-				}
-			}
-		}
-	}
-
-	allEntries := make([]string, 0, len(srcDirMap)+len(buildFilesMap))
-	for n := range srcDirMap {
-		allEntries = append(allEntries, n)
-	}
-	for n := range buildFilesMap {
-		if _, ok := srcDirMap[n]; !ok {
-			allEntries = append(allEntries, n)
-		}
-	}
-	// Tests read the error messages generated, so ensure their order is deterministic
-	sort.Strings(allEntries)
-
-	fullForestPath := shared.JoinPath(context.topdir, forestDir)
-	createForestDir := false
-	if fi, err := os.Lstat(fullForestPath); err != nil {
-		if os.IsNotExist(err) {
-			createForestDir = true
-		} else {
-			fmt.Fprintf(os.Stderr, "Could not read info for '%s': %s\n", forestDir, err)
-		}
-	} else if fi.Mode()&os.ModeDir == 0 {
-		if err := os.RemoveAll(fullForestPath); err != nil {
-			fmt.Fprintf(os.Stderr, "Failed to remove '%s': %s", forestDir, err)
-			os.Exit(1)
-		}
-		createForestDir = true
-	}
-	if createForestDir {
-		if err := os.MkdirAll(fullForestPath, 0777); err != nil {
-			fmt.Fprintf(os.Stderr, "Could not mkdir '%s': %s\n", forestDir, err)
-			os.Exit(1)
-		}
-		context.mkdirCount.Add(1)
-	}
-
-	// Start with a list of items that already exist in the forest, and remove
-	// each element as it is processed in allEntries. Any remaining items in
-	// forestMapForDeletion must be removed. (This handles files which were
-	// removed since the previous forest generation).
-	forestMapForDeletion := readdirToMap(shared.JoinPath(context.topdir, forestDir))
-
-	for _, f := range allEntries {
-		if f[0] == '.' {
-			continue // Ignore dotfiles
-		}
-		delete(forestMapForDeletion, f)
-		// todo add deletionCount metric
-
-		// The full paths of children in the input trees and in the output tree
-		forestChild := shared.JoinPath(forestDir, f)
-		srcChild := shared.JoinPath(srcDir, f)
-		if f == "BUILD.bazel" && renamingBuildFile {
-			srcChild = shared.JoinPath(srcDir, "BUILD")
-		}
-		buildFilesChild := shared.JoinPath(buildFilesDir, f)
-
-		// Descend in the instruction tree if it exists
-		var instructionsChild *instructionsNode
-		if instructions != nil {
-			instructionsChild = instructions.children[f]
-		}
-
-		srcChildEntry, sExists := srcDirMap[f]
-		buildFilesChildEntry, bExists := buildFilesMap[f]
-
-		if instructionsChild != nil && instructionsChild.excluded {
-			if bExists {
-				context.symlinkCount.Add(symlinkIntoForest(context.topdir, forestChild, buildFilesChild))
-			}
-			continue
-		}
-
-		sDir := sExists && isDir(shared.JoinPath(context.topdir, srcChild), srcChildEntry)
-		bDir := bExists && isDir(shared.JoinPath(context.topdir, buildFilesChild), buildFilesChildEntry)
-
-		if !sExists {
-			if bDir && instructionsChild != nil {
-				// Not in the source tree, but we have to exclude something from under
-				// this subtree, so descend
-				context.wg.Add(1)
-				go plantSymlinkForestRecursive(context, instructionsChild, forestChild, buildFilesChild, srcChild)
-			} else {
-				// Not in the source tree, symlink BUILD file
-				context.symlinkCount.Add(symlinkIntoForest(context.topdir, forestChild, buildFilesChild))
-			}
-		} else if !bExists {
-			if sDir && instructionsChild != nil {
-				// Not in the build file tree, but we have to exclude something from
-				// under this subtree, so descend
-				context.wg.Add(1)
-				go plantSymlinkForestRecursive(context, instructionsChild, forestChild, buildFilesChild, srcChild)
-			} else {
-				// Not in the build file tree, symlink source tree, carry on
-				context.symlinkCount.Add(symlinkIntoForest(context.topdir, forestChild, srcChild))
-			}
-		} else if sDir && bDir {
-			// Both are directories. Descend.
-			context.wg.Add(1)
-			go plantSymlinkForestRecursive(context, instructionsChild, forestChild, buildFilesChild, srcChild)
-		} else if !sDir && !bDir {
-			// Neither is a directory. Merge them.
-			srcBuildFile := shared.JoinPath(context.topdir, srcChild)
-			generatedBuildFile := shared.JoinPath(context.topdir, buildFilesChild)
-			// The Android.bp file that codegen used to produce `buildFilesChild` is
-			// already a dependency, we can ignore `buildFilesChild`.
-			context.depCh <- srcChild
-			if err := mergeBuildFiles(shared.JoinPath(context.topdir, forestChild), srcBuildFile, generatedBuildFile, context.verbose); err != nil {
-				fmt.Fprintf(os.Stderr, "Error merging %s and %s: %s",
-					srcBuildFile, generatedBuildFile, err)
-				os.Exit(1)
-			}
-		} else {
-			// Both exist and one is a file. This is an error.
-			fmt.Fprintf(os.Stderr,
-				"Conflict in workspace symlink tree creation: both '%s' and '%s' exist and exactly one is a directory\n",
-				srcChild, buildFilesChild)
-			os.Exit(1)
-		}
-	}
-
-	// Remove all files in the forest that exist in neither the source
-	// tree nor the build files tree. (This handles files which were removed
-	// since the previous forest generation).
-	for f := range forestMapForDeletion {
-		var instructionsChild *instructionsNode
-		if instructions != nil {
-			instructionsChild = instructions.children[f]
-		}
-
-		if instructionsChild != nil && instructionsChild.excluded {
-			// This directory may be excluded because bazel writes to it under the
-			// forest root. Thus this path is intentionally left alone.
-			continue
-		}
-		forestChild := shared.JoinPath(context.topdir, forestDir, f)
-		if err := os.RemoveAll(forestChild); err != nil {
-			fmt.Fprintf(os.Stderr, "Failed to remove '%s/%s': %s", forestDir, f, err)
-			os.Exit(1)
-		}
-	}
-}
-
-// PlantSymlinkForest Creates a symlink forest by merging the directory tree at "buildFiles" and
-// "srcDir" while excluding paths listed in "exclude". Returns the set of paths
-// under srcDir on which readdir() had to be called to produce the symlink
-// forest.
-func PlantSymlinkForest(verbose bool, topdir string, forest string, buildFiles string, exclude []string) (deps []string, mkdirCount, symlinkCount uint64) {
-	context := &symlinkForestContext{
-		verbose:      verbose,
-		topdir:       topdir,
-		depCh:        make(chan string),
-		mkdirCount:   atomic.Uint64{},
-		symlinkCount: atomic.Uint64{},
-	}
-
-	// Check whether soong_build has been modified since the last run
-	soongBuildMTime, err := getSoongBuildMTime()
-	if err != nil {
-		fmt.Fprintln(os.Stderr, err)
-		os.Exit(1)
-	}
-
-	shouldClean, err := shouldCleanSymlinkForest(topdir, forest, soongBuildMTime)
-
-	if err != nil {
-		fmt.Fprintln(os.Stderr, err)
-		os.Exit(1)
-	} else if shouldClean {
-		err = cleanSymlinkForest(topdir, forest)
-		if err != nil {
-			fmt.Fprintln(os.Stderr, err)
-			os.Exit(1)
-		}
-	}
-
-	instructions := instructionsFromExcludePathList(exclude)
-	go func() {
-		context.wg.Add(1)
-		plantSymlinkForestRecursive(context, instructions, forest, buildFiles, ".")
-		context.wg.Wait()
-		close(context.depCh)
-	}()
-
-	for dep := range context.depCh {
-		deps = append(deps, dep)
-	}
-
-	err = writeSoongBuildMTimeFile(topdir, forest, soongBuildMTime)
-	if err != nil {
-		fmt.Fprintln(os.Stderr, err)
-		os.Exit(1)
-	}
-	return deps, context.mkdirCount.Load(), context.symlinkCount.Load()
-}
diff --git a/bp2build/testing.go b/bp2build/testing.go
deleted file mode 100644
index c978164..0000000
--- a/bp2build/testing.go
+++ /dev/null
@@ -1,785 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-/*
-For shareable/common bp2build testing functionality and dumping ground for
-specific-but-shared functionality among tests in package
-*/
-
-import (
-	"fmt"
-	"path/filepath"
-	"regexp"
-	"sort"
-	"strings"
-	"testing"
-
-	"android/soong/ui/metrics/bp2build_metrics_proto"
-
-	"github.com/google/blueprint/proptools"
-
-	"android/soong/android"
-	"android/soong/android/allowlists"
-	"android/soong/bazel"
-)
-
-var (
-	buildDir string
-)
-
-var labelRegex = regexp.MustCompile(`^//([^: ]+):([^ ]+)$`)
-var simpleModuleNameRegex = regexp.MustCompile(`^[^: /]+$`)
-
-func checkError(t *testing.T, errs []error, expectedErr error) bool {
-	t.Helper()
-
-	if len(errs) != 1 {
-		return false
-	}
-	if strings.Contains(errs[0].Error(), expectedErr.Error()) {
-		return true
-	}
-
-	return false
-}
-
-func errored(t *testing.T, tc Bp2buildTestCase, errs []error) bool {
-	t.Helper()
-	if tc.ExpectedErr != nil {
-		// Rely on checkErrors, as this test case is expected to have an error.
-		return false
-	}
-
-	if len(errs) > 0 {
-		for _, err := range errs {
-			t.Errorf("%s: %s", tc.Description, err)
-		}
-		return true
-	}
-
-	// All good, continue execution.
-	return false
-}
-
-func RunBp2BuildTestCaseSimple(t *testing.T, tc Bp2buildTestCase) {
-	t.Helper()
-	RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, tc)
-}
-
-type Bp2buildTestCase struct {
-	Description                string
-	ModuleTypeUnderTest        string
-	ModuleTypeUnderTestFactory android.ModuleFactory
-	// Text to add to the toplevel, root Android.bp file. If Dir is not set, all
-	// ExpectedBazelTargets are assumed to be generated by this file.
-	Blueprint string
-	// ExpectedBazelTargets compares the BazelTargets generated in `Dir` (if not empty).
-	// Otherwise, it checks the BazelTargets generated by `Blueprint` in the root directory.
-	ExpectedBazelTargets []string
-	// ExpectedConvertedModules asserts that modules in this list are labeled as "converted
-	// by bp2build" in the metrics reported by bp2build.
-	ExpectedConvertedModules []string
-	// ExpectedHandcraftedModules asserts that modules in this list are labeled as "handcrafted
-	// in build files" in the metrics reported by bp2build. Such modules are either explicitly
-	// defined in a BUILD file (by name), or registered as "otherwise implicitly handled"
-	// by bp2build (for example, by macros owned by other modules).
-	ExpectedHandcraftedModules []string
-
-	// AlreadyExistingBuildContents, if non-empty, simulates an already-present source BUILD file
-	// in the directory under test. The BUILD file has the given contents. This BUILD file
-	// will also be treated as "BUILD file to keep" by the simulated bp2build environment.
-	AlreadyExistingBuildContents string
-
-	// StubbedBuildDefinitions, if non-empty, adds stub definitions to already-present source
-	// BUILD files for each bazel label given. The BUILD files with these stub definitions
-	// are added to the BUILD file given in AlreadyExistingBuildContents.
-	// Labels may be of the form //pkg/to:target_name (which would be defined in pkg/to/BUILD.bazel)
-	// or `target_name` (which would be defined in ./BUILD.bazel).
-	StubbedBuildDefinitions []string
-
-	Filesystem map[string]string
-	// Dir sets the directory which will be compared against the targets in ExpectedBazelTargets.
-	// This should used in conjunction with the Filesystem property to check for targets
-	// generated from a directory that is not the root.
-	// If not set, all ExpectedBazelTargets are assumed to be generated by the text in the
-	// Blueprint property.
-	Dir string
-	// An error with a string contained within the string of the expected error
-	ExpectedErr         error
-	UnconvertedDepsMode unconvertedDepsMode
-
-	// For every directory listed here, the BUILD file for that directory will
-	// be merged with the generated BUILD file. This allows custom BUILD targets
-	// to be used in tests, or use BUILD files to draw package boundaries.
-	KeepBuildFileForDirs []string
-
-	// An extra FixturePreparer to use when running the test. If you need multiple extra
-	// FixturePreparers, use android.GroupFixturePreparers()
-	ExtraFixturePreparer android.FixturePreparer
-
-	// If bp2build_product_config.go should run as part of the test.
-	RunBp2buildProductConfig bool
-}
-
-func RunBp2BuildTestCase(t *testing.T, registerModuleTypes func(ctx android.RegistrationContext), tc Bp2buildTestCase) {
-	t.Helper()
-	preparers := []android.FixturePreparer{
-		android.FixtureRegisterWithContext(registerModuleTypes),
-	}
-	if tc.ExtraFixturePreparer != nil {
-		preparers = append(preparers, tc.ExtraFixturePreparer)
-	}
-	preparers = append(preparers, android.FixtureSetTestRunner(&bazelTestRunner{generateProductConfigTargets: tc.RunBp2buildProductConfig}))
-	bp2buildSetup := android.GroupFixturePreparers(
-		preparers...,
-	)
-	runBp2BuildTestCaseWithSetup(t, bp2buildSetup, tc)
-}
-
-func runBp2BuildTestCaseWithSetup(t *testing.T, extraPreparer android.FixturePreparer, tc Bp2buildTestCase) {
-	t.Helper()
-	if tc.Filesystem == nil {
-		tc.Filesystem = map[string]string{}
-	}
-	checkDir := "."
-	if tc.Dir != "" {
-		checkDir = tc.Dir
-	}
-	keepExistingBuildDirs := tc.KeepBuildFileForDirs
-	buildFilesToParse := []string{}
-
-	if len(tc.StubbedBuildDefinitions) > 0 {
-		for _, buildDef := range tc.StubbedBuildDefinitions {
-			globalLabelMatch := labelRegex.FindStringSubmatch(buildDef)
-			var dir, targetName string
-			if len(globalLabelMatch) > 0 {
-				dir = globalLabelMatch[1]
-				targetName = globalLabelMatch[2]
-			} else {
-				if !simpleModuleNameRegex.MatchString(buildDef) {
-					t.Errorf("Stubbed build definition '%s' must be either a simple module name or of global target syntax (//foo/bar:baz).", buildDef)
-					return
-				}
-				dir = "."
-				targetName = buildDef
-			}
-			buildFilePath := filepath.Join(dir, "BUILD")
-			tc.Filesystem[buildFilePath] +=
-				MakeBazelTarget(
-					"bp2build_test_stub",
-					targetName,
-					AttrNameToString{})
-			keepExistingBuildDirs = append(keepExistingBuildDirs, dir)
-			buildFilesToParse = append(buildFilesToParse, buildFilePath)
-		}
-	}
-	if len(tc.AlreadyExistingBuildContents) > 0 {
-		buildFilePath := filepath.Join(checkDir, "BUILD")
-		tc.Filesystem[buildFilePath] += tc.AlreadyExistingBuildContents
-		keepExistingBuildDirs = append(keepExistingBuildDirs, checkDir)
-		buildFilesToParse = append(buildFilesToParse, buildFilePath)
-	}
-	filesystem := make(map[string][]byte)
-	for f, content := range tc.Filesystem {
-		filesystem[f] = []byte(content)
-	}
-	preparers := []android.FixturePreparer{
-		extraPreparer,
-		android.FixtureMergeMockFs(filesystem),
-		android.FixtureWithRootAndroidBp(tc.Blueprint),
-		android.FixtureRegisterWithContext(func(ctx android.RegistrationContext) {
-			ctx.RegisterModuleType(tc.ModuleTypeUnderTest, tc.ModuleTypeUnderTestFactory)
-		}),
-		android.FixtureModifyContextWithMockFs(func(ctx *android.TestContext) {
-			// A default configuration for tests to not have to specify bp2build_available on top level
-			// targets.
-			bp2buildConfig := android.NewBp2BuildAllowlist().SetDefaultConfig(
-				allowlists.Bp2BuildConfig{
-					android.Bp2BuildTopLevel: allowlists.Bp2BuildDefaultTrueRecursively,
-				},
-			)
-			for _, f := range keepExistingBuildDirs {
-				bp2buildConfig.SetKeepExistingBuildFile(map[string]bool{
-					f: /*recursive=*/ false,
-				})
-			}
-			ctx.RegisterBp2BuildConfig(bp2buildConfig)
-			// This setting is added to bp2build invocations. It prevents bp2build
-			// from cloning modules to their original state after mutators run. This
-			// would lose some data intentionally set by these mutators.
-			ctx.SkipCloneModulesAfterMutators = true
-			err := ctx.RegisterExistingBazelTargets(".", buildFilesToParse)
-			if err != nil {
-				t.Errorf("error parsing build files in test setup: %s", err)
-			}
-		}),
-		android.FixtureModifyEnv(func(env map[string]string) {
-			if tc.UnconvertedDepsMode == errorModulesUnconvertedDeps {
-				env["BP2BUILD_ERROR_UNCONVERTED"] = "true"
-			}
-		}),
-	}
-
-	preparer := android.GroupFixturePreparers(preparers...)
-	if tc.ExpectedErr != nil {
-		pattern := "\\Q" + tc.ExpectedErr.Error() + "\\E"
-		preparer = preparer.ExtendWithErrorHandler(android.FixtureExpectsOneErrorPattern(pattern))
-	}
-	result := preparer.RunTestWithCustomResult(t).(*BazelTestResult)
-	if len(result.Errs) > 0 {
-		return
-	}
-
-	expectedTargets := map[string][]string{
-		checkDir: tc.ExpectedBazelTargets,
-	}
-
-	result.CompareAllBazelTargets(t, tc, expectedTargets, true)
-}
-
-// bazelTestRunner customizes the test fixture mechanism to run tests of the bp2build build mode.
-type bazelTestRunner struct {
-	generateProductConfigTargets bool
-}
-
-func (b *bazelTestRunner) FinalPreparer(result *android.TestResult) android.CustomTestResult {
-	ctx := result.TestContext
-	ctx.RegisterForBazelConversion()
-
-	return &BazelTestResult{TestResult: result}
-}
-
-func (b *bazelTestRunner) PostParseProcessor(result android.CustomTestResult) {
-	bazelResult := result.(*BazelTestResult)
-	ctx := bazelResult.TestContext
-	config := bazelResult.Config
-	_, errs := ctx.ResolveDependencies(config)
-	if bazelResult.CollateErrs(errs) {
-		return
-	}
-
-	codegenCtx := NewCodegenContext(config, ctx.Context, Bp2Build, "")
-	res, errs := GenerateBazelTargets(codegenCtx, false)
-	if bazelResult.CollateErrs(errs) {
-		return
-	}
-	if b.generateProductConfigTargets {
-		productConfig, err := createProductConfigFiles(codegenCtx, res.moduleNameToPartition, res.metrics.convertedModulePathMap)
-		if err != nil {
-			bazelResult.CollateErrs([]error{err})
-			return
-		}
-		for k, v := range productConfig.bp2buildTargets {
-			res.buildFileToTargets[k] = append(res.buildFileToTargets[k], v...)
-		}
-	}
-
-	// Store additional data for access by tests.
-	bazelResult.conversionResults = res
-}
-
-// BazelTestResult is a wrapper around android.TestResult to provide type safe access to the bazel
-// specific data stored by the bazelTestRunner.
-type BazelTestResult struct {
-	*android.TestResult
-
-	// The result returned by the GenerateBazelTargets function.
-	conversionResults
-}
-
-// CompareAllBazelTargets compares the BazelTargets produced by the test for all the directories
-// with the supplied set of expected targets.
-//
-// If ignoreUnexpected=false then this enforces an exact match where every BazelTarget produced must
-// have a corresponding expected BazelTarget.
-//
-// If ignoreUnexpected=true then it will ignore directories for which there are no expected targets.
-func (b BazelTestResult) CompareAllBazelTargets(t *testing.T, tc Bp2buildTestCase, expectedTargets map[string][]string, ignoreUnexpected bool) {
-	t.Helper()
-	actualTargets := b.buildFileToTargets
-
-	// Generate the sorted set of directories to check.
-	dirsToCheck := android.SortedKeys(expectedTargets)
-	if !ignoreUnexpected {
-		// This needs to perform an exact match so add the directories in which targets were
-		// produced to the list of directories to check.
-		dirsToCheck = append(dirsToCheck, android.SortedKeys(actualTargets)...)
-		dirsToCheck = android.SortedUniqueStrings(dirsToCheck)
-	}
-
-	for _, dir := range dirsToCheck {
-		expected := expectedTargets[dir]
-		actual := actualTargets[dir]
-
-		if expected == nil {
-			if actual != nil {
-				t.Errorf("did not expect any bazel modules in %q but found %d", dir, len(actual))
-			}
-		} else if actual == nil {
-			expectedCount := len(expected)
-			if expectedCount > 0 {
-				t.Errorf("expected %d bazel modules in %q but did not find any", expectedCount, dir)
-			}
-		} else {
-			b.CompareBazelTargets(t, tc.Description, expected, actual)
-		}
-	}
-
-	for _, module := range tc.ExpectedConvertedModules {
-		if _, found := b.metrics.convertedModulePathMap[module]; !found {
-			t.Errorf("expected %s to be generated by bp2build, but was not. Map of converted modules: %s", module, b.metrics.convertedModulePathMap)
-		}
-	}
-
-	for _, module := range tc.ExpectedHandcraftedModules {
-		if reason, found := b.metrics.serialized.UnconvertedModules[module]; !found {
-			t.Errorf("expected %s to be marked 'unconverted' by bp2build, but was not found. Full list: %s",
-				module, b.metrics.serialized.UnconvertedModules)
-		} else {
-			if reason.Type != bp2build_metrics_proto.UnconvertedReasonType_DEFINED_IN_BUILD_FILE {
-				t.Errorf("expected %s to be marked 'handcrafted' by bp2build, but was disabled for another reason: %s", module, reason)
-			}
-		}
-	}
-}
-
-func (b BazelTestResult) CompareBazelTargets(t *testing.T, description string, expectedContents []string, actualTargets BazelTargets) {
-	t.Helper()
-	if actualCount, expectedCount := len(actualTargets), len(expectedContents); actualCount != expectedCount {
-		t.Errorf("%s: Expected %d bazel target (%s), got %d (%s)",
-			description, expectedCount, expectedContents, actualCount, actualTargets)
-	} else {
-		sort.SliceStable(actualTargets, func(i, j int) bool {
-			return actualTargets[i].name < actualTargets[j].name
-		})
-		sort.SliceStable(expectedContents, func(i, j int) bool {
-			return getTargetName(expectedContents[i]) < getTargetName(expectedContents[j])
-		})
-		for i, actualTarget := range actualTargets {
-			if w, g := expectedContents[i], actualTarget.content; w != g {
-				t.Errorf(
-					"%s[%d]: Expected generated Bazel target to be `%s`, got `%s`",
-					description, i, w, g)
-			}
-		}
-	}
-}
-
-type nestedProps struct {
-	Nested_prop *string
-}
-
-type EmbeddedProps struct {
-	Embedded_prop *string
-}
-
-type OtherEmbeddedProps struct {
-	Other_embedded_prop *string
-}
-
-type customProps struct {
-	EmbeddedProps
-	*OtherEmbeddedProps
-
-	Bool_prop     bool
-	Bool_ptr_prop *bool
-	// Ensure that properties tagged `blueprint:mutated` are omitted
-	Int_prop            int `blueprint:"mutated"`
-	Int64_ptr_prop      *int64
-	String_prop         string
-	String_literal_prop *string `android:"arch_variant"`
-	String_ptr_prop     *string
-	String_list_prop    []string
-
-	Nested_props     nestedProps
-	Nested_props_ptr *nestedProps
-
-	Arch_paths         []string `android:"path,arch_variant"`
-	Arch_paths_exclude []string `android:"path,arch_variant"`
-
-	// Prop used to indicate this conversion should be 1 module -> multiple targets
-	One_to_many_prop *bool
-
-	// Prop used to simulate an unsupported property in bp2build conversion. If this
-	// is true, this module should be treated as "unconvertible" via bp2build.
-	Does_not_convert_to_bazel *bool
-
-	Api *string // File describing the APIs of this module
-
-	Test_config_setting *bool // Used to test generation of config_setting targets
-
-	Dir *string // Dir in which the Bazel Target will be created
-}
-
-type customModule struct {
-	android.ModuleBase
-	android.BazelModuleBase
-
-	props customProps
-}
-
-// OutputFiles is needed because some instances of this module use dist with a
-// tag property which requires the module implements OutputFileProducer.
-func (m *customModule) OutputFiles(tag string) (android.Paths, error) {
-	return android.PathsForTesting("path" + tag), nil
-}
-
-func (m *customModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
-	// nothing for now.
-}
-
-func customModuleFactoryBase() android.Module {
-	module := &customModule{}
-	module.AddProperties(&module.props)
-	android.InitBazelModule(module)
-	return module
-}
-
-func customModuleFactoryHostAndDevice() android.Module {
-	m := customModuleFactoryBase()
-	android.InitAndroidArchModule(m, android.HostAndDeviceSupported, android.MultilibBoth)
-	return m
-}
-
-func customModuleFactoryDeviceSupported() android.Module {
-	m := customModuleFactoryBase()
-	android.InitAndroidArchModule(m, android.DeviceSupported, android.MultilibBoth)
-	return m
-}
-
-func customModuleFactoryHostSupported() android.Module {
-	m := customModuleFactoryBase()
-	android.InitAndroidArchModule(m, android.HostSupported, android.MultilibBoth)
-	return m
-}
-
-func customModuleFactoryHostAndDeviceDefault() android.Module {
-	m := customModuleFactoryBase()
-	android.InitAndroidArchModule(m, android.HostAndDeviceDefault, android.MultilibBoth)
-	return m
-}
-
-func customModuleFactoryNeitherHostNorDeviceSupported() android.Module {
-	m := customModuleFactoryBase()
-	android.InitAndroidArchModule(m, android.NeitherHostNorDeviceSupported, android.MultilibBoth)
-	return m
-}
-
-type testProps struct {
-	Test_prop struct {
-		Test_string_prop string
-	}
-}
-
-type customTestModule struct {
-	android.ModuleBase
-
-	props      customProps
-	test_props testProps
-}
-
-func (m *customTestModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
-	// nothing for now.
-}
-
-func customTestModuleFactoryBase() android.Module {
-	m := &customTestModule{}
-	m.AddProperties(&m.props)
-	m.AddProperties(&m.test_props)
-	return m
-}
-
-func customTestModuleFactory() android.Module {
-	m := customTestModuleFactoryBase()
-	android.InitAndroidModule(m)
-	return m
-}
-
-type customDefaultsModule struct {
-	android.ModuleBase
-	android.DefaultsModuleBase
-}
-
-func customDefaultsModuleFactoryBase() android.DefaultsModule {
-	module := &customDefaultsModule{}
-	module.AddProperties(&customProps{})
-	return module
-}
-
-func customDefaultsModuleFactoryBasic() android.Module {
-	return customDefaultsModuleFactoryBase()
-}
-
-func customDefaultsModuleFactory() android.Module {
-	m := customDefaultsModuleFactoryBase()
-	android.InitDefaultsModule(m)
-	return m
-}
-
-type EmbeddedAttr struct {
-	Embedded_attr *string
-}
-
-type OtherEmbeddedAttr struct {
-	Other_embedded_attr *string
-}
-
-type customBazelModuleAttributes struct {
-	EmbeddedAttr
-	*OtherEmbeddedAttr
-	String_literal_prop bazel.StringAttribute
-	String_ptr_prop     *string
-	String_list_prop    []string
-	Arch_paths          bazel.LabelListAttribute
-	Api                 bazel.LabelAttribute
-}
-
-func (m *customModule) dir() *string {
-	return m.props.Dir
-}
-
-func (m *customModule) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	if p := m.props.Does_not_convert_to_bazel; p != nil && *p {
-		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_PROPERTY_UNSUPPORTED, "")
-		return
-	}
-	if p := m.props.One_to_many_prop; p != nil && *p {
-		customBp2buildOneToMany(ctx, m)
-		return
-	}
-
-	paths := bazel.LabelListAttribute{}
-	strAttr := bazel.StringAttribute{}
-	for axis, configToProps := range m.GetArchVariantProperties(ctx, &customProps{}) {
-		for config, props := range configToProps {
-			if custProps, ok := props.(*customProps); ok {
-				if custProps.Arch_paths != nil {
-					paths.SetSelectValue(axis, config, android.BazelLabelForModuleSrcExcludes(ctx, custProps.Arch_paths, custProps.Arch_paths_exclude))
-				}
-				if custProps.String_literal_prop != nil {
-					strAttr.SetSelectValue(axis, config, custProps.String_literal_prop)
-				}
-			}
-		}
-	}
-	productVariableProps, errs := android.ProductVariableProperties(ctx, ctx.Module())
-	for _, err := range errs {
-		ctx.ModuleErrorf("ProductVariableProperties error: %s", err)
-	}
-	if props, ok := productVariableProps["String_literal_prop"]; ok {
-		for c, p := range props {
-			if val, ok := p.(*string); ok {
-				strAttr.SetSelectValue(c.ConfigurationAxis(), c.SelectKey(), val)
-			}
-		}
-	}
-
-	paths.ResolveExcludes()
-
-	attrs := &customBazelModuleAttributes{
-		String_literal_prop: strAttr,
-		String_ptr_prop:     m.props.String_ptr_prop,
-		String_list_prop:    m.props.String_list_prop,
-		Arch_paths:          paths,
-	}
-
-	attrs.Embedded_attr = m.props.Embedded_prop
-	if m.props.OtherEmbeddedProps != nil {
-		attrs.OtherEmbeddedAttr = &OtherEmbeddedAttr{Other_embedded_attr: m.props.OtherEmbeddedProps.Other_embedded_prop}
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class: "custom",
-	}
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: m.Name(), Dir: m.dir()}, attrs)
-
-	if proptools.Bool(m.props.Test_config_setting) {
-		m.createConfigSetting(ctx)
-	}
-
-}
-
-func (m *customModule) createConfigSetting(ctx android.Bp2buildMutatorContext) {
-	csa := bazel.ConfigSettingAttributes{
-		Flag_values: bazel.StringMapAttribute{
-			"//build/bazel/rules/my_string_setting": m.Name(),
-		},
-	}
-	ca := android.CommonAttributes{
-		Name: m.Name() + "_config_setting",
-	}
-	ctx.CreateBazelConfigSetting(
-		csa,
-		ca,
-		ctx.ModuleDir(),
-	)
-}
-
-// A bp2build mutator that uses load statements and creates a 1:M mapping from
-// module to target.
-func customBp2buildOneToMany(ctx android.Bp2buildMutatorContext, m *customModule) {
-
-	baseName := m.Name()
-	attrs := &customBazelModuleAttributes{}
-
-	myLibraryProps := bazel.BazelTargetModuleProperties{
-		Rule_class:        "my_library",
-		Bzl_load_location: "//build/bazel/rules:rules.bzl",
-	}
-	ctx.CreateBazelTargetModule(myLibraryProps, android.CommonAttributes{Name: baseName}, attrs)
-
-	protoLibraryProps := bazel.BazelTargetModuleProperties{
-		Rule_class:        "proto_library",
-		Bzl_load_location: "//build/bazel/rules:proto.bzl",
-	}
-	ctx.CreateBazelTargetModule(protoLibraryProps, android.CommonAttributes{Name: baseName + "_proto_library_deps"}, attrs)
-
-	myProtoLibraryProps := bazel.BazelTargetModuleProperties{
-		Rule_class:        "my_proto_library",
-		Bzl_load_location: "//build/bazel/rules:proto.bzl",
-	}
-	ctx.CreateBazelTargetModule(myProtoLibraryProps, android.CommonAttributes{Name: baseName + "_my_proto_library_deps"}, attrs)
-}
-
-// Helper method for tests to easily access the targets in a dir.
-func generateBazelTargetsForDir(codegenCtx *CodegenContext, dir string) (BazelTargets, []error) {
-	// TODO: Set generateFilegroups to true and/or remove the generateFilegroups argument completely
-	res, err := GenerateBazelTargets(codegenCtx, false)
-	if err != nil {
-		return BazelTargets{}, err
-	}
-	return res.buildFileToTargets[dir], err
-}
-
-func registerCustomModuleForBp2buildConversion(ctx *android.TestContext) {
-	ctx.RegisterModuleType("custom", customModuleFactoryHostAndDevice)
-	ctx.RegisterForBazelConversion()
-}
-
-func simpleModule(typ, name string) string {
-	return fmt.Sprintf(`
-%s {
-		name: "%s",
-}`, typ, name)
-}
-
-type AttrNameToString map[string]string
-
-func (a AttrNameToString) clone() AttrNameToString {
-	newAttrs := make(AttrNameToString, len(a))
-	for k, v := range a {
-		newAttrs[k] = v
-	}
-	return newAttrs
-}
-
-// makeBazelTargetNoRestrictions returns bazel target build file definition that can be host or
-// device specific, or independent of host/device.
-func makeBazelTargetHostOrDevice(typ, name string, attrs AttrNameToString, hod android.HostOrDeviceSupported) string {
-	if _, ok := attrs["target_compatible_with"]; !ok {
-		switch hod {
-		case android.HostSupported:
-			attrs["target_compatible_with"] = `select({
-        "//build/bazel_common_rules/platforms/os:android": ["@platforms//:incompatible"],
-        "//conditions:default": [],
-    })`
-		case android.DeviceSupported:
-			attrs["target_compatible_with"] = `["//build/bazel_common_rules/platforms/os:android"]`
-		}
-	}
-
-	attrStrings := make([]string, 0, len(attrs)+1)
-	if name != "" {
-		attrStrings = append(attrStrings, fmt.Sprintf(`    name = "%s",`, name))
-	}
-	for _, k := range android.SortedKeys(attrs) {
-		attrStrings = append(attrStrings, fmt.Sprintf("    %s = %s,", k, attrs[k]))
-	}
-	return fmt.Sprintf(`%s(
-%s
-)`, typ, strings.Join(attrStrings, "\n"))
-}
-
-// MakeBazelTargetNoRestrictions returns bazel target build file definition that does not add a
-// target_compatible_with.  This is useful for module types like filegroup and genrule that arch not
-// arch variant
-func MakeBazelTargetNoRestrictions(typ, name string, attrs AttrNameToString) string {
-	return makeBazelTargetHostOrDevice(typ, name, attrs, android.HostAndDeviceDefault)
-}
-
-// makeBazelTargetNoRestrictions returns bazel target build file definition that is device specific
-// as this is the most common default in Soong.
-func MakeBazelTarget(typ, name string, attrs AttrNameToString) string {
-	return makeBazelTargetHostOrDevice(typ, name, attrs, android.DeviceSupported)
-}
-
-type ExpectedRuleTarget struct {
-	Rule  string
-	Name  string
-	Attrs AttrNameToString
-	Hod   android.HostOrDeviceSupported
-}
-
-func (ebr ExpectedRuleTarget) String() string {
-	return makeBazelTargetHostOrDevice(ebr.Rule, ebr.Name, ebr.Attrs, ebr.Hod)
-}
-
-func makeCcStubSuiteTargets(name string, attrs AttrNameToString) string {
-	if _, hasStubs := attrs["stubs_symbol_file"]; !hasStubs {
-		return ""
-	}
-	STUB_SUITE_ATTRS := map[string]string{
-		"api_surface":          "api_surface",
-		"stubs_symbol_file":    "symbol_file",
-		"stubs_versions":       "versions",
-		"soname":               "soname",
-		"source_library_label": "source_library_label",
-	}
-
-	stubSuiteAttrs := AttrNameToString{}
-	for key, _ := range attrs {
-		if _, stubSuiteAttr := STUB_SUITE_ATTRS[key]; stubSuiteAttr {
-			stubSuiteAttrs[STUB_SUITE_ATTRS[key]] = attrs[key]
-		} else {
-			panic(fmt.Sprintf("unused cc_stub_suite attr %q\n", key))
-		}
-	}
-	return MakeBazelTarget("cc_stub_suite", name+"_stub_libs", stubSuiteAttrs)
-}
-
-func MakeNeverlinkDuplicateTarget(moduleType string, name string) string {
-	return MakeNeverlinkDuplicateTargetWithAttrs(moduleType, name, AttrNameToString{
-		"sdk_version": `"current"`, // use as default
-	})
-}
-
-func MakeNeverlinkDuplicateTargetWithAttrs(moduleType string, name string, extraAttrs AttrNameToString) string {
-	attrs := extraAttrs
-	attrs["neverlink"] = `True`
-	attrs["exports"] = `[":` + name + `"]`
-	return MakeBazelTarget(moduleType, name+"-neverlink", attrs)
-}
-
-func getTargetName(targetContent string) string {
-	data := strings.Split(targetContent, "name = \"")
-	if len(data) < 2 {
-		return ""
-	} else {
-		endIndex := strings.Index(data[1], "\"")
-		return data[1][:endIndex]
-	}
-}
diff --git a/bpf/bpf.go b/bpf/bpf.go
index 58213aa..ce57b46 100644
--- a/bpf/bpf.go
+++ b/bpf/bpf.go
@@ -22,8 +22,6 @@
 	"strings"
 
 	"android/soong/android"
-	"android/soong/bazel"
-	"android/soong/bazel/cquery"
 	"android/soong/cc"
 
 	"github.com/google/blueprint"
@@ -98,7 +96,6 @@
 
 type bpf struct {
 	android.ModuleBase
-	android.BazelModuleBase
 
 	properties BpfProperties
 
@@ -206,6 +203,7 @@
 		}
 
 	}
+	ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: srcs.Strings()})
 }
 
 func (bpf *bpf) AndroidMk() android.AndroidMkData {
@@ -244,35 +242,6 @@
 	}
 }
 
-var _ android.MixedBuildBuildable = (*bpf)(nil)
-
-func (bpf *bpf) IsMixedBuildSupported(ctx android.BaseModuleContext) bool {
-	return true
-}
-
-func (bpf *bpf) QueueBazelCall(ctx android.BaseModuleContext) {
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(
-		bpf.GetBazelLabel(ctx, bpf),
-		cquery.GetOutputFiles,
-		android.GetConfigKey(ctx))
-}
-
-func (bpf *bpf) ProcessBazelQueryResponse(ctx android.ModuleContext) {
-	bazelCtx := ctx.Config().BazelContext
-	objPaths, err := bazelCtx.GetOutputFiles(bpf.GetBazelLabel(ctx, bpf), android.GetConfigKey(ctx))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-
-	bazelOuts := android.Paths{}
-	for _, p := range objPaths {
-		bazelOuts = append(bazelOuts, android.PathForBazelOut(ctx, p))
-	}
-	bpf.objs = bazelOuts
-}
-
 // Implements OutputFileFileProducer interface so that the obj output can be used in the data property
 // of other modules.
 func (bpf *bpf) OutputFiles(tag string) (android.Paths, error) {
@@ -296,39 +265,5 @@
 	module.AddProperties(&module.properties)
 
 	android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibCommon)
-	android.InitBazelModule(module)
 	return module
 }
-
-type bazelBpfAttributes struct {
-	Srcs              bazel.LabelListAttribute
-	Copts             bazel.StringListAttribute
-	Absolute_includes bazel.StringListAttribute
-	Btf               *bool
-	// TODO(b/249528391): Add support for sub_dir
-}
-
-// bpf bp2build converter
-func (b *bpf) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	if ctx.ModuleType() != "bpf" {
-		return
-	}
-
-	srcs := bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, b.properties.Srcs))
-	copts := bazel.MakeStringListAttribute(b.properties.Cflags)
-	absolute_includes := bazel.MakeStringListAttribute(b.properties.Include_dirs)
-	btf := b.properties.Btf
-
-	attrs := bazelBpfAttributes{
-		Srcs:              srcs,
-		Copts:             copts,
-		Absolute_includes: absolute_includes,
-		Btf:               btf,
-	}
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "bpf",
-		Bzl_load_location: "//build/bazel/rules/bpf:bpf.bzl",
-	}
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: b.Name()}, &attrs)
-}
diff --git a/bpf/bpf_test.go b/bpf/bpf_test.go
index a2010ff..6e39096 100644
--- a/bpf/bpf_test.go
+++ b/bpf/bpf_test.go
@@ -71,26 +71,3 @@
 		`\QAndroid.bp:2:3: module "bpf_invalid_name.o" variant "android_common": invalid character '_' in source name\E`)).
 		RunTestWithBp(t, bp)
 }
-
-func TestBpfWithBazel(t *testing.T) {
-	bp := `
-		bpf {
-			name: "bpf.o",
-			srcs: ["bpf.c"],
-			bazel_module: { label: "//bpf" },
-		}
-	`
-
-	result := android.GroupFixturePreparers(
-		prepareForBpfTest, android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: "outputbase",
-				LabelToOutputFiles: map[string][]string{
-					"//bpf": []string{"bpf.o"}}}
-		})).RunTestWithBp(t, bp)
-
-	output := result.Module("bpf.o", "android_common").(*bpf)
-
-	expectedOutputFiles := []string{"outputbase/execroot/__main__/bpf.o"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, output.objs.Strings())
-}
diff --git a/cc/Android.bp b/cc/Android.bp
index 9496bac..9e4b763 100644
--- a/cc/Android.bp
+++ b/cc/Android.bp
@@ -9,16 +9,15 @@
         "blueprint",
         "blueprint-pathtools",
         "soong",
+        "soong-aconfig",
         "soong-aidl-library",
         "soong-android",
-        "soong-bazel",
         "soong-cc-config",
         "soong-etc",
         "soong-fuzz",
         "soong-genrule",
         "soong-multitree",
         "soong-snapshot",
-        "soong-sysprop-bp2build",
         "soong-testing",
         "soong-tradefed",
     ],
@@ -27,7 +26,6 @@
         "fdo_profile.go",
         "androidmk.go",
         "api_level.go",
-        "bp2build.go",
         "builder.go",
         "cc.go",
         "ccdeps.go",
diff --git a/cc/afdo.go b/cc/afdo.go
index 91cf0b8..bad16a1 100644
--- a/cc/afdo.go
+++ b/cc/afdo.go
@@ -24,16 +24,6 @@
 	"github.com/google/blueprint/proptools"
 )
 
-// TODO(b/267229066): Remove globalAfdoProfileProjects after implementing bp2build converter for fdo_profile
-var (
-	globalAfdoProfileProjects = []string{
-		"vendor/google_data/pgo_profile/sampling/",
-		"toolchain/pgo-profiles/sampling/",
-	}
-)
-
-var afdoProfileProjectsConfigKey = android.NewOnceKey("AfdoProfileProjects")
-
 // This flag needs to be in both CFlags and LdFlags to ensure correct symbol ordering
 const afdoFlagsFormat = "-fprofile-sample-use=%s -fprofile-sample-accurate"
 
@@ -64,6 +54,13 @@
 	return []interface{}{&afdo.Properties}
 }
 
+func (afdo *afdo) begin(ctx BaseModuleContext) {
+	// Disable on eng builds for faster build.
+	if ctx.Config().Eng() {
+		afdo.Properties.Afdo = false
+	}
+}
+
 // afdoEnabled returns true for binaries and shared libraries
 // that set afdo prop to True and there is a profile available
 func (afdo *afdo) afdoEnabled() bool {
diff --git a/cc/androidmk.go b/cc/androidmk.go
index e0e543f..54c7f97 100644
--- a/cc/androidmk.go
+++ b/cc/androidmk.go
@@ -15,6 +15,7 @@
 package cc
 
 import (
+	"android/soong/aconfig"
 	"github.com/google/blueprint/proptools"
 
 	"fmt"
@@ -133,6 +134,7 @@
 					entries.SetString("SOONG_SDK_VARIANT_MODULES",
 						"$(SOONG_SDK_VARIANT_MODULES) $(patsubst %.sdk,%,$(LOCAL_MODULE))")
 				}
+				aconfig.SetAconfigFileMkEntries(c.AndroidModuleBase(), entries, c.mergedAconfigFiles)
 			},
 		},
 		ExtraFooters: []android.AndroidMkExtraFootersFunc{
@@ -175,15 +177,6 @@
 	}
 }
 
-func AndroidMkWriteTestData(data []android.DataPath, entries *android.AndroidMkEntries) {
-	testFiles := android.AndroidMkDataPaths(data)
-	if len(testFiles) > 0 {
-		entries.ExtraEntries = append(entries.ExtraEntries, func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
-			entries.AddStrings("LOCAL_TEST_DATA", testFiles...)
-		})
-	}
-}
-
 func makeOverrideModuleNames(ctx AndroidMkContext, overrides []string) []string {
 	if ctx.Target().NativeBridge == android.NativeBridgeEnabled {
 		var result []string
@@ -379,11 +372,6 @@
 			entries.SetBool("LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG", true)
 		}
 	})
-	dataPaths := []android.DataPath{}
-	for _, srcPath := range benchmark.data {
-		dataPaths = append(dataPaths, android.DataPath{SrcPath: srcPath})
-	}
-	AndroidMkWriteTestData(dataPaths, entries)
 }
 
 func (test *testBinary) AndroidMkEntries(ctx AndroidMkContext, entries *android.AndroidMkEntries) {
@@ -411,40 +399,16 @@
 		test.Properties.Test_options.CommonTestOptions.SetAndroidMkEntries(entries)
 	})
 
-	AndroidMkWriteTestData(test.data, entries)
 	androidMkWriteExtraTestConfigs(test.extraTestConfigs, entries)
 }
 
 func (fuzz *fuzzBinary) AndroidMkEntries(ctx AndroidMkContext, entries *android.AndroidMkEntries) {
 	ctx.subAndroidMk(entries, fuzz.binaryDecorator)
 
-	var fuzzFiles []string
-	for _, d := range fuzz.fuzzPackagedModule.Corpus {
-		fuzzFiles = append(fuzzFiles,
-			filepath.Dir(fuzz.fuzzPackagedModule.CorpusIntermediateDir.String())+":corpus/"+d.Base())
-	}
-
-	for _, d := range fuzz.fuzzPackagedModule.Data {
-		fuzzFiles = append(fuzzFiles,
-			filepath.Dir(fuzz.fuzzPackagedModule.DataIntermediateDir.String())+":data/"+d.Rel())
-	}
-
-	if fuzz.fuzzPackagedModule.Dictionary != nil {
-		fuzzFiles = append(fuzzFiles,
-			filepath.Dir(fuzz.fuzzPackagedModule.Dictionary.String())+":"+fuzz.fuzzPackagedModule.Dictionary.Base())
-	}
-
-	if fuzz.fuzzPackagedModule.Config != nil {
-		fuzzFiles = append(fuzzFiles,
-			filepath.Dir(fuzz.fuzzPackagedModule.Config.String())+":config.json")
-	}
-
 	entries.ExtraEntries = append(entries.ExtraEntries, func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
 		entries.SetBool("LOCAL_IS_FUZZ_TARGET", true)
-		if len(fuzzFiles) > 0 {
-			entries.AddStrings("LOCAL_TEST_DATA", fuzzFiles...)
-		}
 		if fuzz.installedSharedDeps != nil {
+			// TOOD: move to install dep
 			entries.AddStrings("LOCAL_FUZZ_INSTALLED_SHARED_DEPS", fuzz.installedSharedDeps...)
 		}
 	})
diff --git a/cc/binary.go b/cc/binary.go
index 0f05605..61541ad 100644
--- a/cc/binary.go
+++ b/cc/binary.go
@@ -17,13 +17,8 @@
 import (
 	"path/filepath"
 
-	"android/soong/bazel/cquery"
-
-	"github.com/google/blueprint"
-	"github.com/google/blueprint/proptools"
-
 	"android/soong/android"
-	"android/soong/bazel"
+	"github.com/google/blueprint"
 )
 
 type BinaryLinkerProperties struct {
@@ -71,14 +66,13 @@
 
 // cc_binary produces a binary that is runnable on a device.
 func BinaryFactory() android.Module {
-	module, _ := newBinary(android.HostAndDeviceSupported, true)
-	module.bazelHandler = &ccBinaryBazelHandler{module: module}
+	module, _ := newBinary(android.HostAndDeviceSupported)
 	return module.Init()
 }
 
 // cc_binary_host produces a binary that is runnable on a host.
 func BinaryHostFactory() android.Module {
-	module, _ := newBinary(android.HostSupported, true)
+	module, _ := newBinary(android.HostSupported)
 	return module.Init()
 }
 
@@ -196,10 +190,10 @@
 // Individual module implementations which comprise a C++ binary should call this function,
 // set some fields on the result, and then call the Init function.
 func NewBinary(hod android.HostOrDeviceSupported) (*Module, *binaryDecorator) {
-	return newBinary(hod, true)
+	return newBinary(hod)
 }
 
-func newBinary(hod android.HostOrDeviceSupported, bazelable bool) (*Module, *binaryDecorator) {
+func newBinary(hod android.HostOrDeviceSupported) (*Module, *binaryDecorator) {
 	module := newModule(hod, android.MultilibFirst)
 	binary := &binaryDecorator{
 		baseLinker:    NewBaseLinker(module.sanitize),
@@ -208,7 +202,6 @@
 	module.compiler = NewBaseCompiler()
 	module.linker = binary
 	module.installer = binary
-	module.bazelable = bazelable
 
 	// Allow module to be added as member of an sdk/module_exports.
 	module.sdkMemberTypes = []android.SdkMemberType{
@@ -452,6 +445,10 @@
 	return binary.unstrippedOutputFile
 }
 
+func (binary *binaryDecorator) strippedAllOutputFilePath() android.Path {
+	panic("Not implemented.")
+}
+
 func (binary *binaryDecorator) setSymlinkList(ctx ModuleContext) {
 	for _, symlink := range binary.Properties.Symlinks {
 		binary.symlinks = append(binary.symlinks,
@@ -568,149 +565,3 @@
 		},
 	})
 }
-
-type ccBinaryBazelHandler struct {
-	module *Module
-}
-
-var _ BazelHandler = (*ccBinaryBazelHandler)(nil)
-
-func (handler *ccBinaryBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(label, cquery.GetCcUnstrippedInfo, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-}
-
-func (handler *ccBinaryBazelHandler) ProcessBazelQueryResponse(ctx android.ModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	info, err := bazelCtx.GetCcUnstrippedInfo(label, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-
-	var outputFilePath android.Path = android.PathForBazelOut(ctx, info.OutputFile)
-	if len(info.TidyFiles) > 0 {
-		handler.module.tidyFiles = android.PathsForBazelOut(ctx, info.TidyFiles)
-		outputFilePath = android.AttachValidationActions(ctx, outputFilePath, handler.module.tidyFiles)
-	}
-	handler.module.outputFile = android.OptionalPathForPath(outputFilePath)
-	handler.module.linker.(*binaryDecorator).unstrippedOutputFile = android.PathForBazelOut(ctx, info.UnstrippedOutput)
-
-	handler.module.setAndroidMkVariablesFromCquery(info.CcAndroidMkInfo)
-}
-
-func binaryBp2buildAttrs(ctx android.Bp2buildMutatorContext, m *Module) binaryAttributes {
-	baseAttrs := bp2BuildParseBaseProps(ctx, m)
-	binaryLinkerAttrs := bp2buildBinaryLinkerProps(ctx, m)
-
-	if proptools.BoolDefault(binaryLinkerAttrs.Linkshared, true) {
-		baseAttrs.implementationDynamicDeps.Add(baseAttrs.protoDependency)
-	} else {
-		baseAttrs.implementationDeps.Add(baseAttrs.protoDependency)
-	}
-
-	// binaries don't have implementation_whole_archive_deps
-	baseAttrs.wholeArchiveDeps.Append(baseAttrs.implementationWholeArchiveDeps)
-
-	attrs := binaryAttributes{
-		binaryLinkerAttrs: binaryLinkerAttrs,
-
-		Srcs:    baseAttrs.srcs,
-		Srcs_c:  baseAttrs.cSrcs,
-		Srcs_as: baseAttrs.asSrcs,
-
-		Copts:      baseAttrs.copts,
-		Cppflags:   baseAttrs.cppFlags,
-		Conlyflags: baseAttrs.conlyFlags,
-		Asflags:    baseAttrs.asFlags,
-
-		Deps:               baseAttrs.implementationDeps,
-		Dynamic_deps:       baseAttrs.implementationDynamicDeps,
-		Whole_archive_deps: baseAttrs.wholeArchiveDeps,
-		System_deps:        baseAttrs.systemDynamicDeps,
-		Runtime_deps:       baseAttrs.runtimeDeps,
-
-		Local_includes:    baseAttrs.localIncludes,
-		Absolute_includes: baseAttrs.absoluteIncludes,
-		Linkopts:          baseAttrs.linkopts,
-		Use_version_lib:   baseAttrs.useVersionLib,
-		Rtti:              baseAttrs.rtti,
-		Stl:               baseAttrs.stl,
-		Cpp_std:           baseAttrs.cppStd,
-
-		Additional_linker_inputs:   baseAttrs.additionalLinkerInputs,
-		Additional_compiler_inputs: baseAttrs.additionalCompilerInputs,
-
-		Strip: stripAttributes{
-			Keep_symbols:                 baseAttrs.stripKeepSymbols,
-			Keep_symbols_and_debug_frame: baseAttrs.stripKeepSymbolsAndDebugFrame,
-			Keep_symbols_list:            baseAttrs.stripKeepSymbolsList,
-			All:                          baseAttrs.stripAll,
-			None:                         baseAttrs.stripNone,
-		},
-
-		Features: baseAttrs.features,
-
-		SdkAttributes: Bp2BuildParseSdkAttributes(m),
-
-		Native_coverage: baseAttrs.Native_coverage,
-	}
-
-	m.convertTidyAttributes(ctx, &attrs.tidyAttributes)
-
-	return attrs
-}
-
-func binaryBp2build(ctx android.Bp2buildMutatorContext, m *Module) {
-	// shared with cc_test
-	binaryAttrs := binaryBp2buildAttrs(ctx, m)
-
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, m)
-	ctx.CreateBazelTargetModule(bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_binary",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_binary.bzl",
-	},
-		android.CommonAttributes{Name: m.Name(), Tags: tags},
-		&binaryAttrs)
-}
-
-// binaryAttributes contains Bazel attributes corresponding to a cc binary
-type binaryAttributes struct {
-	binaryLinkerAttrs
-	Srcs    bazel.LabelListAttribute
-	Srcs_c  bazel.LabelListAttribute
-	Srcs_as bazel.LabelListAttribute
-
-	Copts                      bazel.StringListAttribute
-	Cppflags                   bazel.StringListAttribute
-	Conlyflags                 bazel.StringListAttribute
-	Asflags                    bazel.StringListAttribute
-	Additional_compiler_inputs bazel.LabelListAttribute
-
-	Deps               bazel.LabelListAttribute
-	Dynamic_deps       bazel.LabelListAttribute
-	Whole_archive_deps bazel.LabelListAttribute
-	System_deps        bazel.LabelListAttribute
-	Runtime_deps       bazel.LabelListAttribute
-
-	Local_includes    bazel.StringListAttribute
-	Absolute_includes bazel.StringListAttribute
-
-	Linkopts                 bazel.StringListAttribute
-	Additional_linker_inputs bazel.LabelListAttribute
-	Use_version_lib          bazel.BoolAttribute
-
-	Rtti    bazel.BoolAttribute
-	Stl     *string
-	Cpp_std *string
-
-	Strip stripAttributes
-
-	Features bazel.StringListAttribute
-
-	SdkAttributes
-
-	tidyAttributes
-
-	Native_coverage *bool
-}
diff --git a/cc/binary_test.go b/cc/binary_test.go
index 2fac002..3e18940 100644
--- a/cc/binary_test.go
+++ b/cc/binary_test.go
@@ -17,89 +17,9 @@
 import (
 	"testing"
 
-	"android/soong/bazel/cquery"
-
 	"android/soong/android"
 )
 
-func TestCcBinaryWithBazel(t *testing.T) {
-	t.Parallel()
-	bp := `
-cc_binary {
-	name: "foo",
-	srcs: ["foo.cc"],
-	bazel_module: { label: "//foo/bar:bar" },
-}`
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir: "outputbase",
-		LabelToCcBinary: map[string]cquery.CcUnstrippedInfo{
-			"//foo/bar:bar": cquery.CcUnstrippedInfo{
-				OutputFile:       "foo",
-				UnstrippedOutput: "foo.unstripped",
-			},
-		},
-	}
-	ctx := testCcWithConfig(t, config)
-
-	binMod := ctx.ModuleForTests("foo", "android_arm64_armv8-a").Module()
-	producer := binMod.(android.OutputFileProducer)
-	outputFiles, err := producer.OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_binary outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{"outputbase/execroot/__main__/foo"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
-
-	unStrippedFilePath := binMod.(*Module).UnstrippedOutputFile()
-	expectedUnStrippedFile := "outputbase/execroot/__main__/foo.unstripped"
-	android.AssertStringEquals(t, "Unstripped output file", expectedUnStrippedFile, unStrippedFilePath.String())
-
-	entries := android.AndroidMkEntriesForTest(t, ctx, binMod)[0]
-	android.AssertStringEquals(t, "unexpected LOCAL_SOONG_MODULE_TYPE", "cc_binary", entries.EntryMap["LOCAL_SOONG_MODULE_TYPE"][0])
-}
-
-func TestCcBinaryWithBazelValidations(t *testing.T) {
-	t.Parallel()
-	bp := `
-cc_binary {
-	name: "foo",
-	srcs: ["foo.cc"],
-	bazel_module: { label: "//foo/bar:bar" },
-	tidy: true,
-}`
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir: "outputbase",
-		LabelToCcBinary: map[string]cquery.CcUnstrippedInfo{
-			"//foo/bar:bar": cquery.CcUnstrippedInfo{
-				OutputFile:       "foo",
-				UnstrippedOutput: "foo.unstripped",
-				TidyFiles:        []string{"foo.c.tidy"},
-			},
-		},
-	}
-	ctx := android.GroupFixturePreparers(
-		prepareForCcTest,
-		android.FixtureMergeEnv(map[string]string{
-			"ALLOW_LOCAL_TIDY_TRUE": "1",
-		}),
-	).RunTestWithConfig(t, config).TestContext
-
-	binMod := ctx.ModuleForTests("foo", "android_arm64_armv8-a").Module()
-	producer := binMod.(android.OutputFileProducer)
-	outputFiles, err := producer.OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_binary outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{"out/soong/.intermediates/foo/android_arm64_armv8-a/validated/foo"}
-	android.AssertPathsRelativeToTopEquals(t, "output files", expectedOutputFiles, outputFiles)
-
-	unStrippedFilePath := binMod.(*Module).UnstrippedOutputFile()
-	expectedUnStrippedFile := "outputbase/execroot/__main__/foo.unstripped"
-	android.AssertStringEquals(t, "Unstripped output file", expectedUnStrippedFile, unStrippedFilePath.String())
-}
-
 func TestBinaryLinkerScripts(t *testing.T) {
 	t.Parallel()
 	result := PrepareForIntegrationTestWithCc.RunTestWithBp(t, `
diff --git a/cc/bp2build.go b/cc/bp2build.go
deleted file mode 100644
index 919b4d4..0000000
--- a/cc/bp2build.go
+++ /dev/null
@@ -1,2127 +0,0 @@
-// Copyright 2021 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//	http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package cc
-
-import (
-	"fmt"
-	"path/filepath"
-	"strings"
-	"sync"
-
-	"android/soong/android"
-	"android/soong/bazel"
-	"android/soong/cc/config"
-	"android/soong/genrule"
-
-	"github.com/google/blueprint"
-
-	"github.com/google/blueprint/proptools"
-)
-
-const (
-	cSrcPartition       = "c"
-	asSrcPartition      = "as"
-	asmSrcPartition     = "asm"
-	lSrcPartition       = "l"
-	llSrcPartition      = "ll"
-	cppSrcPartition     = "cpp"
-	protoSrcPartition   = "proto"
-	aidlSrcPartition    = "aidl"
-	syspropSrcPartition = "sysprop"
-
-	yaccSrcPartition = "yacc"
-
-	rScriptSrcPartition = "renderScript"
-
-	xsdSrcPartition = "xsd"
-
-	genrulePartition = "genrule"
-
-	protoFromGenPartition = "proto_gen"
-
-	hdrPartition = "hdr"
-
-	stubsSuffix = "_stub_libs_current"
-)
-
-// staticOrSharedAttributes are the Bazel-ified versions of StaticOrSharedProperties --
-// properties which apply to either the shared or static version of a cc_library module.
-type staticOrSharedAttributes struct {
-	Srcs      bazel.LabelListAttribute
-	Srcs_c    bazel.LabelListAttribute
-	Srcs_as   bazel.LabelListAttribute
-	Srcs_aidl bazel.LabelListAttribute
-	Hdrs      bazel.LabelListAttribute
-	Copts     bazel.StringListAttribute
-
-	Additional_compiler_inputs bazel.LabelListAttribute
-
-	Deps                              bazel.LabelListAttribute
-	Implementation_deps               bazel.LabelListAttribute
-	Dynamic_deps                      bazel.LabelListAttribute
-	Implementation_dynamic_deps       bazel.LabelListAttribute
-	Whole_archive_deps                bazel.LabelListAttribute
-	Implementation_whole_archive_deps bazel.LabelListAttribute
-	Runtime_deps                      bazel.LabelListAttribute
-
-	System_dynamic_deps bazel.LabelListAttribute
-
-	Enabled bazel.BoolAttribute
-
-	Native_coverage *bool
-
-	Apex_available []string
-
-	Features bazel.StringListAttribute
-
-	SdkAttributes
-
-	tidyAttributes
-}
-
-type tidyAttributes struct {
-	Tidy                  *string
-	Tidy_flags            []string
-	Tidy_checks           []string
-	Tidy_checks_as_errors []string
-	Tidy_disabled_srcs    bazel.LabelListAttribute
-	Tidy_timeout_srcs     bazel.LabelListAttribute
-}
-
-func (m *Module) convertTidyAttributes(ctx android.Bp2buildMutatorContext, moduleAttrs *tidyAttributes) {
-	for _, f := range m.features {
-		if tidy, ok := f.(*tidyFeature); ok {
-			var tidyAttr *string
-			if tidy.Properties.Tidy != nil {
-				if *tidy.Properties.Tidy {
-					tidyAttr = proptools.StringPtr("local")
-				} else {
-					tidyAttr = proptools.StringPtr("never")
-				}
-			}
-			moduleAttrs.Tidy = tidyAttr
-			moduleAttrs.Tidy_flags = tidy.Properties.Tidy_flags
-			moduleAttrs.Tidy_checks = tidy.Properties.Tidy_checks
-			moduleAttrs.Tidy_checks_as_errors = tidy.Properties.Tidy_checks_as_errors
-		}
-
-	}
-	archVariantProps := m.GetArchVariantProperties(ctx, &BaseCompilerProperties{})
-	for axis, configToProps := range archVariantProps {
-		for cfg, _props := range configToProps {
-			if archProps, ok := _props.(*BaseCompilerProperties); ok {
-				archDisabledSrcs := android.BazelLabelForModuleSrc(ctx, archProps.Tidy_disabled_srcs)
-				moduleAttrs.Tidy_disabled_srcs.SetSelectValue(axis, cfg, archDisabledSrcs)
-				archTimeoutSrcs := android.BazelLabelForModuleSrc(ctx, archProps.Tidy_timeout_srcs)
-				moduleAttrs.Tidy_timeout_srcs.SetSelectValue(axis, cfg, archTimeoutSrcs)
-			}
-		}
-	}
-}
-
-// Returns an unchanged label and a bool indicating whether the dep is a genrule that produces .proto files
-func protoFromGenPartitionMapper(pathCtx android.BazelConversionContext) bazel.LabelMapper {
-	return func(ctx bazel.OtherModuleContext, label bazel.Label) (string, bool) {
-		mod, exists := ctx.ModuleFromName(label.OriginalModuleName)
-		if !exists {
-			return label.Label, false
-		}
-		gen, isGen := mod.(*genrule.Module)
-		if !isGen {
-			return label.Label, false
-		}
-		if containsProto(ctx, gen.RawOutputFiles(pathCtx)) {
-			// Return unmodified label + true
-			// True will ensure that this module gets dropped from `srcs` of the generated cc_* target. `srcs` is reserved for .cpp files
-			return label.Label, true
-		}
-		return label.Label, false
-	}
-}
-
-// Returns true if srcs contains only .proto files
-// Raises an exception if there is a combination of .proto and non .proto srcs
-func containsProto(ctx bazel.OtherModuleContext, srcs []string) bool {
-	onlyProtos := false
-	for _, src := range srcs {
-		if strings.HasSuffix(src, ".proto") {
-			onlyProtos = true
-		} else if onlyProtos {
-			// This is not a proto file, and we have encountered a .proto file previously
-			ctx.ModuleErrorf("TOOD: Add bp2build support combination of .proto and non .proto files in outs of genrule")
-		}
-	}
-	return onlyProtos
-}
-
-// groupSrcsByExtension partitions `srcs` into groups based on file extension.
-func groupSrcsByExtension(ctx android.BazelConversionPathContext, srcs bazel.LabelListAttribute) bazel.PartitionToLabelListAttribute {
-	// Convert filegroup dependencies into extension-specific filegroups filtered in the filegroup.bzl
-	// macro.
-	addSuffixForFilegroup := func(suffix string) bazel.LabelMapper {
-		return func(otherModuleCtx bazel.OtherModuleContext, label bazel.Label) (string, bool) {
-
-			m, exists := otherModuleCtx.ModuleFromName(label.OriginalModuleName)
-			labelStr := label.Label
-			if !exists || !android.IsFilegroup(otherModuleCtx, m) {
-				return labelStr, false
-			}
-			// If the filegroup is already converted to aidl_library or proto_library,
-			// skip creating _c_srcs, _as_srcs, _cpp_srcs filegroups
-			fg, _ := m.(android.FileGroupAsLibrary)
-			if fg.ShouldConvertToAidlLibrary(ctx) || fg.ShouldConvertToProtoLibrary(ctx) {
-				return labelStr, false
-			}
-			return labelStr + suffix, true
-		}
-	}
-
-	// TODO(b/190006308): Handle language detection of sources in a Bazel rule.
-	labels := bazel.LabelPartitions{
-		protoSrcPartition: android.ProtoSrcLabelPartition,
-		cSrcPartition:     bazel.LabelPartition{Extensions: []string{".c"}, LabelMapper: addSuffixForFilegroup("_c_srcs")},
-		asSrcPartition:    bazel.LabelPartition{Extensions: []string{".s", ".S"}, LabelMapper: addSuffixForFilegroup("_as_srcs")},
-		asmSrcPartition:   bazel.LabelPartition{Extensions: []string{".asm"}},
-		aidlSrcPartition:  android.AidlSrcLabelPartition,
-		// TODO(http://b/231968910): If there is ever a filegroup target that
-		// 		contains .l or .ll files we will need to find a way to add a
-		// 		LabelMapper for these that identifies these filegroups and
-		//		converts them appropriately
-		lSrcPartition:         bazel.LabelPartition{Extensions: []string{".l"}},
-		llSrcPartition:        bazel.LabelPartition{Extensions: []string{".ll"}},
-		rScriptSrcPartition:   bazel.LabelPartition{Extensions: []string{".fs", ".rscript"}},
-		xsdSrcPartition:       bazel.LabelPartition{LabelMapper: android.XsdLabelMapper(xsdConfigCppTarget)},
-		protoFromGenPartition: bazel.LabelPartition{LabelMapper: protoFromGenPartitionMapper(ctx)},
-		// C++ is the "catch-all" group, and comprises generated sources because we don't
-		// know the language of these sources until the genrule is executed.
-		cppSrcPartition:     bazel.LabelPartition{Extensions: []string{".cpp", ".cc", ".cxx", ".mm"}, LabelMapper: addSuffixForFilegroup("_cpp_srcs"), Keep_remainder: true},
-		syspropSrcPartition: bazel.LabelPartition{Extensions: []string{".sysprop"}},
-		yaccSrcPartition:    bazel.LabelPartition{Extensions: []string{".y", "yy"}},
-	}
-
-	return bazel.PartitionLabelListAttribute(ctx, &srcs, labels)
-}
-
-func partitionHeaders(ctx android.BazelConversionPathContext, hdrs bazel.LabelListAttribute) bazel.PartitionToLabelListAttribute {
-	labels := bazel.LabelPartitions{
-		xsdSrcPartition:  bazel.LabelPartition{LabelMapper: android.XsdLabelMapper(xsdConfigCppTarget)},
-		genrulePartition: bazel.LabelPartition{LabelMapper: genrule.GenruleCcHeaderLabelMapper},
-		hdrPartition:     bazel.LabelPartition{Keep_remainder: true},
-	}
-	return bazel.PartitionLabelListAttribute(ctx, &hdrs, labels)
-}
-
-// bp2BuildParseLibProps returns the attributes for a variant of a cc_library.
-func bp2BuildParseLibProps(ctx android.Bp2buildMutatorContext, module *Module, isStatic bool) staticOrSharedAttributes {
-	lib, ok := module.compiler.(*libraryDecorator)
-	if !ok {
-		return staticOrSharedAttributes{}
-	}
-	return bp2buildParseStaticOrSharedProps(ctx, module, lib, isStatic)
-}
-
-// bp2buildParseSharedProps returns the attributes for the shared variant of a cc_library.
-func bp2BuildParseSharedProps(ctx android.Bp2buildMutatorContext, module *Module) staticOrSharedAttributes {
-	return bp2BuildParseLibProps(ctx, module, false)
-}
-
-// bp2buildParseStaticProps returns the attributes for the static variant of a cc_library.
-func bp2BuildParseStaticProps(ctx android.Bp2buildMutatorContext, module *Module) staticOrSharedAttributes {
-	return bp2BuildParseLibProps(ctx, module, true)
-}
-
-type depsPartition struct {
-	export         bazel.LabelList
-	implementation bazel.LabelList
-}
-
-type bazelLabelForDepsFn func(android.Bp2buildMutatorContext, []string) bazel.LabelList
-
-func maybePartitionExportedAndImplementationsDeps(ctx android.Bp2buildMutatorContext, exportsDeps bool, allDeps, exportedDeps []string, fn bazelLabelForDepsFn) depsPartition {
-	if !exportsDeps {
-		return depsPartition{
-			implementation: fn(ctx, allDeps),
-		}
-	}
-
-	implementation, export := android.FilterList(allDeps, exportedDeps)
-
-	return depsPartition{
-		export:         fn(ctx, export),
-		implementation: fn(ctx, implementation),
-	}
-}
-
-type bazelLabelForDepsExcludesFn func(android.Bp2buildMutatorContext, []string, []string) bazel.LabelList
-
-func maybePartitionExportedAndImplementationsDepsExcludes(ctx android.Bp2buildMutatorContext, exportsDeps bool, allDeps, excludes, exportedDeps []string, fn bazelLabelForDepsExcludesFn) depsPartition {
-	if !exportsDeps {
-		return depsPartition{
-			implementation: fn(ctx, allDeps, excludes),
-		}
-	}
-	implementation, export := android.FilterList(allDeps, exportedDeps)
-
-	return depsPartition{
-		export:         fn(ctx, export, excludes),
-		implementation: fn(ctx, implementation, excludes),
-	}
-}
-
-func bp2BuildPropParseHelper(ctx android.ArchVariantContext, module *Module, propsType interface{}, parseFunc func(axis bazel.ConfigurationAxis, config string, props interface{})) {
-	for axis, configToProps := range module.GetArchVariantProperties(ctx, propsType) {
-		for cfg, props := range configToProps {
-			parseFunc(axis, cfg, props)
-		}
-	}
-}
-
-// Parses properties common to static and shared libraries. Also used for prebuilt libraries.
-func bp2buildParseStaticOrSharedProps(ctx android.Bp2buildMutatorContext, module *Module, lib *libraryDecorator, isStatic bool) staticOrSharedAttributes {
-	attrs := staticOrSharedAttributes{}
-
-	setAttrs := func(axis bazel.ConfigurationAxis, config string, props StaticOrSharedProperties) {
-		attrs.Copts.SetSelectValue(axis, config, parseCommandLineFlags(props.Cflags, filterOutStdFlag, filterOutHiddenVisibility))
-		attrs.Srcs.SetSelectValue(axis, config, android.BazelLabelForModuleSrc(ctx, props.Srcs))
-		attrs.System_dynamic_deps.SetSelectValue(axis, config, bazelLabelForSharedDeps(ctx, props.System_shared_libs))
-
-		staticDeps := maybePartitionExportedAndImplementationsDeps(ctx, true, props.Static_libs, props.Export_static_lib_headers, bazelLabelForStaticDeps)
-		attrs.Deps.SetSelectValue(axis, config, staticDeps.export)
-		attrs.Implementation_deps.SetSelectValue(axis, config, staticDeps.implementation)
-
-		sharedDeps := maybePartitionExportedAndImplementationsDeps(ctx, true, props.Shared_libs, props.Export_shared_lib_headers, bazelLabelForSharedDeps)
-		attrs.Dynamic_deps.SetSelectValue(axis, config, sharedDeps.export)
-		attrs.Implementation_dynamic_deps.SetSelectValue(axis, config, sharedDeps.implementation)
-
-		attrs.Whole_archive_deps.SetSelectValue(axis, config, bazelLabelForWholeDeps(ctx, props.Whole_static_libs))
-		attrs.Enabled.SetSelectValue(axis, config, props.Enabled)
-	}
-	// system_dynamic_deps distinguishes between nil/empty list behavior:
-	//    nil -> use default values
-	//    empty list -> no values specified
-	attrs.System_dynamic_deps.ForceSpecifyEmptyList = true
-
-	var apexAvailable []string
-	if isStatic {
-		apexAvailable = lib.StaticProperties.Static.Apex_available
-		bp2BuildPropParseHelper(ctx, module, &StaticProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-			if staticOrSharedProps, ok := props.(*StaticProperties); ok {
-				setAttrs(axis, config, staticOrSharedProps.Static)
-			}
-		})
-	} else {
-		apexAvailable = lib.SharedProperties.Shared.Apex_available
-		bp2BuildPropParseHelper(ctx, module, &SharedProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-			if staticOrSharedProps, ok := props.(*SharedProperties); ok {
-				setAttrs(axis, config, staticOrSharedProps.Shared)
-			}
-		})
-	}
-
-	partitionedSrcs := groupSrcsByExtension(ctx, attrs.Srcs)
-	attrs.Srcs = partitionedSrcs[cppSrcPartition]
-	attrs.Srcs_c = partitionedSrcs[cSrcPartition]
-	attrs.Srcs_as = partitionedSrcs[asSrcPartition]
-
-	attrs.Apex_available = android.ConvertApexAvailableToTagsWithoutTestApexes(ctx, apexAvailable)
-
-	attrs.Features.Append(convertHiddenVisibilityToFeatureStaticOrShared(ctx, module, isStatic))
-
-	if !partitionedSrcs[protoSrcPartition].IsEmpty() {
-		// TODO(b/208815215): determine whether this is used and add support if necessary
-		ctx.ModuleErrorf("Migrating static/shared only proto srcs is not currently supported")
-	}
-
-	return attrs
-}
-
-// Convenience struct to hold all attributes parsed from prebuilt properties.
-type prebuiltAttributes struct {
-	Src     bazel.LabelAttribute
-	Enabled bazel.BoolAttribute
-}
-
-func parseSrc(ctx android.Bp2buildMutatorContext, srcLabelAttribute *bazel.LabelAttribute, axis bazel.ConfigurationAxis, config string, srcs []string) {
-	srcFileError := func() {
-		ctx.ModuleErrorf("parseSrc: Expected at most one source file for %s %s\n", axis, config)
-	}
-	if len(srcs) > 1 {
-		srcFileError()
-		return
-	} else if len(srcs) == 0 {
-		return
-	}
-	if srcLabelAttribute.SelectValue(axis, config) != nil {
-		srcFileError()
-		return
-	}
-	srcLabelAttribute.SetSelectValue(axis, config, android.BazelLabelForModuleSrcSingle(ctx, srcs[0]))
-}
-
-// NOTE: Used outside of Soong repo project, in the clangprebuilts.go bootstrap_go_package
-func Bp2BuildParsePrebuiltLibraryProps(ctx android.Bp2buildMutatorContext, module *Module, isStatic bool) prebuiltAttributes {
-
-	var srcLabelAttribute bazel.LabelAttribute
-	bp2BuildPropParseHelper(ctx, module, &prebuiltLinkerProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		if prebuiltLinkerProperties, ok := props.(*prebuiltLinkerProperties); ok {
-			parseSrc(ctx, &srcLabelAttribute, axis, config, prebuiltLinkerProperties.Srcs)
-		}
-	})
-
-	var enabledLabelAttribute bazel.BoolAttribute
-	parseAttrs := func(axis bazel.ConfigurationAxis, config string, props StaticOrSharedProperties) {
-		if props.Enabled != nil {
-			enabledLabelAttribute.SetSelectValue(axis, config, props.Enabled)
-		}
-		parseSrc(ctx, &srcLabelAttribute, axis, config, props.Srcs)
-	}
-
-	if isStatic {
-		bp2BuildPropParseHelper(ctx, module, &StaticProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-			if staticProperties, ok := props.(*StaticProperties); ok {
-				parseAttrs(axis, config, staticProperties.Static)
-			}
-		})
-	} else {
-		bp2BuildPropParseHelper(ctx, module, &SharedProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-			if sharedProperties, ok := props.(*SharedProperties); ok {
-				parseAttrs(axis, config, sharedProperties.Shared)
-			}
-		})
-	}
-
-	return prebuiltAttributes{
-		Src:     srcLabelAttribute,
-		Enabled: enabledLabelAttribute,
-	}
-}
-
-func bp2BuildParsePrebuiltBinaryProps(ctx android.Bp2buildMutatorContext, module *Module) prebuiltAttributes {
-	var srcLabelAttribute bazel.LabelAttribute
-	bp2BuildPropParseHelper(ctx, module, &prebuiltLinkerProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		if props, ok := props.(*prebuiltLinkerProperties); ok {
-			parseSrc(ctx, &srcLabelAttribute, axis, config, props.Srcs)
-		}
-	})
-
-	return prebuiltAttributes{
-		Src: srcLabelAttribute,
-	}
-}
-
-func bp2BuildParsePrebuiltObjectProps(ctx android.Bp2buildMutatorContext, module *Module) prebuiltAttributes {
-	var srcLabelAttribute bazel.LabelAttribute
-	bp2BuildPropParseHelper(ctx, module, &prebuiltObjectProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		if props, ok := props.(*prebuiltObjectProperties); ok {
-			parseSrc(ctx, &srcLabelAttribute, axis, config, props.Srcs)
-		}
-	})
-
-	return prebuiltAttributes{
-		Src: srcLabelAttribute,
-	}
-}
-
-type baseAttributes struct {
-	compilerAttributes
-	linkerAttributes
-
-	// A combination of compilerAttributes.features and linkerAttributes.features, as well as sanitizer features
-	features        bazel.StringListAttribute
-	protoDependency *bazel.LabelAttribute
-	aidlDependency  *bazel.LabelAttribute
-	Native_coverage *bool
-}
-
-// Convenience struct to hold all attributes parsed from compiler properties.
-type compilerAttributes struct {
-	// Options for all languages
-	copts bazel.StringListAttribute
-	// Assembly options and sources
-	asFlags bazel.StringListAttribute
-	asSrcs  bazel.LabelListAttribute
-	asmSrcs bazel.LabelListAttribute
-	// C options and sources
-	conlyFlags bazel.StringListAttribute
-	cSrcs      bazel.LabelListAttribute
-	// C++ options and sources
-	cppFlags bazel.StringListAttribute
-	srcs     bazel.LabelListAttribute
-
-	// xsd config sources
-	xsdSrcs       bazel.LabelListAttribute
-	exportXsdSrcs bazel.LabelListAttribute
-
-	// genrule headers
-	genruleHeaders       bazel.LabelListAttribute
-	exportGenruleHeaders bazel.LabelListAttribute
-
-	// Lex sources and options
-	lSrcs   bazel.LabelListAttribute
-	llSrcs  bazel.LabelListAttribute
-	lexopts bazel.StringListAttribute
-
-	// Sysprop sources
-	syspropSrcs bazel.LabelListAttribute
-
-	// Yacc sources
-	yaccSrc               *bazel.LabelAttribute
-	yaccFlags             bazel.StringListAttribute
-	yaccGenLocationHeader bazel.BoolAttribute
-	yaccGenPositionHeader bazel.BoolAttribute
-
-	rsSrcs bazel.LabelListAttribute
-
-	hdrs bazel.LabelListAttribute
-
-	rtti bazel.BoolAttribute
-
-	// Not affected by arch variants
-	stl    *string
-	cStd   *string
-	cppStd *string
-
-	localIncludes    bazel.StringListAttribute
-	absoluteIncludes bazel.StringListAttribute
-
-	includes BazelIncludes
-
-	protoSrcs   bazel.LabelListAttribute
-	aidlSrcs    bazel.LabelListAttribute
-	rscriptSrcs bazel.LabelListAttribute
-
-	stubsSymbolFile *string
-	stubsVersions   bazel.StringListAttribute
-
-	features bazel.StringListAttribute
-
-	stem   bazel.StringAttribute
-	suffix bazel.StringAttribute
-
-	fdoProfile bazel.LabelAttribute
-
-	additionalCompilerInputs bazel.LabelListAttribute
-}
-
-type filterOutFn func(string) bool
-
-// filterOutHiddenVisibility removes the flag specifying hidden visibility as
-// this flag is converted to a toolchain feature
-func filterOutHiddenVisibility(flag string) bool {
-	return flag == config.VisibilityHiddenFlag
-}
-
-func filterOutStdFlag(flag string) bool {
-	return strings.HasPrefix(flag, "-std=")
-}
-
-func filterOutClangUnknownCflags(flag string) bool {
-	for _, f := range config.ClangUnknownCflags {
-		if f == flag {
-			return true
-		}
-	}
-	return false
-}
-
-func parseCommandLineFlags(soongFlags []string, filterOut ...filterOutFn) []string {
-	var result []string
-	for _, flag := range soongFlags {
-		skipFlag := false
-		for _, filter := range filterOut {
-			if filter != nil && filter(flag) {
-				skipFlag = true
-			}
-		}
-		if skipFlag {
-			continue
-		}
-		// Soong's cflags can contain spaces, like `-include header.h`. For
-		// Bazel's copts, split them up to be compatible with the
-		// no_copts_tokenization feature.
-		result = append(result, strings.Split(flag, " ")...)
-	}
-	return result
-}
-
-func (ca *compilerAttributes) bp2buildForAxisAndConfig(ctx android.Bp2buildMutatorContext, axis bazel.ConfigurationAxis, config string, props *BaseCompilerProperties) {
-	// If there's arch specific srcs or exclude_srcs, generate a select entry for it.
-	// TODO(b/186153868): do this for OS specific srcs and exclude_srcs too.
-	srcsList, ok := parseSrcs(ctx, props)
-
-	if ok {
-		ca.srcs.SetSelectValue(axis, config, srcsList)
-	}
-
-	localIncludeDirs := props.Local_include_dirs
-	if axis == bazel.NoConfigAxis {
-		ca.cStd, ca.cppStd = bp2buildResolveCppStdValue(props.C_std, props.Cpp_std, props.Gnu_extensions)
-		if includeBuildDirectory(props.Include_build_directory) {
-			localIncludeDirs = append(localIncludeDirs, ".")
-		}
-	}
-
-	ca.absoluteIncludes.SetSelectValue(axis, config, props.Include_dirs)
-	ca.localIncludes.SetSelectValue(axis, config, localIncludeDirs)
-
-	instructionSet := proptools.StringDefault(props.Instruction_set, "")
-	if instructionSet == "arm" {
-		ca.features.SetSelectValue(axis, config, []string{"arm_isa_arm"})
-	} else if instructionSet != "" && instructionSet != "thumb" {
-		ctx.ModuleErrorf("Unknown value for instruction_set: %s", instructionSet)
-	}
-
-	// In Soong, cflags occur on the command line before -std=<val> flag, resulting in the value being
-	// overridden. In Bazel we always allow overriding, via flags; however, this can cause
-	// incompatibilities, so we remove "-std=" flags from Cflag properties while leaving it in other
-	// cases.
-	ca.copts.SetSelectValue(axis, config, parseCommandLineFlags(props.Cflags, filterOutStdFlag, filterOutClangUnknownCflags, filterOutHiddenVisibility))
-	ca.asFlags.SetSelectValue(axis, config, parseCommandLineFlags(props.Asflags, nil))
-	ca.conlyFlags.SetSelectValue(axis, config, parseCommandLineFlags(props.Conlyflags, filterOutClangUnknownCflags))
-	ca.cppFlags.SetSelectValue(axis, config, parseCommandLineFlags(props.Cppflags, filterOutClangUnknownCflags))
-	ca.rtti.SetSelectValue(axis, config, props.Rtti)
-}
-
-func (ca *compilerAttributes) convertStlProps(ctx android.ArchVariantContext, module *Module) {
-	bp2BuildPropParseHelper(ctx, module, &StlProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		if stlProps, ok := props.(*StlProperties); ok {
-			if stlProps.Stl == nil {
-				return
-			}
-			if ca.stl == nil {
-				stl := deduplicateStlInput(*stlProps.Stl)
-				ca.stl = &stl
-			} else if ca.stl != stlProps.Stl {
-				ctx.ModuleErrorf("Unsupported conversion: module with different stl for different variants: %s and %s", *ca.stl, stlProps.Stl)
-			}
-		}
-	})
-}
-
-func (ca *compilerAttributes) convertProductVariables(ctx android.BazelConversionPathContext, productVariableProps android.ProductConfigProperties) {
-	productVarPropNameToAttribute := map[string]*bazel.StringListAttribute{
-		"Cflags":   &ca.copts,
-		"Asflags":  &ca.asFlags,
-		"Cppflags": &ca.cppFlags,
-	}
-	for propName, attr := range productVarPropNameToAttribute {
-		if productConfigProps, exists := productVariableProps[propName]; exists {
-			for productConfigProp, prop := range productConfigProps {
-				flags, ok := prop.([]string)
-				if !ok {
-					ctx.ModuleErrorf("Could not convert product variable %s property", proptools.PropertyNameForField(propName))
-				}
-				newFlags, _ := bazel.TryVariableSubstitutions(flags, productConfigProp.Name())
-				attr.SetSelectValue(productConfigProp.ConfigurationAxis(), productConfigProp.SelectKey(), newFlags)
-			}
-		}
-	}
-}
-
-func (ca *compilerAttributes) finalize(ctx android.BazelConversionPathContext, implementationHdrs, exportHdrs bazel.LabelListAttribute) {
-	ca.srcs.ResolveExcludes()
-	partitionedSrcs := groupSrcsByExtension(ctx, ca.srcs)
-	partitionedImplHdrs := partitionHeaders(ctx, implementationHdrs)
-	partitionedHdrs := partitionHeaders(ctx, exportHdrs)
-
-	ca.protoSrcs = partitionedSrcs[protoSrcPartition]
-	ca.protoSrcs.Append(partitionedSrcs[protoFromGenPartition])
-	ca.aidlSrcs = partitionedSrcs[aidlSrcPartition]
-
-	for p, lla := range partitionedSrcs {
-		// if there are no sources, there is no need for headers
-		if lla.IsEmpty() {
-			continue
-		}
-		lla.Append(partitionedImplHdrs[hdrPartition])
-		partitionedSrcs[p] = lla
-	}
-
-	ca.hdrs = partitionedHdrs[hdrPartition]
-
-	ca.includesFromHeaders(ctx, partitionedImplHdrs[hdrPartition], partitionedHdrs[hdrPartition])
-
-	xsdSrcs := bazel.SubtractBazelLabelListAttribute(partitionedSrcs[xsdSrcPartition], partitionedHdrs[xsdSrcPartition])
-	xsdSrcs.Append(partitionedImplHdrs[xsdSrcPartition])
-	ca.exportXsdSrcs = partitionedHdrs[xsdSrcPartition]
-	ca.xsdSrcs = bazel.FirstUniqueBazelLabelListAttribute(xsdSrcs)
-
-	ca.genruleHeaders = partitionedImplHdrs[genrulePartition]
-	ca.exportGenruleHeaders = partitionedHdrs[genrulePartition]
-
-	ca.srcs = partitionedSrcs[cppSrcPartition]
-	ca.cSrcs = partitionedSrcs[cSrcPartition]
-	ca.asSrcs = partitionedSrcs[asSrcPartition]
-	ca.asmSrcs = partitionedSrcs[asmSrcPartition]
-	ca.lSrcs = partitionedSrcs[lSrcPartition]
-	ca.llSrcs = partitionedSrcs[llSrcPartition]
-	if yacc := partitionedSrcs[yaccSrcPartition]; !yacc.IsEmpty() {
-		if len(yacc.Value.Includes) > 1 {
-			ctx.PropertyErrorf("srcs", "Found multiple yacc (.y/.yy) files in library")
-		}
-		ca.yaccSrc = bazel.MakeLabelAttribute(yacc.Value.Includes[0].Label)
-	}
-	ca.syspropSrcs = partitionedSrcs[syspropSrcPartition]
-	ca.rscriptSrcs = partitionedSrcs[rScriptSrcPartition]
-
-	ca.absoluteIncludes.DeduplicateAxesFromBase()
-	ca.localIncludes.DeduplicateAxesFromBase()
-}
-
-// Parse srcs from an arch or OS's props value.
-func parseSrcs(ctx android.Bp2buildMutatorContext, props *BaseCompilerProperties) (bazel.LabelList, bool) {
-	anySrcs := false
-	// Add srcs-like dependencies such as generated files.
-	// First create a LabelList containing these dependencies, then merge the values with srcs.
-	genSrcs := props.Generated_sources
-	generatedSrcsLabelList := android.BazelLabelForModuleDepsExcludes(ctx, genSrcs, props.Exclude_generated_sources)
-	if len(props.Generated_sources) > 0 || len(props.Exclude_generated_sources) > 0 {
-		anySrcs = true
-	}
-
-	allSrcsLabelList := android.BazelLabelForModuleSrcExcludes(ctx, props.Srcs, props.Exclude_srcs)
-
-	if len(props.Srcs) > 0 || len(props.Exclude_srcs) > 0 {
-		anySrcs = true
-	}
-
-	return bazel.AppendBazelLabelLists(allSrcsLabelList, generatedSrcsLabelList), anySrcs
-}
-
-func bp2buildStdVal(std *string, prefix string, useGnu bool) *string {
-	defaultVal := prefix + "_std_default"
-	// If c{,pp}std properties are not specified, don't generate them in the BUILD file.
-	// Defaults are handled by the toolchain definition.
-	// However, if gnu_extensions is false, then the default gnu-to-c version must be specified.
-	stdVal := proptools.StringDefault(std, defaultVal)
-	if stdVal == "experimental" || stdVal == defaultVal {
-		if stdVal == "experimental" {
-			stdVal = prefix + "_std_experimental"
-		}
-		if !useGnu {
-			stdVal += "_no_gnu"
-		}
-	} else if !useGnu {
-		stdVal = gnuToCReplacer.Replace(stdVal)
-	}
-
-	if stdVal == defaultVal {
-		return nil
-	}
-	return &stdVal
-}
-
-func bp2buildResolveCppStdValue(c_std *string, cpp_std *string, gnu_extensions *bool) (*string, *string) {
-	useGnu := useGnuExtensions(gnu_extensions)
-
-	return bp2buildStdVal(c_std, "c", useGnu), bp2buildStdVal(cpp_std, "cpp", useGnu)
-}
-
-// packageFromLabel extracts package from a fully-qualified or relative Label and whether the label
-// is fully-qualified.
-// e.g. fully-qualified "//a/b:foo" -> "a/b", true, relative: ":bar" -> ".", false
-func packageFromLabel(label string) (string, bool) {
-	split := strings.Split(label, ":")
-	if len(split) != 2 {
-		return "", false
-	}
-	if split[0] == "" {
-		return ".", false
-	}
-	// remove leading "//"
-	return split[0][2:], true
-}
-
-// includesFromHeaders gets the include directories needed from generated headers
-func (ca *compilerAttributes) includesFromHeaders(ctx android.BazelConversionPathContext, implHdrs, hdrs bazel.LabelListAttribute) {
-	local, absolute := includesFromLabelListAttribute(implHdrs, ca.localIncludes, ca.absoluteIncludes)
-	localExport, absoluteExport := includesFromLabelListAttribute(hdrs, ca.includes.Includes, ca.includes.AbsoluteIncludes)
-
-	ca.localIncludes = local
-	ca.absoluteIncludes = absolute
-
-	ca.includes.Includes = localExport
-	ca.includes.AbsoluteIncludes = absoluteExport
-}
-
-// includesFromLabelList extracts the packages from a LabelListAttribute that should be includes and
-// combines them with existing local/absolute includes.
-func includesFromLabelListAttribute(attr bazel.LabelListAttribute, existingLocal, existingAbsolute bazel.StringListAttribute) (bazel.StringListAttribute, bazel.StringListAttribute) {
-	localAttr := existingLocal.Clone()
-	absoluteAttr := existingAbsolute.Clone()
-	if !attr.Value.IsEmpty() {
-		l, a := includesFromLabelList(attr.Value, existingLocal.Value, existingAbsolute.Value)
-		localAttr.SetSelectValue(bazel.NoConfigAxis, "", l)
-		absoluteAttr.SetSelectValue(bazel.NoConfigAxis, "", a)
-	}
-	for axis, configToLabels := range attr.ConfigurableValues {
-		for c, labels := range configToLabels {
-			local := existingLocal.SelectValue(axis, c)
-			absolute := existingAbsolute.SelectValue(axis, c)
-			l, a := includesFromLabelList(labels, local, absolute)
-			localAttr.SetSelectValue(axis, c, l)
-			absoluteAttr.SetSelectValue(axis, c, a)
-		}
-	}
-	return *localAttr, *absoluteAttr
-}
-
-// includesFromLabelList extracts relative/absolute includes from a bazel.LabelList.
-func includesFromLabelList(labelList bazel.LabelList, existingRel, existingAbs []string) ([]string, []string) {
-	var relative, absolute []string
-	for _, hdr := range labelList.Includes {
-		if pkg, hasPkg := packageFromLabel(hdr.Label); hasPkg {
-			absolute = append(absolute, pkg)
-		} else if pkg != "" {
-			relative = append(relative, pkg)
-		}
-	}
-	if len(relative)+len(existingRel) != 0 {
-		relative = android.FirstUniqueStrings(append(append([]string{}, existingRel...), relative...))
-	}
-	if len(absolute)+len(existingAbs) != 0 {
-		absolute = android.FirstUniqueStrings(append(append([]string{}, existingAbs...), absolute...))
-	}
-	return relative, absolute
-}
-
-type YasmAttributes struct {
-	Srcs         bazel.LabelListAttribute
-	Flags        bazel.StringListAttribute
-	Include_dirs bazel.StringListAttribute
-}
-
-func bp2BuildYasm(ctx android.Bp2buildMutatorContext, m *Module, ca compilerAttributes) *bazel.LabelAttribute {
-	if ca.asmSrcs.IsEmpty() {
-		return nil
-	}
-
-	// Yasm needs the include directories from both local_includes and
-	// export_include_dirs. We don't care about actually exporting them from the
-	// yasm rule though, because they will also be present on the cc_ rule that
-	// wraps this yasm rule.
-	includes := ca.localIncludes.Clone()
-	bp2BuildPropParseHelper(ctx, m, &FlagExporterProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		if flagExporterProperties, ok := props.(*FlagExporterProperties); ok {
-			if len(flagExporterProperties.Export_include_dirs) > 0 {
-				x := bazel.StringListAttribute{}
-				x.SetSelectValue(axis, config, flagExporterProperties.Export_include_dirs)
-				includes.Append(x)
-			}
-		}
-	})
-
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "yasm",
-			Bzl_load_location: "//build/bazel/rules/cc:yasm.bzl",
-		},
-		android.CommonAttributes{Name: m.Name() + "_yasm"},
-		&YasmAttributes{
-			Srcs:         ca.asmSrcs,
-			Flags:        ca.asFlags,
-			Include_dirs: *includes,
-		})
-
-	// We only want to add a dependency on the _yasm target if there are asm
-	// sources in the current configuration. If there are unconfigured asm
-	// sources, always add the dependency. Otherwise, add the dependency only
-	// on the configuration axes and values that had asm sources.
-	if len(ca.asmSrcs.Value.Includes) > 0 {
-		return bazel.MakeLabelAttribute(":" + m.Name() + "_yasm")
-	}
-
-	ret := &bazel.LabelAttribute{}
-	for _, axis := range ca.asmSrcs.SortedConfigurationAxes() {
-		for cfg := range ca.asmSrcs.ConfigurableValues[axis] {
-			ret.SetSelectValue(axis, cfg, bazel.Label{Label: ":" + m.Name() + "_yasm"})
-		}
-	}
-	return ret
-}
-
-// bp2BuildParseBaseProps returns all compiler, linker, library attributes of a cc module.
-func bp2BuildParseBaseProps(ctx android.Bp2buildMutatorContext, module *Module) baseAttributes {
-	archVariantCompilerProps := module.GetArchVariantProperties(ctx, &BaseCompilerProperties{})
-	archVariantLinkerProps := module.GetArchVariantProperties(ctx, &BaseLinkerProperties{})
-	archVariantLibraryProperties := module.GetArchVariantProperties(ctx, &LibraryProperties{})
-
-	axisToConfigs := map[bazel.ConfigurationAxis]map[string]bool{}
-	allAxesAndConfigs := func(cp android.ConfigurationAxisToArchVariantProperties) {
-		for axis, configMap := range cp {
-			if _, ok := axisToConfigs[axis]; !ok {
-				axisToConfigs[axis] = map[string]bool{}
-			}
-			for cfg := range configMap {
-				axisToConfigs[axis][cfg] = true
-			}
-		}
-	}
-	allAxesAndConfigs(archVariantCompilerProps)
-	allAxesAndConfigs(archVariantLinkerProps)
-	allAxesAndConfigs(archVariantLibraryProperties)
-
-	compilerAttrs := compilerAttributes{}
-	linkerAttrs := linkerAttributes{}
-
-	var aidlLibs bazel.LabelList
-	var implementationHdrs, exportHdrs bazel.LabelListAttribute
-
-	// Iterate through these axes in a deterministic order. This is required
-	// because processing certain dependencies may result in concatenating
-	// elements along other axes. (For example, processing NoConfig may result
-	// in elements being added to InApex). This is thus the only way to ensure
-	// that the order of entries in each list is in a predictable order.
-	for _, axis := range bazel.SortedConfigurationAxes(axisToConfigs) {
-		configs := axisToConfigs[axis]
-		for cfg := range configs {
-			var allHdrs []string
-			if baseCompilerProps, ok := archVariantCompilerProps[axis][cfg].(*BaseCompilerProperties); ok {
-				allHdrs = baseCompilerProps.Generated_headers
-
-				if baseCompilerProps.Lex != nil {
-					compilerAttrs.lexopts.SetSelectValue(axis, cfg, baseCompilerProps.Lex.Flags)
-				}
-				if baseCompilerProps.Yacc != nil {
-					compilerAttrs.yaccFlags.SetSelectValue(axis, cfg, baseCompilerProps.Yacc.Flags)
-					compilerAttrs.yaccGenLocationHeader.SetSelectValue(axis, cfg, baseCompilerProps.Yacc.Gen_location_hh)
-					compilerAttrs.yaccGenPositionHeader.SetSelectValue(axis, cfg, baseCompilerProps.Yacc.Gen_position_hh)
-				}
-				(&compilerAttrs).bp2buildForAxisAndConfig(ctx, axis, cfg, baseCompilerProps)
-				aidlLibs.Append(android.BazelLabelForModuleDeps(ctx, baseCompilerProps.Aidl.Libs))
-			}
-
-			var exportedHdrs []string
-
-			if baseLinkerProps, ok := archVariantLinkerProps[axis][cfg].(*BaseLinkerProperties); ok {
-				exportedHdrs = baseLinkerProps.Export_generated_headers
-				(&linkerAttrs).bp2buildForAxisAndConfig(ctx, module, axis, cfg, baseLinkerProps)
-			}
-
-			headers := maybePartitionExportedAndImplementationsDeps(ctx, !module.Binary(), allHdrs, exportedHdrs, android.BazelLabelForModuleDeps)
-
-			implementationHdrs.SetSelectValue(axis, cfg, headers.implementation)
-			exportHdrs.SetSelectValue(axis, cfg, headers.export)
-
-			if libraryProps, ok := archVariantLibraryProperties[axis][cfg].(*LibraryProperties); ok {
-				if axis == bazel.NoConfigAxis {
-					if libraryProps.Stubs.Symbol_file != nil {
-						compilerAttrs.stubsSymbolFile = libraryProps.Stubs.Symbol_file
-						versions := android.CopyOf(libraryProps.Stubs.Versions)
-						normalizeVersions(ctx, versions)
-						versions = addCurrentVersionIfNotPresent(versions)
-						compilerAttrs.stubsVersions.SetSelectValue(axis, cfg, versions)
-					}
-				}
-				if stem := libraryProps.Stem; stem != nil {
-					compilerAttrs.stem.SetSelectValue(axis, cfg, stem)
-				}
-				if suffix := libraryProps.Suffix; suffix != nil {
-					compilerAttrs.suffix.SetSelectValue(axis, cfg, suffix)
-				}
-			}
-
-		}
-	}
-
-	compilerAttrs.convertStlProps(ctx, module)
-	(&linkerAttrs).convertStripProps(ctx, module)
-
-	var nativeCoverage *bool
-	if module.coverage != nil && module.coverage.Properties.Native_coverage != nil &&
-		!Bool(module.coverage.Properties.Native_coverage) {
-		nativeCoverage = BoolPtr(false)
-	}
-
-	productVariableProps, errs := android.ProductVariableProperties(ctx, ctx.Module())
-	for _, err := range errs {
-		ctx.ModuleErrorf("ProductVariableProperties error: %s", err)
-	}
-
-	(&compilerAttrs).convertProductVariables(ctx, productVariableProps)
-	(&linkerAttrs).convertProductVariables(ctx, productVariableProps)
-
-	(&compilerAttrs).finalize(ctx, implementationHdrs, exportHdrs)
-	(&linkerAttrs).finalize(ctx)
-
-	(&compilerAttrs.srcs).Add(bp2BuildYasm(ctx, module, compilerAttrs))
-
-	(&linkerAttrs).deps.Append(compilerAttrs.exportGenruleHeaders)
-	(&linkerAttrs).implementationDeps.Append(compilerAttrs.genruleHeaders)
-
-	(&linkerAttrs).wholeArchiveDeps.Append(compilerAttrs.exportXsdSrcs)
-	(&linkerAttrs).implementationWholeArchiveDeps.Append(compilerAttrs.xsdSrcs)
-
-	protoDep := bp2buildProto(ctx, module, compilerAttrs.protoSrcs, linkerAttrs)
-
-	// bp2buildProto will only set wholeStaticLib or implementationWholeStaticLib, but we don't know
-	// which. This will add the newly generated proto library to the appropriate attribute and nothing
-	// to the other
-	(&linkerAttrs).wholeArchiveDeps.Add(protoDep.wholeStaticLib)
-	(&linkerAttrs).implementationWholeArchiveDeps.Add(protoDep.implementationWholeStaticLib)
-
-	aidlDep := bp2buildCcAidlLibrary(
-		ctx, module,
-		compilerAttrs.aidlSrcs,
-		bazel.LabelListAttribute{
-			Value: aidlLibs,
-		},
-		linkerAttrs,
-		compilerAttrs,
-	)
-	if aidlDep != nil {
-		if lib, ok := module.linker.(*libraryDecorator); ok {
-			if proptools.Bool(lib.Properties.Aidl.Export_aidl_headers) {
-				(&linkerAttrs).wholeArchiveDeps.Add(aidlDep)
-			} else {
-				(&linkerAttrs).implementationWholeArchiveDeps.Add(aidlDep)
-			}
-		}
-	}
-
-	// Create a cc_yacc_static_library if srcs contains .y/.yy files
-	// This internal target will produce an .a file that will be statically linked to the parent library
-	if yaccDep := bp2buildCcYaccLibrary(ctx, compilerAttrs, linkerAttrs); yaccDep != nil {
-		(&linkerAttrs).implementationWholeArchiveDeps.Add(yaccDep)
-	}
-
-	convertedLSrcs := bp2BuildLex(ctx, module.Name(), compilerAttrs)
-	(&compilerAttrs).srcs.Add(&convertedLSrcs.srcName)
-	(&compilerAttrs).cSrcs.Add(&convertedLSrcs.cSrcName)
-
-	if module.afdo != nil && module.afdo.Properties.Afdo {
-		fdoProfileDep := bp2buildFdoProfile(ctx, module)
-		if fdoProfileDep != nil {
-			// TODO(b/276287371): Only set fdo_profile for android platform
-			// https://cs.android.com/android/platform/superproject/main/+/main:build/soong/cc/afdo.go;l=105;drc=2dbe160d1af445de32725098570ec594e3944fc5
-			(&compilerAttrs).fdoProfile.SetValue(*fdoProfileDep)
-		}
-	}
-
-	if !compilerAttrs.syspropSrcs.IsEmpty() {
-		(&linkerAttrs).wholeArchiveDeps.Add(bp2buildCcSysprop(ctx, module.Name(), module.Properties.Min_sdk_version, compilerAttrs.syspropSrcs))
-	}
-
-	linkerAttrs.wholeArchiveDeps.Prepend = true
-	linkerAttrs.deps.Prepend = true
-	compilerAttrs.localIncludes.Prepend = true
-	compilerAttrs.absoluteIncludes.Prepend = true
-	compilerAttrs.hdrs.Prepend = true
-
-	convertedRsSrcs, rsAbsIncludes, rsLocalIncludes := bp2buildRScript(ctx, module, compilerAttrs)
-	(&compilerAttrs).srcs.Add(&convertedRsSrcs)
-	(&compilerAttrs).absoluteIncludes.Append(rsAbsIncludes)
-	(&compilerAttrs).localIncludes.Append(rsLocalIncludes)
-	(&compilerAttrs).localIncludes.Value = android.FirstUniqueStrings(compilerAttrs.localIncludes.Value)
-
-	sanitizerValues := bp2buildSanitizerFeatures(ctx, module)
-
-	features := compilerAttrs.features.Clone().Append(linkerAttrs.features).Append(sanitizerValues.features)
-	features = features.Append(bp2buildLtoFeatures(ctx, module))
-	features = features.Append(convertHiddenVisibilityToFeatureBase(ctx, module))
-	features.DeduplicateAxesFromBase()
-
-	compilerAttrs.copts = *compilerAttrs.copts.Append(sanitizerValues.copts)
-	compilerAttrs.additionalCompilerInputs = *compilerAttrs.additionalCompilerInputs.Append(sanitizerValues.additionalCompilerInputs)
-
-	addMuslSystemDynamicDeps(ctx, linkerAttrs)
-
-	// Dedupe all deps.
-	(&linkerAttrs).deps.Value = bazel.FirstUniqueBazelLabelList((&linkerAttrs).deps.Value)
-	(&linkerAttrs).implementationDeps.Value = bazel.FirstUniqueBazelLabelList((&linkerAttrs).implementationDeps.Value)
-	(&linkerAttrs).implementationDynamicDeps.Value = bazel.FirstUniqueBazelLabelList((&linkerAttrs).implementationDynamicDeps.Value)
-	(&linkerAttrs).wholeArchiveDeps.Value = bazel.FirstUniqueBazelLabelList((&linkerAttrs).wholeArchiveDeps.Value)
-	(&linkerAttrs).implementationWholeArchiveDeps.Value = bazel.FirstUniqueBazelLabelList((&linkerAttrs).implementationWholeArchiveDeps.Value)
-
-	return baseAttributes{
-		compilerAttrs,
-		linkerAttrs,
-		*features,
-		protoDep.protoDep,
-		aidlDep,
-		nativeCoverage,
-	}
-}
-
-type ccYaccLibraryAttributes struct {
-	Src                         bazel.LabelAttribute
-	Flags                       bazel.StringListAttribute
-	Gen_location_hh             bazel.BoolAttribute
-	Gen_position_hh             bazel.BoolAttribute
-	Local_includes              bazel.StringListAttribute
-	Implementation_deps         bazel.LabelListAttribute
-	Implementation_dynamic_deps bazel.LabelListAttribute
-}
-
-func bp2buildCcYaccLibrary(ctx android.Bp2buildMutatorContext, ca compilerAttributes, la linkerAttributes) *bazel.LabelAttribute {
-	if ca.yaccSrc == nil {
-		return nil
-	}
-	yaccLibraryLabel := ctx.Module().Name() + "_yacc"
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "cc_yacc_static_library",
-			Bzl_load_location: "//build/bazel/rules/cc:cc_yacc_library.bzl",
-		},
-		android.CommonAttributes{
-			Name: yaccLibraryLabel,
-		},
-		&ccYaccLibraryAttributes{
-			Src:                         *ca.yaccSrc,
-			Flags:                       ca.yaccFlags,
-			Gen_location_hh:             ca.yaccGenLocationHeader,
-			Gen_position_hh:             ca.yaccGenPositionHeader,
-			Local_includes:              ca.localIncludes,
-			Implementation_deps:         la.implementationDeps,
-			Implementation_dynamic_deps: la.implementationDynamicDeps,
-		},
-	)
-
-	yaccLibrary := &bazel.LabelAttribute{
-		Value: &bazel.Label{
-			Label: ":" + yaccLibraryLabel,
-		},
-	}
-	return yaccLibrary
-}
-
-// As a workaround for b/261657184, we are manually adding the default value
-// of system_dynamic_deps for the linux_musl os.
-// TODO: Solve this properly
-func addMuslSystemDynamicDeps(ctx android.Bp2buildMutatorContext, attrs linkerAttributes) {
-	systemDynamicDeps := attrs.systemDynamicDeps.SelectValue(bazel.OsConfigurationAxis, "linux_musl")
-	if attrs.systemDynamicDeps.HasAxisSpecificValues(bazel.OsConfigurationAxis) && systemDynamicDeps.IsNil() {
-		attrs.systemDynamicDeps.SetSelectValue(bazel.OsConfigurationAxis, "linux_musl", android.BazelLabelForModuleDeps(ctx, config.MuslDefaultSharedLibraries))
-	}
-}
-
-type fdoProfileAttributes struct {
-	Absolute_path_profile string
-}
-
-func bp2buildFdoProfile(
-	ctx android.Bp2buildMutatorContext,
-	m *Module,
-) *bazel.Label {
-	// TODO(b/267229066): Convert to afdo boolean attribute and let Bazel handles finding
-	// fdo_profile target from AfdoProfiles product var
-	for _, project := range globalAfdoProfileProjects {
-		// Ensure it's a Soong package
-		bpPath := android.ExistentPathForSource(ctx, project, "Android.bp")
-		if bpPath.Valid() {
-			// TODO(b/260714900): Handle arch-specific afdo profiles (e.g. `<module-name>-arm<64>.afdo`)
-			path := android.ExistentPathForSource(ctx, project, m.Name()+".afdo")
-			if path.Valid() {
-				fdoProfileLabel := "//" + strings.TrimSuffix(project, "/") + ":" + m.Name()
-				return &bazel.Label{
-					Label: fdoProfileLabel,
-				}
-			}
-		}
-	}
-
-	return nil
-}
-
-func bp2buildCcAidlLibrary(
-	ctx android.Bp2buildMutatorContext,
-	m *Module,
-	aidlSrcs bazel.LabelListAttribute,
-	aidlLibs bazel.LabelListAttribute,
-	linkerAttrs linkerAttributes,
-	compilerAttrs compilerAttributes,
-) *bazel.LabelAttribute {
-	var aidlLibsFromSrcs, aidlFiles bazel.LabelListAttribute
-	apexAvailableTags := android.ApexAvailableTagsWithoutTestApexes(ctx, ctx.Module())
-
-	if !aidlSrcs.IsEmpty() {
-		aidlLibsFromSrcs, aidlFiles = aidlSrcs.Partition(func(src bazel.Label) bool {
-			if fg, ok := android.ToFileGroupAsLibrary(ctx, src.OriginalModuleName); ok &&
-				fg.ShouldConvertToAidlLibrary(ctx) {
-				return true
-			}
-			return false
-		})
-
-		if !aidlFiles.IsEmpty() {
-			aidlLibName := m.Name() + "_aidl_library"
-			ctx.CreateBazelTargetModule(
-				bazel.BazelTargetModuleProperties{
-					Rule_class:        "aidl_library",
-					Bzl_load_location: "//build/bazel/rules/aidl:aidl_library.bzl",
-				},
-				android.CommonAttributes{
-					Name: aidlLibName,
-					Tags: apexAvailableTags,
-				},
-				&aidlLibraryAttributes{
-					Srcs: aidlFiles,
-				},
-			)
-			aidlLibsFromSrcs.Add(&bazel.LabelAttribute{Value: &bazel.Label{Label: ":" + aidlLibName}})
-		}
-	}
-
-	allAidlLibs := aidlLibs.Clone()
-	allAidlLibs.Append(aidlLibsFromSrcs)
-
-	if !allAidlLibs.IsEmpty() {
-		ccAidlLibrarylabel := m.Name() + "_cc_aidl_library"
-		// Since parent cc_library already has these dependencies, we can add them as implementation
-		// deps so that they don't re-export
-		implementationDeps := linkerAttrs.deps.Clone()
-		implementationDeps.Append(linkerAttrs.implementationDeps)
-		implementationDynamicDeps := linkerAttrs.dynamicDeps.Clone()
-		implementationDynamicDeps.Append(linkerAttrs.implementationDynamicDeps)
-
-		sdkAttrs := Bp2BuildParseSdkAttributes(m)
-
-		exportedIncludes := bp2BuildParseExportedIncludes(ctx, m, &compilerAttrs.includes)
-		includeAttrs := includesAttributes{
-			Export_includes:          exportedIncludes.Includes,
-			Export_absolute_includes: exportedIncludes.AbsoluteIncludes,
-			Export_system_includes:   exportedIncludes.SystemIncludes,
-			Local_includes:           compilerAttrs.localIncludes,
-			Absolute_includes:        compilerAttrs.absoluteIncludes,
-		}
-
-		ctx.CreateBazelTargetModule(
-			bazel.BazelTargetModuleProperties{
-				Rule_class:        "cc_aidl_library",
-				Bzl_load_location: "//build/bazel/rules/cc:cc_aidl_library.bzl",
-			},
-			android.CommonAttributes{Name: ccAidlLibrarylabel},
-			&ccAidlLibraryAttributes{
-				Deps:                        *allAidlLibs,
-				Implementation_deps:         *implementationDeps,
-				Implementation_dynamic_deps: *implementationDynamicDeps,
-				Tags:                        apexAvailableTags,
-				SdkAttributes:               sdkAttrs,
-				includesAttributes:          includeAttrs,
-			},
-		)
-		label := &bazel.LabelAttribute{
-			Value: &bazel.Label{
-				Label: ":" + ccAidlLibrarylabel,
-			},
-		}
-		return label
-	}
-
-	return nil
-}
-
-func Bp2BuildParseSdkAttributes(module *Module) SdkAttributes {
-	return SdkAttributes{
-		Sdk_version:     module.Properties.Sdk_version,
-		Min_sdk_version: module.Properties.Min_sdk_version,
-	}
-}
-
-type SdkAttributes struct {
-	Sdk_version     *string
-	Min_sdk_version *string
-}
-
-// Convenience struct to hold all attributes parsed from linker properties.
-type linkerAttributes struct {
-	deps                             bazel.LabelListAttribute
-	implementationDeps               bazel.LabelListAttribute
-	dynamicDeps                      bazel.LabelListAttribute
-	implementationDynamicDeps        bazel.LabelListAttribute
-	runtimeDeps                      bazel.LabelListAttribute
-	wholeArchiveDeps                 bazel.LabelListAttribute
-	implementationWholeArchiveDeps   bazel.LabelListAttribute
-	systemDynamicDeps                bazel.LabelListAttribute
-	usedSystemDynamicDepAsStaticDep  map[string]bool
-	usedSystemDynamicDepAsDynamicDep map[string]bool
-
-	useVersionLib                 bazel.BoolAttribute
-	linkopts                      bazel.StringListAttribute
-	additionalLinkerInputs        bazel.LabelListAttribute
-	stripKeepSymbols              bazel.BoolAttribute
-	stripKeepSymbolsAndDebugFrame bazel.BoolAttribute
-	stripKeepSymbolsList          bazel.StringListAttribute
-	stripAll                      bazel.BoolAttribute
-	stripNone                     bazel.BoolAttribute
-	features                      bazel.StringListAttribute
-}
-
-var (
-	soongSystemSharedLibs = []string{"libc", "libm", "libdl"}
-	versionLib            = "libbuildversion"
-)
-
-// resolveTargetApex re-adds the shared and static libs in target.apex.exclude_shared|static_libs props to non-apex variant
-// since all libs are already excluded by default
-func (la *linkerAttributes) resolveTargetApexProp(ctx android.Bp2buildMutatorContext, props *BaseLinkerProperties) {
-	excludeSharedLibs := bazelLabelForSharedDeps(ctx, props.Target.Apex.Exclude_shared_libs)
-	sharedExcludes := bazel.LabelList{Excludes: excludeSharedLibs.Includes}
-	sharedExcludesLabelList := bazel.LabelListAttribute{}
-	sharedExcludesLabelList.SetSelectValue(bazel.InApexAxis, bazel.InApex, sharedExcludes)
-
-	la.dynamicDeps.Append(sharedExcludesLabelList)
-	la.implementationDynamicDeps.Append(sharedExcludesLabelList)
-
-	excludeStaticLibs := bazelLabelForStaticDeps(ctx, props.Target.Apex.Exclude_static_libs)
-	staticExcludes := bazel.LabelList{Excludes: excludeStaticLibs.Includes}
-	staticExcludesLabelList := bazel.LabelListAttribute{}
-	staticExcludesLabelList.SetSelectValue(bazel.InApexAxis, bazel.InApex, staticExcludes)
-
-	la.deps.Append(staticExcludesLabelList)
-	la.implementationDeps.Append(staticExcludesLabelList)
-}
-
-func (la *linkerAttributes) bp2buildForAxisAndConfig(ctx android.Bp2buildMutatorContext, module *Module, axis bazel.ConfigurationAxis, config string, props *BaseLinkerProperties) {
-	isBinary := module.Binary()
-	// Use a single variable to capture usage of nocrt in arch variants, so there's only 1 error message for this module
-	var axisFeatures []string
-
-	wholeStaticLibs := android.FirstUniqueStrings(props.Whole_static_libs)
-	staticLibs := android.FirstUniqueStrings(android.RemoveListFromList(props.Static_libs, wholeStaticLibs))
-	if axis == bazel.NoConfigAxis {
-		la.useVersionLib.SetSelectValue(axis, config, props.Use_version_lib)
-		if proptools.Bool(props.Use_version_lib) {
-			versionLibAlreadyInDeps := android.InList(versionLib, wholeStaticLibs)
-			// remove from static libs so there is no duplicate dependency
-			_, staticLibs = android.RemoveFromList(versionLib, staticLibs)
-			// only add the dep if it is not in progress
-			if !versionLibAlreadyInDeps {
-				wholeStaticLibs = append(wholeStaticLibs, versionLib)
-			}
-		}
-	}
-
-	// Excludes to parallel Soong:
-	// https://cs.android.com/android/platform/superproject/+/master:build/soong/cc/linker.go;l=247-249;drc=088b53577dde6e40085ffd737a1ae96ad82fc4b0
-	la.wholeArchiveDeps.SetSelectValue(axis, config, bazelLabelForWholeDepsExcludes(ctx, wholeStaticLibs, props.Exclude_static_libs))
-
-	if isBinary && module.StaticExecutable() {
-		usedSystemStatic := android.FilterListPred(staticLibs, func(s string) bool {
-			return android.InList(s, soongSystemSharedLibs) && !android.InList(s, props.Exclude_static_libs)
-		})
-
-		for _, el := range usedSystemStatic {
-			if la.usedSystemDynamicDepAsStaticDep == nil {
-				la.usedSystemDynamicDepAsStaticDep = map[string]bool{}
-			}
-			la.usedSystemDynamicDepAsStaticDep[el] = true
-		}
-	}
-	staticDeps := maybePartitionExportedAndImplementationsDepsExcludes(
-		ctx,
-		!isBinary,
-		staticLibs,
-		props.Exclude_static_libs,
-		props.Export_static_lib_headers,
-		bazelLabelForStaticDepsExcludes,
-	)
-
-	headerLibs := android.FirstUniqueStrings(props.Header_libs)
-	hDeps := maybePartitionExportedAndImplementationsDeps(ctx, !isBinary, headerLibs, props.Export_header_lib_headers, bazelLabelForHeaderDeps)
-
-	(&hDeps.export).Append(staticDeps.export)
-	la.deps.SetSelectValue(axis, config, hDeps.export)
-
-	(&hDeps.implementation).Append(staticDeps.implementation)
-	la.implementationDeps.SetSelectValue(axis, config, hDeps.implementation)
-
-	systemSharedLibs := props.System_shared_libs
-	// systemSharedLibs distinguishes between nil/empty list behavior:
-	//    nil -> use default values
-	//    empty list -> no values specified
-	if len(systemSharedLibs) > 0 {
-		systemSharedLibs = android.FirstUniqueStrings(systemSharedLibs)
-	}
-	la.systemDynamicDeps.SetSelectValue(axis, config, bazelLabelForSharedDeps(ctx, systemSharedLibs))
-
-	sharedLibs := android.FirstUniqueStrings(props.Shared_libs)
-	excludeSharedLibs := props.Exclude_shared_libs
-	usedSystem := android.FilterListPred(sharedLibs, func(s string) bool {
-		return android.InList(s, soongSystemSharedLibs) && !android.InList(s, excludeSharedLibs)
-	})
-
-	for _, el := range usedSystem {
-		if la.usedSystemDynamicDepAsDynamicDep == nil {
-			la.usedSystemDynamicDepAsDynamicDep = map[string]bool{}
-		}
-		la.usedSystemDynamicDepAsDynamicDep[el] = true
-	}
-
-	sharedDeps := maybePartitionExportedAndImplementationsDepsExcludes(
-		ctx,
-		!isBinary,
-		sharedLibs,
-		props.Exclude_shared_libs,
-		props.Export_shared_lib_headers,
-		bazelLabelForSharedDepsExcludes,
-	)
-	la.dynamicDeps.SetSelectValue(axis, config, sharedDeps.export)
-	la.implementationDynamicDeps.SetSelectValue(axis, config, sharedDeps.implementation)
-	la.resolveTargetApexProp(ctx, props)
-
-	if axis == bazel.NoConfigAxis || (axis == bazel.OsConfigurationAxis && config == bazel.OsAndroid) {
-		// If a dependency in la.implementationDynamicDeps or la.dynamicDeps has stubs, its
-		// stub variant should be used when the dependency is linked in a APEX. The
-		// dependencies in NoConfigAxis and OsConfigurationAxis/OsAndroid are grouped by
-		// having stubs or not, so Bazel select() statement can be used to choose
-		// source/stub variants of them.
-		apexAvailable := module.ApexAvailable()
-		SetStubsForDynamicDeps(ctx, axis, config, apexAvailable, sharedDeps.export, &la.dynamicDeps, &la.deps, 0, false)
-		SetStubsForDynamicDeps(ctx, axis, config, apexAvailable, sharedDeps.implementation, &la.implementationDynamicDeps, &la.deps, 1, false)
-		if len(systemSharedLibs) > 0 {
-			SetStubsForDynamicDeps(ctx, axis, config, apexAvailable, bazelLabelForSharedDeps(ctx, systemSharedLibs), &la.systemDynamicDeps, &la.deps, 2, true)
-		}
-	}
-
-	if !BoolDefault(props.Pack_relocations, packRelocationsDefault) {
-		axisFeatures = append(axisFeatures, "disable_pack_relocations")
-	}
-
-	if Bool(props.Allow_undefined_symbols) {
-		axisFeatures = append(axisFeatures, "-no_undefined_symbols")
-	}
-
-	var linkerFlags []string
-	if len(props.Ldflags) > 0 {
-		linkerFlags = append(linkerFlags, proptools.NinjaEscapeList(props.Ldflags)...)
-		// binaries remove static flag if -shared is in the linker flags
-		if isBinary && android.InList("-shared", linkerFlags) {
-			axisFeatures = append(axisFeatures, "-static_flag")
-		}
-	}
-
-	if !props.libCrt() {
-		axisFeatures = append(axisFeatures, "-use_libcrt")
-	}
-	if !props.crt() {
-		axisFeatures = append(axisFeatures, "-link_crt")
-	}
-
-	// This must happen before the addition of flags for Version Script and
-	// Dynamic List, as these flags must be split on spaces and those must not
-	linkerFlags = parseCommandLineFlags(linkerFlags, filterOutClangUnknownCflags)
-
-	additionalLinkerInputs := bazel.LabelList{}
-	if props.Version_script != nil {
-		label := android.BazelLabelForModuleSrcSingle(ctx, *props.Version_script)
-		additionalLinkerInputs.Add(&label)
-		linkerFlags = append(linkerFlags, fmt.Sprintf("-Wl,--version-script,$(location %s)", label.Label))
-		axisFeatures = append(axisFeatures, "android_cfi_exports_map")
-	}
-
-	if props.Dynamic_list != nil {
-		label := android.BazelLabelForModuleSrcSingle(ctx, *props.Dynamic_list)
-		additionalLinkerInputs.Add(&label)
-		linkerFlags = append(linkerFlags, fmt.Sprintf("-Wl,--dynamic-list,$(location %s)", label.Label))
-	}
-
-	la.additionalLinkerInputs.SetSelectValue(axis, config, additionalLinkerInputs)
-	if axis == bazel.OsConfigurationAxis && (config == bazel.OsDarwin || config == bazel.OsLinux || config == bazel.OsWindows) {
-		linkerFlags = append(linkerFlags, props.Host_ldlibs...)
-	}
-	la.linkopts.SetSelectValue(axis, config, linkerFlags)
-
-	if axisFeatures != nil {
-		la.features.SetSelectValue(axis, config, axisFeatures)
-	}
-
-	runtimeDeps := android.BazelLabelForModuleDepsExcludes(ctx, props.Runtime_libs, props.Exclude_runtime_libs)
-	if !runtimeDeps.IsEmpty() {
-		la.runtimeDeps.SetSelectValue(axis, config, runtimeDeps)
-	}
-}
-
-var (
-	apiSurfaceModuleLibCurrentPackage = "@api_surfaces//" + android.ModuleLibApi.String() + "/current:"
-)
-
-func availableToSameApexes(a, b []string) bool {
-	if len(a) == 0 && len(b) == 0 {
-		return true
-	}
-	differ, _, _ := android.ListSetDifference(a, b)
-	return !differ
-}
-
-var (
-	apiDomainConfigSettingKey  = android.NewOnceKey("apiDomainConfigSettingKey")
-	apiDomainConfigSettingLock sync.Mutex
-)
-
-func getApiDomainConfigSettingMap(config android.Config) *map[string]bool {
-	return config.Once(apiDomainConfigSettingKey, func() interface{} {
-		return &map[string]bool{}
-	}).(*map[string]bool)
-}
-
-var (
-	testApexNameToApiDomain = map[string]string{
-		"test_broken_com.android.art": "com.android.art",
-	}
-)
-
-// GetApiDomain returns the canonical name of the apex. This is synonymous to the apex_name definition.
-// https://cs.android.com/android/_/android/platform/build/soong/+/e3f0281b8897da1fe23b2f4f3a05f1dc87bcc902:apex/prebuilt.go;l=81-83;drc=2dc7244af985a6ad701b22f1271e606cabba527f;bpv=1;bpt=0
-// For test apexes, it uses a naming convention heuristic to determine the api domain.
-// TODO (b/281548611): Move this build/soong/android
-func GetApiDomain(apexName string) string {
-	if apiDomain, exists := testApexNameToApiDomain[apexName]; exists {
-		return apiDomain
-	}
-	// Remove `test_` prefix
-	return strings.TrimPrefix(apexName, "test_")
-}
-
-// Create a config setting for this apex in build/bazel/rules/apex
-// The use case for this is stub/impl selection in cc libraries
-// Long term, these config_setting(s) should be colocated with the respective apex definitions.
-// Note that this is an anti-pattern: The config_setting should be created from the apex definition
-// and not from a cc_library.
-// This anti-pattern is needed today since not all apexes have been allowlisted.
-func createInApexConfigSetting(ctx android.Bp2buildMutatorContext, apexName string) {
-	if apexName == android.AvailableToPlatform || apexName == android.AvailableToAnyApex {
-		// These correspond to android-non_apex and android-in_apex
-		return
-	}
-	apiDomainConfigSettingLock.Lock()
-	defer apiDomainConfigSettingLock.Unlock()
-
-	// Return if a config_setting has already been created
-	apiDomain := GetApiDomain(apexName)
-	acsm := getApiDomainConfigSettingMap(ctx.Config())
-	if _, exists := (*acsm)[apiDomain]; exists {
-		return
-	}
-	(*acsm)[apiDomain] = true
-
-	csa := bazel.ConfigSettingAttributes{
-		Flag_values: bazel.StringMapAttribute{
-			"//build/bazel/rules/apex:api_domain": apiDomain,
-		},
-		// Constraint this to android
-		Constraint_values: bazel.MakeLabelListAttribute(
-			bazel.MakeLabelList(
-				[]bazel.Label{
-					bazel.Label{Label: "//build/bazel_common_rules/platforms/os:android"},
-				},
-			),
-		),
-	}
-	ca := android.CommonAttributes{
-		Name: apiDomain,
-	}
-	ctx.CreateBazelConfigSetting(
-		csa,
-		ca,
-		"build/bazel/rules/apex",
-	)
-}
-
-func inApexConfigSetting(apexAvailable string) string {
-	if apexAvailable == android.AvailableToPlatform {
-		return bazel.AndroidPlatform
-	}
-	if apexAvailable == android.AvailableToAnyApex {
-		return bazel.AndroidAndInApex
-	}
-	apiDomain := GetApiDomain(apexAvailable)
-	return "//build/bazel/rules/apex:" + apiDomain
-}
-
-// Inputs to stub vs impl selection.
-type stubSelectionInfo struct {
-	// Label of the implementation library (e.g. //bionic/libc:libc)
-	impl bazel.Label
-	// Axis containing the implementation library
-	axis bazel.ConfigurationAxis
-	// Axis key containing the implementation library
-	config string
-	// API domain of the apex
-	// For test apexes (test_com.android.foo), this will be the source apex (com.android.foo)
-	apiDomain string
-	// List of dep labels
-	dynamicDeps *bazel.LabelListAttribute
-	// Boolean value for determining if the dep is in the same api domain
-	// If false, the label will be rewritten to to the stub label
-	sameApiDomain bool
-}
-
-func useStubOrImplInApexWithName(ssi stubSelectionInfo) {
-	lib := ssi.impl
-	if !ssi.sameApiDomain {
-		lib = bazel.Label{
-			Label: apiSurfaceModuleLibCurrentPackage + strings.TrimPrefix(lib.OriginalModuleName, ":"),
-		}
-	}
-	// Create a select statement specific to this apex
-	inApexSelectValue := ssi.dynamicDeps.SelectValue(bazel.OsAndInApexAxis, inApexConfigSetting(ssi.apiDomain))
-	(&inApexSelectValue).Append(bazel.MakeLabelList([]bazel.Label{lib}))
-	ssi.dynamicDeps.SetSelectValue(bazel.OsAndInApexAxis, inApexConfigSetting(ssi.apiDomain), bazel.FirstUniqueBazelLabelList(inApexSelectValue))
-	// Delete the library from the common config for this apex
-	implDynamicDeps := ssi.dynamicDeps.SelectValue(ssi.axis, ssi.config)
-	implDynamicDeps = bazel.SubtractBazelLabelList(implDynamicDeps, bazel.MakeLabelList([]bazel.Label{ssi.impl}))
-	ssi.dynamicDeps.SetSelectValue(ssi.axis, ssi.config, implDynamicDeps)
-	if ssi.axis == bazel.NoConfigAxis {
-		// Set defaults. Defaults (i.e. host) should use impl and not stubs.
-		defaultSelectValue := ssi.dynamicDeps.SelectValue(bazel.OsAndInApexAxis, bazel.ConditionsDefaultConfigKey)
-		(&defaultSelectValue).Append(bazel.MakeLabelList([]bazel.Label{ssi.impl}))
-		ssi.dynamicDeps.SetSelectValue(bazel.OsAndInApexAxis, bazel.ConditionsDefaultConfigKey, bazel.FirstUniqueBazelLabelList(defaultSelectValue))
-	}
-}
-
-// hasNdkStubs returns true for libfoo if there exists a libfoo.ndk of type ndk_library
-func hasNdkStubs(ctx android.BazelConversionPathContext, c *Module) bool {
-	mod, exists := ctx.ModuleFromName(c.Name() + ndkLibrarySuffix)
-	return exists && ctx.OtherModuleType(mod) == "ndk_library"
-}
-
-func SetStubsForDynamicDeps(ctx android.Bp2buildMutatorContext, axis bazel.ConfigurationAxis,
-	config string, apexAvailable []string, dynamicLibs bazel.LabelList, dynamicDeps *bazel.LabelListAttribute, deps *bazel.LabelListAttribute, ind int, buildNonApexWithStubs bool) {
-
-	// Create a config_setting for each apex_available.
-	// This will be used to select impl of a dep if dep is available to the same apex.
-	for _, aa := range apexAvailable {
-		createInApexConfigSetting(ctx, aa)
-	}
-
-	apiDomainForSelects := []string{}
-	for _, apex := range apexAvailable {
-		apiDomainForSelects = append(apiDomainForSelects, GetApiDomain(apex))
-	}
-	// Always emit a select statement for the platform variant.
-	// This ensures that b build //foo --config=android works
-	// Soong always creates a platform variant even when the library might not be available to platform.
-	if !android.InList(android.AvailableToPlatform, apiDomainForSelects) {
-		apiDomainForSelects = append(apiDomainForSelects, android.AvailableToPlatform)
-	}
-	apiDomainForSelects = android.SortedUniqueStrings(apiDomainForSelects)
-
-	// Create a select for each apex this library could be included in.
-	for _, l := range dynamicLibs.Includes {
-		dep, _ := ctx.ModuleFromName(l.OriginalModuleName)
-		if c, ok := dep.(*Module); !ok || !c.HasStubsVariants() {
-			continue
-		}
-		// TODO (b/280339069): Decrease the verbosity of the generated BUILD files
-		for _, apiDomain := range apiDomainForSelects {
-			var sameApiDomain bool
-			if apiDomain == android.AvailableToPlatform {
-				// Platform variants in Soong use equality of apex_available for stub/impl selection.
-				// https://cs.android.com/android/_/android/platform/build/soong/+/316b0158fe57ee7764235923e7c6f3d530da39c6:cc/cc.go;l=3393-3404;drc=176271a426496fa2688efe2b40d5c74340c63375;bpv=1;bpt=0
-				// One of the factors behind this design choice is cc_test
-				// Tests only have a platform variant, and using equality of apex_available ensures
-				// that tests of an apex library gets its implementation and not stubs.
-				// TODO (b/280343104): Discuss if we can drop this special handling for platform variants.
-				sameApiDomain = availableToSameApexes(apexAvailable, dep.(*Module).ApexAvailable())
-				if linkable, ok := ctx.Module().(LinkableInterface); ok && linkable.Bootstrap() {
-					sameApiDomain = true
-				}
-				// If dependency has `apex_available: ["//apex_available:platform]`, then the platform variant of rdep should link against its impl.
-				// https://cs.android.com/android/_/android/platform/build/soong/+/main:cc/cc.go;l=3617;bpv=1;bpt=0;drc=c6a93d853b37ec90786e745b8d282145e6d3b589
-				if depApexAvailable := dep.(*Module).ApexAvailable(); len(depApexAvailable) == 1 && depApexAvailable[0] == android.AvailableToPlatform {
-					sameApiDomain = true
-				}
-			} else {
-				sameApiDomain = android.InList(apiDomain, dep.(*Module).ApexAvailable())
-			}
-			ssi := stubSelectionInfo{
-				impl:          l,
-				axis:          axis,
-				config:        config,
-				apiDomain:     apiDomain,
-				dynamicDeps:   dynamicDeps,
-				sameApiDomain: sameApiDomain,
-			}
-			useStubOrImplInApexWithName(ssi)
-		}
-	}
-
-	// If the library has an sdk variant, create additional selects to build this variant against the ndk
-	// The config setting for this variant will be //build/bazel/rules/apex:unbundled_app
-	if c, ok := ctx.Module().(*Module); ok && c.Properties.Sdk_version != nil {
-		for _, l := range dynamicLibs.Includes {
-			dep, _ := ctx.ModuleFromName(l.OriginalModuleName)
-			label := l // use the implementation by default
-			if depC, ok := dep.(*Module); ok && hasNdkStubs(ctx, depC) {
-				// If the dependency has ndk stubs, build against the ndk stubs
-				// https://cs.android.com/android/_/android/platform/build/soong/+/main:cc/cc.go;l=2642-2643;drc=e12d252e22dd8afa654325790d3298a0d67bd9d6;bpv=1;bpt=0
-				ver := proptools.String(c.Properties.Sdk_version)
-				// TODO - b/298085502: Add bp2build support for sdk_version: "minimum"
-				ndkLibModule, _ := ctx.ModuleFromName(dep.Name() + ndkLibrarySuffix)
-				label = bazel.Label{
-					Label: "//" + ctx.OtherModuleDir(ndkLibModule) + ":" + ndkLibModule.Name() + "_stub_libs-" + ver,
-				}
-			}
-			// add the ndk lib label to this axis
-			existingValue := dynamicDeps.SelectValue(bazel.OsAndInApexAxis, "unbundled_app")
-			existingValue.Append(bazel.MakeLabelList([]bazel.Label{label}))
-			dynamicDeps.SetSelectValue(bazel.OsAndInApexAxis, "unbundled_app", bazel.FirstUniqueBazelLabelList(existingValue))
-		}
-
-		// Add ndk_sysroot to deps.
-		// ndk_sysroot has a dependency edge on all ndk_headers, and will provide the .h files of _every_ ndk library
-		existingValue := deps.SelectValue(bazel.OsAndInApexAxis, "unbundled_app")
-		existingValue.Append(bazel.MakeLabelList([]bazel.Label{ndkSysrootLabel}))
-		deps.SetSelectValue(bazel.OsAndInApexAxis, "unbundled_app", bazel.FirstUniqueBazelLabelList(existingValue))
-	}
-}
-
-var (
-	ndkSysrootLabel = bazel.Label{
-		Label: "//build/bazel/rules/cc:ndk_sysroot",
-	}
-)
-
-func (la *linkerAttributes) convertStripProps(ctx android.BazelConversionPathContext, module *Module) {
-	bp2BuildPropParseHelper(ctx, module, &StripProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		if stripProperties, ok := props.(*StripProperties); ok {
-			la.stripKeepSymbols.SetSelectValue(axis, config, stripProperties.Strip.Keep_symbols)
-			la.stripKeepSymbolsList.SetSelectValue(axis, config, stripProperties.Strip.Keep_symbols_list)
-			la.stripKeepSymbolsAndDebugFrame.SetSelectValue(axis, config, stripProperties.Strip.Keep_symbols_and_debug_frame)
-			la.stripAll.SetSelectValue(axis, config, stripProperties.Strip.All)
-			la.stripNone.SetSelectValue(axis, config, stripProperties.Strip.None)
-		}
-	})
-}
-
-func (la *linkerAttributes) convertProductVariables(ctx android.Bp2buildMutatorContext, productVariableProps android.ProductConfigProperties) {
-
-	type productVarDep struct {
-		// the name of the corresponding excludes field, if one exists
-		excludesField string
-		// reference to the bazel attribute that should be set for the given product variable config
-		attribute *bazel.LabelListAttribute
-
-		depResolutionFunc func(ctx android.Bp2buildMutatorContext, modules, excludes []string) bazel.LabelList
-	}
-
-	// an intermediate attribute that holds Header_libs info, and will be appended to
-	// implementationDeps at the end, to solve the confliction that both header_libs
-	// and static_libs use implementationDeps.
-	var headerDeps bazel.LabelListAttribute
-
-	productVarToDepFields := map[string]productVarDep{
-		// product variables do not support exclude_shared_libs
-		"Shared_libs":       {attribute: &la.implementationDynamicDeps, depResolutionFunc: bazelLabelForSharedDepsExcludes},
-		"Static_libs":       {"Exclude_static_libs", &la.implementationDeps, bazelLabelForStaticDepsExcludes},
-		"Whole_static_libs": {"Exclude_static_libs", &la.wholeArchiveDeps, bazelLabelForWholeDepsExcludes},
-		"Header_libs":       {attribute: &headerDeps, depResolutionFunc: bazelLabelForHeaderDepsExcludes},
-	}
-
-	for name, dep := range productVarToDepFields {
-		props, exists := productVariableProps[name]
-		excludeProps, excludesExists := productVariableProps[dep.excludesField]
-		// if neither an include nor excludes property exists, then skip it
-		if !exists && !excludesExists {
-			continue
-		}
-		// Collect all the configurations that an include or exclude property exists for.
-		// We want to iterate all configurations rather than either the include or exclude because, for a
-		// particular configuration, we may have either only an include or an exclude to handle.
-		productConfigProps := make(map[android.ProductConfigOrSoongConfigProperty]bool, len(props)+len(excludeProps))
-		for p := range props {
-			productConfigProps[p] = true
-		}
-		for p := range excludeProps {
-			productConfigProps[p] = true
-		}
-
-		for productConfigProp := range productConfigProps {
-			prop, includesExists := props[productConfigProp]
-			excludesProp, excludesExists := excludeProps[productConfigProp]
-			var includes, excludes []string
-			var ok bool
-			// if there was no includes/excludes property, casting fails and that's expected
-			if includes, ok = prop.([]string); includesExists && !ok {
-				ctx.ModuleErrorf("Could not convert product variable %s property", name)
-			}
-			if excludes, ok = excludesProp.([]string); excludesExists && !ok {
-				ctx.ModuleErrorf("Could not convert product variable %s property", dep.excludesField)
-			}
-
-			dep.attribute.EmitEmptyList = productConfigProp.AlwaysEmit()
-			dep.attribute.SetSelectValue(
-				productConfigProp.ConfigurationAxis(),
-				productConfigProp.SelectKey(),
-				dep.depResolutionFunc(ctx, android.FirstUniqueStrings(includes), excludes),
-			)
-		}
-	}
-	la.implementationDeps.Append(headerDeps)
-}
-
-func (la *linkerAttributes) finalize(ctx android.Bp2buildMutatorContext) {
-	// if system dynamic deps have the default value, any use of a system dynamic library used will
-	// result in duplicate library errors for bionic OSes. Here, we explicitly exclude those libraries
-	// from bionic OSes and the no config case as these libraries only build for bionic OSes.
-	if la.systemDynamicDeps.IsNil() && len(la.usedSystemDynamicDepAsDynamicDep) > 0 {
-		toRemove := bazelLabelForSharedDeps(ctx, android.SortedKeys(la.usedSystemDynamicDepAsDynamicDep))
-		la.dynamicDeps.Exclude(bazel.NoConfigAxis, "", toRemove)
-		la.dynamicDeps.Exclude(bazel.OsConfigurationAxis, "android", toRemove)
-		la.dynamicDeps.Exclude(bazel.OsConfigurationAxis, "linux_bionic", toRemove)
-		la.implementationDynamicDeps.Exclude(bazel.NoConfigAxis, "", toRemove)
-		la.implementationDynamicDeps.Exclude(bazel.OsConfigurationAxis, "android", toRemove)
-		la.implementationDynamicDeps.Exclude(bazel.OsConfigurationAxis, "linux_bionic", toRemove)
-
-		la.implementationDynamicDeps.Exclude(bazel.OsAndInApexAxis, bazel.ConditionsDefaultConfigKey, toRemove)
-		stubsToRemove := make([]bazel.Label, 0, len(la.usedSystemDynamicDepAsDynamicDep))
-		for _, lib := range toRemove.Includes {
-			stubLabelInApiSurfaces := bazel.Label{
-				Label: apiSurfaceModuleLibCurrentPackage + lib.OriginalModuleName,
-			}
-			stubsToRemove = append(stubsToRemove, stubLabelInApiSurfaces)
-		}
-		// system libraries (e.g. libc, libm, libdl) belong the com.android.runtime api domain
-		// dedupe the stubs of these libraries from the other api domains (platform, other_apexes...)
-		for _, aa := range ctx.Module().(*Module).ApexAvailable() {
-			la.implementationDynamicDeps.Exclude(bazel.OsAndInApexAxis, inApexConfigSetting(aa), bazel.MakeLabelList(stubsToRemove))
-		}
-		la.implementationDynamicDeps.Exclude(bazel.OsAndInApexAxis, bazel.AndroidPlatform, bazel.MakeLabelList(stubsToRemove))
-	}
-	if la.systemDynamicDeps.IsNil() && len(la.usedSystemDynamicDepAsStaticDep) > 0 {
-		toRemove := bazelLabelForStaticDeps(ctx, android.SortedKeys(la.usedSystemDynamicDepAsStaticDep))
-		la.deps.Exclude(bazel.NoConfigAxis, "", toRemove)
-		la.deps.Exclude(bazel.OsConfigurationAxis, "android", toRemove)
-		la.deps.Exclude(bazel.OsConfigurationAxis, "linux_bionic", toRemove)
-		la.implementationDeps.Exclude(bazel.NoConfigAxis, "", toRemove)
-		la.implementationDeps.Exclude(bazel.OsConfigurationAxis, "android", toRemove)
-		la.implementationDeps.Exclude(bazel.OsConfigurationAxis, "linux_bionic", toRemove)
-	}
-
-	la.deps.ResolveExcludes()
-	la.implementationDeps.ResolveExcludes()
-	la.dynamicDeps.ResolveExcludes()
-	la.implementationDynamicDeps.ResolveExcludes()
-	la.wholeArchiveDeps.ResolveExcludes()
-	la.systemDynamicDeps.ForceSpecifyEmptyList = true
-
-}
-
-// Relativize a list of root-relative paths with respect to the module's
-// directory.
-//
-// include_dirs Soong prop are root-relative (b/183742505), but
-// local_include_dirs, export_include_dirs and export_system_include_dirs are
-// module dir relative. This function makes a list of paths entirely module dir
-// relative.
-//
-// For the `include` attribute, Bazel wants the paths to be relative to the
-// module.
-func bp2BuildMakePathsRelativeToModule(ctx android.BazelConversionPathContext, paths []string) []string {
-	var relativePaths []string
-	for _, path := range paths {
-		// Semantics of filepath.Rel: join(ModuleDir, rel(ModuleDir, path)) == path
-		relativePath, err := filepath.Rel(ctx.ModuleDir(), path)
-		if err != nil {
-			panic(err)
-		}
-		relativePaths = append(relativePaths, relativePath)
-	}
-	return relativePaths
-}
-
-// BazelIncludes contains information about -I and -isystem paths from a module converted to Bazel
-// attributes.
-type BazelIncludes struct {
-	AbsoluteIncludes bazel.StringListAttribute
-	Includes         bazel.StringListAttribute
-	SystemIncludes   bazel.StringListAttribute
-}
-
-func bp2BuildParseExportedIncludes(ctx android.BazelConversionPathContext, module *Module, includes *BazelIncludes) BazelIncludes {
-	var exported BazelIncludes
-	if includes != nil {
-		exported = *includes
-	} else {
-		exported = BazelIncludes{}
-	}
-
-	// cc library Export_include_dirs and Export_system_include_dirs are marked
-	// "variant_prepend" in struct tag, set their prepend property to true to make
-	// sure bp2build generates correct result.
-	exported.Includes.Prepend = true
-	exported.SystemIncludes.Prepend = true
-
-	bp2BuildPropParseHelper(ctx, module, &FlagExporterProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		if flagExporterProperties, ok := props.(*FlagExporterProperties); ok {
-			if len(flagExporterProperties.Export_include_dirs) > 0 {
-				exported.Includes.SetSelectValue(axis, config, android.FirstUniqueStrings(append(exported.Includes.SelectValue(axis, config), flagExporterProperties.Export_include_dirs...)))
-			}
-			if len(flagExporterProperties.Export_system_include_dirs) > 0 {
-				exported.SystemIncludes.SetSelectValue(axis, config, android.FirstUniqueStrings(append(exported.SystemIncludes.SelectValue(axis, config), flagExporterProperties.Export_system_include_dirs...)))
-			}
-		}
-	})
-	exported.AbsoluteIncludes.DeduplicateAxesFromBase()
-	exported.Includes.DeduplicateAxesFromBase()
-	exported.SystemIncludes.DeduplicateAxesFromBase()
-
-	return exported
-}
-
-func BazelLabelNameForStaticModule(baseLabel string) string {
-	return baseLabel + "_bp2build_cc_library_static"
-}
-
-func bazelLabelForStaticModule(ctx android.BazelConversionPathContext, m blueprint.Module) string {
-	label := android.BazelModuleLabel(ctx, m)
-	if ccModule, ok := m.(*Module); ok && ccModule.typ() == fullLibrary {
-		return BazelLabelNameForStaticModule(label)
-	}
-	return label
-}
-
-func bazelLabelForSharedModule(ctx android.BazelConversionPathContext, m blueprint.Module) string {
-	// cc_library, at it's root name, propagates the shared library, which depends on the static
-	// library.
-	return android.BazelModuleLabel(ctx, m)
-}
-
-func bazelLabelForStaticWholeModuleDeps(ctx android.BazelConversionPathContext, m blueprint.Module) string {
-	label := bazelLabelForStaticModule(ctx, m)
-	if aModule, ok := m.(android.Module); ok {
-		if android.IsModulePrebuilt(aModule) {
-			label += "_alwayslink"
-		}
-	}
-	return label
-}
-
-func xsdConfigCppTarget(xsd android.XsdConfigBp2buildTargets) string {
-	return xsd.CppBp2buildTargetName()
-}
-
-func bazelLabelForWholeDeps(ctx android.Bp2buildMutatorContext, modules []string) bazel.LabelList {
-	return android.BazelLabelForModuleDepsWithFn(ctx, modules, bazelLabelForStaticWholeModuleDeps, true)
-}
-
-func bazelLabelForWholeDepsExcludes(ctx android.Bp2buildMutatorContext, modules, excludes []string) bazel.LabelList {
-	return android.BazelLabelForModuleDepsExcludesWithFn(ctx, modules, excludes, bazelLabelForStaticWholeModuleDeps)
-}
-
-func bazelLabelForStaticDepsExcludes(ctx android.Bp2buildMutatorContext, modules, excludes []string) bazel.LabelList {
-	return android.BazelLabelForModuleDepsExcludesWithFn(ctx, modules, excludes, bazelLabelForStaticModule)
-}
-
-func bazelLabelForStaticDeps(ctx android.Bp2buildMutatorContext, modules []string) bazel.LabelList {
-	return android.BazelLabelForModuleDepsWithFn(ctx, modules, bazelLabelForStaticModule, true)
-}
-
-func bazelLabelForSharedDeps(ctx android.Bp2buildMutatorContext, modules []string) bazel.LabelList {
-	return android.BazelLabelForModuleDepsWithFn(ctx, modules, bazelLabelForSharedModule, true)
-}
-
-func bazelLabelForHeaderDeps(ctx android.Bp2buildMutatorContext, modules []string) bazel.LabelList {
-	// This is not elegant, but bp2build's shared library targets only propagate
-	// their header information as part of the normal C++ provider.
-	return bazelLabelForSharedDeps(ctx, modules)
-}
-
-func bazelLabelForHeaderDepsExcludes(ctx android.Bp2buildMutatorContext, modules, excludes []string) bazel.LabelList {
-	// This is only used when product_variable header_libs is processed, to follow
-	// the pattern of depResolutionFunc
-	return android.BazelLabelForModuleDepsExcludesWithFn(ctx, modules, excludes, bazelLabelForSharedModule)
-}
-
-func bazelLabelForSharedDepsExcludes(ctx android.Bp2buildMutatorContext, modules, excludes []string) bazel.LabelList {
-	return android.BazelLabelForModuleDepsExcludesWithFn(ctx, modules, excludes, bazelLabelForSharedModule)
-}
-
-type binaryLinkerAttrs struct {
-	Linkshared *bool
-	Stem       bazel.StringAttribute
-	Suffix     bazel.StringAttribute
-}
-
-func bp2buildBinaryLinkerProps(ctx android.BazelConversionPathContext, m *Module) binaryLinkerAttrs {
-	attrs := binaryLinkerAttrs{}
-	bp2BuildPropParseHelper(ctx, m, &BinaryLinkerProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		linkerProps := props.(*BinaryLinkerProperties)
-		staticExecutable := linkerProps.Static_executable
-		if axis == bazel.NoConfigAxis {
-			if linkBinaryShared := !proptools.Bool(staticExecutable); !linkBinaryShared {
-				attrs.Linkshared = &linkBinaryShared
-			}
-		} else if staticExecutable != nil {
-			// TODO(b/202876379): Static_executable is arch-variant; however, linkshared is a
-			// nonconfigurable attribute. Only 4 AOSP modules use this feature, defer handling
-			ctx.ModuleErrorf("bp2build cannot migrate a module with arch/target-specific static_executable values")
-		}
-		if stem := linkerProps.Stem; stem != nil {
-			attrs.Stem.SetSelectValue(axis, config, stem)
-		}
-		if suffix := linkerProps.Suffix; suffix != nil {
-			attrs.Suffix.SetSelectValue(axis, config, suffix)
-		}
-	})
-
-	return attrs
-}
-
-type sanitizerValues struct {
-	features                 bazel.StringListAttribute
-	copts                    bazel.StringListAttribute
-	additionalCompilerInputs bazel.LabelListAttribute
-}
-
-func bp2buildSanitizerFeatures(ctx android.BazelConversionPathContext, m *Module) sanitizerValues {
-	sanitizerFeatures := bazel.StringListAttribute{}
-	sanitizerCopts := bazel.StringListAttribute{}
-	sanitizerCompilerInputs := bazel.LabelListAttribute{}
-	memtagFeatures := bazel.StringListAttribute{}
-	memtagFeature := ""
-	bp2BuildPropParseHelper(ctx, m, &SanitizeProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		var features []string
-		if sanitizerProps, ok := props.(*SanitizeProperties); ok {
-			if sanitizerProps.Sanitize.Integer_overflow != nil && *sanitizerProps.Sanitize.Integer_overflow {
-				features = append(features, "ubsan_integer_overflow")
-			}
-			for _, sanitizer := range sanitizerProps.Sanitize.Misc_undefined {
-				features = append(features, "ubsan_"+sanitizer)
-			}
-			blocklist := sanitizerProps.Sanitize.Blocklist
-			if blocklist != nil {
-				// TODO: b/294868620 - Change this not to use the special axis when completing the bug
-				coptValue := fmt.Sprintf("-fsanitize-ignorelist=$(location %s)", *blocklist)
-				sanitizerCopts.SetSelectValue(bazel.SanitizersEnabledAxis, bazel.SanitizersEnabled, []string{coptValue})
-				sanitizerCompilerInputs.SetSelectValue(bazel.SanitizersEnabledAxis, bazel.SanitizersEnabled, bazel.MakeLabelListFromTargetNames([]string{*blocklist}))
-			}
-			if sanitizerProps.Sanitize.Cfi != nil && !proptools.Bool(sanitizerProps.Sanitize.Cfi) {
-				features = append(features, "-android_cfi")
-			} else if proptools.Bool(sanitizerProps.Sanitize.Cfi) {
-				features = append(features, "android_cfi")
-				if proptools.Bool(sanitizerProps.Sanitize.Config.Cfi_assembly_support) {
-					features = append(features, "android_cfi_assembly_support")
-				}
-			}
-
-			if sanitizerProps.Sanitize.Memtag_heap != nil {
-				if (axis == bazel.NoConfigAxis && memtagFeature == "") ||
-					(axis == bazel.OsArchConfigurationAxis && config == bazel.OsArchAndroidArm64) {
-					memtagFeature = setMemtagValue(sanitizerProps, &memtagFeatures)
-				}
-			}
-			sanitizerFeatures.SetSelectValue(axis, config, features)
-		}
-	})
-	sanitizerFeatures.Append(memtagFeatures)
-
-	return sanitizerValues{
-		features:                 sanitizerFeatures,
-		copts:                    sanitizerCopts,
-		additionalCompilerInputs: sanitizerCompilerInputs,
-	}
-}
-
-func setMemtagValue(sanitizerProps *SanitizeProperties, memtagFeatures *bazel.StringListAttribute) string {
-	var features []string
-	if proptools.Bool(sanitizerProps.Sanitize.Memtag_heap) {
-		features = append(features, "memtag_heap")
-	} else {
-		features = append(features, "-memtag_heap")
-	}
-	// Logic comes from: https://cs.android.com/android/platform/superproject/main/+/32ea1afbd1148b0b78553f24fa61116c999eb968:build/soong/cc/sanitize.go;l=910
-	if sanitizerProps.Sanitize.Diag.Memtag_heap != nil {
-		if proptools.Bool(sanitizerProps.Sanitize.Diag.Memtag_heap) {
-			features = append(features, "diag_memtag_heap")
-		} else {
-			features = append(features, "-diag_memtag_heap")
-		}
-	}
-	memtagFeatures.SetSelectValue(bazel.OsArchConfigurationAxis, bazel.OsArchAndroidArm64, features)
-
-	return features[0]
-}
-
-func bp2buildLtoFeatures(ctx android.BazelConversionPathContext, m *Module) bazel.StringListAttribute {
-	lto_feature_name := "android_thin_lto"
-	ltoBoolFeatures := bazel.BoolAttribute{}
-	bp2BuildPropParseHelper(ctx, m, &LTOProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		if ltoProps, ok := props.(*LTOProperties); ok {
-			thinProp := ltoProps.Lto.Thin != nil && *ltoProps.Lto.Thin
-			thinPropSetToFalse := ltoProps.Lto.Thin != nil && !*ltoProps.Lto.Thin
-			neverProp := ltoProps.Lto.Never != nil && *ltoProps.Lto.Never
-			if thinProp {
-				ltoBoolFeatures.SetSelectValue(axis, config, BoolPtr(true))
-				return
-			}
-			if neverProp || thinPropSetToFalse {
-				if thinProp {
-					ctx.ModuleErrorf("lto.thin and lto.never are mutually exclusive but were specified together")
-				} else {
-					ltoBoolFeatures.SetSelectValue(axis, config, BoolPtr(false))
-				}
-				return
-			}
-		}
-		ltoBoolFeatures.SetSelectValue(axis, config, nil)
-	})
-
-	props := m.GetArchVariantProperties(ctx, &LTOProperties{})
-	ltoStringFeatures, err := ltoBoolFeatures.ToStringListAttribute(func(boolPtr *bool, axis bazel.ConfigurationAxis, config string) []string {
-		if boolPtr == nil {
-			return []string{}
-		}
-		if !*boolPtr {
-			return []string{"-" + lto_feature_name}
-		}
-		features := []string{lto_feature_name}
-		if ltoProps, ok := props[axis][config].(*LTOProperties); ok {
-			if ltoProps.Whole_program_vtables != nil && *ltoProps.Whole_program_vtables {
-				features = append(features, "android_thin_lto_whole_program_vtables")
-			}
-		}
-		return features
-	})
-	if err != nil {
-		ctx.ModuleErrorf("Error processing LTO attributes: %s", err)
-	}
-	return ltoStringFeatures
-}
-
-func convertHiddenVisibilityToFeatureBase(ctx android.BazelConversionPathContext, m *Module) bazel.StringListAttribute {
-	visibilityHiddenFeature := bazel.StringListAttribute{}
-	bp2BuildPropParseHelper(ctx, m, &BaseCompilerProperties{}, func(axis bazel.ConfigurationAxis, configString string, props interface{}) {
-		if baseCompilerProps, ok := props.(*BaseCompilerProperties); ok {
-			convertHiddenVisibilityToFeatureHelper(&visibilityHiddenFeature, axis, configString, baseCompilerProps.Cflags)
-		}
-	})
-	return visibilityHiddenFeature
-}
-
-func convertHiddenVisibilityToFeatureStaticOrShared(ctx android.BazelConversionPathContext, m *Module, isStatic bool) bazel.StringListAttribute {
-	visibilityHiddenFeature := bazel.StringListAttribute{}
-	if isStatic {
-		bp2BuildPropParseHelper(ctx, m, &StaticProperties{}, func(axis bazel.ConfigurationAxis, configString string, props interface{}) {
-			if staticProps, ok := props.(*StaticProperties); ok {
-				convertHiddenVisibilityToFeatureHelper(&visibilityHiddenFeature, axis, configString, staticProps.Static.Cflags)
-			}
-		})
-	} else {
-		bp2BuildPropParseHelper(ctx, m, &SharedProperties{}, func(axis bazel.ConfigurationAxis, configString string, props interface{}) {
-			if sharedProps, ok := props.(*SharedProperties); ok {
-				convertHiddenVisibilityToFeatureHelper(&visibilityHiddenFeature, axis, configString, sharedProps.Shared.Cflags)
-			}
-		})
-	}
-
-	return visibilityHiddenFeature
-}
-
-func convertHiddenVisibilityToFeatureHelper(feature *bazel.StringListAttribute, axis bazel.ConfigurationAxis, configString string, cflags []string) {
-	if inList(config.VisibilityHiddenFlag, cflags) {
-		feature.SetSelectValue(axis, configString, []string{"visibility_hidden"})
-	}
-}
diff --git a/cc/builder.go b/cc/builder.go
index 69cf75b..e4d5be2 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -1052,6 +1052,9 @@
 	if flags.StripKeepSymbolsAndDebugFrame {
 		args += " --keep-symbols-and-debug-frame"
 	}
+	if ctx.Windows() {
+		args += " --windows"
+	}
 
 	ctx.Build(pctx, android.BuildParams{
 		Rule:        strip,
diff --git a/cc/cc.go b/cc/cc.go
index 74a8d35..7a06128 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -25,14 +25,12 @@
 	"strings"
 
 	"android/soong/testing"
-	"android/soong/ui/metrics/bp2build_metrics_proto"
-
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/proptools"
 
+	"android/soong/aconfig"
 	"android/soong/aidl_library"
 	"android/soong/android"
-	"android/soong/bazel/cquery"
 	"android/soong/cc/config"
 	"android/soong/fuzz"
 	"android/soong/genrule"
@@ -591,7 +589,6 @@
 	GeneratorFlags(ctx ModuleContext, flags Flags, deps PathDeps) Flags
 	GeneratorSources(ctx ModuleContext) GeneratedSource
 	GeneratorBuildActions(ctx ModuleContext, flags Flags, deps PathDeps)
-	GeneratorBp2build(ctx android.Bp2buildMutatorContext, module *Module) bool
 }
 
 // compiler is the interface for a compiler helper object. Different module decorators may implement
@@ -620,6 +617,7 @@
 	link(ctx ModuleContext, flags Flags, deps PathDeps, objs Objects) android.Path
 	appendLdflags([]string)
 	unstrippedOutputFilePath() android.Path
+	strippedAllOutputFilePath() android.Path
 
 	nativeCoverage() bool
 	coverageOutputFilePath() android.OptionalPath
@@ -830,19 +828,6 @@
 	return ok && ccDepTag == testPerSrcDepTag
 }
 
-// bazelHandler is the interface for a helper object related to deferring to Bazel for
-// processing a cc module (during Bazel mixed builds). Individual module types should define
-// their own bazel handler if they support being handled by Bazel.
-type BazelHandler interface {
-	// QueueBazelCall invokes request-queueing functions on the BazelContext
-	//so that these requests are handled when Bazel's cquery is invoked.
-	QueueBazelCall(ctx android.BaseModuleContext, label string)
-
-	// ProcessBazelQueryResponse uses information retrieved from Bazel to set properties
-	// on the current module with given label.
-	ProcessBazelQueryResponse(ctx android.ModuleContext, label string)
-}
-
 // Module contains the properties and members used by all C/C++ module types, and implements
 // the blueprint.Module interface.  It delegates to compiler, linker, and installer interfaces
 // to construct the output file.  Behavior can be customized with a Customizer, or "decorator",
@@ -860,15 +845,12 @@
 type Module struct {
 	fuzz.FuzzModule
 
-	android.BazelModuleBase
-
 	VendorProperties VendorProperties
 	Properties       BaseProperties
 
 	// initialize before calling Init
 	hod        android.HostOrDeviceSupported
 	multilib   android.Multilib
-	bazelable  bool
 	testModule bool
 
 	// Allowable SdkMemberTypes of this module type.
@@ -879,11 +861,10 @@
 	// type-specific logic. These members may reference different objects or the same object.
 	// Functions of these decorators will be invoked to initialize and register type-specific
 	// build statements.
-	generators   []Generator
-	compiler     compiler
-	linker       linker
-	installer    installer
-	bazelHandler BazelHandler
+	generators []Generator
+	compiler   compiler
+	linker     linker
+	installer  installer
 
 	features  []feature
 	stl       *stl
@@ -925,6 +906,9 @@
 	apexSdkVersion android.ApiLevel
 
 	hideApexVariantFromMake bool
+
+	// Aconfig files for all transitive deps.  Also exposed via TransitiveDeclarationsInfo
+	mergedAconfigFiles map[string]android.Paths
 }
 
 func (c *Module) AddJSONData(d *map[string]interface{}) {
@@ -1284,9 +1268,6 @@
 	}
 
 	android.InitAndroidArchModule(c, c.hod, c.multilib)
-	if c.bazelable {
-		android.InitBazelModule(c)
-	}
 	android.InitApexModule(c)
 	android.InitDefaultableModule(c)
 
@@ -1542,8 +1523,6 @@
 }
 
 func InstallToBootstrap(name string, config android.Config) bool {
-	// NOTE: also update //build/bazel/rules/apex/cc.bzl#_installed_to_bootstrap
-	// if this list is updated.
 	if name == "libclang_rt.hwasan" || name == "libc_hwasan" {
 		return true
 	}
@@ -1939,170 +1918,6 @@
 	return subName
 }
 
-var _ android.MixedBuildBuildable = (*Module)(nil)
-
-func (c *Module) getBazelModuleLabel(ctx android.BaseModuleContext) string {
-	var bazelModuleLabel string
-	if c.typ() == fullLibrary && c.static() {
-		// cc_library is a special case in bp2build; two targets are generated -- one for each
-		// of the shared and static variants. The shared variant keeps the module name, but the
-		// static variant uses a different suffixed name.
-		bazelModuleLabel = bazelLabelForStaticModule(ctx, c)
-	} else {
-		bazelModuleLabel = c.GetBazelLabel(ctx, c)
-	}
-	labelNoPrebuilt := bazelModuleLabel
-	if c.IsPrebuilt() {
-		labelNoPrebuilt = android.RemoveOptionalPrebuiltPrefixFromBazelLabel(bazelModuleLabel)
-	}
-	return labelNoPrebuilt
-}
-
-func (c *Module) QueueBazelCall(ctx android.BaseModuleContext) {
-	c.bazelHandler.QueueBazelCall(ctx, c.getBazelModuleLabel(ctx))
-}
-
-// IsMixedBuildSupported returns true if the module should be analyzed by Bazel
-// in any of the --bazel-mode(s).
-func (c *Module) IsMixedBuildSupported(ctx android.BaseModuleContext) bool {
-	if !allEnabledSanitizersSupportedByBazel(ctx, c) {
-		//TODO(b/278772861) support sanitizers in Bazel rules
-		return false
-	}
-	if !imageVariantSupportedByBazel(c) {
-		return false
-	}
-	if c.IsSdkVariant() {
-		return false
-	}
-	return c.bazelHandler != nil
-}
-
-func imageVariantSupportedByBazel(c *Module) bool {
-	if c.IsLlndk() {
-		return false
-	}
-	if c.InVendor() {
-		return false
-	}
-	if c.InProduct() {
-		return false
-	}
-	if c.InRamdisk() {
-		return false
-	}
-	if c.InVendorRamdisk() {
-		return false
-	}
-	if c.InRecovery() {
-		return false
-	}
-	return true
-}
-
-func allEnabledSanitizersSupportedByBazel(ctx android.BaseModuleContext, c *Module) bool {
-	if c.sanitize == nil {
-		return true
-	}
-	sanitizeProps := &c.sanitize.Properties.SanitizeMutated
-
-	unsupportedSanitizers := []*bool{
-		sanitizeProps.Safestack,
-		sanitizeProps.Scudo,
-		BoolPtr(len(c.sanitize.Properties.Sanitize.Recover) > 0),
-	}
-	for _, san := range unsupportedSanitizers {
-		if Bool(san) {
-			return false
-		}
-	}
-
-	for _, san := range Sanitizers {
-		if san == intOverflow {
-			// TODO(b/261058727): enable mixed builds for all modules with UBSan
-			// Currently we can only support ubsan when minimum runtime is used.
-			ubsanEnabled := Bool(sanitizeProps.Integer_overflow) || len(sanitizeProps.Misc_undefined) > 0
-			if !ubsanEnabled || c.MinimalRuntimeNeeded() {
-				continue
-			}
-		} else if san == cfi {
-			apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
-			// Only allow cfi if this is an apex variant
-			if !apexInfo.IsForPlatform() {
-				continue
-			}
-		}
-		if c.sanitize.isSanitizerEnabled(san) {
-			return false
-		}
-	}
-
-	return true
-}
-
-func GetApexConfigKey(ctx android.BaseModuleContext) *android.ApexConfigKey {
-	apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
-	if !apexInfo.IsForPlatform() {
-		apexKey := android.ApexConfigKey{
-			WithinApex:     true,
-			ApexSdkVersion: findApexSdkVersion(ctx, apexInfo).String(),
-			ApiDomain:      findApiDomain(apexInfo),
-		}
-		return &apexKey
-	}
-
-	return nil
-}
-
-// Returns the api domain of a module for an apexInfo group
-// Input:
-// ai.InApexModules: [com.android.foo, test_com.android.foo, com.google.android.foo]
-// Return:
-// com.android.foo
-
-// If a module is included in multiple api domains (collated by min_sdk_version), it will return
-// the first match. The other matches have the same build actions since they share a min_sdk_version, so returning
-// the first match is fine.
-func findApiDomain(ai android.ApexInfo) string {
-	// Remove any test apexes
-	matches, _ := android.FilterList(ai.InApexModules, ai.TestApexes)
-	// Remove any google apexes. Rely on naming convention.
-	pred := func(s string) bool { return !strings.HasPrefix(s, "com.google") }
-	matches = android.FilterListPred(matches, pred)
-	if len(matches) > 0 {
-		// Return the first match
-		return android.SortedUniqueStrings(matches)[0]
-	} else {
-		// No apex in the tree has a dependency on this module
-		return ""
-	}
-}
-
-func (c *Module) ProcessBazelQueryResponse(ctx android.ModuleContext) {
-	bazelModuleLabel := c.getBazelModuleLabel(ctx)
-	c.bazelHandler.ProcessBazelQueryResponse(ctx, bazelModuleLabel)
-
-	c.Properties.SubName = GetSubnameProperty(ctx, c)
-	apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
-	if !apexInfo.IsForPlatform() {
-		c.hideApexVariantFromMake = true
-	}
-
-	c.makeLinkType = GetMakeLinkType(ctx, c)
-
-	mctx := &moduleContext{
-		ModuleContext: ctx,
-		moduleContextImpl: moduleContextImpl{
-			mod: c,
-		},
-	}
-	mctx.ctx = mctx
-
-	// TODO(b/244432500): Get the tradefed config from the bazel target instead
-	// of generating it with Soong.
-	c.maybeInstall(mctx, apexInfo)
-}
-
 func moduleContextFromAndroidModuleContext(actx android.ModuleContext, c *Module) ModuleContext {
 	ctx := &moduleContext{
 		ModuleContext: actx,
@@ -2318,6 +2133,9 @@
 	if c.testModule {
 		ctx.SetProvider(testing.TestModuleProviderKey, testing.TestModuleProviderData{})
 	}
+	ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: deps.GeneratedSources.Strings()})
+
+	aconfig.CollectDependencyAconfigFiles(ctx, &c.mergedAconfigFiles)
 
 	c.maybeInstall(ctx, apexInfo)
 }
@@ -2338,9 +2156,8 @@
 	}
 }
 
-// maybeInstall is called at the end of both GenerateAndroidBuildActions and
-// ProcessBazelQueryResponse to run the install hooks for installable modules,
-// like binaries and tests.
+// maybeInstall is called at the end of both GenerateAndroidBuildActions to run the
+// install hooks for installable modules, like binaries and tests.
 func (c *Module) maybeInstall(ctx ModuleContext, apexInfo android.ApexInfo) {
 	if !proptools.BoolDefault(c.Installable(), true) {
 		// If the module has been specifically configure to not be installed then
@@ -2363,12 +2180,6 @@
 	}
 }
 
-func (c *Module) setAndroidMkVariablesFromCquery(info cquery.CcAndroidMkInfo) {
-	c.Properties.AndroidMkSharedLibs = info.LocalSharedLibs
-	c.Properties.AndroidMkStaticLibs = info.LocalStaticLibs
-	c.Properties.AndroidMkWholeStaticLibs = info.LocalWholeStaticLibs
-}
-
 func (c *Module) toolchain(ctx android.BaseModuleContext) config.Toolchain {
 	if c.cachedToolchain == nil {
 		c.cachedToolchain = config.FindToolchainWithContext(ctx)
@@ -2395,6 +2206,9 @@
 	if c.coverage != nil {
 		c.coverage.begin(ctx)
 	}
+	if c.afdo != nil {
+		c.afdo.begin(ctx)
+	}
 	if c.lto != nil {
 		c.lto.begin(ctx)
 	}
@@ -3821,6 +3635,11 @@
 			return android.PathsIfNonNil(c.linker.unstrippedOutputFilePath()), nil
 		}
 		return nil, nil
+	case "stripped_all":
+		if c.linker != nil {
+			return android.PathsIfNonNil(c.linker.strippedAllOutputFilePath()), nil
+		}
+		return nil, nil
 	default:
 		return nil, fmt.Errorf("unsupported module reference tag %q", tag)
 	}
@@ -4205,65 +4024,6 @@
 	return unknownType
 }
 
-// ConvertWithBp2build converts Module to Bazel for bp2build.
-func (c *Module) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	if len(c.generators) > 0 {
-		allConverted := true
-		for _, generator := range c.generators {
-			allConverted = allConverted && generator.GeneratorBp2build(ctx, c)
-		}
-		if allConverted {
-			return
-		}
-	}
-
-	prebuilt := c.IsPrebuilt()
-	switch c.typ() {
-	case binary:
-		if prebuilt {
-			prebuiltBinaryBp2Build(ctx, c)
-		} else {
-			binaryBp2build(ctx, c)
-		}
-	case testBin:
-		if !prebuilt {
-			testBinaryBp2build(ctx, c)
-		}
-	case object:
-		if prebuilt {
-			prebuiltObjectBp2Build(ctx, c)
-		} else {
-			objectBp2Build(ctx, c)
-		}
-	case fullLibrary:
-		if !prebuilt {
-			libraryBp2Build(ctx, c)
-		} else {
-			prebuiltLibraryBp2Build(ctx, c)
-		}
-	case headerLibrary:
-		libraryHeadersBp2Build(ctx, c)
-	case staticLibrary:
-		if prebuilt {
-			prebuiltLibraryStaticBp2Build(ctx, c, false)
-		} else {
-			sharedOrStaticLibraryBp2Build(ctx, c, true)
-		}
-	case sharedLibrary:
-		if prebuilt {
-			prebuiltLibrarySharedBp2Build(ctx, c)
-		} else {
-			sharedOrStaticLibraryBp2Build(ctx, c, false)
-		}
-	case ndkPrebuiltStl:
-		ndkPrebuiltStlBp2build(ctx, c)
-	case ndkLibrary:
-		ndkLibraryBp2build(ctx, c)
-	default:
-		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_TYPE_UNSUPPORTED, "")
-	}
-}
-
 // Defaults
 type Defaults struct {
 	android.ModuleBase
diff --git a/cc/cc_test.go b/cc/cc_test.go
index e2dba90..3631f19 100644
--- a/cc/cc_test.go
+++ b/cc/cc_test.go
@@ -26,7 +26,6 @@
 
 	"android/soong/aidl_library"
 	"android/soong/android"
-	"android/soong/bazel/cquery"
 )
 
 func init() {
@@ -40,32 +39,21 @@
 var prepareForCcTest = android.GroupFixturePreparers(
 	PrepareForTestWithCcIncludeVndk,
 	android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
+		variables.VendorApiLevel = StringPtr("202404")
 		variables.DeviceVndkVersion = StringPtr("current")
 		variables.Platform_vndk_version = StringPtr("29")
 	}),
 )
 
-var ccLibInApex = "cc_lib_in_apex"
 var apexVariationName = "apex28"
 var apexVersion = "28"
 
 func registerTestMutators(ctx android.RegistrationContext) {
 	ctx.PostDepsMutators(func(ctx android.RegisterMutatorsContext) {
 		ctx.BottomUp("apex", testApexMutator).Parallel()
-		ctx.BottomUp("mixed_builds_prep", mixedBuildsPrepareMutator).Parallel()
 	})
 }
 
-func mixedBuildsPrepareMutator(ctx android.BottomUpMutatorContext) {
-	if m := ctx.Module(); m.Enabled() {
-		if mixedBuildMod, ok := m.(android.MixedBuildBuildable); ok {
-			if mixedBuildMod.IsMixedBuildSupported(ctx) && android.MixedBuildsEnabled(ctx) == android.MixedBuildEnabled {
-				mixedBuildMod.QueueBazelCall(ctx)
-			}
-		}
-	}
-}
-
 func testApexMutator(mctx android.BottomUpMutatorContext) {
 	modules := mctx.CreateVariations(apexVariationName)
 	apexInfo := android.ApexInfo{
@@ -341,9 +329,9 @@
 	}
 }
 
-func checkWriteFileOutput(t *testing.T, params android.TestingBuildParams, expected []string) {
+func checkWriteFileOutput(t *testing.T, ctx *android.TestContext, params android.TestingBuildParams, expected []string) {
 	t.Helper()
-	content := android.ContentFromFileRuleForTests(t, params)
+	content := android.ContentFromFileRuleForTests(t, ctx, params)
 	actual := strings.FieldsFunc(content, func(r rune) bool { return r == '\n' })
 	assertArrayString(t, actual, expected)
 }
@@ -351,7 +339,7 @@
 func checkVndkOutput(t *testing.T, ctx *android.TestContext, output string, expected []string) {
 	t.Helper()
 	vndkSnapshot := ctx.SingletonForTests("vndk-snapshot")
-	checkWriteFileOutput(t, vndkSnapshot.Output(output), expected)
+	checkWriteFileOutput(t, ctx, vndkSnapshot.Output(output), expected)
 }
 
 func checkVndkLibrariesOutput(t *testing.T, ctx *android.TestContext, module string, expected []string) {
@@ -2131,11 +2119,13 @@
 	ensureStringContains(t, vendor_cflags, "-D__ANDROID_VNDK__")
 	ensureStringContains(t, vendor_cflags, "-D__ANDROID_VENDOR__")
 	ensureStringNotContains(t, vendor_cflags, "-D__ANDROID_PRODUCT__")
+	ensureStringContains(t, vendor_cflags, "-D__ANDROID_VENDOR_API__=202404")
 
 	product_cflags := product_static.Rule("cc").Args["cFlags"]
 	ensureStringContains(t, product_cflags, "-D__ANDROID_VNDK__")
 	ensureStringContains(t, product_cflags, "-D__ANDROID_PRODUCT__")
 	ensureStringNotContains(t, product_cflags, "-D__ANDROID_VENDOR__")
+	ensureStringNotContains(t, product_cflags, "-D__ANDROID_VENDOR_API__=202404")
 }
 
 func TestEnforceProductVndkVersionErrors(t *testing.T) {
@@ -2926,258 +2916,6 @@
 	checkStaticLibs(t, []string{"lib1", "libc++_static", "libc++demangle", "libclang_rt.builtins"}, module)
 }
 
-func TestLibDepAndroidMkExportInMixedBuilds(t *testing.T) {
-	bp := `
-		cc_library {
-			name: "static_dep",
-		}
-		cc_library {
-			name: "whole_static_dep",
-		}
-		cc_library {
-			name: "shared_dep",
-		}
-		cc_library {
-			name: "lib",
-			bazel_module: { label: "//:lib" },
-			static_libs: ["static_dep"],
-			whole_static_libs: ["whole_static_dep"],
-			shared_libs: ["shared_dep"],
-		}
-		cc_test {
-			name: "test",
-			bazel_module: { label: "//:test" },
-			static_libs: ["static_dep"],
-			whole_static_libs: ["whole_static_dep"],
-			shared_libs: ["shared_dep"],
-			gtest: false,
-			sanitize: {
-				// cc_test modules default to memtag_heap: true,
-				// but this adds extra dependencies that we don't care about
-				never: true,
-			}
-		}
-		cc_binary {
-			name: "binary",
-			bazel_module: { label: "//:binary" },
-			static_libs: ["static_dep"],
-			whole_static_libs: ["whole_static_dep"],
-			shared_libs: ["shared_dep"],
-		}
-		cc_library_headers {
-			name: "lib_headers",
-			bazel_module: { label: "//:lib_headers" },
-			static_libs: ["static_dep"],
-			whole_static_libs: ["whole_static_dep"],
-			shared_libs: ["shared_dep"],
-		}
-		cc_prebuilt_library {
-			name: "lib_prebuilt",
-			bazel_module: { label: "//:lib_prebuilt" },
-			static_libs: ["static_dep"],
-			whole_static_libs: ["whole_static_dep"],
-			shared_libs: ["shared_dep"],
-		}
-	`
-
-	testCases := []struct {
-		name          string
-		moduleName    string
-		variant       string
-		androidMkInfo cquery.CcAndroidMkInfo
-	}{
-		{
-			name:       "shared lib",
-			moduleName: "lib",
-			variant:    "android_arm64_armv8-a_shared",
-			androidMkInfo: cquery.CcAndroidMkInfo{
-				LocalStaticLibs:      []string{"static_dep"},
-				LocalWholeStaticLibs: []string{"whole_static_dep"},
-				LocalSharedLibs:      []string{"shared_dep"},
-			},
-		},
-		{
-			name:       "static lib",
-			moduleName: "lib",
-			variant:    "android_arm64_armv8-a_static",
-			androidMkInfo: cquery.CcAndroidMkInfo{
-				LocalStaticLibs:      []string{"static_dep"},
-				LocalWholeStaticLibs: []string{"whole_static_dep"},
-				LocalSharedLibs:      []string{"shared_dep"},
-			},
-		},
-		{
-			name:       "cc_test arm64",
-			moduleName: "test",
-			variant:    "android_arm64_armv8-a",
-			androidMkInfo: cquery.CcAndroidMkInfo{
-				LocalStaticLibs:      []string{"static_dep"},
-				LocalWholeStaticLibs: []string{"whole_static_dep"},
-				LocalSharedLibs:      []string{"shared_dep"},
-			},
-		},
-		{
-			name:       "cc_test arm",
-			moduleName: "test",
-			variant:    "android_arm_armv7-a-neon",
-			androidMkInfo: cquery.CcAndroidMkInfo{
-				LocalStaticLibs:      []string{"static_dep"},
-				LocalWholeStaticLibs: []string{"whole_static_dep"},
-				LocalSharedLibs:      []string{"shared_dep"},
-			},
-		},
-		{
-			name:       "cc_binary",
-			moduleName: "binary",
-			variant:    "android_arm64_armv8-a",
-			androidMkInfo: cquery.CcAndroidMkInfo{
-				LocalStaticLibs:      []string{"static_dep"},
-				LocalWholeStaticLibs: []string{"whole_static_dep"},
-				LocalSharedLibs:      []string{"shared_dep"},
-			},
-		},
-		{
-			name:       "cc_library_headers",
-			moduleName: "lib_headers",
-			variant:    "android_arm64_armv8-a",
-			androidMkInfo: cquery.CcAndroidMkInfo{
-				LocalStaticLibs:      []string{"static_dep"},
-				LocalWholeStaticLibs: []string{"whole_static_dep"},
-				LocalSharedLibs:      []string{"shared_dep"},
-			},
-		},
-		{
-			name:       "prebuilt lib static",
-			moduleName: "lib_prebuilt",
-			variant:    "android_arm64_armv8-a_static",
-			androidMkInfo: cquery.CcAndroidMkInfo{
-				LocalStaticLibs:      []string{"static_dep"},
-				LocalWholeStaticLibs: []string{"whole_static_dep"},
-				LocalSharedLibs:      []string{"shared_dep"},
-			},
-		},
-		{
-			name:       "prebuilt lib shared",
-			moduleName: "lib_prebuilt",
-			variant:    "android_arm64_armv8-a_shared",
-			androidMkInfo: cquery.CcAndroidMkInfo{
-				LocalStaticLibs:      []string{"static_dep"},
-				LocalWholeStaticLibs: []string{"whole_static_dep"},
-				LocalSharedLibs:      []string{"shared_dep"},
-			},
-		},
-	}
-
-	outputBaseDir := "out/bazel"
-	for _, tc := range testCases {
-		t.Run(tc.name, func(t *testing.T) {
-			result := android.GroupFixturePreparers(
-				prepareForCcTest,
-				android.FixtureModifyConfig(func(config android.Config) {
-					config.BazelContext = android.MockBazelContext{
-						OutputBaseDir: outputBaseDir,
-						LabelToCcInfo: map[string]cquery.CcInfo{
-							"//:lib": cquery.CcInfo{
-								CcAndroidMkInfo:      tc.androidMkInfo,
-								RootDynamicLibraries: []string{""},
-							},
-							"//:lib_bp2build_cc_library_static": cquery.CcInfo{
-								CcAndroidMkInfo:    tc.androidMkInfo,
-								RootStaticArchives: []string{""},
-							},
-							"//:lib_headers": cquery.CcInfo{
-								CcAndroidMkInfo: tc.androidMkInfo,
-								OutputFiles:     []string{""},
-							},
-							"//:lib_prebuilt": cquery.CcInfo{
-								CcAndroidMkInfo: tc.androidMkInfo,
-							},
-							"//:lib_prebuilt_bp2build_cc_library_static": cquery.CcInfo{
-								CcAndroidMkInfo: tc.androidMkInfo,
-							},
-						},
-						LabelToCcBinary: map[string]cquery.CcUnstrippedInfo{
-							"//:test__tf_internal": cquery.CcUnstrippedInfo{
-								CcAndroidMkInfo: tc.androidMkInfo,
-							},
-							"//:binary": cquery.CcUnstrippedInfo{
-								CcAndroidMkInfo: tc.androidMkInfo,
-							},
-						},
-					}
-				}),
-			).RunTestWithBp(t, bp)
-			ctx := result.TestContext
-
-			module := ctx.ModuleForTests(tc.moduleName, tc.variant).Module().(*Module)
-			entries := android.AndroidMkEntriesForTest(t, ctx, module)[0]
-			if !reflect.DeepEqual(module.Properties.AndroidMkStaticLibs, tc.androidMkInfo.LocalStaticLibs) {
-				t.Errorf("incorrect static_libs"+
-					"\nactual:   %v"+
-					"\nexpected: %v",
-					module.Properties.AndroidMkStaticLibs,
-					tc.androidMkInfo.LocalStaticLibs,
-				)
-			}
-			staticDepsDiffer, missingStaticDeps, additionalStaticDeps := android.ListSetDifference(
-				entries.EntryMap["LOCAL_STATIC_LIBRARIES"],
-				tc.androidMkInfo.LocalStaticLibs,
-			)
-			if staticDepsDiffer {
-				t.Errorf(
-					"expected LOCAL_STATIC_LIBRARIES to be %q but was %q; missing: %q; extra %q",
-					tc.androidMkInfo.LocalStaticLibs,
-					entries.EntryMap["LOCAL_STATIC_LIBRARIES"],
-					missingStaticDeps,
-					additionalStaticDeps,
-				)
-			}
-
-			if !reflect.DeepEqual(module.Properties.AndroidMkWholeStaticLibs, tc.androidMkInfo.LocalWholeStaticLibs) {
-				t.Errorf("expected module.Properties.AndroidMkWholeStaticLibs to be %q, but was %q",
-					tc.androidMkInfo.LocalWholeStaticLibs,
-					module.Properties.AndroidMkWholeStaticLibs,
-				)
-			}
-			wholeStaticDepsDiffer, missingWholeStaticDeps, additionalWholeStaticDeps := android.ListSetDifference(
-				entries.EntryMap["LOCAL_WHOLE_STATIC_LIBRARIES"],
-				tc.androidMkInfo.LocalWholeStaticLibs,
-			)
-			if wholeStaticDepsDiffer {
-				t.Errorf(
-					"expected LOCAL_WHOLE_STATIC_LIBRARIES to be %q but was %q; missing: %q; extra %q",
-					tc.androidMkInfo.LocalWholeStaticLibs,
-					entries.EntryMap["LOCAL_WHOLE_STATIC_LIBRARIES"],
-					missingWholeStaticDeps,
-					additionalWholeStaticDeps,
-				)
-			}
-
-			if !reflect.DeepEqual(module.Properties.AndroidMkSharedLibs, tc.androidMkInfo.LocalSharedLibs) {
-				t.Errorf("incorrect shared_libs"+
-					"\nactual:   %v"+
-					"\nexpected: %v",
-					module.Properties.AndroidMkSharedLibs,
-					tc.androidMkInfo.LocalSharedLibs,
-				)
-			}
-			sharedDepsDiffer, missingSharedDeps, additionalSharedDeps := android.ListSetDifference(
-				entries.EntryMap["LOCAL_SHARED_LIBRARIES"],
-				tc.androidMkInfo.LocalSharedLibs,
-			)
-			if sharedDepsDiffer {
-				t.Errorf(
-					"expected LOCAL_SHARED_LIBRARIES to be %q but was %q; missing %q; extra %q",
-					tc.androidMkInfo.LocalSharedLibs,
-					entries.EntryMap["LOCAL_SHARED_LIBRARIES"],
-					missingSharedDeps,
-					additionalSharedDeps,
-				)
-			}
-		})
-	}
-}
-
 var compilerFlagsTestCases = []struct {
 	in  string
 	out bool
@@ -3519,130 +3257,6 @@
 	}
 }
 
-func TestMixedBuildUsesStubs(t *testing.T) {
-	t.Parallel()
-	bp := `
-		cc_library_shared {
-			name: "libFoo",
-			bazel_module: { label: "//:libFoo" },
-			srcs: ["foo.c"],
-			stubs: {
-				symbol_file: "foo.map.txt",
-				versions: ["current"],
-			},
-			apex_available: ["bar", "a1"],
-		}
-
-		cc_library_shared {
-			name: "libBar",
-			srcs: ["bar.c"],
-			shared_libs: ["libFoo"],
-			apex_available: ["a1"],
-		}
-
-		cc_library_shared {
-			name: "libA1",
-			srcs: ["a1.c"],
-			shared_libs: ["libFoo"],
-			apex_available: ["a1"],
-		}
-
-		cc_library_shared {
-			name: "libBarA1",
-			srcs: ["bara1.c"],
-			shared_libs: ["libFoo"],
-			apex_available: ["bar", "a1"],
-		}
-
-		cc_library_shared {
-			name: "libAnyApex",
-			srcs: ["anyApex.c"],
-			shared_libs: ["libFoo"],
-			apex_available: ["//apex_available:anyapex"],
-		}
-
-		cc_library_shared {
-			name: "libBaz",
-			srcs: ["baz.c"],
-			shared_libs: ["libFoo"],
-			apex_available: ["baz"],
-		}
-
-		cc_library_shared {
-			name: "libQux",
-			srcs: ["qux.c"],
-			shared_libs: ["libFoo"],
-			apex_available: ["qux", "bar"],
-		}`
-
-	result := android.GroupFixturePreparers(
-		prepareForCcTest,
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: "out/bazel",
-				LabelToCcInfo: map[string]cquery.CcInfo{
-					"//:libFoo": {
-						RootDynamicLibraries: []string{"libFoo.so"},
-					},
-					"//:libFoo_stub_libs-current": {
-						RootDynamicLibraries: []string{"libFoo_stub_libs-current.so"},
-					},
-				},
-			}
-		}),
-	).RunTestWithBp(t, bp)
-	ctx := result.TestContext
-
-	variants := ctx.ModuleVariantsForTests("libFoo")
-	expectedVariants := []string{
-		"android_arm64_armv8-a_shared",
-		"android_arm64_armv8-a_shared_current",
-		"android_arm_armv7-a-neon_shared",
-		"android_arm_armv7-a-neon_shared_current",
-	}
-	variantsMismatch := false
-	if len(variants) != len(expectedVariants) {
-		variantsMismatch = true
-	} else {
-		for _, v := range expectedVariants {
-			if !inList(v, variants) {
-				variantsMismatch = false
-			}
-		}
-	}
-	if variantsMismatch {
-		t.Errorf("variants of libFoo expected:\n")
-		for _, v := range expectedVariants {
-			t.Errorf("%q\n", v)
-		}
-		t.Errorf(", but got:\n")
-		for _, v := range variants {
-			t.Errorf("%q\n", v)
-		}
-	}
-
-	linkAgainstFoo := []string{"libBarA1"}
-	linkAgainstFooStubs := []string{"libBar", "libA1", "libBaz", "libQux", "libAnyApex"}
-
-	libFooPath := "out/bazel/execroot/__main__/libFoo.so"
-	for _, lib := range linkAgainstFoo {
-		libLinkRule := ctx.ModuleForTests(lib, "android_arm64_armv8-a_shared").Rule("ld")
-		libFlags := libLinkRule.Args["libFlags"]
-		if !strings.Contains(libFlags, libFooPath) {
-			t.Errorf("%q: %q is not found in %q", lib, libFooPath, libFlags)
-		}
-	}
-
-	libFooStubPath := "out/bazel/execroot/__main__/libFoo_stub_libs-current.so"
-	for _, lib := range linkAgainstFooStubs {
-		libLinkRule := ctx.ModuleForTests(lib, "android_arm64_armv8-a_shared").Rule("ld")
-		libFlags := libLinkRule.Args["libFlags"]
-		if !strings.Contains(libFlags, libFooStubPath) {
-			t.Errorf("%q: %q is not found in %q", lib, libFooStubPath, libFlags)
-		}
-	}
-}
-
 func TestVersioningMacro(t *testing.T) {
 	t.Parallel()
 	for _, tc := range []struct{ moduleName, expected string }{
@@ -4016,9 +3630,6 @@
 			shared: {
 				srcs: ["baz.c"],
 			},
-			bazel_module: {
-				bp2build_available: true,
-			},
 		}
 
 		cc_library_static {
@@ -4302,7 +3913,7 @@
 		libfoo.Rule("aidl_library").Implicits,
 	)
 
-	manifest := android.RuleBuilderSboxProtoForTests(t, libfoo.Output("aidl_library.sbox.textproto"))
+	manifest := android.RuleBuilderSboxProtoForTests(t, ctx, libfoo.Output("aidl_library.sbox.textproto"))
 	aidlCommand := manifest.Commands[0].GetCommand()
 
 	expectedAidlFlags := "-Ipackage_foo/a -Ipackage_bar/x"
@@ -4337,7 +3948,7 @@
 	`)
 
 	libfoo := ctx.ModuleForTests("libfoo", "android_arm64_armv8-a_static")
-	manifest := android.RuleBuilderSboxProtoForTests(t, libfoo.Output("aidl.sbox.textproto"))
+	manifest := android.RuleBuilderSboxProtoForTests(t, ctx.TestContext, libfoo.Output("aidl.sbox.textproto"))
 	aidlCommand := manifest.Commands[0].GetCommand()
 	expectedAidlFlag := "-Werror"
 	if !strings.Contains(aidlCommand, expectedAidlFlag) {
@@ -4388,7 +3999,7 @@
 				}
 			`)
 			libfoo := ctx.ModuleForTests("libfoo", tc.variant)
-			manifest := android.RuleBuilderSboxProtoForTests(t, libfoo.Output("aidl.sbox.textproto"))
+			manifest := android.RuleBuilderSboxProtoForTests(t, ctx, libfoo.Output("aidl.sbox.textproto"))
 			aidlCommand := manifest.Commands[0].GetCommand()
 			expectedAidlFlag := "--min_sdk_version=" + tc.expected
 			if !strings.Contains(aidlCommand, expectedAidlFlag) {
@@ -4818,7 +4429,7 @@
 
 	cflags := []string{"-Werror", "-std=candcpp"}
 	cstd := []string{"-std=gnu17", "-std=conly"}
-	cppstd := []string{"-std=gnu++17", "-std=cpp", "-fno-rtti"}
+	cppstd := []string{"-std=gnu++20", "-std=cpp", "-fno-rtti"}
 
 	lastIncludes := []string{
 		"out/soong/ndk/sysroot/usr/include",
@@ -5148,308 +4759,28 @@
 	}
 }
 
-func TestDclaLibraryInApex(t *testing.T) {
+func TestStrippedAllOutputFile(t *testing.T) {
 	t.Parallel()
 	bp := `
-	cc_library_shared {
-		name: "cc_lib_in_apex",
-		srcs: ["foo.cc"],
-    apex_available: ["myapex"],
-		bazel_module: { label: "//foo/bar:bar" },
-	}`
-	label := "//foo/bar:bar"
-	arch64 := "arm64_armv8-a"
-	arch32 := "arm_armv7-a-neon"
-	apexCfgKey := android.ApexConfigKey{
-		WithinApex:     true,
-		ApexSdkVersion: "28",
-	}
-
-	result := android.GroupFixturePreparers(
-		prepareForCcTest,
-		android.FixtureRegisterWithContext(registerTestMutators),
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: "outputbase",
-				LabelToCcInfo: map[string]cquery.CcInfo{
-					android.BuildMockBazelContextResultKey(label, arch32, android.Android, apexCfgKey): cquery.CcInfo{
-						RootDynamicLibraries: []string{"foo.so"},
-					},
-					android.BuildMockBazelContextResultKey(label, arch64, android.Android, apexCfgKey): cquery.CcInfo{
-						RootDynamicLibraries: []string{"foo.so"},
-					},
-				},
-				BazelRequests: make(map[string]bool),
+		cc_library {
+			name: "test_lib",
+			srcs: ["test_lib.cpp"],
+			dist: {
+				targets: [ "dist_target" ],
+				tag: "stripped_all",
 			}
-		}),
-	).RunTestWithBp(t, bp)
-	ctx := result.TestContext
-
-	// Test if the bazel request is queued correctly
-	key := android.BuildMockBazelContextRequestKey(label, cquery.GetCcInfo, arch32, android.Android, apexCfgKey)
-	if !ctx.Config().BazelContext.(android.MockBazelContext).BazelRequests[key] {
-		t.Errorf("Bazel request was not queued: %s", key)
-	}
-
-	sharedFoo := ctx.ModuleForTests(ccLibInApex, "android_arm_armv7-a-neon_shared_"+apexVariationName).Module()
-	producer := sharedFoo.(android.OutputFileProducer)
-	outputFiles, err := producer.OutputFiles("")
+		}
+ `
+	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
+	ctx := testCcWithConfig(t, config)
+	module := ctx.ModuleForTests("test_lib", "android_arm_armv7-a-neon_shared").Module()
+	outputFile, err := module.(android.OutputFileProducer).OutputFiles("stripped_all")
 	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
+		t.Errorf("Expected cc_library to produce output files, error: %s", err)
+		return
 	}
-	expectedOutputFiles := []string{"outputbase/execroot/__main__/foo.so"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
-}
-
-func TestDisableSanitizerVariantsInMixedBuilds(t *testing.T) {
-	t.Parallel()
-	bp := `
-		cc_library_static {
-			name: "foo_ubsan_minimal",
-			srcs: ["foo.cc"],
-			bazel_module: { label: "//foo_ubsan_minimal" },
-			sanitize: {
-				all_undefined: true,
-				integer_overflow: true,
-			},
-		}
-		cc_library_static {
-			name: "foo",
-			srcs: ["foo.cc"],
-			bazel_module: { label: "//foo" },
-			sanitize: {
-				address: true,
-				hwaddress: true,
-				fuzzer: true,
-				integer_overflow: true,
-				scs: true,
-			},
-		}
-		cc_library_static {
-			name: "foo_tsan",
-			srcs: ["foo.cc"],
-			bazel_module: { label: "//foo_tsan" },
-			sanitize: {
-				thread: true,
-			},
-		}
-		cc_library_static {
-			name: "foo_cfi",
-			srcs: ["foo.cc"],
-			bazel_module: { label: "//foo_cfi" },
-			sanitize: {
-				cfi: true,
-			},
-		}
-		cc_library_static {
-			name: "foo_memtag_stack",
-			srcs: ["foo.cc"],
-			bazel_module: { label: "//foo_memtag_stack" },
-			sanitize: {
-				memtag_stack: true,
-			},
-		}
-		cc_library_static {
-			name: "foo_memtag_heap",
-			srcs: ["foo.cc"],
-			bazel_module: { label: "//foo_memtag_heap" },
-			sanitize: {
-				memtag_heap: true,
-			},
-		}
-		cc_library_static {
-			name: "foo_safestack",
-			srcs: ["foo.cc"],
-			bazel_module: { label: "//foo_safestack" },
-			sanitize: {
-				safestack: true,
-			},
-		}
-		cc_library_static {
-			name: "foo_scudo",
-			srcs: ["foo.cc"],
-			bazel_module: { label: "//foo_scudo" },
-			sanitize: {
-				scudo: true,
-			},
-		}
-	`
-	testcases := []struct {
-		name                string
-		variant             string
-		expectedOutputPaths []string
-	}{
-		{
-			name:    "foo_ubsan_minimal",
-			variant: "android_arm64_armv8-a_static_apex28",
-			expectedOutputPaths: []string{
-				"outputbase/execroot/__main__/foo_ubsan_minimal.a",
-			},
-		},
-		{
-			name:    "foo",
-			variant: "android_arm64_armv8-a_static_apex28",
-			expectedOutputPaths: []string{
-				"outputbase/execroot/__main__/foo.a",
-			},
-		},
-		{
-			name:    "foo",
-			variant: "android_arm_armv7-a-neon_static_asan_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo/android_arm_armv7-a-neon_static_asan_apex28/foo.a",
-			},
-		},
-		{
-			name:    "foo",
-			variant: "android_arm64_armv8-a_static_hwasan_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo/android_arm64_armv8-a_static_hwasan_apex28/foo.a",
-			},
-		},
-		{
-			name:    "foo",
-			variant: "android_arm64_armv8-a_static_fuzzer_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo/android_arm64_armv8-a_static_fuzzer_apex28/foo.a",
-			},
-		},
-		{
-			name:    "foo",
-			variant: "android_arm_armv7-a-neon_static_asan_fuzzer_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo/android_arm_armv7-a-neon_static_asan_fuzzer_apex28/foo.a",
-			},
-		},
-		{
-			name:    "foo",
-			variant: "android_arm64_armv8-a_static_hwasan_fuzzer_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo/android_arm64_armv8-a_static_hwasan_fuzzer_apex28/foo.a",
-			},
-		},
-		{
-			name:    "foo",
-			variant: "android_arm64_armv8-a_static_scs_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo/android_arm64_armv8-a_static_scs_apex28/foo.a",
-			},
-		},
-		{
-			name:    "foo",
-			variant: "android_arm64_armv8-a_static_hwasan_scs_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo/android_arm64_armv8-a_static_hwasan_scs_apex28/foo.a",
-			},
-		},
-		{
-			name:    "foo",
-			variant: "android_arm64_armv8-a_static_hwasan_scs_fuzzer_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo/android_arm64_armv8-a_static_hwasan_scs_fuzzer_apex28/foo.a",
-			},
-		},
-		{
-			name:    "foo_tsan",
-			variant: "android_arm64_armv8-a_static_apex28",
-			expectedOutputPaths: []string{
-				"outputbase/execroot/__main__/foo_tsan.a",
-			},
-		},
-		{
-			name:    "foo_tsan",
-			variant: "android_arm64_armv8-a_static_tsan_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo_tsan/android_arm64_armv8-a_static_tsan_apex28/foo_tsan.a",
-			},
-		},
-		{
-			name:    "foo_cfi",
-			variant: "android_arm64_armv8-a_static_apex28",
-			expectedOutputPaths: []string{
-				"outputbase/execroot/__main__/foo_cfi.a",
-			},
-		},
-		{
-			name:    "foo_cfi",
-			variant: "android_arm64_armv8-a_static_cfi_apex28",
-			expectedOutputPaths: []string{
-				"outputbase/execroot/__main__/foo_cfi.a",
-			},
-		},
-		{
-			name:    "foo_memtag_stack",
-			variant: "android_arm64_armv8-a_static_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo_memtag_stack/android_arm64_armv8-a_static_apex28/foo_memtag_stack.a",
-			},
-		},
-		{
-			name:    "foo_memtag_heap",
-			variant: "android_arm64_armv8-a_static_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo_memtag_heap/android_arm64_armv8-a_static_apex28/foo_memtag_heap.a",
-			},
-		},
-		{
-			name:    "foo_safestack",
-			variant: "android_arm64_armv8-a_static_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo_safestack/android_arm64_armv8-a_static_apex28/foo_safestack.a",
-			},
-		},
-		{
-			name:    "foo_scudo",
-			variant: "android_arm64_armv8-a_static_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo_scudo/android_arm64_armv8-a_static_apex28/foo_scudo.a",
-			},
-		},
-	}
-
-	ctx := android.GroupFixturePreparers(
-		prepareForCcTest,
-		prepareForAsanTest,
-		android.FixtureRegisterWithContext(registerTestMutators),
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: "outputbase",
-				LabelToCcInfo: map[string]cquery.CcInfo{
-					"//foo_ubsan_minimal": {
-						RootStaticArchives: []string{"foo_ubsan_minimal.a"},
-					},
-					"//foo": {
-						RootStaticArchives: []string{"foo.a"},
-					},
-					"//foo_tsan": {
-						RootStaticArchives: []string{"foo_tsan.a"},
-					},
-					"//foo_cfi": {
-						RootStaticArchives: []string{"foo_cfi.a"},
-					},
-					"//foo_memtag_stack": {
-						RootStaticArchives: []string{"INVALID_ARCHIVE.a"},
-					},
-					"//foo_memtag_heap": {
-						RootStaticArchives: []string{"INVALID_ARCHIVE.a"},
-					},
-					"//foo_safestack": {
-						RootStaticArchives: []string{"INVALID_ARCHIVE.a"},
-					},
-					"//foo_scudo": {
-						RootStaticArchives: []string{"INVALID_ARCHIVE.a"},
-					},
-				},
-			}
-		}),
-	).RunTestWithBp(t, bp).TestContext
-
-	for _, tc := range testcases {
-		fooMod := ctx.ModuleForTests(tc.name, tc.variant).Module()
-		outputFiles, err := fooMod.(android.OutputFileProducer).OutputFiles("")
-		if err != nil {
-			t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-		}
-		android.AssertPathsRelativeToTopEquals(t, "output files", tc.expectedOutputPaths, outputFiles)
+	if !strings.HasSuffix(outputFile.Strings()[0], "/stripped_all/test_lib.so") {
+		t.Errorf("Unexpected output file: %s", outputFile.Strings()[0])
+		return
 	}
 }
diff --git a/cc/compiler.go b/cc/compiler.go
index 490d3cc..c9de1b0 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -406,6 +406,15 @@
 		flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_VNDK__")
 		if ctx.inVendor() {
 			flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_VENDOR__")
+
+			vendorApiLevel := ctx.Config().VendorApiLevel()
+			if vendorApiLevel == "" {
+				// TODO(b/314036847): This is a fallback for UDC targets.
+				// This must be a build failure when UDC is no longer built
+				// from this source tree.
+				vendorApiLevel = ctx.Config().PlatformSdkVersion().String()
+			}
+			flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_VENDOR_API__="+vendorApiLevel)
 		} else if ctx.inProduct() {
 			flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_PRODUCT__")
 		}
@@ -470,7 +479,7 @@
 			target += strconv.Itoa(android.FutureApiLevelInt)
 		} else {
 			apiLevel := nativeApiLevelOrPanic(ctx, version)
-			target += apiLevel.String()
+			target += strconv.Itoa(apiLevel.FinalOrFutureInt())
 		}
 	}
 
diff --git a/cc/config/arm64_device.go b/cc/config/arm64_device.go
index 12722a7..82beb29 100644
--- a/cc/config/arm64_device.go
+++ b/cc/config/arm64_device.go
@@ -103,7 +103,7 @@
 	exportedVars.ExportStringList("Arm64Cflags", arm64Cflags)
 	pctx.VariableFunc("Arm64Cflags", func(ctx android.PackageVarContext) string {
 		flags := arm64Cflags
-		if ctx.Config().PageSizeAgnostic() {
+		if ctx.Config().NoBionicPageSizeMacro() {
 			flags = append(flags, "-D__BIONIC_NO_PAGE_SIZE_MACRO")
 		}
 		return strings.Join(flags, " ")
diff --git a/cc/config/global.go b/cc/config/global.go
index 2ca9df9..85ebd60 100644
--- a/cc/config/global.go
+++ b/cc/config/global.go
@@ -357,9 +357,9 @@
 	}
 
 	CStdVersion               = "gnu17"
-	CppStdVersion             = "gnu++17"
+	CppStdVersion             = "gnu++20"
 	ExperimentalCStdVersion   = "gnu2x"
-	ExperimentalCppStdVersion = "gnu++2a"
+	ExperimentalCppStdVersion = "gnu++2b"
 
 	// prebuilts/clang default settings.
 	ClangDefaultBase         = "prebuilts/clang/host"
@@ -378,12 +378,6 @@
 	VisibilityDefaultFlag = "-fvisibility=default"
 )
 
-// BazelCcToolchainVars generates bzl file content containing variables for
-// Bazel's cc_toolchain configuration.
-func BazelCcToolchainVars(config android.Config) string {
-	return android.BazelToolchainVars(config, exportedVars)
-}
-
 func ExportStringList(name string, value []string) {
 	exportedVars.ExportStringList(name, value)
 }
diff --git a/cc/config/riscv64_device.go b/cc/config/riscv64_device.go
index d5bc760..0964015 100644
--- a/cc/config/riscv64_device.go
+++ b/cc/config/riscv64_device.go
@@ -25,7 +25,6 @@
 	riscv64Cflags = []string{
 		// Help catch common 32/64-bit errors.
 		"-Werror=implicit-function-declaration",
-		"-fno-emulated-tls",
 		"-march=rv64gcv_zba_zbb_zbs",
 		// Equivalent to "-munaligned-access", but our clang doesn't have that yet.
 		"-Xclang -target-feature -Xclang +unaligned-scalar-mem",
@@ -40,11 +39,13 @@
 		// Equivalent to "-munaligned-access", but our clang doesn't have that yet.
 		"-Xclang -target-feature -Xclang +unaligned-scalar-mem",
 		"-Xclang -target-feature -Xclang +unaligned-vector-mem",
+		// We should change the default for this in clang, but for now...
+		// (https://github.com/google/android-riscv64/issues/124)
+		"-mllvm -jump-is-expensive=false",
 	}
 
 	riscv64Lldflags = append(riscv64Ldflags,
 		"-Wl,-z,max-page-size=4096",
-		"-Wl,-plugin-opt,-emulated-tls=0",
 	)
 
 	riscv64Cppflags = []string{}
diff --git a/cc/config/x86_64_device.go b/cc/config/x86_64_device.go
index 00a395f..e43848c 100644
--- a/cc/config/x86_64_device.go
+++ b/cc/config/x86_64_device.go
@@ -107,7 +107,7 @@
 	exportedVars.ExportStringList("X86_64Cflags", x86_64Cflags)
 	pctx.VariableFunc("X86_64Cflags", func(ctx android.PackageVarContext) string {
 		flags := x86_64Cflags
-		if ctx.Config().PageSizeAgnostic() {
+		if ctx.Config().NoBionicPageSizeMacro() {
 			flags = append(flags, "-D__BIONIC_NO_PAGE_SIZE_MACRO")
 		}
 		return strings.Join(flags, " ")
diff --git a/cc/fdo_profile.go b/cc/fdo_profile.go
index cd3eb1e..02f68b5 100644
--- a/cc/fdo_profile.go
+++ b/cc/fdo_profile.go
@@ -16,10 +16,7 @@
 
 import (
 	"android/soong/android"
-	"android/soong/bazel"
-
 	"github.com/google/blueprint"
-	"github.com/google/blueprint/proptools"
 )
 
 func init() {
@@ -32,7 +29,6 @@
 
 type fdoProfile struct {
 	android.ModuleBase
-	android.BazelModuleBase
 
 	properties fdoProfileProperties
 }
@@ -41,50 +37,6 @@
 	Profile *string `android:"arch_variant"`
 }
 
-type bazelFdoProfileAttributes struct {
-	Profile bazel.StringAttribute
-}
-
-func (fp *fdoProfile) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	var profileAttr bazel.StringAttribute
-
-	archVariantProps := fp.GetArchVariantProperties(ctx, &fdoProfileProperties{})
-	for axis, configToProps := range archVariantProps {
-		for config, _props := range configToProps {
-			if archProps, ok := _props.(*fdoProfileProperties); ok {
-				if axis.String() == "arch" || axis.String() == "no_config" {
-					if archProps.Profile != nil {
-						profileAttr.SetSelectValue(axis, config, archProps.Profile)
-					}
-				}
-			}
-		}
-	}
-
-	// Ideally, cc_library_shared's fdo_profile attr can be a select statement so that we
-	// don't lift the restriction here. However, in cc_library_shared macro, fdo_profile
-	// is used as a string, we need to temporarily lift the host restriction until we can
-	// pass use fdo_profile attr with select statement
-	// https://cs.android.com/android/platform/superproject/+/master:build/bazel/rules/cc/cc_library_shared.bzl;l=127;drc=cc01bdfd39857eddbab04ef69ab6db22dcb1858a
-	// TODO(b/276287371): Drop the restriction override after fdo_profile path is handled properly
-	var noRestriction bazel.BoolAttribute
-	noRestriction.SetSelectValue(bazel.NoConfigAxis, "", proptools.BoolPtr(true))
-
-	ctx.CreateBazelTargetModuleWithRestrictions(
-		bazel.BazelTargetModuleProperties{
-			Bzl_load_location: "//build/bazel/rules/fdo:fdo_profile.bzl",
-			Rule_class:        "fdo_profile",
-		},
-		android.CommonAttributes{
-			Name: fp.Name(),
-		},
-		&bazelFdoProfileAttributes{
-			Profile: profileAttr,
-		},
-		noRestriction,
-	)
-}
-
 // FdoProfileInfo is provided by FdoProfileProvider
 type FdoProfileInfo struct {
 	Path android.Path
@@ -128,6 +80,5 @@
 	m := &fdoProfile{}
 	m.AddProperties(&m.properties)
 	android.InitAndroidMultiTargetsArchModule(m, android.DeviceSupported, android.MultilibBoth)
-	android.InitBazelModule(m)
 	return m
 }
diff --git a/cc/fuzz.go b/cc/fuzz.go
index 8fc4898..6b3a739 100644
--- a/cc/fuzz.go
+++ b/cc/fuzz.go
@@ -106,6 +106,7 @@
 	fuzzPackagedModule  fuzz.FuzzPackagedModule
 	installedSharedDeps []string
 	sharedLibraries     android.RuleBuilderInstalls
+	data                []android.DataPath
 }
 
 func (fuzz *fuzzBinary) fuzzBinary() bool {
@@ -231,16 +232,10 @@
 }
 
 func (fuzzBin *fuzzBinary) install(ctx ModuleContext, file android.Path) {
-	installBase := "fuzz"
-
-	fuzzBin.binaryDecorator.baseInstaller.dir = filepath.Join(
-		installBase, ctx.Target().Arch.ArchType.String(), ctx.ModuleName())
-	fuzzBin.binaryDecorator.baseInstaller.dir64 = filepath.Join(
-		installBase, ctx.Target().Arch.ArchType.String(), ctx.ModuleName())
-	fuzzBin.binaryDecorator.baseInstaller.install(ctx, file)
-
 	fuzzBin.fuzzPackagedModule = PackageFuzzModule(ctx, fuzzBin.fuzzPackagedModule, pctx)
 
+	installBase := "fuzz"
+
 	// Grab the list of required shared libraries.
 	fuzzBin.sharedLibraries, _ = CollectAllSharedDependencies(ctx)
 
@@ -256,34 +251,35 @@
 				SharedLibrarySymbolsInstallLocation(install, installBase, ctx.Arch().ArchType.String()))
 		}
 	}
+
+	for _, d := range fuzzBin.fuzzPackagedModule.Corpus {
+		fuzzBin.data = append(fuzzBin.data, android.DataPath{SrcPath: d, RelativeInstallPath: "corpus", WithoutRel: true})
+	}
+
+	for _, d := range fuzzBin.fuzzPackagedModule.Data {
+		fuzzBin.data = append(fuzzBin.data, android.DataPath{SrcPath: d, RelativeInstallPath: "data"})
+	}
+
+	if d := fuzzBin.fuzzPackagedModule.Dictionary; d != nil {
+		fuzzBin.data = append(fuzzBin.data, android.DataPath{SrcPath: d, WithoutRel: true})
+	}
+
+	if d := fuzzBin.fuzzPackagedModule.Config; d != nil {
+		fuzzBin.data = append(fuzzBin.data, android.DataPath{SrcPath: d, WithoutRel: true})
+	}
+
+	fuzzBin.binaryDecorator.baseInstaller.dir = filepath.Join(
+		installBase, ctx.Target().Arch.ArchType.String(), ctx.ModuleName())
+	fuzzBin.binaryDecorator.baseInstaller.dir64 = filepath.Join(
+		installBase, ctx.Target().Arch.ArchType.String(), ctx.ModuleName())
+	fuzzBin.binaryDecorator.baseInstaller.installTestData(ctx, fuzzBin.data)
+	fuzzBin.binaryDecorator.baseInstaller.install(ctx, file)
 }
 
 func PackageFuzzModule(ctx android.ModuleContext, fuzzPackagedModule fuzz.FuzzPackagedModule, pctx android.PackageContext) fuzz.FuzzPackagedModule {
 	fuzzPackagedModule.Corpus = android.PathsForModuleSrc(ctx, fuzzPackagedModule.FuzzProperties.Corpus)
-	intermediateDir := android.PathForModuleOut(ctx, "corpus")
-
-	// Create one rule per file to avoid MAX_ARG_STRLEN hardlimit.
-	for _, entry := range fuzzPackagedModule.Corpus {
-		ctx.Build(pctx, android.BuildParams{
-			Rule:   android.Cp,
-			Output: intermediateDir.Join(ctx, entry.Base()),
-			Input:  entry,
-		})
-	}
-	fuzzPackagedModule.CorpusIntermediateDir = intermediateDir
 
 	fuzzPackagedModule.Data = android.PathsForModuleSrc(ctx, fuzzPackagedModule.FuzzProperties.Data)
-	intermediateDir = android.PathForModuleOut(ctx, "data")
-
-	// Create one rule per file to avoid MAX_ARG_STRLEN hardlimit.
-	for _, entry := range fuzzPackagedModule.Data {
-		ctx.Build(pctx, android.BuildParams{
-			Rule:   android.Cp,
-			Output: intermediateDir.Join(ctx, entry.Rel()),
-			Input:  entry,
-		})
-	}
-	fuzzPackagedModule.DataIntermediateDir = intermediateDir
 
 	if fuzzPackagedModule.FuzzProperties.Dictionary != nil {
 		fuzzPackagedModule.Dictionary = android.PathForModuleSrc(ctx, *fuzzPackagedModule.FuzzProperties.Dictionary)
@@ -303,7 +299,7 @@
 }
 
 func NewFuzzer(hod android.HostOrDeviceSupported) *Module {
-	module, binary := newBinary(hod, false)
+	module, binary := newBinary(hod)
 	baseInstallerPath := "fuzz"
 
 	binary.baseInstaller = NewBaseInstaller(baseInstallerPath, baseInstallerPath, InstallInData)
diff --git a/cc/gen.go b/cc/gen.go
index 151f23d..2e72e30 100644
--- a/cc/gen.go
+++ b/cc/gen.go
@@ -19,9 +19,6 @@
 	"strings"
 
 	"android/soong/aidl_library"
-	"android/soong/bazel"
-	"android/soong/sysprop/bp2build"
-
 	"github.com/google/blueprint"
 
 	"android/soong/android"
@@ -181,41 +178,6 @@
 	})
 }
 
-type LexAttrs struct {
-	Srcs    bazel.LabelListAttribute
-	Lexopts bazel.StringListAttribute
-}
-
-type LexNames struct {
-	cSrcName bazel.LabelAttribute
-	srcName  bazel.LabelAttribute
-}
-
-func bp2BuildLex(ctx android.Bp2buildMutatorContext, moduleName string, ca compilerAttributes) LexNames {
-	names := LexNames{}
-	if !ca.lSrcs.IsEmpty() {
-		names.cSrcName = createLexTargetModule(ctx, moduleName+"_genlex_l", ca.lSrcs, ca.lexopts)
-	}
-	if !ca.llSrcs.IsEmpty() {
-		names.srcName = createLexTargetModule(ctx, moduleName+"_genlex_ll", ca.llSrcs, ca.lexopts)
-	}
-	return names
-}
-
-func createLexTargetModule(ctx android.Bp2buildMutatorContext, name string, srcs bazel.LabelListAttribute, opts bazel.StringListAttribute) bazel.LabelAttribute {
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "genlex",
-			Bzl_load_location: "//build/bazel/rules/cc:flex.bzl",
-		},
-		android.CommonAttributes{Name: name},
-		&LexAttrs{
-			Srcs:    srcs,
-			Lexopts: opts,
-		})
-	return bazel.LabelAttribute{Value: &bazel.Label{Label: ":" + name}}
-}
-
 func genSysprop(ctx android.ModuleContext, syspropFile android.Path) (android.Path, android.Paths) {
 	headerFile := android.PathForModuleGen(ctx, "sysprop", "include", syspropFile.Rel()+".h")
 	publicHeaderFile := android.PathForModuleGen(ctx, "sysprop/public", "include", syspropFile.Rel()+".h")
@@ -240,35 +202,6 @@
 	return cppFile, headers.Paths()
 }
 
-func bp2buildCcSysprop(ctx android.Bp2buildMutatorContext, moduleName string, minSdkVersion *string, srcs bazel.LabelListAttribute) *bazel.LabelAttribute {
-	labels := bp2build.SyspropLibraryLabels{
-		SyspropLibraryLabel:  moduleName + "_sysprop_library",
-		CcStaticLibraryLabel: moduleName + "_cc_sysprop_library_static",
-	}
-	bp2build.Bp2buildBaseSyspropLibrary(ctx, labels.SyspropLibraryLabel, srcs)
-	bp2build.Bp2buildSyspropCc(ctx, labels, minSdkVersion)
-	return createLabelAttributeCorrespondingToSrcs(":"+labels.CcStaticLibraryLabel, srcs)
-}
-
-// Creates a LabelAttribute for a given label where the value is only set for
-// the same config values that have values in a given LabelListAttribute
-func createLabelAttributeCorrespondingToSrcs(baseLabelName string, srcs bazel.LabelListAttribute) *bazel.LabelAttribute {
-	baseLabel := bazel.Label{Label: baseLabelName}
-	label := bazel.LabelAttribute{}
-	if !srcs.Value.IsNil() && !srcs.Value.IsEmpty() {
-		label.Value = &baseLabel
-		return &label
-	}
-	for axis, configToSrcs := range srcs.ConfigurableValues {
-		for config, val := range configToSrcs {
-			if !val.IsNil() && !val.IsEmpty() {
-				label.SetSelectValue(axis, config, baseLabel)
-			}
-		}
-	}
-	return &label
-}
-
 // Used to communicate information from the genSources method back to the library code that uses
 // it.
 type generatedSourceInfo struct {
diff --git a/cc/gen_test.go b/cc/gen_test.go
index 85df333..439f0a9 100644
--- a/cc/gen_test.go
+++ b/cc/gen_test.go
@@ -67,7 +67,7 @@
 			t.Errorf("missing aidl includes in global flags")
 		}
 
-		aidlCommand := android.RuleBuilderSboxProtoForTests(t, aidlManifest).Commands[0].GetCommand()
+		aidlCommand := android.RuleBuilderSboxProtoForTests(t, ctx, aidlManifest).Commands[0].GetCommand()
 		if !strings.Contains(aidlCommand, "-Isub") {
 			t.Errorf("aidl command for c.aidl should contain \"-Isub\", but was %q", aidlCommand)
 		}
diff --git a/cc/generated_cc_library.go b/cc/generated_cc_library.go
index 8428e94..b1084e4 100644
--- a/cc/generated_cc_library.go
+++ b/cc/generated_cc_library.go
@@ -28,9 +28,6 @@
 		staticAndSharedLibrarySdkMemberType,
 	}
 
-	module.bazelable = true
-	module.bazelHandler = &ccLibraryBazelHandler{module: module}
-
 	module.generators = append(module.generators, callbacks)
 
 	return module.Init()
diff --git a/cc/genrule.go b/cc/genrule.go
index 63c728c..0c06ae6 100644
--- a/cc/genrule.go
+++ b/cc/genrule.go
@@ -62,7 +62,6 @@
 	android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibBoth)
 
 	android.InitApexModule(module)
-	android.InitBazelModule(module)
 
 	return module
 }
diff --git a/cc/genrule_test.go b/cc/genrule_test.go
index 0d16e62..9295244 100644
--- a/cc/genrule_test.go
+++ b/cc/genrule_test.go
@@ -178,7 +178,7 @@
 				android.OptionalFixturePreparer(tt.preparer),
 			).RunTestWithBp(t, bp)
 			gen := result.ModuleForTests("gen", tt.variant)
-			sboxProto := android.RuleBuilderSboxProtoForTests(t, gen.Output("genrule.sbox.textproto"))
+			sboxProto := android.RuleBuilderSboxProtoForTests(t, result.TestContext, gen.Output("genrule.sbox.textproto"))
 			cmd := *sboxProto.Commands[0].Command
 			android.AssertStringDoesContain(t, "incorrect CC_ARCH", cmd, "CC_ARCH="+tt.arch+" ")
 			android.AssertStringDoesContain(t, "incorrect CC_NATIVE_BRIDGE", cmd, "CC_NATIVE_BRIDGE="+tt.nativeBridge+" ")
diff --git a/cc/image.go b/cc/image.go
index 239f1db..4f36111 100644
--- a/cc/image.go
+++ b/cc/image.go
@@ -23,6 +23,8 @@
 
 	"android/soong/android"
 	"android/soong/snapshot"
+
+	"github.com/google/blueprint/proptools"
 )
 
 var _ android.ImageInterface = (*Module)(nil)
@@ -622,6 +624,10 @@
 
 		lib.baseCompiler.Properties.Exclude_generated_sources = append(lib.baseCompiler.Properties.Exclude_generated_sources,
 			lib.baseCompiler.Properties.Target.Vendor.Exclude_generated_sources...)
+
+		if lib.Properties.Target.Vendor.No_stubs {
+			proptools.Clear(&lib.Properties.Stubs)
+		}
 	}
 }
 
@@ -635,6 +641,10 @@
 
 		lib.baseCompiler.Properties.Exclude_generated_sources = append(lib.baseCompiler.Properties.Exclude_generated_sources,
 			lib.baseCompiler.Properties.Target.Product.Exclude_generated_sources...)
+
+		if lib.Properties.Target.Product.No_stubs {
+			proptools.Clear(&lib.Properties.Stubs)
+		}
 	}
 }
 
diff --git a/cc/installer.go b/cc/installer.go
index e2c0e7b..a0b6295 100644
--- a/cc/installer.go
+++ b/cc/installer.go
@@ -59,6 +59,8 @@
 	relative string
 	location installLocation
 
+	installDeps android.InstallPaths
+
 	path android.InstallPath
 }
 
@@ -97,7 +99,12 @@
 }
 
 func (installer *baseInstaller) install(ctx ModuleContext, file android.Path) {
-	installer.path = ctx.InstallFile(installer.installDir(ctx), file.Base(), file)
+	installer.path = ctx.InstallFile(installer.installDir(ctx), file.Base(), file, installer.installDeps...)
+}
+
+func (installer *baseInstaller) installTestData(ctx ModuleContext, data []android.DataPath) {
+	installedData := ctx.InstallTestData(installer.installDir(ctx), data)
+	installer.installDeps = append(installer.installDeps, installedData...)
 }
 
 func (installer *baseInstaller) everInstallable() bool {
diff --git a/cc/library.go b/cc/library.go
index d22bcec..4d5a254 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -24,28 +24,11 @@
 	"sync"
 
 	"android/soong/android"
-	"android/soong/bazel"
-	"android/soong/bazel/cquery"
-
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/pathtools"
 	"github.com/google/blueprint/proptools"
 )
 
-var (
-	alwaysLinkLibraries = map[string]bool{
-		// Coverage libraries are _always_ added as a whole_static_dep. By converting as these as
-		// alwayslink = True, we can add these as to deps (e.g. as a regular static dep) in Bazel
-		// without any extra complications in cc_shared_library roots to prevent linking the same
-		// library repeatedly.
-		"libprofile-extras_ndk":               true,
-		"libprofile-extras":                   true,
-		"libprofile-clang-extras_ndk":         true,
-		"libprofile-clang-extras_cfi_support": true,
-		"libprofile-clang-extras":             true,
-	}
-)
-
 // LibraryProperties is a collection of properties shared by cc library rules/cc.
 type LibraryProperties struct {
 	// local file name to pass to the linker as -unexported_symbols_list
@@ -107,6 +90,13 @@
 			Suffix *string `android:"arch_variant"`
 
 			Header_abi_checker headerAbiCheckerProperties
+
+			// Disable stubs for vendor/product variants
+			// This is a workaround to keep `stubs` only for "core" variant (not product/vendor).
+			// It would be nice if we could put `stubs` into a `target: { core: {} }`
+			// block but it's not supported in soong yet. This could be removed/simplified once we have
+			// a better syntax.
+			No_stubs bool
 		}
 
 		Platform struct {
@@ -228,336 +218,6 @@
 	ctx.RegisterModuleType("cc_library_host_shared", LibraryHostSharedFactory)
 }
 
-// TODO(b/199902614): Can this be factored to share with the other Attributes?
-// For bp2build conversion.
-type bazelCcLibraryAttributes struct {
-	// Attributes pertaining to both static and shared variants.
-	Srcs    bazel.LabelListAttribute
-	Srcs_c  bazel.LabelListAttribute
-	Srcs_as bazel.LabelListAttribute
-
-	Copts      bazel.StringListAttribute
-	Cppflags   bazel.StringListAttribute
-	Conlyflags bazel.StringListAttribute
-	Asflags    bazel.StringListAttribute
-
-	Hdrs bazel.LabelListAttribute
-
-	Deps                              bazel.LabelListAttribute
-	Implementation_deps               bazel.LabelListAttribute
-	Dynamic_deps                      bazel.LabelListAttribute
-	Implementation_dynamic_deps       bazel.LabelListAttribute
-	Whole_archive_deps                bazel.LabelListAttribute
-	Implementation_whole_archive_deps bazel.LabelListAttribute
-	System_dynamic_deps               bazel.LabelListAttribute
-
-	Export_includes        bazel.StringListAttribute
-	Export_system_includes bazel.StringListAttribute
-	Local_includes         bazel.StringListAttribute
-	Absolute_includes      bazel.StringListAttribute
-	Linkopts               bazel.StringListAttribute
-	Rtti                   bazel.BoolAttribute
-
-	Stl     *string
-	Cpp_std *string
-	C_std   *string
-
-	// This is shared only.
-	Additional_linker_inputs bazel.LabelListAttribute
-
-	// Common properties shared between both shared and static variants.
-	Shared staticOrSharedAttributes
-	Static staticOrSharedAttributes
-
-	Strip stripAttributes
-
-	Features bazel.StringListAttribute
-}
-
-type aidlLibraryAttributes struct {
-	Srcs        bazel.LabelListAttribute
-	Include_dir *string
-	Tags        bazel.StringListAttribute
-}
-
-type ccAidlLibraryAttributes struct {
-	Deps                        bazel.LabelListAttribute
-	Implementation_deps         bazel.LabelListAttribute
-	Implementation_dynamic_deps bazel.LabelListAttribute
-	Tags                        bazel.StringListAttribute
-
-	SdkAttributes
-	includesAttributes
-}
-
-type stripAttributes struct {
-	Keep_symbols                 bazel.BoolAttribute
-	Keep_symbols_and_debug_frame bazel.BoolAttribute
-	Keep_symbols_list            bazel.StringListAttribute
-	All                          bazel.BoolAttribute
-	None                         bazel.BoolAttribute
-}
-
-func stripAttrsFromLinkerAttrs(la *linkerAttributes) stripAttributes {
-	return stripAttributes{
-		Keep_symbols:                 la.stripKeepSymbols,
-		Keep_symbols_and_debug_frame: la.stripKeepSymbolsAndDebugFrame,
-		Keep_symbols_list:            la.stripKeepSymbolsList,
-		All:                          la.stripAll,
-		None:                         la.stripNone,
-	}
-}
-
-func libraryBp2Build(ctx android.Bp2buildMutatorContext, m *Module) {
-	sharedAttrs := bp2BuildParseSharedProps(ctx, m)
-	staticAttrs := bp2BuildParseStaticProps(ctx, m)
-	baseAttributes := bp2BuildParseBaseProps(ctx, m)
-	compilerAttrs := baseAttributes.compilerAttributes
-	linkerAttrs := baseAttributes.linkerAttributes
-	exportedIncludes := bp2BuildParseExportedIncludes(ctx, m, &compilerAttrs.includes)
-
-	srcs := compilerAttrs.srcs
-
-	sharedAttrs.Dynamic_deps.Add(baseAttributes.protoDependency)
-	staticAttrs.Deps.Add(baseAttributes.protoDependency)
-
-	asFlags := compilerAttrs.asFlags
-	if compilerAttrs.asSrcs.IsEmpty() && sharedAttrs.Srcs_as.IsEmpty() && staticAttrs.Srcs_as.IsEmpty() {
-		// Skip asflags for BUILD file simplicity if there are no assembly sources.
-		asFlags = bazel.MakeStringListAttribute(nil)
-	}
-
-	sharedFeatures := baseAttributes.features.Clone().Append(sharedAttrs.Features)
-	sharedFeatures.DeduplicateAxesFromBase()
-	staticFeatures := baseAttributes.features.Clone().Append(staticAttrs.Features)
-	staticFeatures.DeduplicateAxesFromBase()
-
-	staticCommonAttrs := staticOrSharedAttributes{
-		Srcs:    *srcs.Clone().Append(staticAttrs.Srcs),
-		Srcs_c:  *compilerAttrs.cSrcs.Clone().Append(staticAttrs.Srcs_c),
-		Srcs_as: *compilerAttrs.asSrcs.Clone().Append(staticAttrs.Srcs_as),
-		Copts:   *compilerAttrs.copts.Clone().Append(staticAttrs.Copts),
-		Hdrs:    *compilerAttrs.hdrs.Clone().Append(staticAttrs.Hdrs),
-
-		Deps:                              *linkerAttrs.deps.Clone().Append(staticAttrs.Deps),
-		Implementation_deps:               *linkerAttrs.implementationDeps.Clone().Append(staticAttrs.Implementation_deps),
-		Dynamic_deps:                      *linkerAttrs.dynamicDeps.Clone().Append(staticAttrs.Dynamic_deps),
-		Implementation_dynamic_deps:       *linkerAttrs.implementationDynamicDeps.Clone().Append(staticAttrs.Implementation_dynamic_deps),
-		Implementation_whole_archive_deps: linkerAttrs.implementationWholeArchiveDeps,
-		Whole_archive_deps:                *linkerAttrs.wholeArchiveDeps.Clone().Append(staticAttrs.Whole_archive_deps),
-		System_dynamic_deps:               *linkerAttrs.systemDynamicDeps.Clone().Append(staticAttrs.System_dynamic_deps),
-		Runtime_deps:                      linkerAttrs.runtimeDeps,
-		SdkAttributes:                     Bp2BuildParseSdkAttributes(m),
-		Native_coverage:                   baseAttributes.Native_coverage,
-		Additional_compiler_inputs:        compilerAttrs.additionalCompilerInputs,
-	}
-
-	includeAttrs := includesAttributes{
-		Export_includes:          exportedIncludes.Includes,
-		Export_absolute_includes: exportedIncludes.AbsoluteIncludes,
-		Export_system_includes:   exportedIncludes.SystemIncludes,
-		Local_includes:           compilerAttrs.localIncludes,
-		Absolute_includes:        compilerAttrs.absoluteIncludes,
-	}
-
-	sharedCommonAttrs := staticOrSharedAttributes{
-		Srcs:    *srcs.Clone().Append(sharedAttrs.Srcs),
-		Srcs_c:  *compilerAttrs.cSrcs.Clone().Append(sharedAttrs.Srcs_c),
-		Srcs_as: *compilerAttrs.asSrcs.Clone().Append(sharedAttrs.Srcs_as),
-		Copts:   *compilerAttrs.copts.Clone().Append(sharedAttrs.Copts),
-		Hdrs:    *compilerAttrs.hdrs.Clone().Append(sharedAttrs.Hdrs),
-
-		Deps:                              *linkerAttrs.deps.Clone().Append(sharedAttrs.Deps),
-		Implementation_deps:               *linkerAttrs.implementationDeps.Clone().Append(sharedAttrs.Implementation_deps),
-		Dynamic_deps:                      *linkerAttrs.dynamicDeps.Clone().Append(sharedAttrs.Dynamic_deps),
-		Implementation_dynamic_deps:       *linkerAttrs.implementationDynamicDeps.Clone().Append(sharedAttrs.Implementation_dynamic_deps),
-		Whole_archive_deps:                *linkerAttrs.wholeArchiveDeps.Clone().Append(sharedAttrs.Whole_archive_deps),
-		Implementation_whole_archive_deps: linkerAttrs.implementationWholeArchiveDeps,
-		System_dynamic_deps:               *linkerAttrs.systemDynamicDeps.Clone().Append(sharedAttrs.System_dynamic_deps),
-		Runtime_deps:                      linkerAttrs.runtimeDeps,
-		SdkAttributes:                     Bp2BuildParseSdkAttributes(m),
-		Native_coverage:                   baseAttributes.Native_coverage,
-		Additional_compiler_inputs:        compilerAttrs.additionalCompilerInputs,
-	}
-
-	staticTargetAttrs := &bazelCcLibraryStaticAttributes{
-		staticOrSharedAttributes: staticCommonAttrs,
-		includesAttributes:       includeAttrs,
-
-		Cppflags:   compilerAttrs.cppFlags,
-		Conlyflags: compilerAttrs.conlyFlags,
-		Asflags:    asFlags,
-
-		Rtti:    compilerAttrs.rtti,
-		Stl:     compilerAttrs.stl,
-		Cpp_std: compilerAttrs.cppStd,
-		C_std:   compilerAttrs.cStd,
-
-		Features: *staticFeatures,
-	}
-
-	sharedTargetAttrs := &bazelCcLibrarySharedAttributes{
-		staticOrSharedAttributes: sharedCommonAttrs,
-		includesAttributes:       includeAttrs,
-
-		Cppflags:   compilerAttrs.cppFlags,
-		Conlyflags: compilerAttrs.conlyFlags,
-		Asflags:    asFlags,
-
-		Linkopts:        linkerAttrs.linkopts,
-		Rtti:            compilerAttrs.rtti,
-		Stl:             compilerAttrs.stl,
-		Cpp_std:         compilerAttrs.cppStd,
-		C_std:           compilerAttrs.cStd,
-		Use_version_lib: linkerAttrs.useVersionLib,
-
-		Additional_linker_inputs: linkerAttrs.additionalLinkerInputs,
-
-		Strip:                             stripAttrsFromLinkerAttrs(&linkerAttrs),
-		Features:                          *sharedFeatures,
-		bazelCcHeaderAbiCheckerAttributes: bp2buildParseAbiCheckerProps(ctx, m),
-
-		Fdo_profile: compilerAttrs.fdoProfile,
-	}
-
-	if compilerAttrs.stubsSymbolFile != nil && len(compilerAttrs.stubsVersions.Value) > 0 {
-		sharedTargetAttrs.Stubs_symbol_file = compilerAttrs.stubsSymbolFile
-	}
-
-	sharedTargetAttrs.Stem = compilerAttrs.stem
-	sharedTargetAttrs.Suffix = compilerAttrs.suffix
-
-	for axis, configToProps := range m.GetArchVariantProperties(ctx, &LibraryProperties{}) {
-		for cfg, props := range configToProps {
-			if props, ok := props.(*LibraryProperties); ok {
-				if props.Inject_bssl_hash != nil {
-					// This is an edge case applies only to libcrypto
-					if m.Name() == "libcrypto" || m.Name() == "libcrypto_for_testing" {
-						sharedTargetAttrs.Inject_bssl_hash.SetSelectValue(axis, cfg, props.Inject_bssl_hash)
-					} else {
-						ctx.PropertyErrorf("inject_bssl_hash", "only applies to libcrypto")
-					}
-				}
-			}
-		}
-	}
-
-	staticProps := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_library_static",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_library_static.bzl",
-	}
-	sharedProps := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_library_shared",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_library_shared.bzl",
-	}
-
-	if _, ok := alwaysLinkLibraries[m.Name()]; ok {
-		staticTargetAttrs.Alwayslink = proptools.BoolPtr(true)
-	}
-
-	var tagsForStaticVariant bazel.StringListAttribute
-	if compilerAttrs.stubsSymbolFile == nil && len(compilerAttrs.stubsVersions.Value) == 0 {
-		tagsForStaticVariant = android.ApexAvailableTagsWithoutTestApexes(ctx, m)
-	}
-	tagsForStaticVariant.Append(bazel.StringListAttribute{Value: staticAttrs.Apex_available})
-
-	tagsForSharedVariant := android.ApexAvailableTagsWithoutTestApexes(ctx, m)
-	tagsForSharedVariant.Append(bazel.StringListAttribute{Value: sharedAttrs.Apex_available})
-
-	ctx.CreateBazelTargetModuleWithRestrictions(staticProps,
-		android.CommonAttributes{
-			Name: m.Name() + "_bp2build_cc_library_static",
-			Tags: tagsForStaticVariant,
-			// TODO: b/303307456 - Remove this when data is properly supported in cc rules.
-			SkipData: proptools.BoolPtr(true),
-		},
-		staticTargetAttrs, staticAttrs.Enabled)
-	ctx.CreateBazelTargetModuleWithRestrictions(sharedProps,
-		android.CommonAttributes{
-			Name: m.Name(),
-			Tags: tagsForSharedVariant,
-			// TODO: b/303307456 - Remove this when data is properly supported in cc rules.
-			SkipData: proptools.BoolPtr(true),
-		},
-		sharedTargetAttrs, sharedAttrs.Enabled)
-
-	createStubsBazelTargetIfNeeded(ctx, m, compilerAttrs, exportedIncludes, baseAttributes)
-}
-
-func createStubsBazelTargetIfNeeded(ctx android.Bp2buildMutatorContext, m *Module, compilerAttrs compilerAttributes, exportedIncludes BazelIncludes, baseAttributes baseAttributes) {
-	if compilerAttrs.stubsSymbolFile != nil && len(compilerAttrs.stubsVersions.Value) > 0 {
-		stubSuitesProps := bazel.BazelTargetModuleProperties{
-			Rule_class:        "cc_stub_suite",
-			Bzl_load_location: "//build/bazel/rules/cc:cc_stub_library.bzl",
-		}
-		soname := m.Name() + ".so"
-		stubSuitesAttrs := &bazelCcStubSuiteAttributes{
-			Symbol_file:          compilerAttrs.stubsSymbolFile,
-			Versions:             compilerAttrs.stubsVersions,
-			Export_includes:      exportedIncludes.Includes,
-			Soname:               &soname,
-			Source_library_label: proptools.StringPtr(m.GetBazelLabel(ctx, m)),
-			Deps:                 baseAttributes.deps,
-			Api_surface:          proptools.StringPtr("module-libapi"),
-		}
-		if _, isNdk := ctx.ModuleFromName(m.Name() + ".ndk"); isNdk {
-			stubSuitesAttrs.Included_in_ndk = proptools.BoolPtr(true)
-		}
-
-		ctx.CreateBazelTargetModule(stubSuitesProps, android.CommonAttributes{
-			Name: m.Name() + "_stub_libs",
-			// TODO: b/303307456 - Remove this when data is properly supported in cc rules.
-			SkipData: proptools.BoolPtr(true),
-		},
-			stubSuitesAttrs)
-
-		// Add alias for the stub shared_library in @api_surfaces repository
-		currentModuleLibApiDir := ctx.Config().ApiSurfacesDir(android.ModuleLibApi, "current")
-		actualLabelInMainWorkspace := bazel.Label{
-			Label: fmt.Sprintf("@//%s:%s%s", ctx.ModuleDir(), m.Name(), stubsSuffix),
-		}
-		ctx.CreateBazelTargetAliasInDir(currentModuleLibApiDir, m.Name(), actualLabelInMainWorkspace)
-
-		// Add alias for headers exported by the stub library
-		headerLabelInMainWorkspace := bazel.Label{
-			// This label is generated from cc_stub_suite macro
-			Label: fmt.Sprintf("@//%s:%s_stub_libs_%s_headers", ctx.ModuleDir(), m.Name(), android.ModuleLibApi.String()),
-		}
-		headerAlias := m.Name() + "_headers"
-		ctx.CreateBazelTargetAliasInDir(currentModuleLibApiDir, headerAlias, headerLabelInMainWorkspace)
-	}
-}
-
-// wrapper struct to flatten the arch and os specific export_include_dirs
-// flattening is necessary since we want to export apis of all arches even when we build for x86 (e.g.)
-type bazelCcApiLibraryHeadersAttributes struct {
-	bazelCcLibraryHeadersAttributes
-
-	Arch *string
-}
-
-func (a *bazelCcApiLibraryHeadersAttributes) isEmpty() bool {
-	return a.Export_includes.IsEmpty() &&
-		a.Export_system_includes.IsEmpty() &&
-		a.Deps.IsEmpty()
-}
-
-type apiIncludes struct {
-	name  string // name of the Bazel target in the generated bp2build workspace
-	attrs bazelCcApiLibraryHeadersAttributes
-}
-
-func (includes *apiIncludes) isEmpty() bool {
-	return includes.attrs.isEmpty()
-}
-
-func (includes *apiIncludes) addDep(name string) {
-	l := bazel.Label{Label: ":" + name}
-	ll := bazel.MakeLabelList([]bazel.Label{l})
-	lla := bazel.MakeLabelListAttribute(ll)
-	includes.attrs.Deps.Append(lla)
-}
-
 // cc_library creates both static and/or shared libraries for a device and/or
 // host. By default, a cc_library has a single variant that targets the device.
 // Specifying `host_supported: true` also creates a library that targets the
@@ -570,8 +230,6 @@
 		staticLibrarySdkMemberType,
 		staticAndSharedLibrarySdkMemberType,
 	}
-	module.bazelable = true
-	module.bazelHandler = &ccLibraryBazelHandler{module: module}
 	return module.Init()
 }
 
@@ -580,8 +238,6 @@
 	module, library := NewLibrary(android.HostAndDeviceSupported)
 	library.BuildOnlyStatic()
 	module.sdkMemberTypes = []android.SdkMemberType{staticLibrarySdkMemberType}
-	module.bazelable = true
-	module.bazelHandler = &ccLibraryBazelHandler{module: module}
 	return module.Init()
 }
 
@@ -590,8 +246,6 @@
 	module, library := NewLibrary(android.HostAndDeviceSupported)
 	library.BuildOnlyShared()
 	module.sdkMemberTypes = []android.SdkMemberType{sharedLibrarySdkMemberType}
-	module.bazelable = true
-	module.bazelHandler = &ccLibraryBazelHandler{module: module}
 	return module.Init()
 }
 
@@ -601,8 +255,6 @@
 	module, library := NewLibrary(android.HostSupported)
 	library.BuildOnlyStatic()
 	module.sdkMemberTypes = []android.SdkMemberType{staticLibrarySdkMemberType}
-	module.bazelable = true
-	module.bazelHandler = &ccLibraryBazelHandler{module: module}
 	return module.Init()
 }
 
@@ -611,8 +263,6 @@
 	module, library := NewLibrary(android.HostSupported)
 	library.BuildOnlyShared()
 	module.sdkMemberTypes = []android.SdkMemberType{sharedLibrarySdkMemberType}
-	module.bazelable = true
-	module.bazelHandler = &ccLibraryBazelHandler{module: module}
 	return module.Init()
 }
 
@@ -750,6 +400,8 @@
 
 	// Location of the linked, unstripped library for shared libraries
 	unstrippedOutputFile android.Path
+	// Location of the linked, stripped library for shared libraries, strip: "all"
+	strippedAllOutputFile android.Path
 
 	// Location of the file that should be copied to dist dir when requested
 	distFile android.Path
@@ -775,145 +427,6 @@
 	apiListCoverageXmlPath android.ModuleOutPath
 }
 
-type ccLibraryBazelHandler struct {
-	module *Module
-}
-
-var _ BazelHandler = (*ccLibraryBazelHandler)(nil)
-
-// generateStaticBazelBuildActions constructs the StaticLibraryInfo Soong
-// provider from a Bazel shared library's CcInfo provider.
-func (handler *ccLibraryBazelHandler) generateStaticBazelBuildActions(ctx android.ModuleContext, label string, ccInfo cquery.CcInfo) {
-	rootStaticArchives := ccInfo.RootStaticArchives
-	if len(rootStaticArchives) != 1 {
-		ctx.ModuleErrorf("expected exactly one root archive file for '%s', but got %s", label, rootStaticArchives)
-		return
-	}
-	var outputFilePath android.Path = android.PathForBazelOut(ctx, rootStaticArchives[0])
-	if len(ccInfo.TidyFiles) > 0 {
-		handler.module.tidyFiles = android.PathsForBazelOut(ctx, ccInfo.TidyFiles)
-		outputFilePath = android.AttachValidationActions(ctx, outputFilePath, handler.module.tidyFiles)
-	}
-	handler.module.outputFile = android.OptionalPathForPath(outputFilePath)
-
-	objPaths := ccInfo.CcObjectFiles
-	objFiles := make(android.Paths, len(objPaths))
-	for i, objPath := range objPaths {
-		objFiles[i] = android.PathForBazelOut(ctx, objPath)
-	}
-	objects := Objects{
-		objFiles: objFiles,
-	}
-
-	ctx.SetProvider(StaticLibraryInfoProvider, StaticLibraryInfo{
-		StaticLibrary: outputFilePath,
-		ReuseObjects:  objects,
-		Objects:       objects,
-
-		// TODO(b/190524881): Include transitive static libraries in this provider to support
-		// static libraries with deps.
-		TransitiveStaticLibrariesForOrdering: android.NewDepSetBuilder[android.Path](android.TOPOLOGICAL).
-			Direct(outputFilePath).
-			Build(),
-	})
-
-	return
-}
-
-// generateSharedBazelBuildActions constructs the SharedLibraryInfo Soong
-// provider from a Bazel shared library's CcInfo provider.
-func (handler *ccLibraryBazelHandler) generateSharedBazelBuildActions(ctx android.ModuleContext, label string, ccInfo cquery.CcInfo) {
-	rootDynamicLibraries := ccInfo.RootDynamicLibraries
-
-	if len(rootDynamicLibraries) != 1 {
-		ctx.ModuleErrorf("expected exactly one root dynamic library file for '%s', but got %s", label, rootDynamicLibraries)
-		return
-	}
-	var outputFilePath android.Path = android.PathForBazelOut(ctx, rootDynamicLibraries[0])
-	if len(ccInfo.TidyFiles) > 0 {
-		handler.module.tidyFiles = android.PathsForBazelOut(ctx, ccInfo.TidyFiles)
-		outputFilePath = android.AttachValidationActions(ctx, outputFilePath, handler.module.tidyFiles)
-	}
-
-	handler.module.outputFile = android.OptionalPathForPath(outputFilePath)
-	handler.module.linker.(*libraryDecorator).unstrippedOutputFile = android.PathForBazelOut(ctx, ccInfo.UnstrippedOutput)
-
-	var tocFile android.OptionalPath
-	if len(ccInfo.TocFile) > 0 {
-		tocFile = android.OptionalPathForPath(android.PathForBazelOut(ctx, ccInfo.TocFile))
-	}
-	handler.module.linker.(*libraryDecorator).tocFile = tocFile
-
-	if len(ccInfo.AbiDiffFiles) > 0 {
-		handler.module.linker.(*libraryDecorator).sAbiDiff = android.PathsForBazelOut(ctx, ccInfo.AbiDiffFiles)
-	}
-
-	ctx.SetProvider(SharedLibraryInfoProvider, SharedLibraryInfo{
-		TableOfContents: tocFile,
-		SharedLibrary:   outputFilePath,
-		Target:          ctx.Target(),
-		// TODO(b/190524881): Include transitive static libraries in this provider to support
-		// static libraries with deps. The provider key for this is TransitiveStaticLibrariesForOrdering.
-	})
-}
-
-func (handler *ccLibraryBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(label, cquery.GetCcInfo, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-	if v := handler.module.library.stubsVersion(); v != "" {
-		stubsLabel := label + "_stub_libs-" + v
-		bazelCtx.QueueBazelRequest(stubsLabel, cquery.GetCcInfo, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-	}
-}
-
-func (handler *ccLibraryBazelHandler) ProcessBazelQueryResponse(ctx android.ModuleContext, label string) {
-	if v := handler.module.library.stubsVersion(); v != "" {
-		// if we are a stubs variant, just use the Bazel stubs target
-		label = label + "_stub_libs-" + v
-	}
-	bazelCtx := ctx.Config().BazelContext
-	ccInfo, err := bazelCtx.GetCcInfo(label, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-	if err != nil {
-		ctx.ModuleErrorf("Error getting Bazel CcInfo: %s", err)
-		return
-	}
-
-	if handler.module.static() {
-		handler.generateStaticBazelBuildActions(ctx, label, ccInfo)
-	} else if handler.module.Shared() {
-		handler.generateSharedBazelBuildActions(ctx, label, ccInfo)
-	} else {
-		ctx.ModuleErrorf("Unhandled bazel case for %s (neither shared nor static!)", ctx.ModuleName())
-	}
-
-	handler.module.linker.(*libraryDecorator).setFlagExporterInfoFromCcInfo(ctx, ccInfo)
-	handler.module.maybeUnhideFromMake()
-
-	if i, ok := handler.module.linker.(snapshotLibraryInterface); ok {
-		// Dependencies on this library will expect collectedSnapshotHeaders to
-		// be set, otherwise validation will fail. For now, set this to an empty
-		// list.
-		// TODO(b/190533363): More closely mirror the collectHeadersForSnapshot
-		// implementation.
-		i.(*libraryDecorator).collectedSnapshotHeaders = android.Paths{}
-	}
-
-	handler.module.setAndroidMkVariablesFromCquery(ccInfo.CcAndroidMkInfo)
-
-	cctx := moduleContextFromAndroidModuleContext(ctx, handler.module)
-	addStubDependencyProviders(cctx)
-}
-
-func (library *libraryDecorator) setFlagExporterInfoFromCcInfo(ctx android.ModuleContext, ccInfo cquery.CcInfo) {
-	flagExporterInfo := flagExporterInfoFromCcInfo(ctx, ccInfo)
-	// flag exporters consolidates properties like includes, flags, dependencies that should be
-	// exported from this module to other modules
-	ctx.SetProvider(FlagExporterInfoProvider, flagExporterInfo)
-	// Store flag info to be passed along to androidmk
-	// TODO(b/184387147): Androidmk should be done in Bazel, not Soong.
-	library.flagExporterInfo = &flagExporterInfo
-}
-
 func GlobHeadersForSnapshot(ctx android.ModuleContext, paths android.Paths) android.Paths {
 	ret := android.Paths{}
 
@@ -928,11 +441,6 @@
 			continue
 		}
 
-		// Filter out the generated headers from bazel.
-		if strings.HasPrefix(dir, android.PathForBazelOut(ctx, "bazel-out").String()) {
-			continue
-		}
-
 		// libeigen wrongly exports the root directory "external/eigen". But only two
 		// subdirectories "Eigen" and "unsupported" contain exported header files. Even worse
 		// some of them have no extension. So we need special treatment for libeigen in order
@@ -1695,6 +1203,17 @@
 		}
 	}
 
+	// Generate an output file for dist as if strip: "all" is set on the module.
+	// Currently this is for layoutlib release process only.
+	for _, dist := range ctx.Module().(*Module).Dists() {
+		if dist.Tag != nil && *dist.Tag == "stripped_all" {
+			strippedAllOutputFile := android.PathForModuleOut(ctx, "stripped_all", fileName)
+			transformStrip(ctx, outputFile, strippedAllOutputFile, StripFlags{Toolchain: flags.Toolchain})
+			library.strippedAllOutputFile = strippedAllOutputFile
+			break
+		}
+	}
+
 	sharedLibs := deps.EarlySharedLibs
 	sharedLibs = append(sharedLibs, deps.SharedLibs...)
 	sharedLibs = append(sharedLibs, deps.LateSharedLibs...)
@@ -1756,6 +1275,10 @@
 	return library.unstrippedOutputFile
 }
 
+func (library *libraryDecorator) strippedAllOutputFilePath() android.Path {
+	return library.strippedAllOutputFile
+}
+
 func (library *libraryDecorator) disableStripping() {
 	library.stripper.StripProperties.Strip.None = BoolPtr(true)
 }
@@ -2614,7 +2137,7 @@
 // normalizeVersions modifies `versions` in place, so that each raw version
 // string becomes its normalized canonical form.
 // Validates that the versions in `versions` are specified in least to greatest order.
-func normalizeVersions(ctx android.BazelConversionPathContext, versions []string) {
+func normalizeVersions(ctx android.BaseModuleContext, versions []string) {
 	var previous android.ApiLevel
 	for i, v := range versions {
 		ver, err := android.ApiLevelFromUser(ctx, v)
@@ -2785,263 +2308,3 @@
 
 	return outputFile
 }
-
-func bp2buildParseAbiCheckerProps(ctx android.Bp2buildMutatorContext, module *Module) bazelCcHeaderAbiCheckerAttributes {
-	lib, ok := module.linker.(*libraryDecorator)
-	if !ok {
-		return bazelCcHeaderAbiCheckerAttributes{}
-	}
-
-	abiChecker := lib.getHeaderAbiCheckerProperties(ctx)
-
-	abiCheckerAttrs := bazelCcHeaderAbiCheckerAttributes{
-		Abi_checker_enabled:                 abiChecker.Enabled,
-		Abi_checker_exclude_symbol_versions: abiChecker.Exclude_symbol_versions,
-		Abi_checker_exclude_symbol_tags:     abiChecker.Exclude_symbol_tags,
-		Abi_checker_check_all_apis:          abiChecker.Check_all_apis,
-		Abi_checker_diff_flags:              abiChecker.Diff_flags,
-	}
-	if abiChecker.Symbol_file != nil {
-		symbolFile := android.BazelLabelForModuleSrcSingle(ctx, *abiChecker.Symbol_file)
-		abiCheckerAttrs.Abi_checker_symbol_file = &symbolFile
-	}
-
-	return abiCheckerAttrs
-}
-
-func sharedOrStaticLibraryBp2Build(ctx android.Bp2buildMutatorContext, module *Module, isStatic bool) {
-	baseAttributes := bp2BuildParseBaseProps(ctx, module)
-	compilerAttrs := baseAttributes.compilerAttributes
-	linkerAttrs := baseAttributes.linkerAttributes
-
-	exportedIncludes := bp2BuildParseExportedIncludes(ctx, module, &compilerAttrs.includes)
-	includeAttrs := includesAttributes{
-		Export_includes:          exportedIncludes.Includes,
-		Export_absolute_includes: exportedIncludes.AbsoluteIncludes,
-		Export_system_includes:   exportedIncludes.SystemIncludes,
-		Local_includes:           compilerAttrs.localIncludes,
-		Absolute_includes:        compilerAttrs.absoluteIncludes,
-	}
-
-	// Append shared/static{} stanza properties. These won't be specified on
-	// cc_library_* itself, but may be specified in cc_defaults that this module
-	// depends on.
-	libSharedOrStaticAttrs := bp2BuildParseLibProps(ctx, module, isStatic)
-
-	compilerAttrs.srcs.Append(libSharedOrStaticAttrs.Srcs)
-	compilerAttrs.cSrcs.Append(libSharedOrStaticAttrs.Srcs_c)
-	compilerAttrs.asSrcs.Append(libSharedOrStaticAttrs.Srcs_as)
-	compilerAttrs.copts.Append(libSharedOrStaticAttrs.Copts)
-
-	linkerAttrs.deps.Append(libSharedOrStaticAttrs.Deps)
-	linkerAttrs.implementationDeps.Append(libSharedOrStaticAttrs.Implementation_deps)
-	linkerAttrs.dynamicDeps.Append(libSharedOrStaticAttrs.Dynamic_deps)
-	linkerAttrs.implementationDynamicDeps.Append(libSharedOrStaticAttrs.Implementation_dynamic_deps)
-	linkerAttrs.systemDynamicDeps.Append(libSharedOrStaticAttrs.System_dynamic_deps)
-
-	asFlags := compilerAttrs.asFlags
-	if compilerAttrs.asSrcs.IsEmpty() {
-		// Skip asflags for BUILD file simplicity if there are no assembly sources.
-		asFlags = bazel.MakeStringListAttribute(nil)
-	}
-
-	features := baseAttributes.features.Clone().Append(libSharedOrStaticAttrs.Features)
-	features.DeduplicateAxesFromBase()
-
-	commonAttrs := staticOrSharedAttributes{
-		Srcs:    compilerAttrs.srcs,
-		Srcs_c:  compilerAttrs.cSrcs,
-		Srcs_as: compilerAttrs.asSrcs,
-		Copts:   compilerAttrs.copts,
-		Hdrs:    compilerAttrs.hdrs,
-
-		Deps:                              linkerAttrs.deps,
-		Implementation_deps:               linkerAttrs.implementationDeps,
-		Dynamic_deps:                      linkerAttrs.dynamicDeps,
-		Implementation_dynamic_deps:       linkerAttrs.implementationDynamicDeps,
-		Whole_archive_deps:                linkerAttrs.wholeArchiveDeps,
-		Implementation_whole_archive_deps: linkerAttrs.implementationWholeArchiveDeps,
-		System_dynamic_deps:               linkerAttrs.systemDynamicDeps,
-		SdkAttributes:                     Bp2BuildParseSdkAttributes(module),
-		Runtime_deps:                      linkerAttrs.runtimeDeps,
-		Native_coverage:                   baseAttributes.Native_coverage,
-		Additional_compiler_inputs:        compilerAttrs.additionalCompilerInputs,
-	}
-
-	module.convertTidyAttributes(ctx, &commonAttrs.tidyAttributes)
-
-	var attrs interface{}
-	if isStatic {
-		commonAttrs.Deps.Add(baseAttributes.protoDependency)
-		var alwayslink *bool
-		if _, ok := alwaysLinkLibraries[module.Name()]; ok && isStatic {
-			alwayslink = proptools.BoolPtr(true)
-		}
-		attrs = &bazelCcLibraryStaticAttributes{
-			staticOrSharedAttributes: commonAttrs,
-			Rtti:                     compilerAttrs.rtti,
-			Stl:                      compilerAttrs.stl,
-			Cpp_std:                  compilerAttrs.cppStd,
-			C_std:                    compilerAttrs.cStd,
-
-			includesAttributes: includeAttrs,
-
-			Cppflags:   compilerAttrs.cppFlags,
-			Conlyflags: compilerAttrs.conlyFlags,
-			Asflags:    asFlags,
-
-			Alwayslink: alwayslink,
-			Features:   *features,
-		}
-
-	} else {
-		commonAttrs.Dynamic_deps.Add(baseAttributes.protoDependency)
-
-		sharedLibAttrs := &bazelCcLibrarySharedAttributes{
-			staticOrSharedAttributes: commonAttrs,
-
-			Cppflags:   compilerAttrs.cppFlags,
-			Conlyflags: compilerAttrs.conlyFlags,
-			Asflags:    asFlags,
-
-			Linkopts:        linkerAttrs.linkopts,
-			Use_version_lib: linkerAttrs.useVersionLib,
-
-			Rtti:    compilerAttrs.rtti,
-			Stl:     compilerAttrs.stl,
-			Cpp_std: compilerAttrs.cppStd,
-			C_std:   compilerAttrs.cStd,
-
-			includesAttributes: includeAttrs,
-
-			Additional_linker_inputs: linkerAttrs.additionalLinkerInputs,
-
-			Strip: stripAttrsFromLinkerAttrs(&linkerAttrs),
-
-			Features: *features,
-
-			Stem:   compilerAttrs.stem,
-			Suffix: compilerAttrs.suffix,
-
-			bazelCcHeaderAbiCheckerAttributes: bp2buildParseAbiCheckerProps(ctx, module),
-
-			Fdo_profile: compilerAttrs.fdoProfile,
-		}
-		if compilerAttrs.stubsSymbolFile != nil && len(compilerAttrs.stubsVersions.Value) > 0 {
-			sharedLibAttrs.Stubs_symbol_file = compilerAttrs.stubsSymbolFile
-		}
-		attrs = sharedLibAttrs
-	}
-
-	var modType string
-	if isStatic {
-		modType = "cc_library_static"
-	} else {
-		modType = "cc_library_shared"
-		createStubsBazelTargetIfNeeded(ctx, module, compilerAttrs, exportedIncludes, baseAttributes)
-	}
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        modType,
-		Bzl_load_location: fmt.Sprintf("//build/bazel/rules/cc:%s.bzl", modType),
-	}
-
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, module)
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{
-		Name: module.Name(),
-		Tags: tags,
-		// TODO: b/303307456 - Remove this when data is properly supported in cc rules.
-		SkipData: proptools.BoolPtr(true),
-	}, attrs)
-}
-
-type includesAttributes struct {
-	Export_includes          bazel.StringListAttribute
-	Export_absolute_includes bazel.StringListAttribute
-	Export_system_includes   bazel.StringListAttribute
-	Local_includes           bazel.StringListAttribute
-	Absolute_includes        bazel.StringListAttribute
-}
-
-// TODO(b/199902614): Can this be factored to share with the other Attributes?
-type bazelCcLibraryStaticAttributes struct {
-	staticOrSharedAttributes
-	includesAttributes
-
-	Use_version_lib bazel.BoolAttribute
-	Rtti            bazel.BoolAttribute
-	Stl             *string
-	Cpp_std         *string
-	C_std           *string
-
-	Hdrs bazel.LabelListAttribute
-
-	Cppflags   bazel.StringListAttribute
-	Conlyflags bazel.StringListAttribute
-	Asflags    bazel.StringListAttribute
-
-	Alwayslink *bool
-	Features   bazel.StringListAttribute
-}
-
-// TODO(b/199902614): Can this be factored to share with the other Attributes?
-type bazelCcLibrarySharedAttributes struct {
-	staticOrSharedAttributes
-	includesAttributes
-
-	Linkopts        bazel.StringListAttribute
-	Use_version_lib bazel.BoolAttribute
-
-	Rtti    bazel.BoolAttribute
-	Stl     *string
-	Cpp_std *string
-	C_std   *string
-
-	Hdrs bazel.LabelListAttribute
-
-	Strip                    stripAttributes
-	Additional_linker_inputs bazel.LabelListAttribute
-
-	Cppflags   bazel.StringListAttribute
-	Conlyflags bazel.StringListAttribute
-	Asflags    bazel.StringListAttribute
-
-	Features bazel.StringListAttribute
-
-	Stubs_symbol_file *string
-
-	Inject_bssl_hash bazel.BoolAttribute
-
-	Stem   bazel.StringAttribute
-	Suffix bazel.StringAttribute
-
-	bazelCcHeaderAbiCheckerAttributes
-
-	Fdo_profile bazel.LabelAttribute
-}
-
-type bazelCcStubSuiteAttributes struct {
-	Symbol_file          *string
-	Versions             bazel.StringListAttribute
-	Export_includes      bazel.StringListAttribute
-	Source_library_label *string
-	Soname               *string
-	Deps                 bazel.LabelListAttribute
-	Api_surface          *string
-
-	// Unless the library is in the NDK, module-libapi stubs should *not* include the public symbols
-	// Soong uses a global variable to determine if the library is in the NDK
-	// Since Bazel does not have global analysis, create an explicit property
-	// This property is only relevant if `api_surface = module-libapi`
-	// https://cs.android.com/android/_/android/platform/build/soong/+/main:cc/library.go;l=1214-1219;drc=7123cc5370a38983ee6325b5f5f6df19f4e4f10b;bpv=1;bpt=0
-	Included_in_ndk *bool
-}
-
-type bazelCcHeaderAbiCheckerAttributes struct {
-	Abi_checker_enabled                 *bool
-	Abi_checker_symbol_file             *bazel.Label
-	Abi_checker_exclude_symbol_versions []string
-	Abi_checker_exclude_symbol_tags     []string
-	Abi_checker_check_all_apis          *bool
-	Abi_checker_diff_flags              []string
-}
diff --git a/cc/library_headers.go b/cc/library_headers.go
index 2e5a195..98533b2 100644
--- a/cc/library_headers.go
+++ b/cc/library_headers.go
@@ -16,8 +16,6 @@
 
 import (
 	"android/soong/android"
-	"android/soong/bazel"
-	"android/soong/bazel/cquery"
 )
 
 func init() {
@@ -48,52 +46,6 @@
 	ctx.RegisterModuleType("cc_prebuilt_library_headers", prebuiltLibraryHeaderFactory)
 }
 
-type libraryHeaderBazelHandler struct {
-	module  *Module
-	library *libraryDecorator
-}
-
-var _ BazelHandler = (*libraryHeaderBazelHandler)(nil)
-
-func (handler *libraryHeaderBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(label, cquery.GetCcInfo, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-}
-
-func (h *libraryHeaderBazelHandler) ProcessBazelQueryResponse(ctx android.ModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	ccInfo, err := bazelCtx.GetCcInfo(label, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-
-	outputPaths := ccInfo.OutputFiles
-	if len(outputPaths) != 1 {
-		ctx.ModuleErrorf("expected exactly one output file for %q, but got %q", label, outputPaths)
-		return
-	}
-
-	var outputPath android.Path = android.PathForBazelOut(ctx, outputPaths[0])
-	if len(ccInfo.TidyFiles) > 0 {
-		h.module.tidyFiles = android.PathsForBazelOut(ctx, ccInfo.TidyFiles)
-		outputPath = android.AttachValidationActions(ctx, outputPath, h.module.tidyFiles)
-	}
-	h.module.outputFile = android.OptionalPathForPath(outputPath)
-
-	// HeaderLibraryInfo is an empty struct to indicate to dependencies that this is a header library
-	ctx.SetProvider(HeaderLibraryInfoProvider, HeaderLibraryInfo{})
-
-	h.library.setFlagExporterInfoFromCcInfo(ctx, ccInfo)
-
-	// Dependencies on this library will expect collectedSnapshotHeaders to be set, otherwise
-	// validation will fail. For now, set this to an empty list.
-	// TODO(cparsons): More closely mirror the collectHeadersForSnapshot implementation.
-	h.library.collectedSnapshotHeaders = android.Paths{}
-
-	h.module.setAndroidMkVariablesFromCquery(ccInfo.CcAndroidMkInfo)
-}
-
 // cc_library_headers contains a set of c/c++ headers which are imported by
 // other soong cc modules using the header_libs property. For best practices,
 // use export_include_dirs property or LOCAL_EXPORT_C_INCLUDE_DIRS for
@@ -102,8 +54,6 @@
 	module, library := NewLibrary(android.HostAndDeviceSupported)
 	library.HeaderOnly()
 	module.sdkMemberTypes = []android.SdkMemberType{headersLibrarySdkMemberType}
-	module.bazelable = true
-	module.bazelHandler = &libraryHeaderBazelHandler{module: module, library: library}
 	return module.Init()
 }
 
@@ -111,50 +61,5 @@
 func prebuiltLibraryHeaderFactory() android.Module {
 	module, library := NewPrebuiltLibrary(android.HostAndDeviceSupported, "")
 	library.HeaderOnly()
-	module.bazelable = true
-	module.bazelHandler = &ccLibraryBazelHandler{module: module}
 	return module.Init()
 }
-
-type bazelCcLibraryHeadersAttributes struct {
-	Hdrs                     bazel.LabelListAttribute
-	Export_includes          bazel.StringListAttribute
-	Export_absolute_includes bazel.StringListAttribute
-	Export_system_includes   bazel.StringListAttribute
-	Deps                     bazel.LabelListAttribute
-	SdkAttributes
-}
-
-func libraryHeadersBp2Build(ctx android.Bp2buildMutatorContext, module *Module) {
-	baseAttributes := bp2BuildParseBaseProps(ctx, module)
-	exportedIncludes := bp2BuildParseExportedIncludes(ctx, module, &baseAttributes.includes)
-	linkerAttrs := baseAttributes.linkerAttributes
-	(&linkerAttrs.deps).Append(linkerAttrs.dynamicDeps)
-	(&linkerAttrs.deps).Append(linkerAttrs.wholeArchiveDeps)
-
-	attrs := &bazelCcLibraryHeadersAttributes{
-		Export_includes:          exportedIncludes.Includes,
-		Export_absolute_includes: exportedIncludes.AbsoluteIncludes,
-		Export_system_includes:   exportedIncludes.SystemIncludes,
-		Deps:                     linkerAttrs.deps,
-		Hdrs:                     baseAttributes.hdrs,
-		SdkAttributes:            Bp2BuildParseSdkAttributes(module),
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_library_headers",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_library_headers.bzl",
-	}
-
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, module)
-
-	name := module.Name()
-	if module.IsPrebuilt() {
-		name = android.RemoveOptionalPrebuiltPrefix(name)
-	}
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{
-		Name: name,
-		Tags: tags,
-	}, attrs)
-}
diff --git a/cc/library_sdk_member.go b/cc/library_sdk_member.go
index e743bb6..52e78d7 100644
--- a/cc/library_sdk_member.go
+++ b/cc/library_sdk_member.go
@@ -251,16 +251,9 @@
 	return &nativeLibInfoProperties{memberType: mt}
 }
 
-func isBazelOutDirectory(p android.Path) bool {
-	_, bazel := p.(android.BazelOutPath)
-	return bazel
-}
-
 func isGeneratedHeaderDirectory(p android.Path) bool {
 	_, gen := p.(android.WritablePath)
-	// TODO(b/183213331): Here we assume that bazel-based headers are not generated; we need
-	// to support generated headers in mixed builds.
-	return gen && !isBazelOutDirectory(p)
+	return gen
 }
 
 type includeDirsProperty struct {
diff --git a/cc/library_test.go b/cc/library_test.go
index dbe2be8..2ed2d76 100644
--- a/cc/library_test.go
+++ b/cc/library_test.go
@@ -19,7 +19,6 @@
 	"testing"
 
 	"android/soong/android"
-	"android/soong/bazel/cquery"
 )
 
 func TestLibraryReuse(t *testing.T) {
@@ -246,137 +245,6 @@
 	testCcError(t, `"libfoo" .*: versions: "X" could not be parsed as an integer and is not a recognized codename`, bp)
 }
 
-func TestCcLibraryWithBazel(t *testing.T) {
-	t.Parallel()
-	bp := `
-cc_library {
-	name: "foo",
-	srcs: ["foo.cc"],
-	bazel_module: { label: "//foo/bar:bar" },
-}`
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir: "outputbase",
-		LabelToCcInfo: map[string]cquery.CcInfo{
-			"//foo/bar:bar": cquery.CcInfo{
-				CcObjectFiles:        []string{"foo.o"},
-				Includes:             []string{"include"},
-				SystemIncludes:       []string{"system_include"},
-				Headers:              []string{"foo.h"},
-				RootDynamicLibraries: []string{"foo.so"},
-				UnstrippedOutput:     "foo_unstripped.so",
-			},
-			"//foo/bar:bar_bp2build_cc_library_static": cquery.CcInfo{
-				CcObjectFiles:      []string{"foo.o"},
-				Includes:           []string{"include"},
-				SystemIncludes:     []string{"system_include"},
-				Headers:            []string{"foo.h"},
-				RootStaticArchives: []string{"foo.a"},
-			},
-		},
-	}
-	ctx := testCcWithConfig(t, config)
-
-	staticFoo := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon_static").Module()
-	outputFiles, err := staticFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-
-	expectedOutputFiles := []string{"outputbase/execroot/__main__/foo.a"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
-
-	flagExporter := ctx.ModuleProvider(staticFoo, FlagExporterInfoProvider).(FlagExporterInfo)
-	android.AssertPathsRelativeToTopEquals(t, "exported include dirs", []string{"outputbase/execroot/__main__/include"}, flagExporter.IncludeDirs)
-	android.AssertPathsRelativeToTopEquals(t, "exported system include dirs", []string{"outputbase/execroot/__main__/system_include"}, flagExporter.SystemIncludeDirs)
-	android.AssertPathsRelativeToTopEquals(t, "exported headers", []string{"outputbase/execroot/__main__/foo.h"}, flagExporter.GeneratedHeaders)
-	android.AssertPathsRelativeToTopEquals(t, "deps", []string{"outputbase/execroot/__main__/foo.h"}, flagExporter.Deps)
-
-	sharedFoo := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-	outputFiles, err = sharedFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_library outputfiles %s", err)
-	}
-	expectedOutputFiles = []string{"outputbase/execroot/__main__/foo.so"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
-
-	android.AssertStringEquals(t, "unstripped shared library", "outputbase/execroot/__main__/foo_unstripped.so", sharedFoo.(*Module).linker.unstrippedOutputFilePath().String())
-	flagExporter = ctx.ModuleProvider(sharedFoo, FlagExporterInfoProvider).(FlagExporterInfo)
-	android.AssertPathsRelativeToTopEquals(t, "exported include dirs", []string{"outputbase/execroot/__main__/include"}, flagExporter.IncludeDirs)
-	android.AssertPathsRelativeToTopEquals(t, "exported system include dirs", []string{"outputbase/execroot/__main__/system_include"}, flagExporter.SystemIncludeDirs)
-	android.AssertPathsRelativeToTopEquals(t, "exported headers", []string{"outputbase/execroot/__main__/foo.h"}, flagExporter.GeneratedHeaders)
-	android.AssertPathsRelativeToTopEquals(t, "deps", []string{"outputbase/execroot/__main__/foo.h"}, flagExporter.Deps)
-}
-
-func TestCcLibraryWithBazelValidations(t *testing.T) {
-	t.Parallel()
-	bp := `
-cc_library {
-	name: "foo",
-	srcs: ["foo.cc"],
-	bazel_module: { label: "//foo/bar:bar" },
-	tidy: true,
-}`
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir: "outputbase",
-		LabelToCcInfo: map[string]cquery.CcInfo{
-			"//foo/bar:bar": cquery.CcInfo{
-				CcObjectFiles:        []string{"foo.o"},
-				Includes:             []string{"include"},
-				SystemIncludes:       []string{"system_include"},
-				Headers:              []string{"foo.h"},
-				RootDynamicLibraries: []string{"foo.so"},
-				UnstrippedOutput:     "foo_unstripped.so",
-			},
-			"//foo/bar:bar_bp2build_cc_library_static": cquery.CcInfo{
-				CcObjectFiles:      []string{"foo.o"},
-				Includes:           []string{"include"},
-				SystemIncludes:     []string{"system_include"},
-				Headers:            []string{"foo.h"},
-				RootStaticArchives: []string{"foo.a"},
-				TidyFiles:          []string{"foo.c.tidy"},
-			},
-		},
-	}
-	ctx := android.GroupFixturePreparers(
-		prepareForCcTest,
-		android.FixtureMergeEnv(map[string]string{
-			"ALLOW_LOCAL_TIDY_TRUE": "1",
-		}),
-	).RunTestWithConfig(t, config).TestContext
-
-	staticFoo := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon_static").Module()
-	outputFiles, err := staticFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-
-	expectedOutputFiles := []string{"out/soong/.intermediates/foo/android_arm_armv7-a-neon_static/validated/foo.a"}
-	android.AssertPathsRelativeToTopEquals(t, "output files", expectedOutputFiles, outputFiles)
-
-	flagExporter := ctx.ModuleProvider(staticFoo, FlagExporterInfoProvider).(FlagExporterInfo)
-	android.AssertPathsRelativeToTopEquals(t, "exported include dirs", []string{"outputbase/execroot/__main__/include"}, flagExporter.IncludeDirs)
-	android.AssertPathsRelativeToTopEquals(t, "exported system include dirs", []string{"outputbase/execroot/__main__/system_include"}, flagExporter.SystemIncludeDirs)
-	android.AssertPathsRelativeToTopEquals(t, "exported headers", []string{"outputbase/execroot/__main__/foo.h"}, flagExporter.GeneratedHeaders)
-	android.AssertPathsRelativeToTopEquals(t, "deps", []string{"outputbase/execroot/__main__/foo.h"}, flagExporter.Deps)
-
-	sharedFoo := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-	outputFiles, err = sharedFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_library outputfiles %s", err)
-	}
-	expectedOutputFiles = []string{"outputbase/execroot/__main__/foo.so"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
-
-	android.AssertStringEquals(t, "unstripped shared library", "outputbase/execroot/__main__/foo_unstripped.so", sharedFoo.(*Module).linker.unstrippedOutputFilePath().String())
-	flagExporter = ctx.ModuleProvider(sharedFoo, FlagExporterInfoProvider).(FlagExporterInfo)
-	android.AssertPathsRelativeToTopEquals(t, "exported include dirs", []string{"outputbase/execroot/__main__/include"}, flagExporter.IncludeDirs)
-	android.AssertPathsRelativeToTopEquals(t, "exported system include dirs", []string{"outputbase/execroot/__main__/system_include"}, flagExporter.SystemIncludeDirs)
-	android.AssertPathsRelativeToTopEquals(t, "exported headers", []string{"outputbase/execroot/__main__/foo.h"}, flagExporter.GeneratedHeaders)
-	android.AssertPathsRelativeToTopEquals(t, "deps", []string{"outputbase/execroot/__main__/foo.h"}, flagExporter.Deps)
-}
-
 func TestLibraryVersionScript(t *testing.T) {
 	t.Parallel()
 	result := PrepareForIntegrationTestWithCc.RunTestWithBp(t, `
@@ -413,107 +281,6 @@
 
 }
 
-func TestCcLibrarySharedWithBazelValidations(t *testing.T) {
-	t.Parallel()
-	bp := `
-cc_library_shared {
-	name: "foo",
-	srcs: ["foo.cc"],
-	bazel_module: { label: "//foo/bar:bar" },
-	tidy: true,
-}`
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir: "outputbase",
-		LabelToCcInfo: map[string]cquery.CcInfo{
-			"//foo/bar:bar": cquery.CcInfo{
-				CcObjectFiles:        []string{"foo.o"},
-				Includes:             []string{"include"},
-				SystemIncludes:       []string{"system_include"},
-				RootDynamicLibraries: []string{"foo.so"},
-				TocFile:              "foo.so.toc",
-				TidyFiles:            []string{"foo.c.tidy"},
-			},
-		},
-	}
-	ctx := android.GroupFixturePreparers(
-		prepareForCcTest,
-		android.FixtureMergeEnv(map[string]string{
-			"ALLOW_LOCAL_TIDY_TRUE": "1",
-		}),
-	).RunTestWithConfig(t, config).TestContext
-
-	sharedFoo := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-	producer := sharedFoo.(android.OutputFileProducer)
-	outputFiles, err := producer.OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{"out/soong/.intermediates/foo/android_arm_armv7-a-neon_shared/validated/foo.so"}
-	android.AssertPathsRelativeToTopEquals(t, "output files", expectedOutputFiles, outputFiles)
-
-	tocFilePath := sharedFoo.(*Module).Toc()
-	if !tocFilePath.Valid() {
-		t.Errorf("Invalid tocFilePath: %s", tocFilePath)
-	}
-	tocFile := tocFilePath.Path()
-	expectedToc := "outputbase/execroot/__main__/foo.so.toc"
-	android.AssertStringEquals(t, "toc file", expectedToc, tocFile.String())
-
-	entries := android.AndroidMkEntriesForTest(t, ctx, sharedFoo)[0]
-	expectedFlags := []string{"-Ioutputbase/execroot/__main__/include", "-isystem outputbase/execroot/__main__/system_include"}
-	gotFlags := entries.EntryMap["LOCAL_EXPORT_CFLAGS"]
-	android.AssertDeepEquals(t, "androidmk exported cflags", expectedFlags, gotFlags)
-	android.AssertStringEquals(t, "unexpected LOCAL_SOONG_MODULE_TYPE", "cc_library_shared", entries.EntryMap["LOCAL_SOONG_MODULE_TYPE"][0])
-}
-
-func TestCcLibrarySharedWithBazel(t *testing.T) {
-	t.Parallel()
-	bp := `
-cc_library_shared {
-	name: "foo",
-	srcs: ["foo.cc"],
-	bazel_module: { label: "//foo/bar:bar" },
-}`
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir: "outputbase",
-		LabelToCcInfo: map[string]cquery.CcInfo{
-			"//foo/bar:bar": cquery.CcInfo{
-				CcObjectFiles:        []string{"foo.o"},
-				Includes:             []string{"include"},
-				SystemIncludes:       []string{"system_include"},
-				RootDynamicLibraries: []string{"foo.so"},
-				TocFile:              "foo.so.toc",
-			},
-		},
-	}
-	ctx := testCcWithConfig(t, config)
-
-	sharedFoo := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-	producer := sharedFoo.(android.OutputFileProducer)
-	outputFiles, err := producer.OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{"outputbase/execroot/__main__/foo.so"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
-
-	tocFilePath := sharedFoo.(*Module).Toc()
-	if !tocFilePath.Valid() {
-		t.Errorf("Invalid tocFilePath: %s", tocFilePath)
-	}
-	tocFile := tocFilePath.Path()
-	expectedToc := "outputbase/execroot/__main__/foo.so.toc"
-	android.AssertStringEquals(t, "toc file", expectedToc, tocFile.String())
-
-	entries := android.AndroidMkEntriesForTest(t, ctx, sharedFoo)[0]
-	expectedFlags := []string{"-Ioutputbase/execroot/__main__/include", "-isystem outputbase/execroot/__main__/system_include"}
-	gotFlags := entries.EntryMap["LOCAL_EXPORT_CFLAGS"]
-	android.AssertDeepEquals(t, "androidmk exported cflags", expectedFlags, gotFlags)
-	android.AssertStringEquals(t, "unexpected LOCAL_SOONG_MODULE_TYPE", "cc_library_shared", entries.EntryMap["LOCAL_SOONG_MODULE_TYPE"][0])
-}
-
 func TestWholeStaticLibPrebuilts(t *testing.T) {
 	t.Parallel()
 	result := PrepareForIntegrationTestWithCc.RunTestWithBp(t, `
diff --git a/cc/linkable.go b/cc/linkable.go
index 5b5b856..994517c 100644
--- a/cc/linkable.go
+++ b/cc/linkable.go
@@ -2,7 +2,6 @@
 
 import (
 	"android/soong/android"
-	"android/soong/bazel/cquery"
 	"android/soong/fuzz"
 	"android/soong/snapshot"
 
@@ -431,19 +430,3 @@
 }
 
 var FlagExporterInfoProvider = blueprint.NewProvider(FlagExporterInfo{})
-
-// flagExporterInfoFromCcInfo populates FlagExporterInfo provider with information from Bazel.
-func flagExporterInfoFromCcInfo(ctx android.ModuleContext, ccInfo cquery.CcInfo) FlagExporterInfo {
-
-	includes := android.PathsForBazelOut(ctx, ccInfo.Includes)
-	systemIncludes := android.PathsForBazelOut(ctx, ccInfo.SystemIncludes)
-	headers := android.PathsForBazelOut(ctx, ccInfo.Headers)
-
-	return FlagExporterInfo{
-		IncludeDirs:       android.FirstUniquePaths(includes),
-		SystemIncludeDirs: android.FirstUniquePaths(systemIncludes),
-		GeneratedHeaders:  headers,
-		// necessary to ensure generated headers are considered implicit deps of dependent actions
-		Deps: headers,
-	}
-}
diff --git a/cc/lto.go b/cc/lto.go
index d2a43d2..8b0880c 100644
--- a/cc/lto.go
+++ b/cc/lto.go
@@ -116,7 +116,8 @@
 		// better dead code elimination and CFG simplification, but do
 		// not perform costly optimizations for a balance between compile
 		// time, binary size and performance.
-		if !lto.ThinLTO() {
+		// Apply the same for Eng builds as well.
+		if !lto.ThinLTO() || ctx.Config().Eng() {
 			ltoLdFlags = append(ltoLdFlags, "-Wl,--lto-O0")
 		}
 
diff --git a/cc/ndk_headers.go b/cc/ndk_headers.go
index 461aa96..0fbc8d0 100644
--- a/cc/ndk_headers.go
+++ b/cc/ndk_headers.go
@@ -18,11 +18,8 @@
 	"fmt"
 	"path/filepath"
 
-	"github.com/google/blueprint"
-	"github.com/google/blueprint/proptools"
-
 	"android/soong/android"
-	"android/soong/bazel"
+	"github.com/google/blueprint"
 )
 
 var (
@@ -81,7 +78,6 @@
 
 type headerModule struct {
 	android.ModuleBase
-	android.BazelModuleBase
 
 	properties headerProperties
 
@@ -148,30 +144,6 @@
 	}
 }
 
-type bazelNdkHeadersAttributes struct {
-	Strip_import_prefix *string
-	Import_prefix       *string
-	Hdrs                bazel.LabelListAttribute
-	Run_versioner       *bool
-}
-
-func (h *headerModule) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "ndk_headers",
-		Bzl_load_location: "//build/bazel/rules/cc:ndk_headers.bzl",
-	}
-	attrs := &bazelNdkHeadersAttributes{
-		Strip_import_prefix: h.properties.From,
-		Import_prefix:       h.properties.To,
-		Hdrs:                bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrcExcludes(ctx, h.properties.Srcs, h.properties.Exclude_srcs)),
-	}
-	ctx.CreateBazelTargetModule(
-		props,
-		android.CommonAttributes{Name: h.Name()},
-		attrs,
-	)
-}
-
 // ndk_headers installs the sets of ndk headers defined in the srcs property
 // to the sysroot base + "usr/include" + to directory + directory component.
 // ndk_headers requires the license file to be specified. Example:
@@ -186,7 +158,6 @@
 	module := &headerModule{}
 	module.AddProperties(&module.properties)
 	android.InitAndroidModule(module)
-	android.InitBazelModule(module)
 	return module
 }
 
@@ -219,7 +190,6 @@
 // Note that this is really only built to handle bionic/libc/include.
 type versionedHeaderModule struct {
 	android.ModuleBase
-	android.BazelModuleBase
 
 	properties versionedHeaderProperties
 
@@ -258,25 +228,6 @@
 	processHeadersWithVersioner(ctx, fromSrcPath, toOutputPath, m.srcPaths, installPaths)
 }
 
-func (h *versionedHeaderModule) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "ndk_headers",
-		Bzl_load_location: "//build/bazel/rules/cc:ndk_headers.bzl",
-	}
-	globPattern := headerGlobPattern(proptools.String(h.properties.From))
-	attrs := &bazelNdkHeadersAttributes{
-		Strip_import_prefix: h.properties.From,
-		Import_prefix:       h.properties.To,
-		Run_versioner:       proptools.BoolPtr(true),
-		Hdrs:                bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, []string{globPattern})),
-	}
-	ctx.CreateBazelTargetModule(
-		props,
-		android.CommonAttributes{Name: h.Name()},
-		attrs,
-	)
-}
-
 func processHeadersWithVersioner(ctx android.ModuleContext, srcDir, outDir android.Path,
 	srcPaths android.Paths, installPaths []android.WritablePath) android.Path {
 	// The versioner depends on a dependencies directory to simplify determining include paths
@@ -326,7 +277,6 @@
 	module.AddProperties(&module.properties)
 
 	android.InitAndroidModule(module)
-	android.InitBazelModule(module)
 
 	return module
 }
diff --git a/cc/ndk_library.go b/cc/ndk_library.go
index df775de..98fb334 100644
--- a/cc/ndk_library.go
+++ b/cc/ndk_library.go
@@ -25,7 +25,6 @@
 	"github.com/google/blueprint/proptools"
 
 	"android/soong/android"
-	"android/soong/bazel"
 	"android/soong/cc/config"
 )
 
@@ -334,18 +333,12 @@
 		return false
 	}
 	// http://b/156513478
-	// http://b/277624006
-	// This step is expensive. We're not able to do anything with the outputs of
-	// this step yet (canDiffAbi is flagged off because libabigail isn't able to
-	// handle all our libraries), disable it. There's no sense in protecting
-	// against checking in code that breaks abidw since by the time any of this
-	// can be turned on we'll need to migrate to STG anyway.
-	return false
+	return config.ReleaseNdkAbiMonitored()
 }
 
 // Feature flag to disable diffing against prebuilts.
-func canDiffAbi() bool {
-	return false
+func canDiffAbi(config android.Config) bool {
+	return config.ReleaseNdkAbiMonitored()
 }
 
 func (this *stubDecorator) dumpAbi(ctx ModuleContext, symbolList android.Path) {
@@ -476,7 +469,7 @@
 	c.versionScriptPath = nativeAbiResult.versionScript
 	if canDumpAbi(ctx.Config()) {
 		c.dumpAbi(ctx, nativeAbiResult.symbolList)
-		if canDiffAbi() {
+		if canDiffAbi(ctx.Config()) {
 			c.diffAbi(ctx)
 		}
 	}
@@ -569,51 +562,5 @@
 func NdkLibraryFactory() android.Module {
 	module := newStubLibrary()
 	android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibBoth)
-	android.InitBazelModule(module)
 	return module
 }
-
-type bazelCcApiContributionAttributes struct {
-	Api          bazel.LabelAttribute
-	Api_surfaces bazel.StringListAttribute
-	Hdrs         bazel.LabelListAttribute
-	Library_name string
-}
-
-func ndkLibraryBp2build(ctx android.Bp2buildMutatorContext, c *Module) {
-	ndk, _ := c.linker.(*stubDecorator)
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_stub_suite",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_stub_library.bzl",
-	}
-	sourceLibraryName := strings.TrimSuffix(c.Name(), ".ndk")
-	fromApiLevel, err := android.ApiLevelFromUser(ctx, proptools.String(ndk.properties.First_version))
-	if err != nil {
-		ctx.PropertyErrorf("first_version", "error converting first_version %v", proptools.String(ndk.properties.First_version))
-	}
-	symbolFileLabel := android.BazelLabelForModuleSrcSingle(ctx, proptools.String(ndk.properties.Symbol_file))
-	attrs := &bazelCcStubSuiteAttributes{
-		// TODO - b/300504837 Add ndk headers
-		Symbol_file:     proptools.StringPtr(symbolFileLabel.Label),
-		Soname:          proptools.StringPtr(sourceLibraryName + ".so"),
-		Api_surface:     proptools.StringPtr(android.PublicApi.String()),
-		Included_in_ndk: proptools.BoolPtr(true),
-	}
-	if sourceLibrary, exists := ctx.ModuleFromName(sourceLibraryName); exists {
-		// the source library might not exist in minimal/unbuildable branches like kernel-build-tools.
-		// check for its existence
-		attrs.Source_library_label = proptools.StringPtr(c.GetBazelLabel(ctx, sourceLibrary))
-	}
-	if ctx.Config().RawPlatformSdkVersion() != nil {
-		// This is a hack to populate `versions` only on branches that set a platform_sdk_version
-		// This prevents errors on branches such as kernel-build-tools
-		// This hack is acceptable since we are not required to support NDK Bazel builds on those branches
-		attrs.Versions = bazel.MakeStringListAttribute(ndkLibraryVersions(ctx, fromApiLevel))
-	}
-
-	ctx.CreateBazelTargetModule(
-		props,
-		android.CommonAttributes{Name: c.Name() + "_stub_libs"},
-		attrs,
-	)
-}
diff --git a/cc/ndk_prebuilt.go b/cc/ndk_prebuilt.go
index c3e6510..842bdf6 100644
--- a/cc/ndk_prebuilt.go
+++ b/cc/ndk_prebuilt.go
@@ -15,11 +15,9 @@
 package cc
 
 import (
-	"path/filepath"
 	"strings"
 
 	"android/soong/android"
-	"android/soong/bazel"
 )
 
 func init() {
@@ -66,7 +64,6 @@
 	module.Properties.Sdk_version = StringPtr("minimum")
 	module.Properties.AlwaysSdk = true
 	module.stl.Properties.Stl = StringPtr("none")
-	module.bazelable = true
 	return module.Init()
 }
 
@@ -87,7 +84,6 @@
 	module.Properties.AlwaysSdk = true
 	module.Properties.Sdk_version = StringPtr("current")
 	module.stl.Properties.Stl = StringPtr("none")
-	module.bazelable = true
 	return module.Init()
 }
 
@@ -135,81 +131,3 @@
 
 	return lib
 }
-
-var (
-	archToAbiDirMap = map[string]string{
-		"android_arm":     "armeabi-v7a",
-		"android_arm64":   "arm64-v8a",
-		"android_riscv64": "riscv64",
-		"android_x86":     "x86",
-		"android_x86_64":  "x86_64",
-	}
-)
-
-// stlSrcBp2build returns a bazel label for the checked-in .so/.a file
-// It contains a select statement for each ABI
-func stlSrcBp2build(ctx android.Bp2buildMutatorContext, c *Module) bazel.LabelAttribute {
-	libName := strings.TrimPrefix(c.Name(), "ndk_")
-	libExt := ".so" // TODO - b/201079053: Support windows
-	if ctx.ModuleType() == "ndk_prebuilt_static_stl" {
-		libExt = ".a"
-	}
-	src := bazel.LabelAttribute{}
-	for arch, abiDir := range archToAbiDirMap {
-		srcPath := filepath.Join(libDir, abiDir, libName+libExt)
-		src.SetSelectValue(
-			bazel.OsArchConfigurationAxis,
-			arch,
-			android.BazelLabelForModuleSrcSingle(ctx, srcPath),
-		)
-	}
-	return src
-}
-
-// stlIncludesBp2build returns the includes exported by the STL
-func stlIncludesBp2build(c *Module) bazel.StringListAttribute {
-	linker, _ := c.linker.(*ndkPrebuiltStlLinker)
-	includeDirs := append(
-		[]string{},
-		linker.libraryDecorator.flagExporter.Properties.Export_include_dirs...,
-	)
-	includeDirs = append(
-		includeDirs,
-		linker.libraryDecorator.flagExporter.Properties.Export_system_include_dirs...,
-	)
-	return bazel.MakeStringListAttribute(android.FirstUniqueStrings(includeDirs))
-}
-
-func ndkPrebuiltStlBp2build(ctx android.Bp2buildMutatorContext, c *Module) {
-	if ctx.ModuleType() == "ndk_prebuilt_static_stl" {
-		ndkPrebuiltStaticStlBp2build(ctx, c)
-	} else {
-		ndkPrebuiltSharedStlBp2build(ctx, c)
-	}
-}
-
-func ndkPrebuiltStaticStlBp2build(ctx android.Bp2buildMutatorContext, c *Module) {
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_prebuilt_library_static",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_prebuilt_library_static.bzl",
-	}
-	attrs := &bazelPrebuiltLibraryStaticAttributes{
-		Static_library:         stlSrcBp2build(ctx, c),
-		Export_system_includes: stlIncludesBp2build(c), // The exports are always as system
-	}
-	// TODO: min_sdk_version
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: c.Name()}, attrs)
-}
-
-func ndkPrebuiltSharedStlBp2build(ctx android.Bp2buildMutatorContext, c *Module) {
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_prebuilt_library_shared",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_prebuilt_library_shared.bzl",
-	}
-	attrs := &bazelPrebuiltLibrarySharedAttributes{
-		Shared_library:         stlSrcBp2build(ctx, c),
-		Export_system_includes: stlIncludesBp2build(c), // The exports are always as system
-	}
-	// TODO: min_sdk_version
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: c.Name()}, attrs)
-}
diff --git a/cc/object.go b/cc/object.go
index d6eb369..0dba99f 100644
--- a/cc/object.go
+++ b/cc/object.go
@@ -19,8 +19,6 @@
 	"strings"
 
 	"android/soong/android"
-	"android/soong/bazel"
-	"android/soong/bazel/cquery"
 )
 
 //
@@ -50,33 +48,6 @@
 	ndkSysrootPath android.Path
 }
 
-type objectBazelHandler struct {
-	module *Module
-}
-
-var _ BazelHandler = (*objectBazelHandler)(nil)
-
-func (handler *objectBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(label, cquery.GetOutputFiles, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-}
-
-func (handler *objectBazelHandler) ProcessBazelQueryResponse(ctx android.ModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	objPaths, err := bazelCtx.GetOutputFiles(label, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-
-	if len(objPaths) != 1 {
-		ctx.ModuleErrorf("expected exactly one object file for '%s', but got %s", label, objPaths)
-		return
-	}
-
-	handler.module.outputFile = android.OptionalPathForPath(android.PathForBazelOut(ctx, objPaths[0]))
-}
-
 type ObjectLinkerProperties struct {
 	// list of static library modules that should only provide headers for this module.
 	Static_libs []string `android:"arch_variant,variant_prepend"`
@@ -125,115 +96,15 @@
 		baseLinker: NewBaseLinker(module.sanitize),
 	}
 	module.compiler = NewBaseCompiler()
-	module.bazelHandler = &objectBazelHandler{module: module}
 
 	// Clang's address-significance tables are incompatible with ld -r.
 	module.compiler.appendCflags([]string{"-fno-addrsig"})
 
 	module.sdkMemberTypes = []android.SdkMemberType{ccObjectSdkMemberType}
 
-	module.bazelable = true
 	return module.Init()
 }
 
-// For bp2build conversion.
-type bazelObjectAttributes struct {
-	Srcs                bazel.LabelListAttribute
-	Srcs_as             bazel.LabelListAttribute
-	Hdrs                bazel.LabelListAttribute
-	Objs                bazel.LabelListAttribute
-	Deps                bazel.LabelListAttribute
-	System_dynamic_deps bazel.LabelListAttribute
-	Copts               bazel.StringListAttribute
-	Asflags             bazel.StringListAttribute
-	Local_includes      bazel.StringListAttribute
-	Absolute_includes   bazel.StringListAttribute
-	Stl                 *string
-	Linker_script       bazel.LabelAttribute
-	Crt                 *bool
-	SdkAttributes
-}
-
-// objectBp2Build is the bp2build converter from cc_object modules to the
-// Bazel equivalent target, plus any necessary include deps for the cc_object.
-func objectBp2Build(ctx android.Bp2buildMutatorContext, m *Module) {
-	if m.compiler == nil {
-		// a cc_object must have access to the compiler decorator for its props.
-		ctx.ModuleErrorf("compiler must not be nil for a cc_object module")
-	}
-
-	// Set arch-specific configurable attributes
-	baseAttributes := bp2BuildParseBaseProps(ctx, m)
-	compilerAttrs := baseAttributes.compilerAttributes
-	var objs bazel.LabelListAttribute
-	var deps bazel.LabelListAttribute
-	systemDynamicDeps := bazel.LabelListAttribute{ForceSpecifyEmptyList: true}
-
-	var linkerScript bazel.LabelAttribute
-
-	for axis, configToProps := range m.GetArchVariantProperties(ctx, &ObjectLinkerProperties{}) {
-		for config, props := range configToProps {
-			if objectLinkerProps, ok := props.(*ObjectLinkerProperties); ok {
-				if objectLinkerProps.Linker_script != nil {
-					label := android.BazelLabelForModuleSrcSingle(ctx, *objectLinkerProps.Linker_script)
-					linkerScript.SetSelectValue(axis, config, label)
-				}
-				objs.SetSelectValue(axis, config, android.BazelLabelForModuleDeps(ctx, objectLinkerProps.Objs))
-				systemSharedLibs := objectLinkerProps.System_shared_libs
-				if len(systemSharedLibs) > 0 {
-					systemSharedLibs = android.FirstUniqueStrings(systemSharedLibs)
-				}
-				systemDynamicDeps.SetSelectValue(axis, config, bazelLabelForSharedDeps(ctx, systemSharedLibs))
-				deps.SetSelectValue(axis, config, android.BazelLabelForModuleDeps(ctx, objectLinkerProps.Static_libs))
-				deps.SetSelectValue(axis, config, android.BazelLabelForModuleDeps(ctx, objectLinkerProps.Shared_libs))
-				deps.SetSelectValue(axis, config, android.BazelLabelForModuleDeps(ctx, objectLinkerProps.Header_libs))
-				// static_libs, shared_libs, and header_libs have variant_prepend tag
-				deps.Prepend = true
-			}
-		}
-	}
-	objs.ResolveExcludes()
-
-	// Don't split cc_object srcs across languages. Doing so would add complexity,
-	// and this isn't typically done for cc_object.
-	srcs := compilerAttrs.srcs
-	srcs.Append(compilerAttrs.cSrcs)
-
-	asFlags := compilerAttrs.asFlags
-	if compilerAttrs.asSrcs.IsEmpty() {
-		// Skip asflags for BUILD file simplicity if there are no assembly sources.
-		asFlags = bazel.MakeStringListAttribute(nil)
-	}
-
-	attrs := &bazelObjectAttributes{
-		Srcs:                srcs,
-		Srcs_as:             compilerAttrs.asSrcs,
-		Objs:                objs,
-		Deps:                deps,
-		System_dynamic_deps: systemDynamicDeps,
-		Copts:               compilerAttrs.copts,
-		Asflags:             asFlags,
-		Local_includes:      compilerAttrs.localIncludes,
-		Absolute_includes:   compilerAttrs.absoluteIncludes,
-		Stl:                 compilerAttrs.stl,
-		Linker_script:       linkerScript,
-		Crt:                 m.linker.(*objectLinker).Properties.Crt,
-		SdkAttributes:       Bp2BuildParseSdkAttributes(m),
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_object",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_object.bzl",
-	}
-
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, m)
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{
-		Name: m.Name(),
-		Tags: tags,
-	}, attrs)
-}
-
 func (object *objectLinker) appendLdflags(flags []string) {
 	panic(fmt.Errorf("appendLdflags on objectLinker not supported"))
 }
@@ -348,6 +219,10 @@
 	return nil
 }
 
+func (object *objectLinker) strippedAllOutputFilePath() android.Path {
+	panic("Not implemented.")
+}
+
 func (object *objectLinker) nativeCoverage() bool {
 	return true
 }
diff --git a/cc/object_test.go b/cc/object_test.go
index b1e2a0f..e6a3fdd 100644
--- a/cc/object_test.go
+++ b/cc/object_test.go
@@ -85,30 +85,6 @@
 	})
 }
 
-func TestCcObjectWithBazel(t *testing.T) {
-	bp := `
-cc_object {
-	name: "foo",
-	srcs: ["baz.o"],
-	bazel_module: { label: "//foo/bar:bar" },
-}`
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir: "outputbase",
-		LabelToOutputFiles: map[string][]string{
-			"//foo/bar:bar": []string{"bazel_out.o"}}}
-	ctx := testCcWithConfig(t, config)
-
-	module := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon").Module()
-	outputFiles, err := module.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-
-	expectedOutputFiles := []string{"outputbase/execroot/__main__/bazel_out.o"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
-}
-
 func TestCcObjectOutputFile(t *testing.T) {
 	testcases := []struct {
 		name       string
diff --git a/cc/prebuilt.go b/cc/prebuilt.go
index b4819b0..f68fa24 100644
--- a/cc/prebuilt.go
+++ b/cc/prebuilt.go
@@ -18,8 +18,6 @@
 	"path/filepath"
 
 	"android/soong/android"
-	"android/soong/bazel"
-	"android/soong/bazel/cquery"
 )
 
 func init() {
@@ -57,13 +55,6 @@
 	// This is needed only if this library is linked by other modules in build time.
 	// Only makes sense for the Windows target.
 	Windows_import_lib *string `android:"path,arch_variant"`
-
-	// MixedBuildsDisabled is true if and only if building this prebuilt is explicitly disabled in mixed builds for either
-	// its static or shared version on the current build variant. This is to prevent Bazel targets for build variants with
-	// which either the static or shared version is incompatible from participating in mixed buiods. Please note that this
-	// is an override and does not fully determine whether Bazel or Soong will be used. For the full determination, see
-	// cc.ProcessBazelQueryResponse, cc.QueueBazelCall, and cc.MixedBuildsDisabled.
-	MixedBuildsDisabled bool `blueprint:"mutated"`
 }
 
 type prebuiltLinker struct {
@@ -261,7 +252,6 @@
 
 func (p *prebuiltLibraryLinker) disablePrebuilt() {
 	p.properties.Srcs = nil
-	p.properties.MixedBuildsDisabled = true
 }
 
 // Implements versionedInterface
@@ -272,8 +262,6 @@
 func NewPrebuiltLibrary(hod android.HostOrDeviceSupported, srcsProperty string) (*Module, *libraryDecorator) {
 	module, library := NewLibrary(hod)
 	module.compiler = nil
-	module.bazelable = true
-	module.bazelHandler = &prebuiltLibraryBazelHandler{module: module, library: library}
 
 	prebuilt := &prebuiltLibraryLinker{
 		libraryDecorator: library,
@@ -348,82 +336,6 @@
 	return module, library
 }
 
-type bazelPrebuiltLibraryStaticAttributes struct {
-	Static_library         bazel.LabelAttribute
-	Export_includes        bazel.StringListAttribute
-	Export_system_includes bazel.StringListAttribute
-	Alwayslink             bazel.BoolAttribute
-}
-
-// TODO(b/228623543): The below is not entirely true until the bug is fixed. For now, both targets are always generated
-// Implements bp2build for cc_prebuilt_library modules. This will generate:
-//   - Only a cc_prebuilt_library_static if the shared.enabled property is set to false across all variants.
-//   - Only a cc_prebuilt_library_shared if the static.enabled property is set to false across all variants
-//   - Both a cc_prebuilt_library_static and cc_prebuilt_library_shared if the aforementioned properties are not false across
-//     all variants
-//
-// In all cases, cc_prebuilt_library_static target names will be appended with "_bp2build_cc_library_static".
-func prebuiltLibraryBp2Build(ctx android.Bp2buildMutatorContext, module *Module) {
-	prebuiltLibraryStaticBp2Build(ctx, module, true)
-	prebuiltLibrarySharedBp2Build(ctx, module)
-}
-
-func prebuiltLibraryStaticBp2Build(ctx android.Bp2buildMutatorContext, module *Module, fullBuild bool) {
-	prebuiltAttrs := Bp2BuildParsePrebuiltLibraryProps(ctx, module, true)
-	exportedIncludes := bp2BuildParseExportedIncludes(ctx, module, nil)
-
-	attrs := &bazelPrebuiltLibraryStaticAttributes{
-		Static_library:         prebuiltAttrs.Src,
-		Export_includes:        exportedIncludes.Includes,
-		Export_system_includes: exportedIncludes.SystemIncludes,
-		// TODO: ¿Alwayslink?
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_prebuilt_library_static",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_prebuilt_library_static.bzl",
-	}
-
-	name := android.RemoveOptionalPrebuiltPrefix(module.Name())
-	if fullBuild {
-		name += "_bp2build_cc_library_static"
-	}
-
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, module)
-	ctx.CreateBazelTargetModuleWithRestrictions(props, android.CommonAttributes{Name: name, Tags: tags}, attrs, prebuiltAttrs.Enabled)
-
-	_true := true
-	alwayslinkAttrs := *attrs
-	alwayslinkAttrs.Alwayslink.SetValue(&_true)
-	ctx.CreateBazelTargetModuleWithRestrictions(props, android.CommonAttributes{Name: name + "_alwayslink", Tags: tags}, &alwayslinkAttrs, prebuiltAttrs.Enabled)
-}
-
-type bazelPrebuiltLibrarySharedAttributes struct {
-	Shared_library         bazel.LabelAttribute
-	Export_includes        bazel.StringListAttribute
-	Export_system_includes bazel.StringListAttribute
-}
-
-func prebuiltLibrarySharedBp2Build(ctx android.Bp2buildMutatorContext, module *Module) {
-	prebuiltAttrs := Bp2BuildParsePrebuiltLibraryProps(ctx, module, false)
-	exportedIncludes := bp2BuildParseExportedIncludes(ctx, module, nil)
-
-	attrs := &bazelPrebuiltLibrarySharedAttributes{
-		Shared_library:         prebuiltAttrs.Src,
-		Export_includes:        exportedIncludes.Includes,
-		Export_system_includes: exportedIncludes.SystemIncludes,
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_prebuilt_library_shared",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_prebuilt_library_shared.bzl",
-	}
-
-	name := android.RemoveOptionalPrebuiltPrefix(module.Name())
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, module)
-	ctx.CreateBazelTargetModuleWithRestrictions(props, android.CommonAttributes{Name: name, Tags: tags}, attrs, prebuiltAttrs.Enabled)
-}
-
 type prebuiltObjectProperties struct {
 	Srcs []string `android:"path,arch_variant"`
 }
@@ -435,135 +347,6 @@
 	properties prebuiltObjectProperties
 }
 
-type prebuiltLibraryBazelHandler struct {
-	module  *Module
-	library *libraryDecorator
-}
-
-var _ BazelHandler = (*prebuiltLibraryBazelHandler)(nil)
-
-func (h *prebuiltLibraryBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
-	if h.module.linker.(*prebuiltLibraryLinker).properties.MixedBuildsDisabled {
-		return
-	}
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(label, cquery.GetCcInfo, android.GetConfigKey(ctx))
-}
-
-func (h *prebuiltLibraryBazelHandler) ProcessBazelQueryResponse(ctx android.ModuleContext, label string) {
-	if h.module.linker.(*prebuiltLibraryLinker).properties.MixedBuildsDisabled {
-		return
-	}
-	bazelCtx := ctx.Config().BazelContext
-	ccInfo, err := bazelCtx.GetCcInfo(label, android.GetConfigKey(ctx))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-
-	if h.module.static() {
-		if ok := h.processStaticBazelQueryResponse(ctx, label, ccInfo); !ok {
-			return
-		}
-	} else if h.module.Shared() {
-		if ok := h.processSharedBazelQueryResponse(ctx, label, ccInfo); !ok {
-			return
-		}
-	} else {
-		return
-	}
-
-	h.module.maybeUnhideFromMake()
-
-	h.module.setAndroidMkVariablesFromCquery(ccInfo.CcAndroidMkInfo)
-}
-
-func (h *prebuiltLibraryBazelHandler) processStaticBazelQueryResponse(ctx android.ModuleContext, label string, ccInfo cquery.CcInfo) bool {
-	staticLibs := ccInfo.CcStaticLibraryFiles
-	if len(staticLibs) > 1 {
-		ctx.ModuleErrorf("expected 1 static library from bazel target %q, got %s", label, staticLibs)
-		return false
-	}
-
-	// TODO(b/184543518): cc_prebuilt_library_static may have properties for re-exporting flags
-
-	// TODO(eakammer):Add stub-related flags if this library is a stub library.
-	// h.library.exportVersioningMacroIfNeeded(ctx)
-
-	// Dependencies on this library will expect collectedSnapshotHeaders to be set, otherwise
-	// validation will fail. For now, set this to an empty list.
-	// TODO(cparsons): More closely mirror the collectHeadersForSnapshot implementation.
-	h.library.collectedSnapshotHeaders = android.Paths{}
-
-	if len(staticLibs) == 0 {
-		h.module.outputFile = android.OptionalPath{}
-		return true
-	}
-
-	var outputPath android.Path = android.PathForBazelOut(ctx, staticLibs[0])
-	if len(ccInfo.TidyFiles) > 0 {
-		h.module.tidyFiles = android.PathsForBazelOut(ctx, ccInfo.TidyFiles)
-		outputPath = android.AttachValidationActions(ctx, outputPath, h.module.tidyFiles)
-	}
-
-	h.module.outputFile = android.OptionalPathForPath(outputPath)
-
-	depSet := android.NewDepSetBuilder[android.Path](android.TOPOLOGICAL).Direct(outputPath).Build()
-	ctx.SetProvider(StaticLibraryInfoProvider, StaticLibraryInfo{
-		StaticLibrary:                        outputPath,
-		TransitiveStaticLibrariesForOrdering: depSet,
-	})
-
-	return true
-}
-
-func (h *prebuiltLibraryBazelHandler) processSharedBazelQueryResponse(ctx android.ModuleContext, label string, ccInfo cquery.CcInfo) bool {
-	sharedLibs := ccInfo.CcSharedLibraryFiles
-	if len(sharedLibs) > 1 {
-		ctx.ModuleErrorf("expected 1 shared library from bazel target %s, got %q", label, sharedLibs)
-		return false
-	}
-
-	// TODO(b/184543518): cc_prebuilt_library_shared may have properties for re-exporting flags
-
-	// TODO(eakammer):Add stub-related flags if this library is a stub library.
-	// h.library.exportVersioningMacroIfNeeded(ctx)
-
-	if len(sharedLibs) == 0 {
-		h.module.outputFile = android.OptionalPath{}
-		return true
-	}
-
-	var outputPath android.Path = android.PathForBazelOut(ctx, sharedLibs[0])
-	if len(ccInfo.TidyFiles) > 0 {
-		h.module.tidyFiles = android.PathsForBazelOut(ctx, ccInfo.TidyFiles)
-		outputPath = android.AttachValidationActions(ctx, outputPath, h.module.tidyFiles)
-	}
-
-	h.module.outputFile = android.OptionalPathForPath(outputPath)
-
-	// FIXME(b/214600441): We don't yet strip prebuilt shared libraries
-	h.library.unstrippedOutputFile = outputPath
-
-	var toc android.Path
-	if len(ccInfo.TocFile) > 0 {
-		toc = android.PathForBazelOut(ctx, ccInfo.TocFile)
-	} else {
-		toc = outputPath // Just reuse `out` so ninja still gets an input but won't matter
-	}
-
-	info := SharedLibraryInfo{
-		SharedLibrary:   outputPath,
-		TableOfContents: android.OptionalPathForPath(toc),
-		Target:          ctx.Target(),
-	}
-	ctx.SetProvider(SharedLibraryInfoProvider, info)
-
-	h.library.setFlagExporterInfoFromCcInfo(ctx, ccInfo)
-	h.module.maybeUnhideFromMake()
-	return true
-}
-
 func (p *prebuiltObjectLinker) prebuilt() *android.Prebuilt {
 	return &p.Prebuilt
 }
@@ -593,8 +376,6 @@
 
 func NewPrebuiltObject(hod android.HostOrDeviceSupported) *Module {
 	module := newObject(hod)
-	module.bazelHandler = &prebuiltObjectBazelHandler{module: module}
-	module.bazelable = true
 	prebuilt := &prebuiltObjectLinker{
 		objectLinker: objectLinker{
 			baseLinker: NewBaseLinker(nil),
@@ -606,54 +387,6 @@
 	return module
 }
 
-type prebuiltObjectBazelHandler struct {
-	module *Module
-}
-
-var _ BazelHandler = (*prebuiltObjectBazelHandler)(nil)
-
-func (h *prebuiltObjectBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(label, cquery.GetOutputFiles, android.GetConfigKey(ctx))
-}
-
-func (h *prebuiltObjectBazelHandler) ProcessBazelQueryResponse(ctx android.ModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	outputs, err := bazelCtx.GetOutputFiles(label, android.GetConfigKey(ctx))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-	if len(outputs) != 1 {
-		ctx.ModuleErrorf("Expected a single output for `%s`, but got:\n%v", label, outputs)
-		return
-	}
-	out := android.PathForBazelOut(ctx, outputs[0])
-	h.module.outputFile = android.OptionalPathForPath(out)
-	h.module.maybeUnhideFromMake()
-}
-
-type bazelPrebuiltObjectAttributes struct {
-	Src bazel.LabelAttribute
-}
-
-func prebuiltObjectBp2Build(ctx android.Bp2buildMutatorContext, module *Module) {
-	prebuiltAttrs := bp2BuildParsePrebuiltObjectProps(ctx, module)
-
-	attrs := &bazelPrebuiltObjectAttributes{
-		Src: prebuiltAttrs.Src,
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_prebuilt_object",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_prebuilt_object.bzl",
-	}
-
-	name := android.RemoveOptionalPrebuiltPrefix(module.Name())
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, module)
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: name, Tags: tags}, attrs)
-}
-
 func PrebuiltObjectFactory() android.Module {
 	module := NewPrebuiltObject(android.HostAndDeviceSupported)
 	return module.Init()
@@ -747,15 +480,9 @@
 	return module.Init()
 }
 
-type prebuiltBinaryBazelHandler struct {
-	module    *Module
-	decorator *binaryDecorator
-}
-
 func NewPrebuiltBinary(hod android.HostOrDeviceSupported) (*Module, *binaryDecorator) {
-	module, binary := newBinary(hod, true)
+	module, binary := newBinary(hod)
 	module.compiler = nil
-	module.bazelHandler = &prebuiltBinaryBazelHandler{module, binary}
 
 	prebuilt := &prebuiltBinaryLinker{
 		binaryDecorator: binary,
@@ -769,54 +496,6 @@
 	return module, binary
 }
 
-var _ BazelHandler = (*prebuiltBinaryBazelHandler)(nil)
-
-func (h *prebuiltBinaryBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(label, cquery.GetOutputFiles, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-}
-
-func (h *prebuiltBinaryBazelHandler) ProcessBazelQueryResponse(ctx android.ModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	outputs, err := bazelCtx.GetOutputFiles(label, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-	if len(outputs) != 1 {
-		ctx.ModuleErrorf("Expected a single output for `%s`, but got:\n%v", label, outputs)
-		return
-	}
-	out := android.PathForBazelOut(ctx, outputs[0])
-	h.module.outputFile = android.OptionalPathForPath(out)
-	h.module.maybeUnhideFromMake()
-}
-
-type bazelPrebuiltBinaryAttributes struct {
-	Src   bazel.LabelAttribute
-	Strip stripAttributes
-}
-
-func prebuiltBinaryBp2Build(ctx android.Bp2buildMutatorContext, module *Module) {
-	prebuiltAttrs := bp2BuildParsePrebuiltBinaryProps(ctx, module)
-
-	var la linkerAttributes
-	la.convertStripProps(ctx, module)
-	attrs := &bazelPrebuiltBinaryAttributes{
-		Src:   prebuiltAttrs.Src,
-		Strip: stripAttrsFromLinkerAttrs(&la),
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_prebuilt_binary",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_prebuilt_binary.bzl",
-	}
-
-	name := android.RemoveOptionalPrebuiltPrefix(module.Name())
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, module)
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: name, Tags: tags}, attrs)
-}
-
 type Sanitized struct {
 	None struct {
 		Srcs []string `android:"path,arch_variant"`
diff --git a/cc/prebuilt_test.go b/cc/prebuilt_test.go
index 0c79e55..8b4174b 100644
--- a/cc/prebuilt_test.go
+++ b/cc/prebuilt_test.go
@@ -19,8 +19,6 @@
 	"testing"
 
 	"android/soong/android"
-	"android/soong/bazel/cquery"
-
 	"github.com/google/blueprint"
 )
 
@@ -386,289 +384,6 @@
 	assertString(t, static2.OutputFile().Path().Base(), "libf.hwasan.a")
 }
 
-func TestPrebuiltLibraryWithBazel(t *testing.T) {
-	const bp = `
-cc_prebuilt_library {
-	name: "foo",
-	shared: {
-		srcs: ["foo.so"],
-	},
-	static: {
-		srcs: ["foo.a"],
-	},
-	bazel_module: { label: "//foo/bar:bar" },
-}`
-	outBaseDir := "outputbase"
-	result := android.GroupFixturePreparers(
-		prepareForPrebuiltTest,
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: outBaseDir,
-				LabelToCcInfo: map[string]cquery.CcInfo{
-					"//foo/bar:bar": cquery.CcInfo{
-						CcSharedLibraryFiles: []string{"foo.so"},
-					},
-					"//foo/bar:bar_bp2build_cc_library_static": cquery.CcInfo{
-						CcStaticLibraryFiles: []string{"foo.a"},
-					},
-				},
-			}
-		}),
-	).RunTestWithBp(t, bp)
-	sharedFoo := result.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-	pathPrefix := outBaseDir + "/execroot/__main__/"
-
-	sharedInfo := result.ModuleProvider(sharedFoo, SharedLibraryInfoProvider).(SharedLibraryInfo)
-	android.AssertPathRelativeToTopEquals(t,
-		"prebuilt library shared target path did not exist or did not match expected. If the base path is what does not match, it is likely that Soong built this module instead of Bazel.",
-		pathPrefix+"foo.so", sharedInfo.SharedLibrary)
-
-	outputFiles, err := sharedFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{pathPrefix + "foo.so"}
-	android.AssertDeepEquals(t,
-		"prebuilt library shared target output files did not match expected.",
-		expectedOutputFiles, outputFiles.Strings())
-
-	staticFoo := result.ModuleForTests("foo", "android_arm_armv7-a-neon_static").Module()
-	staticInfo := result.ModuleProvider(staticFoo, StaticLibraryInfoProvider).(StaticLibraryInfo)
-	android.AssertPathRelativeToTopEquals(t,
-		"prebuilt library static target path did not exist or did not match expected. If the base path is what does not match, it is likely that Soong built this module instead of Bazel.",
-		pathPrefix+"foo.a", staticInfo.StaticLibrary)
-
-	staticOutputFiles, err := staticFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object staticOutputFiles %s", err)
-	}
-	expectedStaticOutputFiles := []string{pathPrefix + "foo.a"}
-	android.AssertDeepEquals(t,
-		"prebuilt library static target output files did not match expected.",
-		expectedStaticOutputFiles, staticOutputFiles.Strings())
-}
-
-func TestPrebuiltLibraryWithBazelValidations(t *testing.T) {
-	const bp = `
-cc_prebuilt_library {
-	name: "foo",
-	shared: {
-		srcs: ["foo.so"],
-	},
-	static: {
-		srcs: ["foo.a"],
-	},
-	bazel_module: { label: "//foo/bar:bar" },
-	tidy: true,
-}`
-	outBaseDir := "outputbase"
-	result := android.GroupFixturePreparers(
-		prepareForPrebuiltTest,
-		android.FixtureMergeEnv(map[string]string{
-			"ALLOW_LOCAL_TIDY_TRUE": "1",
-		}),
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: outBaseDir,
-				LabelToCcInfo: map[string]cquery.CcInfo{
-					"//foo/bar:bar": cquery.CcInfo{
-						CcSharedLibraryFiles: []string{"foo.so"},
-						TidyFiles:            []string{"foo.c.tidy"},
-					},
-					"//foo/bar:bar_bp2build_cc_library_static": cquery.CcInfo{
-						CcStaticLibraryFiles: []string{"foo.a"},
-						TidyFiles:            []string{"foo.c.tidy"},
-					},
-				},
-			}
-		}),
-	).RunTestWithBp(t, bp)
-	sharedFoo := result.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-
-	expectedOutputFile := "out/soong/.intermediates/foo/android_arm_armv7-a-neon_shared/validated/foo.so"
-	sharedInfo := result.ModuleProvider(sharedFoo, SharedLibraryInfoProvider).(SharedLibraryInfo)
-	android.AssertPathRelativeToTopEquals(t,
-		"prebuilt library shared target path did not exist or did not match expected. If the base path is what does not match, it is likely that Soong built this module instead of Bazel.",
-		expectedOutputFile, sharedInfo.SharedLibrary)
-
-	outputFiles, err := sharedFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{expectedOutputFile}
-	android.AssertPathsRelativeToTopEquals(t,
-		"prebuilt library shared target output files did not match expected.",
-		expectedOutputFiles, outputFiles)
-
-	staticFoo := result.ModuleForTests("foo", "android_arm_armv7-a-neon_static").Module()
-	staticInfo := result.ModuleProvider(staticFoo, StaticLibraryInfoProvider).(StaticLibraryInfo)
-	expectedStaticOutputFile := "out/soong/.intermediates/foo/android_arm_armv7-a-neon_static/validated/foo.a"
-	android.AssertPathRelativeToTopEquals(t,
-		"prebuilt library static target path did not exist or did not match expected. If the base path is what does not match, it is likely that Soong built this module instead of Bazel.",
-		expectedStaticOutputFile, staticInfo.StaticLibrary)
-
-	staticOutputFiles, err := staticFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object staticOutputFiles %s", err)
-	}
-	expectedStaticOutputFiles := []string{expectedStaticOutputFile}
-	android.AssertPathsRelativeToTopEquals(t,
-		"prebuilt library static target output files did not match expected.",
-		expectedStaticOutputFiles, staticOutputFiles)
-}
-
-func TestPrebuiltLibraryWithBazelStaticDisabled(t *testing.T) {
-	const bp = `
-cc_prebuilt_library {
-	name: "foo",
-	shared: {
-		srcs: ["foo.so"],
-	},
-	static: {
-		enabled: false
-	},
-	bazel_module: { label: "//foo/bar:bar" },
-}`
-	outBaseDir := "outputbase"
-	result := android.GroupFixturePreparers(
-		prepareForPrebuiltTest,
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: outBaseDir,
-				LabelToCcInfo: map[string]cquery.CcInfo{
-					"//foo/bar:bar": cquery.CcInfo{
-						CcSharedLibraryFiles: []string{"foo.so"},
-					},
-				},
-			}
-		}),
-	).RunTestWithBp(t, bp)
-	sharedFoo := result.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-	pathPrefix := outBaseDir + "/execroot/__main__/"
-
-	sharedInfo := result.ModuleProvider(sharedFoo, SharedLibraryInfoProvider).(SharedLibraryInfo)
-	android.AssertPathRelativeToTopEquals(t,
-		"prebuilt library shared target path did not exist or did not match expected. If the base path is what does not match, it is likely that Soong built this module instead of Bazel.",
-		pathPrefix+"foo.so", sharedInfo.SharedLibrary)
-
-	outputFiles, err := sharedFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{pathPrefix + "foo.so"}
-	android.AssertDeepEquals(t,
-		"prebuilt library shared target output files did not match expected.",
-		expectedOutputFiles, outputFiles.Strings())
-}
-
-func TestPrebuiltLibraryStaticWithBazel(t *testing.T) {
-	const bp = `
-cc_prebuilt_library_static {
-	name: "foo",
-	srcs: ["foo.so"],
-	bazel_module: { label: "//foo/bar:bar" },
-}`
-	outBaseDir := "outputbase"
-	result := android.GroupFixturePreparers(
-		prepareForPrebuiltTest,
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: outBaseDir,
-				LabelToCcInfo: map[string]cquery.CcInfo{
-					"//foo/bar:bar": cquery.CcInfo{
-						CcStaticLibraryFiles: []string{"foo.so"},
-					},
-				},
-			}
-		}),
-	).RunTestWithBp(t, bp)
-	staticFoo := result.ModuleForTests("foo", "android_arm_armv7-a-neon_static").Module()
-	pathPrefix := outBaseDir + "/execroot/__main__/"
-
-	info := result.ModuleProvider(staticFoo, StaticLibraryInfoProvider).(StaticLibraryInfo)
-	android.AssertPathRelativeToTopEquals(t,
-		"prebuilt library static path did not match expected. If the base path is what does not match, it is likely that Soong built this module instead of Bazel.",
-		pathPrefix+"foo.so", info.StaticLibrary)
-
-	outputFiles, err := staticFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{pathPrefix + "foo.so"}
-	android.AssertDeepEquals(t, "prebuilt library static output files did not match expected.", expectedOutputFiles, outputFiles.Strings())
-}
-
-func TestPrebuiltLibrarySharedWithBazelWithoutToc(t *testing.T) {
-	const bp = `
-cc_prebuilt_library_shared {
-	name: "foo",
-	srcs: ["foo.so"],
-	bazel_module: { label: "//foo/bar:bar" },
-}`
-	outBaseDir := "outputbase"
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir: outBaseDir,
-		LabelToCcInfo: map[string]cquery.CcInfo{
-			"//foo/bar:bar": cquery.CcInfo{
-				CcSharedLibraryFiles: []string{"foo.so"},
-			},
-		},
-	}
-	ctx := testCcWithConfig(t, config)
-	sharedFoo := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-	pathPrefix := outBaseDir + "/execroot/__main__/"
-
-	info := ctx.ModuleProvider(sharedFoo, SharedLibraryInfoProvider).(SharedLibraryInfo)
-	android.AssertPathRelativeToTopEquals(t, "prebuilt shared library",
-		pathPrefix+"foo.so", info.SharedLibrary)
-	android.AssertPathRelativeToTopEquals(t, "prebuilt's 'nullary' ToC",
-		pathPrefix+"foo.so", info.TableOfContents.Path())
-
-	outputFiles, err := sharedFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{pathPrefix + "foo.so"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
-}
-
-func TestPrebuiltLibrarySharedWithBazelWithToc(t *testing.T) {
-	const bp = `
-cc_prebuilt_library_shared {
-	name: "foo",
-	srcs: ["foo.so"],
-	bazel_module: { label: "//foo/bar:bar" },
-}`
-	outBaseDir := "outputbase"
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir: outBaseDir,
-		LabelToCcInfo: map[string]cquery.CcInfo{
-			"//foo/bar:bar": cquery.CcInfo{
-				CcSharedLibraryFiles: []string{"foo.so"},
-				TocFile:              "toc",
-			},
-		},
-	}
-	ctx := testCcWithConfig(t, config)
-	sharedFoo := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-	pathPrefix := outBaseDir + "/execroot/__main__/"
-
-	info := ctx.ModuleProvider(sharedFoo, SharedLibraryInfoProvider).(SharedLibraryInfo)
-	android.AssertPathRelativeToTopEquals(t, "prebuilt shared library's ToC",
-		pathPrefix+"toc", info.TableOfContents.Path())
-	android.AssertPathRelativeToTopEquals(t, "prebuilt shared library",
-		pathPrefix+"foo.so", info.SharedLibrary)
-
-	outputFiles, err := sharedFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{pathPrefix + "foo.so"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
-}
-
 func TestPrebuiltStubNoinstall(t *testing.T) {
 	testFunc := func(t *testing.T, expectLibfooOnSystemLib bool, fs android.MockFS) {
 		result := android.GroupFixturePreparers(
@@ -794,27 +509,3 @@
 }`
 	testCcError(t, `Android.bp:4:6: module "bintest" variant "android_arm64_armv8-a": srcs: multiple prebuilt source files`, bp)
 }
-
-func TestPrebuiltBinaryWithBazel(t *testing.T) {
-	const bp = `
-cc_prebuilt_binary {
-	name: "bintest",
-	srcs: ["bin"],
-	bazel_module: { label: "//bin/foo:foo" },
-}`
-	const outBaseDir = "outputbase"
-	const expectedOut = outBaseDir + "/execroot/__main__/bin"
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir:      outBaseDir,
-		LabelToOutputFiles: map[string][]string{"//bin/foo:foo": []string{"bin"}},
-	}
-	ctx := testCcWithConfig(t, config)
-	bin := ctx.ModuleForTests("bintest", "android_arm64_armv8-a").Module().(*Module)
-	out := bin.OutputFile()
-	if !out.Valid() {
-		t.Error("Invalid output file")
-		return
-	}
-	android.AssertStringEquals(t, "output file", expectedOut, out.String())
-}
diff --git a/cc/proto.go b/cc/proto.go
index 4e08a4c..4d72f26 100644
--- a/cc/proto.go
+++ b/cc/proto.go
@@ -19,7 +19,6 @@
 	"github.com/google/blueprint/proptools"
 
 	"android/soong/android"
-	"android/soong/bazel"
 )
 
 const (
@@ -163,109 +162,3 @@
 
 	return flags
 }
-
-type protoAttributes struct {
-	Deps bazel.LabelListAttribute
-
-	// A list of proto_library targets that that the proto_library in `deps` depends on
-	// This list is overestimation.
-	// Overestimation is necessary since Soong includes other protos via proto.include_dirs and not
-	// a specific .proto file module explicitly.
-	Transitive_deps bazel.LabelListAttribute
-
-	// A list of cc_library_* targets that the generated cpp code depends on
-	Cc_deps bazel.LabelListAttribute
-
-	Min_sdk_version *string
-}
-
-type bp2buildProtoDeps struct {
-	wholeStaticLib               *bazel.LabelAttribute
-	implementationWholeStaticLib *bazel.LabelAttribute
-	protoDep                     *bazel.LabelAttribute
-}
-
-func bp2buildProto(ctx android.Bp2buildMutatorContext, m *Module, protoSrcs bazel.LabelListAttribute, la linkerAttributes) bp2buildProtoDeps {
-	var ret bp2buildProtoDeps
-
-	protoInfo, ok := android.Bp2buildProtoProperties(ctx, &m.ModuleBase, protoSrcs)
-	if !ok || protoInfo.Proto_libs.IsEmpty() {
-		return ret
-	}
-
-	var depName string
-	typ := proptools.StringDefault(protoInfo.Type, protoTypeDefault)
-	var rule_class string
-	suffix := "_cc_proto"
-	switch typ {
-	case "lite":
-		suffix += "_lite"
-		rule_class = "cc_lite_proto_library"
-		depName = "libprotobuf-cpp-lite"
-	case "full":
-		rule_class = "cc_proto_library"
-		depName = "libprotobuf-cpp-full"
-	default:
-		ctx.PropertyErrorf("proto.type", "cannot handle conversion at this time: %q", typ)
-	}
-
-	dep := android.BazelLabelForModuleDepSingle(ctx, depName)
-	ret.protoDep = &bazel.LabelAttribute{Value: &dep}
-
-	var protoAttrs protoAttributes
-	protoAttrs.Deps.SetValue(protoInfo.Proto_libs)
-	protoAttrs.Transitive_deps.SetValue(protoInfo.Transitive_proto_libs)
-
-	// Add the implementation deps of the top-level cc_library_static
-	// This is necessary to compile the internal root of cc_proto_library.
-	// Without this, clang might not be able to find .h files that the generated cpp files depends on
-	protoAttrs.Cc_deps = *la.implementationDeps.Clone()
-	protoAttrs.Cc_deps.Append(la.implementationDynamicDeps)
-	protoAttrs.Cc_deps.Append(la.implementationWholeArchiveDeps)
-	protoAttrs.Cc_deps.Append(la.wholeArchiveDeps)
-	// Subtract myself to prevent possible circular dep
-	protoAttrs.Cc_deps = bazel.SubtractBazelLabelListAttribute(
-		protoAttrs.Cc_deps,
-		bazel.MakeLabelListAttribute(
-			bazel.MakeLabelList([]bazel.Label{
-				bazel.Label{Label: ":" + m.Name() + suffix},
-			}),
-		),
-	)
-	// Subtract the protobuf libraries since cc_proto_library implicitly adds them
-	protoAttrs.Cc_deps = bazel.SubtractBazelLabelListAttribute(
-		protoAttrs.Cc_deps,
-		bazel.MakeLabelListAttribute(
-			bazel.MakeLabelList([]bazel.Label{
-				bazel.Label{Label: "//external/protobuf:libprotobuf-cpp-full", OriginalModuleName: "libprotobuf-cpp-full"},
-				bazel.Label{Label: "//external/protobuf:libprotobuf-cpp-lite", OriginalModuleName: "libprotobuf-cpp-lite"},
-			}),
-		),
-	)
-
-	protoAttrs.Min_sdk_version = m.Properties.Min_sdk_version
-
-	name := m.Name() + suffix
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, m)
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        rule_class,
-			Bzl_load_location: "//build/bazel/rules/cc:cc_proto.bzl",
-		},
-		android.CommonAttributes{Name: name, Tags: tags},
-		&protoAttrs)
-
-	var privateHdrs bool
-	if lib, ok := m.linker.(*libraryDecorator); ok {
-		privateHdrs = !proptools.Bool(lib.Properties.Proto.Export_proto_headers)
-	}
-
-	labelAttr := &bazel.LabelAttribute{Value: &bazel.Label{Label: ":" + name}}
-	if privateHdrs {
-		ret.implementationWholeStaticLib = labelAttr
-	} else {
-		ret.wholeStaticLib = labelAttr
-	}
-
-	return ret
-}
diff --git a/cc/rs.go b/cc/rs.go
index 93acdc7..b0d759b 100644
--- a/cc/rs.go
+++ b/cc/rs.go
@@ -20,7 +20,6 @@
 	"strings"
 
 	"android/soong/android"
-	"android/soong/bazel"
 	"github.com/google/blueprint"
 )
 
@@ -134,35 +133,3 @@
 
 	return flags
 }
-
-type rscriptAttributes struct {
-	// Renderscript source files
-	Srcs bazel.LabelListAttribute
-}
-
-func bp2buildRScript(ctx android.Bp2buildMutatorContext, m *Module, ca compilerAttributes) (bazel.LabelAttribute, bazel.StringListAttribute, bazel.StringListAttribute) {
-	var rscriptAttrs rscriptAttributes
-	var rsAbsIncludes bazel.StringListAttribute
-	var localIncludes bazel.StringListAttribute
-	var rsModuleName string
-	var convertedRsSrcsLabel bazel.LabelAttribute
-
-	if !ca.rscriptSrcs.IsEmpty() {
-		rscriptAttrs.Srcs = ca.rscriptSrcs
-		rsModuleName = m.Name() + "_renderscript"
-
-		localIncludes.Value = []string{"."}
-		rsAbsIncludes.Value = []string{"frameworks/rs", "frameworks/rs/cpp"}
-		convertedRsSrcsLabel = bazel.LabelAttribute{Value: &bazel.Label{Label: rsModuleName}}
-
-		ctx.CreateBazelTargetModule(
-			bazel.BazelTargetModuleProperties{
-				Rule_class:        "rscript_to_cpp",
-				Bzl_load_location: "//build/bazel/rules/cc:rscript_to_cpp.bzl",
-			},
-			android.CommonAttributes{Name: rsModuleName},
-			&rscriptAttrs)
-	}
-
-	return convertedRsSrcsLabel, rsAbsIncludes, localIncludes
-}
diff --git a/cc/sanitize.go b/cc/sanitize.go
index 6624d4b..31c0500 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -1911,7 +1911,3 @@
 func hwasanMakeVarsProvider(ctx android.MakeVarsContext) {
 	hwasanStaticLibs(ctx.Config()).exportToMake(ctx)
 }
-
-func BazelCcSanitizerToolchainVars(config android.Config) string {
-	return android.BazelToolchainVars(config, exportedVars)
-}
diff --git a/cc/stl.go b/cc/stl.go
index a31a585..63c23d7 100644
--- a/cc/stl.go
+++ b/cc/stl.go
@@ -134,8 +134,6 @@
 	return "libunwind"
 }
 
-// Should be kept up to date with
-// https://cs.android.com/android/platform/superproject/+/master:build/bazel/rules/cc/stl.bzl;l=46;drc=21771b671ae08565033768a6d3d151c54f887fa2
 func (stl *stl) deps(ctx BaseModuleContext, deps Deps) Deps {
 	switch stl.Properties.SelectedStl {
 	case "libstdc++":
@@ -187,8 +185,6 @@
 	return deps
 }
 
-// Should be kept up to date with
-// https://cs.android.com/android/platform/superproject/+/master:build/bazel/rules/cc/stl.bzl;l=94;drc=5bc8e39d2637927dc57dd0850210d43d348a1341
 func (stl *stl) flags(ctx ModuleContext, flags Flags) Flags {
 	switch stl.Properties.SelectedStl {
 	case "libc++", "libc++_static":
diff --git a/cc/strip.go b/cc/strip.go
index c60e135..b1f34bb 100644
--- a/cc/strip.go
+++ b/cc/strip.go
@@ -59,7 +59,6 @@
 	return !forceDisable && (forceEnable || defaultEnable)
 }
 
-// Keep this consistent with //build/bazel/rules/stripped_shared_library.bzl.
 func (stripper *Stripper) strip(actx android.ModuleContext, in android.Path, out android.ModuleOutPath,
 	flags StripFlags, isStaticLib bool) {
 	if actx.Darwin() {
diff --git a/cc/stub_library.go b/cc/stub_library.go
index 3a6d0ae..47c6cb9 100644
--- a/cc/stub_library.go
+++ b/cc/stub_library.go
@@ -27,7 +27,8 @@
 }
 
 type stubLibraries struct {
-	stubLibraryMap map[string]bool
+	stubLibraryMap       map[string]bool
+	stubVendorLibraryMap map[string]bool
 
 	apiListCoverageXmlPaths []string
 }
@@ -54,6 +55,9 @@
 			if IsStubTarget(m) {
 				if name := getInstalledFileName(m); name != "" {
 					s.stubLibraryMap[name] = true
+					if m.InVendor() {
+						s.stubVendorLibraryMap[name] = true
+					}
 				}
 			}
 			if m.library != nil {
@@ -67,13 +71,15 @@
 
 func stubLibrariesSingleton() android.Singleton {
 	return &stubLibraries{
-		stubLibraryMap: make(map[string]bool),
+		stubLibraryMap:       make(map[string]bool),
+		stubVendorLibraryMap: make(map[string]bool),
 	}
 }
 
 func (s *stubLibraries) MakeVars(ctx android.MakeVarsContext) {
 	// Convert stub library file names into Makefile variable.
 	ctx.Strict("STUB_LIBRARIES", strings.Join(android.SortedKeys(s.stubLibraryMap), " "))
+	ctx.Strict("SOONG_STUB_VENDOR_LIBRARIES", strings.Join(android.SortedKeys(s.stubVendorLibraryMap), " "))
 
 	// Export the list of API XML files to Make.
 	sort.Strings(s.apiListCoverageXmlPaths)
diff --git a/cc/test.go b/cc/test.go
index a4224c3..d02145b 100644
--- a/cc/test.go
+++ b/cc/test.go
@@ -22,8 +22,6 @@
 	"github.com/google/blueprint/proptools"
 
 	"android/soong/android"
-	"android/soong/bazel"
-	"android/soong/bazel/cquery"
 	"android/soong/tradefed"
 )
 
@@ -139,8 +137,7 @@
 // specific functionality on a device. The executable binary gets an implicit
 // static_libs dependency on libgtests unless the gtest flag is set to false.
 func TestFactory() android.Module {
-	module := NewTest(android.HostAndDeviceSupported, true)
-	module.bazelHandler = &ccTestBazelHandler{module: module}
+	module := NewTest(android.HostAndDeviceSupported)
 	return module.Init()
 }
 
@@ -164,7 +161,7 @@
 
 // cc_test_host compiles a test host binary.
 func TestHostFactory() android.Module {
-	module := NewTest(android.HostSupported, true)
+	module := NewTest(android.HostSupported)
 	return module.Init()
 }
 
@@ -424,6 +421,8 @@
 	if ctx.Host() && test.gtest() && test.Properties.Test_options.Unit_test == nil {
 		test.Properties.Test_options.Unit_test = proptools.BoolPtr(true)
 	}
+
+	test.binaryDecorator.baseInstaller.installTestData(ctx, test.data)
 	test.binaryDecorator.baseInstaller.install(ctx, file)
 }
 
@@ -486,9 +485,8 @@
 	return configs
 }
 
-func NewTest(hod android.HostOrDeviceSupported, bazelable bool) *Module {
-	module, binary := newBinary(hod, bazelable)
-	module.bazelable = bazelable
+func NewTest(hod android.HostOrDeviceSupported) *Module {
+	module, binary := newBinary(hod)
 	module.multilib = android.MultilibBoth
 	module.testModule = true
 	binary.baseInstaller = NewTestInstaller()
@@ -550,7 +548,6 @@
 	}
 	module.linker = test
 	module.installer = test
-	module.bazelable = true
 	return module
 }
 
@@ -584,7 +581,7 @@
 type benchmarkDecorator struct {
 	*binaryDecorator
 	Properties BenchmarkProperties
-	data       android.Paths
+	data       []android.DataPath
 	testConfig android.Path
 }
 
@@ -605,7 +602,9 @@
 }
 
 func (benchmark *benchmarkDecorator) install(ctx ModuleContext, file android.Path) {
-	benchmark.data = android.PathsForModuleSrc(ctx, benchmark.Properties.Data)
+	for _, d := range android.PathsForModuleSrc(ctx, benchmark.Properties.Data) {
+		benchmark.data = append(benchmark.data, android.DataPath{SrcPath: d})
+	}
 
 	var configs []tradefed.Config
 	if Bool(benchmark.Properties.Require_root) {
@@ -623,11 +622,12 @@
 
 	benchmark.binaryDecorator.baseInstaller.dir = filepath.Join("benchmarktest", ctx.ModuleName())
 	benchmark.binaryDecorator.baseInstaller.dir64 = filepath.Join("benchmarktest64", ctx.ModuleName())
+	benchmark.binaryDecorator.baseInstaller.installTestData(ctx, benchmark.data)
 	benchmark.binaryDecorator.baseInstaller.install(ctx, file)
 }
 
 func NewBenchmark(hod android.HostOrDeviceSupported) *Module {
-	module, binary := newBinary(hod, false)
+	module, binary := newBinary(hod)
 	module.multilib = android.MultilibBoth
 	binary.baseInstaller = NewBaseInstaller("benchmarktest", "benchmarktest64", InstallInData)
 
@@ -638,180 +638,3 @@
 	module.installer = benchmark
 	return module
 }
-
-type ccTestBazelHandler struct {
-	module *Module
-}
-
-var _ BazelHandler = (*ccTestBazelHandler)(nil)
-
-// The top level target named $label is a test_suite target,
-// not the internal cc_test executable target.
-//
-// This is to ensure `b test //$label` runs the test_suite target directly,
-// which depends on tradefed_test targets, instead of the internal cc_test
-// target, which doesn't have tradefed integrations.
-//
-// However, for cquery, we want the internal cc_test executable target, which
-// has the suffix "__tf_internal".
-func mixedBuildsTestLabel(label string) string {
-	return label + "__tf_internal"
-}
-
-func (handler *ccTestBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(mixedBuildsTestLabel(label), cquery.GetCcUnstrippedInfo, android.GetConfigKey(ctx))
-}
-
-func (handler *ccTestBazelHandler) ProcessBazelQueryResponse(ctx android.ModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	info, err := bazelCtx.GetCcUnstrippedInfo(mixedBuildsTestLabel(label), android.GetConfigKey(ctx))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-
-	var outputFilePath android.Path = android.PathForBazelOut(ctx, info.OutputFile)
-	if len(info.TidyFiles) > 0 {
-		handler.module.tidyFiles = android.PathsForBazelOut(ctx, info.TidyFiles)
-		outputFilePath = android.AttachValidationActions(ctx, outputFilePath, handler.module.tidyFiles)
-	}
-	handler.module.outputFile = android.OptionalPathForPath(outputFilePath)
-	handler.module.linker.(*testBinary).unstrippedOutputFile = android.PathForBazelOut(ctx, info.UnstrippedOutput)
-
-	handler.module.setAndroidMkVariablesFromCquery(info.CcAndroidMkInfo)
-}
-
-// binaryAttributes contains Bazel attributes corresponding to a cc test
-type testBinaryAttributes struct {
-	binaryAttributes
-
-	Gtest *bool
-
-	tidyAttributes
-	tradefed.TestConfigAttributes
-
-	Runs_on bazel.StringListAttribute
-}
-
-// testBinaryBp2build is the bp2build converter for cc_test modules. A cc_test's
-// dependency graph and compilation/linking steps are functionally similar to a
-// cc_binary, but has additional dependencies on test deps like gtest, and
-// produces additional runfiles like XML plans for Tradefed orchestration
-//
-// TODO(b/244432609): handle `isolated` property.
-// TODO(b/244432134): handle custom runpaths for tests that assume runfile layouts not
-// default to bazel. (see linkerInit function)
-func testBinaryBp2build(ctx android.Bp2buildMutatorContext, m *Module) {
-	var testBinaryAttrs testBinaryAttributes
-	testBinaryAttrs.binaryAttributes = binaryBp2buildAttrs(ctx, m)
-
-	var data bazel.LabelListAttribute
-	var tags bazel.StringListAttribute
-
-	testBinaryProps := m.GetArchVariantProperties(ctx, &TestBinaryProperties{})
-	for axis, configToProps := range testBinaryProps {
-		for config, props := range configToProps {
-			if p, ok := props.(*TestBinaryProperties); ok {
-				// Combine data, data_bins and data_libs into a single 'data' attribute.
-				var combinedData bazel.LabelList
-				combinedData.Append(android.BazelLabelForModuleSrc(ctx, p.Data))
-				combinedData.Append(android.BazelLabelForModuleDeps(ctx, p.Data_bins))
-				combinedData.Append(android.BazelLabelForModuleDeps(ctx, p.Data_libs))
-				data.SetSelectValue(axis, config, combinedData)
-				tags.SetSelectValue(axis, config, p.Test_options.Tags)
-			}
-		}
-	}
-
-	// The logic comes from https://cs.android.com/android/platform/superproject/main/+/0df8153267f96da877febc5332240fa06ceb8533:build/soong/cc/sanitize.go;l=488
-	var features bazel.StringListAttribute
-	curFeatures := testBinaryAttrs.binaryAttributes.Features.SelectValue(bazel.OsArchConfigurationAxis, bazel.OsArchAndroidArm64)
-	var newFeatures []string
-	if !android.InList("memtag_heap", curFeatures) && !android.InList("-memtag_heap", curFeatures) {
-		newFeatures = append(newFeatures, "memtag_heap")
-		if !android.InList("diag_memtag_heap", curFeatures) && !android.InList("-diag_memtag_heap", curFeatures) {
-			newFeatures = append(newFeatures, "diag_memtag_heap")
-		}
-	}
-
-	features.SetSelectValue(bazel.OsArchConfigurationAxis, bazel.OsArchAndroidArm64, newFeatures)
-	testBinaryAttrs.binaryAttributes.Features.Append(features)
-	testBinaryAttrs.binaryAttributes.Features.DeduplicateAxesFromBase()
-
-	m.convertTidyAttributes(ctx, &testBinaryAttrs.tidyAttributes)
-
-	testBinary := m.linker.(*testBinary)
-	gtest := testBinary.gtest()
-	gtestIsolated := testBinary.isolated(ctx)
-	// Use the underling bool pointer for Gtest in attrs
-	// This ensures that if this property is not set in Android.bp file, it will not be set in BUILD file either
-	// cc_test macro will default gtest to True
-	testBinaryAttrs.Gtest = testBinary.LinkerProperties.Gtest
-
-	addImplicitGtestDeps(ctx, &testBinaryAttrs, gtest, gtestIsolated)
-
-	var unitTest *bool
-
-	for _, testProps := range m.GetProperties() {
-		if p, ok := testProps.(*TestBinaryProperties); ok {
-			useVendor := false // TODO Bug: 262914724
-			testInstallBase := getTestInstallBase(useVendor)
-			testConfigAttributes := tradefed.GetTestConfigAttributes(
-				ctx,
-				p.Test_config,
-				p.Test_options.Extra_test_configs,
-				p.Auto_gen_config,
-				p.Test_options.Test_suite_tag,
-				p.Test_config_template,
-				getTradefedConfigOptions(ctx, p, gtestIsolated, true),
-				&testInstallBase,
-			)
-			testBinaryAttrs.TestConfigAttributes = testConfigAttributes
-			unitTest = p.Test_options.Unit_test
-		}
-	}
-
-	testBinaryAttrs.Runs_on = bazel.MakeStringListAttribute(android.RunsOn(
-		m.ModuleBase.HostSupported(),
-		m.ModuleBase.DeviceSupported(),
-		gtest || (unitTest != nil && *unitTest)))
-
-	// TODO (b/262914724): convert to tradefed_cc_test and tradefed_cc_test_host
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "cc_test",
-			Bzl_load_location: "//build/bazel/rules/cc:cc_test.bzl",
-		},
-		android.CommonAttributes{
-			Name: m.Name(),
-			Data: data,
-			Tags: tags,
-		},
-		&testBinaryAttrs)
-}
-
-// cc_test that builds using gtest needs some additional deps
-// addImplicitGtestDeps makes these deps explicit in the generated BUILD files
-func addImplicitGtestDeps(ctx android.Bp2buildMutatorContext, attrs *testBinaryAttributes, gtest, gtestIsolated bool) {
-	addDepsAndDedupe := func(lla *bazel.LabelListAttribute, modules []string) {
-		moduleLabels := android.BazelLabelForModuleDeps(ctx, modules)
-		lla.Value.Append(moduleLabels)
-		// Dedupe
-		lla.Value = bazel.FirstUniqueBazelLabelList(lla.Value)
-	}
-	// this must be kept in sync with Soong's implementation in:
-	// https://cs.android.com/android/_/android/platform/build/soong/+/460fb2d6d546b5ab493a7e5479998c4933a80f73:cc/test.go;l=300-313;drc=ec7314336a2b35ea30ce5438b83949c28e3ac429;bpv=1;bpt=0
-	if gtest {
-		// TODO - b/244433197: Handle canUseSdk
-		if gtestIsolated {
-			addDepsAndDedupe(&attrs.Deps, []string{"libgtest_isolated_main"})
-			addDepsAndDedupe(&attrs.Dynamic_deps, []string{"liblog"})
-		} else {
-			addDepsAndDedupe(&attrs.Deps, []string{
-				"libgtest_main",
-				"libgtest",
-			})
-		}
-	}
-}
diff --git a/cc/testing.go b/cc/testing.go
index 71d986b..b1583f1 100644
--- a/cc/testing.go
+++ b/cc/testing.go
@@ -797,7 +797,7 @@
 func checkOverrides(t *testing.T, ctx *android.TestContext, singleton android.TestingSingleton, jsonPath string, expected []string) {
 	t.Helper()
 	out := singleton.MaybeOutput(jsonPath)
-	content := android.ContentFromFileRuleForTests(t, out)
+	content := android.ContentFromFileRuleForTests(t, ctx, out)
 
 	var flags snapshotJsonFlags
 	if err := json.Unmarshal([]byte(content), &flags); err != nil {
diff --git a/cc/tidy.go b/cc/tidy.go
index 7b123cb..76ac7d5 100644
--- a/cc/tidy.go
+++ b/cc/tidy.go
@@ -68,7 +68,6 @@
 // Then, that old style usage will be obsolete and an error.
 const NoWarningsAsErrorsInTidyFlags = true
 
-// keep this up to date with https://cs.android.com/android/platform/superproject/+/master:build/bazel/rules/cc/clang_tidy.bzl
 func (tidy *tidyFeature) flags(ctx ModuleContext, flags Flags) Flags {
 	CheckBadTidyFlags(ctx, "tidy_flags", tidy.Properties.Tidy_flags)
 	CheckBadTidyChecks(ctx, "tidy_checks", tidy.Properties.Tidy_checks)
diff --git a/cc/vendor_snapshot_test.go b/cc/vendor_snapshot_test.go
index c5431b3..890a533 100644
--- a/cc/vendor_snapshot_test.go
+++ b/cc/vendor_snapshot_test.go
@@ -23,13 +23,14 @@
 	"testing"
 )
 
-func checkJsonContents(t *testing.T, ctx android.TestingSingleton, jsonPath string, key string, value string) {
-	jsonOut := ctx.MaybeOutput(jsonPath)
+func checkJsonContents(t *testing.T, ctx *android.TestContext, snapshotSingleton android.TestingSingleton, jsonPath string, key string, value string) {
+	jsonOut := snapshotSingleton.MaybeOutput(jsonPath)
 	if jsonOut.Rule == nil {
 		t.Errorf("%q expected but not found", jsonPath)
 		return
 	}
-	if !strings.Contains(jsonOut.Args["content"], fmt.Sprintf("%q:%q", key, value)) {
+	content := android.ContentFromFileRuleForTests(t, ctx, jsonOut)
+	if !strings.Contains(content, fmt.Sprintf("%q:%q", key, value)) {
 		t.Errorf("%q must include %q:%q but it only has %v", jsonPath, key, value, jsonOut.Args["content"])
 	}
 }
@@ -167,8 +168,8 @@
 			filepath.Join(staticDir, "libvendor_available.a.json"),
 			filepath.Join(staticDir, "libvendor_available.cfi.a.json"))
 
-		checkJsonContents(t, snapshotSingleton, filepath.Join(staticDir, "libb.a.json"), "MinSdkVersion", "apex_inherit")
-		checkJsonContents(t, snapshotSingleton, filepath.Join(staticDir, "libvendor_available.a.json"), "MinSdkVersion", "29")
+		checkJsonContents(t, ctx, snapshotSingleton, filepath.Join(staticDir, "libb.a.json"), "MinSdkVersion", "apex_inherit")
+		checkJsonContents(t, ctx, snapshotSingleton, filepath.Join(staticDir, "libvendor_available.a.json"), "MinSdkVersion", "29")
 
 		// For binary executables, all vendor:true and vendor_available modules are captured.
 		if archType == "arm64" {
diff --git a/cmd/sbox/sbox.go b/cmd/sbox/sbox.go
index 3364f50..e69a930 100644
--- a/cmd/sbox/sbox.go
+++ b/cmd/sbox/sbox.go
@@ -22,6 +22,7 @@
 	"flag"
 	"fmt"
 	"io"
+	"io/fs"
 	"io/ioutil"
 	"os"
 	"os/exec"
@@ -478,7 +479,8 @@
 // copyOneFile copies a file and its permissions.  If forceExecutable is true it adds u+x to the
 // permissions.  If exists is allowFromNotExists it returns nil if the from path doesn't exist.
 // If write is onlyWriteIfChanged then the output file is compared to the input file and not written to
-// if it is the same, avoiding updating the timestamp.
+// if it is the same, avoiding updating the timestamp. If from is a symlink, the symlink itself
+// will be copied, instead of what it points to.
 func copyOneFile(from string, to string, forceExecutable bool, exists existsType,
 	write writeType) error {
 	err := os.MkdirAll(filepath.Dir(to), 0777)
@@ -486,7 +488,7 @@
 		return err
 	}
 
-	stat, err := os.Stat(from)
+	stat, err := os.Lstat(from)
 	if err != nil {
 		if os.IsNotExist(err) && exists == allowFromNotExists {
 			return nil
@@ -494,6 +496,25 @@
 		return err
 	}
 
+	if stat.Mode()&fs.ModeSymlink != 0 {
+		linkTarget, err := os.Readlink(from)
+		if err != nil {
+			return err
+		}
+		if write == onlyWriteIfChanged {
+			toLinkTarget, err := os.Readlink(to)
+			if err == nil && toLinkTarget == linkTarget {
+				return nil
+			}
+		}
+		err = os.Remove(to)
+		if err != nil && !os.IsNotExist(err) {
+			return err
+		}
+
+		return os.Symlink(linkTarget, to)
+	}
+
 	perm := stat.Mode()
 	if forceExecutable {
 		perm = perm | 0100 // u+x
diff --git a/cmd/soong_build/main.go b/cmd/soong_build/main.go
index 5abbdb7..7742492 100644
--- a/cmd/soong_build/main.go
+++ b/cmd/soong_build/main.go
@@ -28,8 +28,6 @@
 	"android/soong/android/allowlists"
 	"android/soong/bp2build"
 	"android/soong/shared"
-	"android/soong/ui/metrics/bp2build_metrics_proto"
-
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/bootstrap"
 	"github.com/google/blueprint/deptools"
@@ -74,16 +72,10 @@
 	flag.StringVar(&cmdlineArgs.ModuleActionsFile, "module_actions_file", "", "JSON file to output inputs/outputs of actions of modules")
 	flag.StringVar(&cmdlineArgs.DocFile, "soong_docs", "", "build documentation file to output")
 	flag.StringVar(&cmdlineArgs.BazelQueryViewDir, "bazel_queryview_dir", "", "path to the bazel queryview directory relative to --top")
-	flag.StringVar(&cmdlineArgs.Bp2buildMarker, "bp2build_marker", "", "If set, run bp2build, touch the specified marker file then exit")
-	flag.StringVar(&cmdlineArgs.SymlinkForestMarker, "symlink_forest_marker", "", "If set, create the bp2build symlink forest, touch the specified marker file, then exit")
 	flag.StringVar(&cmdlineArgs.OutFile, "o", "build.ninja", "the Ninja file to output")
 	flag.StringVar(&cmdlineArgs.SoongVariables, "soong_variables", "soong.variables", "the file contains all build variables")
-	flag.StringVar(&cmdlineArgs.BazelForceEnabledModules, "bazel-force-enabled-modules", "", "additional modules to build with Bazel. Comma-delimited")
 	flag.BoolVar(&cmdlineArgs.EmptyNinjaFile, "empty-ninja-file", false, "write out a 0-byte ninja file")
 	flag.BoolVar(&cmdlineArgs.MultitreeBuild, "multitree-build", false, "this is a multitree build")
-	flag.BoolVar(&cmdlineArgs.BazelMode, "bazel-mode", false, "use bazel for analysis of certain modules")
-	flag.BoolVar(&cmdlineArgs.BazelModeStaging, "bazel-mode-staging", false, "use bazel for analysis of certain near-ready modules")
-	flag.BoolVar(&cmdlineArgs.UseBazelProxy, "use-bazel-proxy", false, "communicate with bazel using unix socket proxy instead of spawning subprocesses")
 	flag.BoolVar(&cmdlineArgs.BuildFromSourceStub, "build-from-source-stub", false, "build Java stubs from source files instead of API text files")
 	flag.BoolVar(&cmdlineArgs.EnsureAllowlistIntegrity, "ensure-allowlist-integrity", false, "verify that allowlisted modules are mixed-built")
 	// Flags that probably shouldn't be flags of soong_build, but we haven't found
@@ -110,40 +102,6 @@
 	return ctx
 }
 
-// Bazel-enabled mode. Attaches a mutator to queue Bazel requests, adds a
-// BeforePrepareBuildActionsHook to invoke Bazel, and then uses Bazel metadata
-// for modules that should be handled by Bazel.
-func runMixedModeBuild(ctx *android.Context, extraNinjaDeps []string) string {
-	ctx.EventHandler.Begin("mixed_build")
-	defer ctx.EventHandler.End("mixed_build")
-
-	bazelHook := func() error {
-		err := ctx.Config().BazelContext.QueueBazelSandwichCqueryRequests(ctx.Config())
-		if err != nil {
-			return err
-		}
-		return ctx.Config().BazelContext.InvokeBazel(ctx.Config(), ctx)
-	}
-	ctx.SetBeforePrepareBuildActionsHook(bazelHook)
-	ninjaDeps, err := bootstrap.RunBlueprint(cmdlineArgs.Args, bootstrap.DoEverything, ctx.Context, ctx.Config())
-	maybeQuit(err, "")
-	ninjaDeps = append(ninjaDeps, extraNinjaDeps...)
-
-	bazelPaths, err := readFileLines(ctx.Config().Getenv("BAZEL_DEPS_FILE"))
-	if err != nil {
-		panic("Bazel deps file not found: " + err.Error())
-	}
-	ninjaDeps = append(ninjaDeps, bazelPaths...)
-	ninjaDeps = append(ninjaDeps, writeBuildGlobsNinjaFile(ctx)...)
-
-	writeDepFile(cmdlineArgs.OutFile, ctx.EventHandler, ninjaDeps)
-
-	if needToWriteNinjaHint(ctx) {
-		writeNinjaHint(ctx)
-	}
-	return cmdlineArgs.OutFile
-}
-
 func needToWriteNinjaHint(ctx *android.Context) bool {
 	switch ctx.Config().GetenvWithDefault("SOONG_GENERATES_NINJA_HINT", "") {
 	case "always":
@@ -228,67 +186,6 @@
 	maybeQuit(err, "error writing soong_build metrics %s", metricsFile)
 }
 
-// Errors out if any modules expected to be mixed_built were not, unless
-// the modules did not exist.
-func checkForAllowlistIntegrityError(configuration android.Config, isStagingMode bool) error {
-	modules := findMisconfiguredModules(configuration, isStagingMode)
-	if len(modules) == 0 {
-		return nil
-	}
-
-	return fmt.Errorf("Error: expected the following modules to be mixed_built: %s", modules)
-}
-
-// Returns true if the given module has all of the following true:
-//  1. Is allowlisted to be built with Bazel.
-//  2. Has a variant which is *not* built with Bazel.
-//  3. Has no variant which is built with Bazel.
-//
-// This indicates the allowlisting of this variant had no effect.
-// TODO(b/280457637): Return true for nonexistent modules.
-func isAllowlistMisconfiguredForModule(module string, mixedBuildsEnabled map[string]struct{}, mixedBuildsDisabled map[string]struct{}) bool {
-	_, enabled := mixedBuildsEnabled[module]
-
-	if enabled {
-		return false
-	}
-
-	_, disabled := mixedBuildsDisabled[module]
-	return disabled
-
-}
-
-// Returns the list of modules that should have been mixed_built (per the
-// allowlists and cmdline flags) but were not.
-// Note: nonexistent modules are excluded from the list. See b/280457637
-func findMisconfiguredModules(configuration android.Config, isStagingMode bool) []string {
-	retval := []string{}
-	forceEnabledModules := configuration.BazelModulesForceEnabledByFlag()
-
-	mixedBuildsEnabled := configuration.GetMixedBuildsEnabledModules()
-	mixedBuildsDisabled := configuration.GetMixedBuildsDisabledModules()
-	for _, module := range allowlists.ProdMixedBuildsEnabledList {
-		if isAllowlistMisconfiguredForModule(module, mixedBuildsEnabled, mixedBuildsDisabled) {
-			retval = append(retval, module)
-		}
-	}
-
-	if isStagingMode {
-		for _, module := range allowlists.StagingMixedBuildsEnabledList {
-			if isAllowlistMisconfiguredForModule(module, mixedBuildsEnabled, mixedBuildsDisabled) {
-				retval = append(retval, module)
-			}
-		}
-	}
-
-	for module, _ := range forceEnabledModules {
-		if isAllowlistMisconfiguredForModule(module, mixedBuildsEnabled, mixedBuildsDisabled) {
-			retval = append(retval, module)
-		}
-	}
-	return retval
-}
-
 func writeJsonModuleGraphAndActions(ctx *android.Context, cmdArgs android.CmdArgs) {
 	graphFile, graphErr := os.Create(shared.JoinPath(topDir, cmdArgs.ModuleGraphFile))
 	maybeQuit(graphErr, "graph err")
@@ -424,37 +321,9 @@
 	ctx := newContext(configuration)
 	android.StartBackgroundMetrics(configuration)
 
-	var finalOutputFile string
-
-	// Run Soong for a specific activity, like bp2build, queryview
-	// or the actual Soong build for the build.ninja file.
-	switch configuration.BuildMode {
-	case android.SymlinkForest:
-		finalOutputFile = runSymlinkForestCreation(ctx, extraNinjaDeps, metricsDir)
-	case android.Bp2build:
-		// Run the alternate pipeline of bp2build mutators and singleton to convert
-		// Blueprint to BUILD files before everything else.
-		finalOutputFile = runBp2Build(ctx, extraNinjaDeps, metricsDir)
-	default:
-		ctx.Register()
-		isMixedBuildsEnabled := configuration.IsMixedBuildsEnabled()
-		if isMixedBuildsEnabled {
-			finalOutputFile = runMixedModeBuild(ctx, extraNinjaDeps)
-			if cmdlineArgs.EnsureAllowlistIntegrity {
-				if err := checkForAllowlistIntegrityError(configuration, cmdlineArgs.BazelModeStaging); err != nil {
-					maybeQuit(err, "")
-				}
-			}
-		} else {
-			finalOutputFile = runSoongOnlyBuild(ctx, extraNinjaDeps)
-		}
-		writeMetrics(configuration, ctx.EventHandler, metricsDir)
-	}
-
-	// Register this environment variablesas being an implicit dependencies of
-	// soong_build. Changes to this environment variable will result in
-	// retriggering soong_build.
-	configuration.Getenv("USE_BAZEL_VERSION")
+	ctx.Register()
+	finalOutputFile := runSoongOnlyBuild(ctx, extraNinjaDeps)
+	writeMetrics(configuration, ctx.EventHandler, metricsDir)
 
 	writeUsedEnvironmentFile(configuration)
 
@@ -497,213 +366,6 @@
 	maybeQuit(err, "error touching '%s'", path)
 }
 
-// Read the bazel.list file that the Soong Finder already dumped earlier (hopefully)
-// It contains the locations of BUILD files, BUILD.bazel files, etc. in the source dir
-func getExistingBazelRelatedFiles(topDir string) ([]string, error) {
-	bazelFinderFile := filepath.Join(filepath.Dir(cmdlineArgs.ModuleListFile), "bazel.list")
-	if !filepath.IsAbs(bazelFinderFile) {
-		// Assume this was a relative path under topDir
-		bazelFinderFile = filepath.Join(topDir, bazelFinderFile)
-	}
-	return readFileLines(bazelFinderFile)
-}
-
-func bazelArtifacts() []string {
-	return []string{
-		"bazel-bin",
-		"bazel-genfiles",
-		"bazel-out",
-		"bazel-testlogs",
-		"bazel-workspace",
-		"bazel-" + filepath.Base(topDir),
-	}
-}
-
-// This could in theory easily be separated into a binary that generically
-// merges two directories into a symlink tree. The main obstacle is that this
-// function currently depends on both Bazel-specific knowledge (the existence
-// of bazel-* symlinks) and configuration (the set of BUILD.bazel files that
-// should and should not be kept)
-//
-// Ideally, bp2build would write a file that contains instructions to the
-// symlink tree creation binary. Then the latter would not need to depend on
-// the very heavy-weight machinery of soong_build .
-func runSymlinkForestCreation(ctx *android.Context, extraNinjaDeps []string, metricsDir string) string {
-	var ninjaDeps []string
-	var mkdirCount, symlinkCount uint64
-
-	ctx.EventHandler.Do("symlink_forest", func() {
-		ninjaDeps = append(ninjaDeps, extraNinjaDeps...)
-		verbose := ctx.Config().IsEnvTrue("BP2BUILD_VERBOSE")
-
-		// PlantSymlinkForest() returns all the directories that were readdir()'ed.
-		// Such a directory SHOULD be added to `ninjaDeps` so that a child directory
-		// or file created/deleted under it would trigger an update of the symlink forest.
-		generatedRoot := shared.JoinPath(ctx.Config().SoongOutDir(), "bp2build")
-		workspaceRoot := shared.JoinPath(ctx.Config().SoongOutDir(), "workspace")
-		var symlinkForestDeps []string
-		ctx.EventHandler.Do("plant", func() {
-			symlinkForestDeps, mkdirCount, symlinkCount = bp2build.PlantSymlinkForest(
-				verbose, topDir, workspaceRoot, generatedRoot, excludedFromSymlinkForest(ctx, verbose))
-		})
-		ninjaDeps = append(ninjaDeps, symlinkForestDeps...)
-	})
-
-	writeDepFile(cmdlineArgs.SymlinkForestMarker, ctx.EventHandler, ninjaDeps)
-	touch(shared.JoinPath(topDir, cmdlineArgs.SymlinkForestMarker))
-	codegenMetrics := bp2build.ReadCodegenMetrics(metricsDir)
-	if codegenMetrics == nil {
-		m := bp2build.CreateCodegenMetrics()
-		codegenMetrics = &m
-	} else {
-		//TODO (usta) we cannot determine if we loaded a stale file, i.e. from an unrelated prior
-		//invocation of codegen. We should simply use a separate .pb file
-	}
-	codegenMetrics.SetSymlinkCount(symlinkCount)
-	codegenMetrics.SetMkDirCount(mkdirCount)
-	writeBp2BuildMetrics(codegenMetrics, ctx.EventHandler, metricsDir)
-	return cmdlineArgs.SymlinkForestMarker
-}
-
-func excludedFromSymlinkForest(ctx *android.Context, verbose bool) []string {
-	excluded := bazelArtifacts()
-	if cmdlineArgs.OutDir[0] != '/' {
-		excluded = append(excluded, cmdlineArgs.OutDir)
-	}
-
-	// Find BUILD files in the srcDir which are not in the allowlist
-	// (android.Bp2BuildConversionAllowlist#ShouldKeepExistingBuildFileForDir)
-	// and return their paths so they can be left out of the Bazel workspace dir (i.e. ignored)
-	existingBazelFiles, err := getExistingBazelRelatedFiles(topDir)
-	maybeQuit(err, "Error determining existing Bazel-related files")
-
-	for _, path := range existingBazelFiles {
-		fullPath := shared.JoinPath(topDir, path)
-		fileInfo, err2 := os.Stat(fullPath)
-		if err2 != nil {
-			// Warn about error, but continue trying to check files
-			fmt.Fprintf(os.Stderr, "WARNING: Error accessing path '%s', err: %s\n", fullPath, err2)
-			continue
-		}
-		// Exclude only files named 'BUILD' or 'BUILD.bazel' and unless forcibly kept
-		if fileInfo.IsDir() ||
-			(fileInfo.Name() != "BUILD" && fileInfo.Name() != "BUILD.bazel") ||
-			ctx.Config().Bp2buildPackageConfig.ShouldKeepExistingBuildFileForDir(filepath.Dir(path)) {
-			// Don't ignore this existing build file
-			continue
-		}
-		if verbose {
-			fmt.Fprintf(os.Stderr, "Ignoring existing BUILD file: %s\n", path)
-		}
-		excluded = append(excluded, path)
-	}
-
-	// Temporarily exclude stuff to make `bazel build //external/...` (and `bazel build //frameworks/...`)  work
-	excluded = append(excluded,
-		// FIXME: 'autotest_lib' is a symlink back to external/autotest, and this causes an infinite
-		// symlink expansion error for Bazel
-		"external/autotest/venv/autotest_lib",
-		"external/autotest/autotest_lib",
-		"external/autotest/client/autotest_lib/client",
-
-		// FIXME: The external/google-fruit/extras/bazel_root/third_party/fruit dir is poison
-		// It contains several symlinks back to real source dirs, and those source dirs contain
-		// BUILD files we want to ignore
-		"external/google-fruit/extras/bazel_root/third_party/fruit",
-
-		// FIXME: 'frameworks/compile/slang' has a filegroup error due to an escaping issue
-		"frameworks/compile/slang",
-	)
-	return excluded
-}
-
-// Run Soong in the bp2build mode. This creates a standalone context that registers
-// an alternate pipeline of mutators and singletons specifically for generating
-// Bazel BUILD files instead of Ninja files.
-func runBp2Build(ctx *android.Context, extraNinjaDeps []string, metricsDir string) string {
-	var codegenMetrics *bp2build.CodegenMetrics
-	ctx.EventHandler.Do("bp2build", func() {
-
-		ctx.EventHandler.Do("read_build", func() {
-			existingBazelFiles, err := getExistingBazelRelatedFiles(topDir)
-			maybeQuit(err, "Error determining existing Bazel-related files")
-
-			err = ctx.RegisterExistingBazelTargets(topDir, existingBazelFiles)
-			maybeQuit(err, "Error parsing existing Bazel-related files")
-		})
-
-		// Propagate "allow misssing dependencies" bit. This is normally set in
-		// newContext(), but we create ctx without calling that method.
-		ctx.SetAllowMissingDependencies(ctx.Config().AllowMissingDependencies())
-		ctx.SetNameInterface(newNameResolver(ctx.Config()))
-		ctx.RegisterForBazelConversion()
-		ctx.SetModuleListFile(cmdlineArgs.ModuleListFile)
-		// Skip cloning modules during bp2build's blueprint run. Some mutators set
-		// bp2build-related module values which should be preserved during codegen.
-		ctx.SkipCloneModulesAfterMutators = true
-
-		var ninjaDeps []string
-		ninjaDeps = append(ninjaDeps, extraNinjaDeps...)
-
-		// Run the loading and analysis pipeline to prepare the graph of regular
-		// Modules parsed from Android.bp files, and the BazelTargetModules mapped
-		// from the regular Modules.
-		ctx.EventHandler.Do("bootstrap", func() {
-			blueprintArgs := cmdlineArgs
-			bootstrapDeps, err := bootstrap.RunBlueprint(blueprintArgs.Args,
-				bootstrap.StopBeforePrepareBuildActions, ctx.Context, ctx.Config())
-			maybeQuit(err, "")
-			ninjaDeps = append(ninjaDeps, bootstrapDeps...)
-		})
-
-		globListFiles := writeBuildGlobsNinjaFile(ctx)
-		ninjaDeps = append(ninjaDeps, globListFiles...)
-
-		// Run the code-generation phase to convert BazelTargetModules to BUILD files
-		// and print conversion codegenMetrics to the user.
-		codegenContext := bp2build.NewCodegenContext(ctx.Config(), ctx, bp2build.Bp2Build, topDir)
-		codegenMetrics = bp2build.Codegen(codegenContext)
-
-		ninjaDeps = append(ninjaDeps, codegenContext.AdditionalNinjaDeps()...)
-
-		writeDepFile(cmdlineArgs.Bp2buildMarker, ctx.EventHandler, ninjaDeps)
-		touch(shared.JoinPath(topDir, cmdlineArgs.Bp2buildMarker))
-	})
-
-	// Only report metrics when in bp2build mode. The metrics aren't relevant
-	// for queryview, since that's a total repo-wide conversion and there's a
-	// 1:1 mapping for each module.
-	if ctx.Config().IsEnvTrue("BP2BUILD_VERBOSE") {
-		codegenMetrics.Print()
-	}
-	writeBp2BuildMetrics(codegenMetrics, ctx.EventHandler, metricsDir)
-	return cmdlineArgs.Bp2buildMarker
-}
-
-// Write Bp2Build metrics into $LOG_DIR
-func writeBp2BuildMetrics(codegenMetrics *bp2build.CodegenMetrics, eventHandler *metrics.EventHandler, metricsDir string) {
-	for _, event := range eventHandler.CompletedEvents() {
-		codegenMetrics.AddEvent(&bp2build_metrics_proto.Event{
-			Name:      event.Id,
-			StartTime: uint64(event.Start.UnixNano()),
-			RealTime:  event.RuntimeNanoseconds(),
-		})
-	}
-	if len(metricsDir) < 1 {
-		fmt.Fprintf(os.Stderr, "\nMissing required env var for generating bp2build metrics: LOG_DIR\n")
-		os.Exit(1)
-	}
-	codegenMetrics.Write(metricsDir)
-}
-
-func readFileLines(path string) ([]string, error) {
-	data, err := os.ReadFile(path)
-	if err == nil {
-		return strings.Split(strings.TrimSpace(string(data)), "\n"), nil
-	}
-	return nil, err
-
-}
 func maybeQuit(err error, format string, args ...interface{}) {
 	if err == nil {
 		return
diff --git a/cmd/soong_ui/main.go b/cmd/soong_ui/main.go
index c94ff07..fe3f8f7 100644
--- a/cmd/soong_ui/main.go
+++ b/cmd/soong_ui/main.go
@@ -18,7 +18,6 @@
 	"context"
 	"flag"
 	"fmt"
-	"io/ioutil"
 	"os"
 	"path/filepath"
 	"strconv"
@@ -194,16 +193,13 @@
 	buildErrorFile := filepath.Join(logsDir, c.logsPrefix+"build_error")
 	soongMetricsFile := filepath.Join(logsDir, c.logsPrefix+"soong_metrics")
 	rbeMetricsFile := filepath.Join(logsDir, c.logsPrefix+"rbe_metrics.pb")
-	bp2buildMetricsFile := filepath.Join(logsDir, c.logsPrefix+"bp2build_metrics.pb")
 	soongBuildMetricsFile := filepath.Join(logsDir, c.logsPrefix+"soong_build_metrics.pb")
 
 	metricsFiles := []string{
-		buildErrorFile,           // build error strings
-		rbeMetricsFile,           // high level metrics related to remote build execution.
-		bp2buildMetricsFile,      // high level metrics related to bp2build.
-		soongMetricsFile,         // high level metrics related to this build system.
-		soongBuildMetricsFile,    // high level metrics related to soong build(except bp2build)
-		config.BazelMetricsDir(), // directory that contains a set of bazel metrics.
+		buildErrorFile,        // build error strings
+		rbeMetricsFile,        // high level metrics related to remote build execution.
+		soongMetricsFile,      // high level metrics related to this build system.
+		soongBuildMetricsFile, // high level metrics related to soong build
 	}
 
 	os.MkdirAll(logsDir, 0777)
@@ -293,38 +289,12 @@
 		}
 	}
 
-	removeBadTargetRename(buildCtx, config)
-
 	// Create a source finder.
 	f := build.NewSourceFinder(buildCtx, config)
 	defer f.Shutdown()
 	build.FindSources(buildCtx, config, f)
 }
 
-func removeBadTargetRename(ctx build.Context, config build.Config) {
-	log := ctx.ContextImpl.Logger
-	// find bad paths
-	m, err := filepath.Glob(filepath.Join(config.OutDir(), "bazel", "output", "execroot", "__main__", "bazel-out", "mixed_builds_product-*", "bin", "tools", "metalava", "metalava"))
-	if err != nil {
-		log.Fatalf("Glob for invalid file failed %s", err)
-	}
-	for _, f := range m {
-		info, err := os.Stat(f)
-		if err != nil {
-			log.Fatalf("Stat of invalid file %q failed %s", f, err)
-		}
-		// if it's a directory, leave it, but remove the files
-		if !info.IsDir() {
-			err = os.Remove(f)
-			if err != nil {
-				log.Fatalf("Remove of invalid file %q failed %s", f, err)
-			} else {
-				log.Verbosef("Removed %q", f)
-			}
-		}
-	}
-}
-
 func dumpVar(ctx build.Context, config build.Config, args []string) {
 	flags := flag.NewFlagSet("dumpvar", flag.ExitOnError)
 	flags.SetOutput(ctx.Writer)
@@ -607,81 +577,6 @@
 	return nil, nil, fmt.Errorf("Command not found: %q\nDid you mean one of these: %q", args[1], listFlags())
 }
 
-// For Bazel support, this moves files and directories from e.g. out/dist/$f to DIST_DIR/$f if necessary.
-func populateExternalDistDir(ctx build.Context, config build.Config) {
-	// Make sure that internalDistDirPath and externalDistDirPath are both absolute paths, so we can compare them
-	var err error
-	var internalDistDirPath string
-	var externalDistDirPath string
-	if internalDistDirPath, err = filepath.Abs(config.DistDir()); err != nil {
-		ctx.Fatalf("Unable to find absolute path of %s: %s", internalDistDirPath, err)
-	}
-	if externalDistDirPath, err = filepath.Abs(config.RealDistDir()); err != nil {
-		ctx.Fatalf("Unable to find absolute path of %s: %s", externalDistDirPath, err)
-	}
-	if externalDistDirPath == internalDistDirPath {
-		return
-	}
-
-	// Make sure the internal DIST_DIR actually exists before trying to read from it
-	if _, err = os.Stat(internalDistDirPath); os.IsNotExist(err) {
-		ctx.Println("Skipping Bazel dist dir migration - nothing to do!")
-		return
-	}
-
-	// Make sure the external DIST_DIR actually exists before trying to write to it
-	if err = os.MkdirAll(externalDistDirPath, 0755); err != nil {
-		ctx.Fatalf("Unable to make directory %s: %s", externalDistDirPath, err)
-	}
-
-	ctx.Println("Populating external DIST_DIR...")
-
-	populateExternalDistDirHelper(ctx, config, internalDistDirPath, externalDistDirPath)
-}
-
-func populateExternalDistDirHelper(ctx build.Context, config build.Config, internalDistDirPath string, externalDistDirPath string) {
-	files, err := ioutil.ReadDir(internalDistDirPath)
-	if err != nil {
-		ctx.Fatalf("Can't read internal distdir %s: %s", internalDistDirPath, err)
-	}
-	for _, f := range files {
-		internalFilePath := filepath.Join(internalDistDirPath, f.Name())
-		externalFilePath := filepath.Join(externalDistDirPath, f.Name())
-
-		if f.IsDir() {
-			// Moving a directory - check if there is an existing directory to merge with
-			externalLstat, err := os.Lstat(externalFilePath)
-			if err != nil {
-				if !os.IsNotExist(err) {
-					ctx.Fatalf("Can't lstat external %s: %s", externalDistDirPath, err)
-				}
-				// Otherwise, if the error was os.IsNotExist, that's fine and we fall through to the rename at the bottom
-			} else {
-				if externalLstat.IsDir() {
-					// Existing dir - try to merge the directories?
-					populateExternalDistDirHelper(ctx, config, internalFilePath, externalFilePath)
-					continue
-				} else {
-					// Existing file being replaced with a directory. Delete the existing file...
-					if err := os.RemoveAll(externalFilePath); err != nil {
-						ctx.Fatalf("Unable to remove existing %s: %s", externalFilePath, err)
-					}
-				}
-			}
-		} else {
-			// Moving a file (not a dir) - delete any existing file or directory
-			if err := os.RemoveAll(externalFilePath); err != nil {
-				ctx.Fatalf("Unable to remove existing %s: %s", externalFilePath, err)
-			}
-		}
-
-		// The actual move - do a rename instead of a copy in order to save disk space.
-		if err := os.Rename(internalFilePath, externalFilePath); err != nil {
-			ctx.Fatalf("Unable to rename %s -> %s due to error %s", internalFilePath, externalFilePath, err)
-		}
-	}
-}
-
 func setMaxFiles(ctx build.Context) {
 	var limits syscall.Rlimit
 
diff --git a/etc/prebuilt_etc.go b/etc/prebuilt_etc.go
index b7d2971..66df101 100644
--- a/etc/prebuilt_etc.go
+++ b/etc/prebuilt_etc.go
@@ -31,16 +31,12 @@
 	"encoding/json"
 	"fmt"
 	"path/filepath"
-	"reflect"
 	"strings"
 
 	"github.com/google/blueprint/proptools"
 
 	"android/soong/android"
-	"android/soong/bazel"
-	"android/soong/bazel/cquery"
 	"android/soong/snapshot"
-	"android/soong/ui/metrics/bp2build_metrics_proto"
 )
 
 var pctx = android.NewPackageContext("android/soong/etc")
@@ -139,7 +135,6 @@
 type PrebuiltEtc struct {
 	android.ModuleBase
 	android.DefaultableModuleBase
-	android.BazelModuleBase
 
 	snapshot.VendorSnapshotModuleInterface
 	snapshot.RecoverySnapshotModuleInterface
@@ -462,7 +457,6 @@
 	// This module is device-only
 	android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
 	android.InitDefaultableModule(module)
-	android.InitBazelModule(module)
 	return module
 }
 
@@ -492,7 +486,6 @@
 	// This module is host-only
 	android.InitAndroidArchModule(module, android.HostSupported, android.MultilibCommon)
 	android.InitDefaultableModule(module)
-	android.InitBazelModule(module)
 	return module
 }
 
@@ -503,7 +496,6 @@
 	InitPrebuiltEtcModule(module, "cacerts")
 	// This module is device-only
 	android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
-	android.InitBazelModule(module)
 	return module
 }
 
@@ -526,7 +518,6 @@
 	// This module is host-only
 	android.InitAndroidArchModule(module, android.HostSupported, android.MultilibCommon)
 	android.InitDefaultableModule(module)
-	android.InitBazelModule(module)
 	return module
 }
 
@@ -538,7 +529,6 @@
 	// This module is device-only
 	android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
 	android.InitDefaultableModule(module)
-	android.InitBazelModule(module)
 	return module
 }
 
@@ -730,154 +720,3 @@
 
 	return snapshot.SnapshotPaths{OutputFiles: snapshotOutputs, NoticeFiles: snapshotNotices}
 }
-
-// For Bazel / bp2build
-
-type bazelPrebuiltFileAttributes struct {
-	Src               bazel.LabelAttribute
-	Filename          bazel.LabelAttribute
-	Dir               string
-	Installable       bazel.BoolAttribute
-	Filename_from_src bazel.BoolAttribute
-}
-
-// Bp2buildHelper returns a bazelPrebuiltFileAttributes used for the conversion
-// of prebuilt_*  modules. bazelPrebuiltFileAttributes has the common attributes
-// used by both prebuilt_etc_xml and other prebuilt_* moodules
-func (module *PrebuiltEtc) Bp2buildHelper(ctx android.Bp2buildMutatorContext) (*bazelPrebuiltFileAttributes, bool) {
-	var src bazel.LabelAttribute
-	for axis, configToProps := range module.GetArchVariantProperties(ctx, &prebuiltEtcProperties{}) {
-		for config, p := range configToProps {
-			props, ok := p.(*prebuiltEtcProperties)
-			if !ok {
-				continue
-			}
-			if props.Src != nil {
-				srcStr := proptools.String(props.Src)
-				if srcStr == ctx.ModuleName() {
-					ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_PROPERTY_UNSUPPORTED, "src == name")
-					return &bazelPrebuiltFileAttributes{}, false
-				}
-				label := android.BazelLabelForModuleSrcSingle(ctx, srcStr)
-				src.SetSelectValue(axis, config, label)
-			}
-		}
-		productVarProperties, errs := android.ProductVariableProperties(ctx, ctx.Module())
-		for _, err := range errs {
-			ctx.ModuleErrorf("ProductVariableProperties error: %s", err)
-		}
-		for propName, productConfigProps := range productVarProperties {
-			for configProp, propVal := range productConfigProps {
-				if propName == "Src" {
-					props, ok := propVal.(*string)
-					if !ok {
-						ctx.PropertyErrorf(" Expected Property to have type string, but was %s\n", reflect.TypeOf(propVal).String())
-						continue
-					}
-					if props != nil {
-						label := android.BazelLabelForModuleSrcSingle(ctx, *props)
-						src.SetSelectValue(configProp.ConfigurationAxis(), configProp.SelectKey(), label)
-					}
-				}
-			}
-		}
-	}
-
-	var filename string
-	var filenameFromSrc bool
-	moduleProps := module.properties
-
-	if moduleProps.Filename != nil && *moduleProps.Filename != "" {
-		filename = *moduleProps.Filename
-	} else if moduleProps.Filename_from_src != nil && *moduleProps.Filename_from_src {
-		if moduleProps.Src != nil {
-			filename = android.BazelLabelForModuleSrcSingle(ctx, *moduleProps.Src).Label
-		}
-		filenameFromSrc = true
-	} else {
-		filename = ctx.ModuleName()
-	}
-
-	var dir = module.installDirBase
-	if module.SubDir() != "" {
-		dir = dir + "/" + module.SubDir()
-	}
-
-	var installable bazel.BoolAttribute
-	if install := module.properties.Installable; install != nil {
-		installable.Value = install
-	}
-
-	attrs := &bazelPrebuiltFileAttributes{
-		Src:         src,
-		Dir:         dir,
-		Installable: installable,
-	}
-
-	if filename != "" {
-		attrs.Filename = bazel.LabelAttribute{Value: &bazel.Label{Label: filename}}
-	} else if filenameFromSrc {
-		attrs.Filename_from_src = bazel.BoolAttribute{Value: moduleProps.Filename_from_src}
-	}
-
-	return attrs, true
-}
-
-// ConvertWithBp2build performs bp2build conversion of PrebuiltEtc
-// prebuilt_* modules (except prebuilt_etc_xml) are PrebuiltEtc,
-// which we treat as *PrebuiltFile*
-func (module *PrebuiltEtc) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	var dir = module.installDirBase
-	// prebuilt_file only supports "etc" or "usr/share" or "." as module installDirBase
-	if !(dir == "etc" || dir == "usr/share" || dir == ".") {
-		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_TYPE_UNSUPPORTED, "dir")
-		return
-	}
-
-	attrs, convertible := module.Bp2buildHelper(ctx)
-	if !convertible {
-		return
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "prebuilt_file",
-		Bzl_load_location: "//build/bazel/rules:prebuilt_file.bzl",
-	}
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: module.Name()}, attrs)
-}
-
-var _ android.MixedBuildBuildable = (*PrebuiltEtc)(nil)
-
-func (pe *PrebuiltEtc) IsMixedBuildSupported(ctx android.BaseModuleContext) bool {
-	return true
-}
-
-func (pe *PrebuiltEtc) QueueBazelCall(ctx android.BaseModuleContext) {
-	ctx.Config().BazelContext.QueueBazelRequest(
-		pe.GetBazelLabel(ctx, pe),
-		cquery.GetPrebuiltFileInfo,
-		android.GetConfigKey(ctx),
-	)
-}
-
-func (pe *PrebuiltEtc) ProcessBazelQueryResponse(ctx android.ModuleContext) {
-	bazelCtx := ctx.Config().BazelContext
-	pfi, err := bazelCtx.GetPrebuiltFileInfo(pe.GetBazelLabel(ctx, pe), android.GetConfigKey(ctx))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-
-	// Set properties for androidmk
-	pe.installDirPath = android.PathForModuleInstall(ctx, pfi.Dir)
-
-	// Installation rules
-	ip := installProperties{
-		installable:    pfi.Installable,
-		filename:       pfi.Filename,
-		sourceFilePath: android.PathForSource(ctx, pfi.Src),
-		// symlinks: pe.properties.Symlinks, // TODO: b/207489266 - Fully support all properties in prebuilt_file
-	}
-	pe.addInstallRules(ctx, ip)
-}
diff --git a/etc/prebuilt_etc_test.go b/etc/prebuilt_etc_test.go
index 5c4e222..df11709 100644
--- a/etc/prebuilt_etc_test.go
+++ b/etc/prebuilt_etc_test.go
@@ -23,7 +23,6 @@
 	"github.com/google/blueprint/proptools"
 
 	"android/soong/android"
-	"android/soong/bazel/cquery"
 	"android/soong/snapshot"
 )
 
@@ -495,41 +494,3 @@
 		checkIfSnapshotNotTaken(t, result, "recovery", "prebuilt_recovery_indirect")
 	})
 }
-
-func TestPrebuiltEtcAndroidMkEntriesWithBazel(t *testing.T) {
-	t.Parallel()
-	bp := `
-prebuilt_etc {
-	name: "myetc",
-	src: "prebuilt_etc.rc", // filename in src tree
-	filename: "init.rc", // target filename on device
-	sub_dir: "subdir", // relative subdir for installation
-	bazel_module: { label: "//foo/bar:myetc" },
-}
-`
-	res := android.GroupFixturePreparers(
-		prepareForPrebuiltEtcTest,
-		android.FixtureModifyConfig(func(cfg android.Config) {
-			cfg.BazelContext = android.MockBazelContext{
-				LabelToPrebuiltFileInfo: map[string]cquery.PrebuiltFileInfo{
-					"//foo/bar:myetc": cquery.PrebuiltFileInfo{
-						Src:         "foo/bar/prebuilt_etc.rc",
-						Dir:         "etc/subdir",
-						Filename:    "init.rc",
-						Installable: true,
-					},
-				},
-			}
-		}),
-	).RunTestWithBp(t, bp)
-	ctx := res.ModuleForTests("myetc", "android_arm64_armv8-a")
-	mod := ctx.Module()
-	entries := android.AndroidMkEntriesForTest(t, res.TestContext, mod)[0]
-	// verify androidmk entries
-	android.AssertStringDoesContain(t, "LOCAL_MODULE_PATH should contain", entries.EntryMap["LOCAL_MODULE_PATH"][0], "etc/subdir")
-	android.AssertStringEquals(t, "LOCAL_INSTALLED_MODULE_STEM is incorrect", "init.rc", entries.EntryMap["LOCAL_INSTALLED_MODULE_STEM"][0])
-	// verify installation rules
-	install := ctx.Description("install")
-	android.AssertStringEquals(t, "Source location of prebuilt_etc installation", "out/soong/.intermediates/myetc/android_arm64_armv8-a/init.rc", install.Input.String())
-	android.AssertStringEquals(t, "Target location of prebuilt_etc installation", "out/soong/target/product/test_device/system/etc/subdir/init.rc", install.Output.String())
-}
diff --git a/fuzz/fuzz_common.go b/fuzz/fuzz_common.go
index 94b795f..5d7bc2b 100644
--- a/fuzz/fuzz_common.go
+++ b/fuzz/fuzz_common.go
@@ -399,13 +399,11 @@
 }
 
 type FuzzPackagedModule struct {
-	FuzzProperties        FuzzProperties
-	Dictionary            android.Path
-	Corpus                android.Paths
-	CorpusIntermediateDir android.Path
-	Config                android.Path
-	Data                  android.Paths
-	DataIntermediateDir   android.Path
+	FuzzProperties FuzzProperties
+	Dictionary     android.Path
+	Corpus         android.Paths
+	Config         android.Path
+	Data           android.Paths
 }
 
 func GetFramework(ctx android.LoadHookContext, lang Lang) Framework {
diff --git a/genrule/Android.bp b/genrule/Android.bp
index b201cae..7331741 100644
--- a/genrule/Android.bp
+++ b/genrule/Android.bp
@@ -11,7 +11,6 @@
         "sbox_proto",
         "soong",
         "soong-android",
-        "soong-bazel",
         "soong-shared",
     ],
     srcs: [
diff --git a/genrule/allowlists.go b/genrule/allowlists.go
index d74bf61..8abf73e 100644
--- a/genrule/allowlists.go
+++ b/genrule/allowlists.go
@@ -26,14 +26,12 @@
 		"CtsApkVerityTestDebugFiles",
 		"aidl_camera_build_version",
 		"camera-its",
-		"libcore-non-cts-tests-txt",
-		"swiftshader_spvtools_update_build_version",
+		"chre_atoms_log.h",
 		// go/keep-sorted end
 	}
 
 	SandboxingDenyPathList = []string{
 		// go/keep-sorted start
-		"art/test",
 		// go/keep-sorted end
 	}
 )
diff --git a/genrule/genrule.go b/genrule/genrule.go
index 8f2c047..0512c15 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -21,18 +21,14 @@
 import (
 	"fmt"
 	"io"
-	"path/filepath"
 	"strconv"
 	"strings"
 
-	"android/soong/bazel/cquery"
-
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/bootstrap"
 	"github.com/google/blueprint/proptools"
 
 	"android/soong/android"
-	"android/soong/bazel"
 )
 
 func init() {
@@ -159,7 +155,6 @@
 type Module struct {
 	android.ModuleBase
 	android.DefaultableModuleBase
-	android.BazelModuleBase
 	android.ApexModuleBase
 
 	// For other packages to make their own genrules with extra
@@ -191,8 +186,6 @@
 	subDir  string
 }
 
-var _ android.MixedBuildBuildable = (*Module)(nil)
-
 type taskFunc func(ctx android.ModuleContext, rawCommand string, srcFiles android.Paths) []generateTask
 
 type generateTask struct {
@@ -254,30 +247,6 @@
 	}
 }
 
-func (g *Module) ProcessBazelQueryResponse(ctx android.ModuleContext) {
-	g.generateCommonBuildActions(ctx)
-
-	label := g.GetBazelLabel(ctx, g)
-	bazelCtx := ctx.Config().BazelContext
-	filePaths, err := bazelCtx.GetOutputFiles(label, android.GetConfigKey(ctx))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-
-	var bazelOutputFiles android.Paths
-	exportIncludeDirs := map[string]bool{}
-	for _, bazelOutputFile := range filePaths {
-		bazelOutputFiles = append(bazelOutputFiles, android.PathForBazelOutRelative(ctx, ctx.ModuleDir(), bazelOutputFile))
-		exportIncludeDirs[filepath.Dir(bazelOutputFile)] = true
-	}
-	g.outputFiles = bazelOutputFiles
-	g.outputDeps = bazelOutputFiles
-	for includePath, _ := range exportIncludeDirs {
-		g.exportedIncludeDirs = append(g.exportedIncludeDirs, android.PathForBazelOut(ctx, includePath))
-	}
-}
-
 // generateCommonBuildActions contains build action generation logic
 // common to both the mixed build case and the legacy case of genrule processing.
 // To fully support genrule in mixed builds, the contents of this function should
@@ -424,6 +393,7 @@
 		return srcFiles
 	}
 	srcFiles := addLabelsForInputs("srcs", g.properties.Srcs, g.properties.Exclude_srcs)
+	ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: srcFiles.Strings()})
 
 	var copyFrom android.Paths
 	var outputFiles android.WritablePaths
@@ -538,7 +508,7 @@
 						if len(paths) == 0 {
 							return reportError("label %q has no files", label)
 						}
-						return proptools.ShellEscape(strings.Join(paths, " ")), nil
+						return strings.Join(proptools.ShellEscapeList(paths), " "), nil
 					} else {
 						return reportError("unknown locations label %q is not in srcs, out, tools or tool_files.", label)
 					}
@@ -611,17 +581,15 @@
 
 func (g *Module) GenerateAndroidBuildActions(ctx android.ModuleContext) {
 	// Allowlist genrule to use depfile until we have a solution to remove it.
-	// TODO(b/235582219): Remove allowlist for genrule
+	// TODO(b/307824623): Remove depfile property
 	if Bool(g.properties.Depfile) {
 		sandboxingAllowlistSets := getSandboxingAllowlistSets(ctx)
-		// TODO(b/283852474): Checking the GenruleSandboxing flag is temporary in
-		// order to pass the presubmit before internal master is updated.
 		if ctx.DeviceConfig().GenruleSandboxing() && !sandboxingAllowlistSets.depfileAllowSet[g.Name()] {
 			ctx.PropertyErrorf(
 				"depfile",
-				"Deprecated to ensure the module type is convertible to Bazel. "+
-					"Try specifying the dependencies explicitly so that there is no need to use depfile. "+
-					"If not possible, the escape hatch is to add the module to allowlists.go to bypass the error.")
+				"Deprecated because with genrule sandboxing, dependencies must be known before the action is run "+
+					"in order to add them to the sandbox. "+
+					"Please specify the dependencies explicitly so that there is no need to use depfile.")
 		}
 	}
 
@@ -644,15 +612,6 @@
 	}
 }
 
-func (g *Module) QueueBazelCall(ctx android.BaseModuleContext) {
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(g.GetBazelLabel(ctx, g), cquery.GetOutputFiles, android.GetConfigKey(ctx))
-}
-
-func (g *Module) IsMixedBuildSupported(ctx android.BaseModuleContext) bool {
-	return true
-}
-
 // Collect information for opening IDE project files in java/jdeps.go.
 func (g *Module) IDEInfo(dpInfo *android.IdeInfo) {
 	dpInfo.Srcs = append(dpInfo.Srcs, g.Srcs().Strings()...)
@@ -842,7 +801,6 @@
 func GenSrcsFactory() android.Module {
 	m := NewGenSrcs()
 	android.InitAndroidModule(m)
-	android.InitBazelModule(m)
 	return m
 }
 
@@ -857,14 +815,6 @@
 	Data []string `android:"path"`
 }
 
-type bazelGensrcsAttributes struct {
-	Srcs             bazel.LabelListAttribute
-	Output_extension *string
-	Tools            bazel.LabelListAttribute
-	Cmd              bazel.StringAttribute
-	Data             bazel.LabelListAttribute
-}
-
 const defaultShardSize = 50
 
 func NewGenRule() *Module {
@@ -896,7 +846,6 @@
 	m := NewGenRule()
 	android.InitAndroidModule(m)
 	android.InitDefaultableModule(m)
-	android.InitBazelModule(m)
 	return m
 }
 
@@ -905,215 +854,6 @@
 	Out []string
 }
 
-type BazelGenruleAttributes struct {
-	Srcs  bazel.LabelListAttribute
-	Outs  []string
-	Tools bazel.LabelListAttribute
-	Cmd   bazel.StringAttribute
-}
-
-// ConvertWithBp2build converts a Soong module -> Bazel target.
-func (m *Module) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	// Bazel only has the "tools" attribute.
-	tools_prop := android.BazelLabelForModuleDeps(ctx, m.properties.Tools)
-	tool_files_prop := android.BazelLabelForModuleSrc(ctx, m.properties.Tool_files)
-	tools_prop.Append(tool_files_prop)
-
-	tools := bazel.MakeLabelListAttribute(tools_prop)
-	srcs := bazel.LabelListAttribute{}
-	srcs_labels := bazel.LabelList{}
-	// Only cc_genrule is arch specific
-	if ctx.ModuleType() == "cc_genrule" {
-		for axis, configToProps := range m.GetArchVariantProperties(ctx, &generatorProperties{}) {
-			for config, props := range configToProps {
-				if props, ok := props.(*generatorProperties); ok {
-					labels := android.BazelLabelForModuleSrcExcludes(ctx, props.Srcs, props.Exclude_srcs)
-					srcs_labels.Append(labels)
-					srcs.SetSelectValue(axis, config, labels)
-				}
-			}
-		}
-	} else {
-		srcs_labels = android.BazelLabelForModuleSrcExcludes(ctx, m.properties.Srcs, m.properties.Exclude_srcs)
-		srcs = bazel.MakeLabelListAttribute(srcs_labels)
-	}
-
-	var allReplacements bazel.LabelList
-	allReplacements.Append(tools.Value)
-	allReplacements.Append(bazel.FirstUniqueBazelLabelList(srcs_labels))
-
-	// The Output_extension prop is not in an immediately accessible field
-	// in the Module struct, so use GetProperties and cast it
-	// to the known struct prop.
-	var outputExtension *string
-	var data bazel.LabelListAttribute
-	if ctx.ModuleType() == "gensrcs" {
-		for _, propIntf := range m.GetProperties() {
-			if props, ok := propIntf.(*genSrcsProperties); ok {
-				outputExtension = props.Output_extension
-				dataFiles := android.BazelLabelForModuleSrc(ctx, props.Data)
-				allReplacements.Append(bazel.FirstUniqueBazelLabelList(dataFiles))
-				data = bazel.MakeLabelListAttribute(dataFiles)
-				break
-			}
-		}
-	}
-
-	replaceVariables := func(cmd string) string {
-		// Replace in and out variables with $< and $@
-		if ctx.ModuleType() == "gensrcs" {
-			cmd = strings.ReplaceAll(cmd, "$(in)", "$(SRC)")
-			cmd = strings.ReplaceAll(cmd, "$(out)", "$(OUT)")
-		} else {
-			cmd = strings.Replace(cmd, "$(in)", "$(SRCS)", -1)
-			cmd = strings.Replace(cmd, "$(out)", "$(OUTS)", -1)
-		}
-		cmd = strings.Replace(cmd, "$(genDir)", "$(RULEDIR)", -1)
-		if len(tools.Value.Includes) > 0 {
-			cmd = strings.Replace(cmd, "$(location)", fmt.Sprintf("$(location %s)", tools.Value.Includes[0].Label), -1)
-			cmd = strings.Replace(cmd, "$(locations)", fmt.Sprintf("$(locations %s)", tools.Value.Includes[0].Label), -1)
-		}
-		for _, l := range allReplacements.Includes {
-			bpLoc := fmt.Sprintf("$(location %s)", l.OriginalModuleName)
-			bpLocs := fmt.Sprintf("$(locations %s)", l.OriginalModuleName)
-			bazelLoc := fmt.Sprintf("$(location %s)", l.Label)
-			bazelLocs := fmt.Sprintf("$(locations %s)", l.Label)
-			cmd = strings.Replace(cmd, bpLoc, bazelLoc, -1)
-			cmd = strings.Replace(cmd, bpLocs, bazelLocs, -1)
-		}
-		return cmd
-	}
-
-	var cmdProp bazel.StringAttribute
-	cmdProp.SetValue(replaceVariables(proptools.String(m.properties.Cmd)))
-	allProductVariableProps, errs := android.ProductVariableProperties(ctx, m)
-	for _, err := range errs {
-		ctx.ModuleErrorf("ProductVariableProperties error: %s", err)
-	}
-	if productVariableProps, ok := allProductVariableProps["Cmd"]; ok {
-		for productVariable, value := range productVariableProps {
-			var cmd string
-			if strValue, ok := value.(*string); ok && strValue != nil {
-				cmd = *strValue
-			}
-			cmd = replaceVariables(cmd)
-			cmdProp.SetSelectValue(productVariable.ConfigurationAxis(), productVariable.SelectKey(), &cmd)
-		}
-	}
-
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, m)
-
-	bazelName := m.Name()
-	if ctx.ModuleType() == "gensrcs" {
-		props := bazel.BazelTargetModuleProperties{
-			Rule_class:        "gensrcs",
-			Bzl_load_location: "//build/bazel/rules:gensrcs.bzl",
-		}
-		attrs := &bazelGensrcsAttributes{
-			Srcs:             srcs,
-			Output_extension: outputExtension,
-			Cmd:              cmdProp,
-			Tools:            tools,
-			Data:             data,
-		}
-		ctx.CreateBazelTargetModule(props, android.CommonAttributes{
-			Name: m.Name(),
-			Tags: tags,
-		}, attrs)
-	} else {
-		outs := m.RawOutputFiles(ctx)
-		for _, out := range outs {
-			if out == bazelName {
-				// This is a workaround to circumvent a Bazel warning where a genrule's
-				// out may not have the same name as the target itself. This makes no
-				// difference for reverse dependencies, because they may depend on the
-				// out file by name.
-				bazelName = bazelName + "-gen"
-				break
-			}
-		}
-		attrs := &BazelGenruleAttributes{
-			Srcs:  srcs,
-			Outs:  outs,
-			Cmd:   cmdProp,
-			Tools: tools,
-		}
-		props := bazel.BazelTargetModuleProperties{
-			Rule_class: "genrule",
-		}
-		ctx.CreateBazelTargetModule(props, android.CommonAttributes{
-			Name: bazelName,
-			Tags: tags,
-		}, attrs)
-	}
-
-	if m.needsCcLibraryHeadersBp2build() {
-		includeDirs := make([]string, len(m.properties.Export_include_dirs)*2)
-		for i, dir := range m.properties.Export_include_dirs {
-			includeDirs[i*2] = dir
-			includeDirs[i*2+1] = filepath.Clean(filepath.Join(ctx.ModuleDir(), dir))
-		}
-		attrs := &ccHeaderLibraryAttrs{
-			Hdrs:            []string{":" + bazelName},
-			Export_includes: includeDirs,
-		}
-		props := bazel.BazelTargetModuleProperties{
-			Rule_class:        "cc_library_headers",
-			Bzl_load_location: "//build/bazel/rules/cc:cc_library_headers.bzl",
-		}
-		ctx.CreateBazelTargetModule(props, android.CommonAttributes{
-			Name: m.Name() + genruleHeaderLibrarySuffix,
-			Tags: tags,
-		}, attrs)
-	}
-}
-
-const genruleHeaderLibrarySuffix = "__header_library"
-
-func (m *Module) needsCcLibraryHeadersBp2build() bool {
-	return len(m.properties.Export_include_dirs) > 0
-}
-
-// GenruleCcHeaderMapper is a bazel.LabelMapper function to map genrules to a cc_library_headers
-// target when they export multiple include directories.
-func GenruleCcHeaderLabelMapper(ctx bazel.OtherModuleContext, label bazel.Label) (string, bool) {
-	mod, exists := ctx.ModuleFromName(label.OriginalModuleName)
-	if !exists {
-		return label.Label, false
-	}
-	if m, ok := mod.(*Module); ok {
-		if m.needsCcLibraryHeadersBp2build() {
-			return label.Label + genruleHeaderLibrarySuffix, true
-		}
-	}
-	return label.Label, false
-}
-
-type ccHeaderLibraryAttrs struct {
-	Hdrs []string
-
-	Export_includes []string
-}
-
-// RawOutputFfiles returns the raw outputs specified in Android.bp
-// This does not contain the fully resolved path relative to the top of the tree
-func (g *Module) RawOutputFiles(ctx android.BazelConversionContext) []string {
-	if ctx.Config().BuildMode != android.Bp2build {
-		ctx.ModuleErrorf("RawOutputFiles is only supported in bp2build mode")
-	}
-	// The Out prop is not in an immediately accessible field
-	// in the Module struct, so use GetProperties and cast it
-	// to the known struct prop.
-	var outs []string
-	for _, propIntf := range g.GetProperties() {
-		if props, ok := propIntf.(*genRuleProperties); ok {
-			outs = props.Out
-			break
-		}
-	}
-	return outs
-}
-
 var Bool = proptools.Bool
 var String = proptools.String
 
diff --git a/genrule/genrule_test.go b/genrule/genrule_test.go
index 7c14531..fa0ee17 100644
--- a/genrule/genrule_test.go
+++ b/genrule/genrule_test.go
@@ -543,7 +543,7 @@
 	for _, test := range testcases {
 		t.Run(test.name, func(t *testing.T) {
 			gen := result.ModuleForTests(test.name, "")
-			manifest := android.RuleBuilderSboxProtoForTests(t, gen.Output("genrule.sbox.textproto"))
+			manifest := android.RuleBuilderSboxProtoForTests(t, result.TestContext, gen.Output("genrule.sbox.textproto"))
 			hash := manifest.Commands[0].GetInputHash()
 
 			android.AssertStringEquals(t, "hash", test.expectedHash, hash)
@@ -708,7 +708,7 @@
 				depfile: true,
 				cmd: "cat $(in) > $(out) && cat $(depfile)",
 			`,
-			err: "depfile: Deprecated to ensure the module type is convertible to Bazel",
+			err: "depfile: Deprecated because with genrule sandboxing, dependencies must be known before the action is run in order to add them to the sandbox",
 		},
 		{
 			name: `no error when module is allowlisted`,
@@ -1039,31 +1039,6 @@
 	}
 }
 
-func TestGenruleWithBazel(t *testing.T) {
-	bp := `
-		genrule {
-				name: "foo",
-				out: ["one.txt", "two.txt"],
-				bazel_module: { label: "//foo/bar:bar" },
-		}
-	`
-
-	result := android.GroupFixturePreparers(
-		prepareForGenRuleTest, android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: "outputbase",
-				LabelToOutputFiles: map[string][]string{
-					"//foo/bar:bar": []string{"bazelone.txt", "bazeltwo.txt"}}}
-		})).RunTestWithBp(t, testGenruleBp()+bp)
-
-	gen := result.Module("foo", "").(*Module)
-
-	expectedOutputFiles := []string{"outputbase/execroot/__main__/bazelone.txt",
-		"outputbase/execroot/__main__/bazeltwo.txt"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, gen.outputFiles.Strings())
-	android.AssertDeepEquals(t, "output deps", expectedOutputFiles, gen.outputDeps.Strings())
-}
-
 func TestGenruleWithGlobPaths(t *testing.T) {
 	testcases := []struct {
 		name            string
diff --git a/go.mod b/go.mod
index 0a11bd2..1174958 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
 module android/soong
 
-go 1.20
+go 1.21
 
 require (
 	github.com/google/blueprint v0.0.0
diff --git a/go.work b/go.work
index 67f6549..7c6022b 100644
--- a/go.work
+++ b/go.work
@@ -1,4 +1,4 @@
-go 1.19
+go 1.21
 
 use (
 	.
diff --git a/java/Android.bp b/java/Android.bp
index 9f42771..79cd3f9 100644
--- a/java/Android.bp
+++ b/java/Android.bp
@@ -9,8 +9,8 @@
         "blueprint",
         "blueprint-pathtools",
         "soong",
+        "soong-aconfig",
         "soong-android",
-        "soong-bazel",
         "soong-cc",
         "soong-dexpreopt",
         "soong-genrule",
@@ -85,6 +85,7 @@
         "app_import_test.go",
         "app_set_test.go",
         "app_test.go",
+        "code_metadata_test.go",
         "bootclasspath_fragment_test.go",
         "device_host_converter_test.go",
         "dex_test.go",
diff --git a/java/aapt2.go b/java/aapt2.go
index 17ee6ee..445e912 100644
--- a/java/aapt2.go
+++ b/java/aapt2.go
@@ -202,7 +202,8 @@
 func aapt2Link(ctx android.ModuleContext,
 	packageRes, genJar, proguardOptions, rTxt android.WritablePath,
 	flags []string, deps android.Paths,
-	compiledRes, compiledOverlay, assetPackages android.Paths, splitPackages android.WritablePaths) {
+	compiledRes, compiledOverlay, assetPackages android.Paths, splitPackages android.WritablePaths,
+	featureFlagsPaths android.Paths) {
 
 	var inFlags []string
 
@@ -255,6 +256,11 @@
 		})
 	}
 
+	for _, featureFlagsPath := range featureFlagsPaths {
+		deps = append(deps, featureFlagsPath)
+		inFlags = append(inFlags, "--feature-flags", "@"+featureFlagsPath.String())
+	}
+
 	// Note the absence of splitPackages. The caller is supposed to compose and provide --split flag
 	// values via the flags parameter when it wants to split outputs.
 	// TODO(b/174509108): Perhaps we can process it in this func while keeping the code reasonably
diff --git a/java/aar.go b/java/aar.go
index 57a05d4..af99cd0 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -22,10 +22,7 @@
 	"strings"
 
 	"android/soong/android"
-	"android/soong/bazel"
 	"android/soong/dexpreopt"
-	"android/soong/ui/metrics/bp2build_metrics_proto"
-
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/proptools"
 )
@@ -349,6 +346,7 @@
 	excludedLibs                   []string
 	enforceDefaultTargetSdkVersion bool
 	extraLinkFlags                 []string
+	aconfigTextFiles               android.Paths
 }
 
 func (a *aapt) buildActions(ctx android.ModuleContext, opts aaptBuildActionOptions) {
@@ -529,7 +527,8 @@
 		transitiveAssets = android.ReverseSliceInPlace(staticDeps.assets())
 	}
 	aapt2Link(ctx, packageRes, srcJar, proguardOptionsFile, rTxt,
-		linkFlags, linkDeps, compiledRes, compiledOverlay, transitiveAssets, splitPackages)
+		linkFlags, linkDeps, compiledRes, compiledOverlay, transitiveAssets, splitPackages,
+		opts.aconfigTextFiles)
 	// Extract assets from the resource package output so that they can be used later in aapt2link
 	// for modules that depend on this one.
 	if android.PrefixInList(linkFlags, "-A ") {
@@ -766,7 +765,6 @@
 type AndroidLibrary struct {
 	Library
 	aapt
-	android.BazelModuleBase
 
 	androidLibraryProperties androidLibraryProperties
 
@@ -903,7 +901,6 @@
 
 	android.InitApexModule(module)
 	InitJavaModule(module, android.DeviceSupported)
-	android.InitBazelModule(module)
 	return module
 }
 
@@ -942,7 +939,6 @@
 	android.ModuleBase
 	android.DefaultableModuleBase
 	android.ApexModuleBase
-	android.BazelModuleBase
 	prebuilt android.Prebuilt
 
 	// Functionality common to Module and Import.
@@ -1193,7 +1189,7 @@
 
 	transitiveAssets := android.ReverseSliceInPlace(staticDeps.assets())
 	aapt2Link(ctx, a.exportPackage, nil, proguardOptionsFile, a.rTxt,
-		linkFlags, linkDeps, nil, overlayRes, transitiveAssets, nil)
+		linkFlags, linkDeps, nil, overlayRes, transitiveAssets, nil, nil)
 
 	a.rJar = android.PathForModuleOut(ctx, "busybox/R.jar")
 	resourceProcessorBusyBoxGenerateBinaryR(ctx, a.rTxt, a.manifest, a.rJar, nil, true)
@@ -1314,189 +1310,5 @@
 	android.InitPrebuiltModule(module, &module.properties.Aars)
 	android.InitApexModule(module)
 	InitJavaModuleMultiTargets(module, android.DeviceSupported)
-	android.InitBazelModule(module)
 	return module
 }
-
-type bazelAapt struct {
-	Manifest       bazel.Label
-	Resource_files bazel.LabelListAttribute
-	Resource_zips  bazel.LabelListAttribute
-	Assets_dir     bazel.StringAttribute
-	Assets         bazel.LabelListAttribute
-}
-
-type bazelAndroidLibrary struct {
-	*javaLibraryAttributes
-	*bazelAapt
-}
-
-type bazelAndroidLibraryImport struct {
-	Aar         bazel.Label
-	Deps        bazel.LabelListAttribute
-	Exports     bazel.LabelListAttribute
-	Sdk_version bazel.StringAttribute
-}
-
-func (a *aapt) convertAaptAttrsWithBp2Build(ctx android.Bp2buildMutatorContext) (*bazelAapt, bool) {
-	manifest := proptools.StringDefault(a.aaptProperties.Manifest, "AndroidManifest.xml")
-
-	resourceFiles := bazel.LabelList{
-		Includes: []bazel.Label{},
-	}
-	for _, dir := range android.PathsWithOptionalDefaultForModuleSrc(ctx, a.aaptProperties.Resource_dirs, "res") {
-		files := android.RootToModuleRelativePaths(ctx, androidResourceGlob(ctx, dir))
-		resourceFiles.Includes = append(resourceFiles.Includes, files...)
-	}
-
-	assetsDir := bazel.StringAttribute{}
-	var assets bazel.LabelList
-	for i, dir := range android.PathsWithOptionalDefaultForModuleSrc(ctx, a.aaptProperties.Asset_dirs, "assets") {
-		if i > 0 {
-			ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_PROPERTY_UNSUPPORTED, "multiple asset_dirs")
-			return &bazelAapt{}, false
-		}
-		// Assets_dirs are relative to the module dir when specified, but if the default in used in
-		// PathsWithOptionalDefaultForModuleSrc, then dir is relative to the top.
-		assetsRelDir, error := filepath.Rel(ctx.ModuleDir(), dir.Rel())
-		if error != nil {
-			assetsRelDir = dir.Rel()
-		}
-		assetsDir.Value = proptools.StringPtr(assetsRelDir)
-		assets = bazel.MakeLabelList(android.RootToModuleRelativePaths(ctx, androidResourceGlob(ctx, dir)))
-
-	}
-	var resourceZips bazel.LabelList
-	if len(a.aaptProperties.Resource_zips) > 0 {
-		if ctx.ModuleName() == "framework-res" {
-			resourceZips = android.BazelLabelForModuleSrc(ctx, a.aaptProperties.Resource_zips)
-		} else {
-			//TODO: b/301593550 - Implement support for this
-			ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_PROPERTY_UNSUPPORTED, "resource_zips")
-			return &bazelAapt{}, false
-		}
-	}
-	return &bazelAapt{
-		android.BazelLabelForModuleSrcSingle(ctx, manifest),
-		bazel.MakeLabelListAttribute(resourceFiles),
-		bazel.MakeLabelListAttribute(resourceZips),
-		assetsDir,
-		bazel.MakeLabelListAttribute(assets),
-	}, true
-}
-
-func (a *AARImport) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	if len(a.properties.Aars) == 0 {
-		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_PROPERTY_UNSUPPORTED, "aars can't be empty")
-		return
-	}
-	aars := android.BazelLabelForModuleSrcExcludes(ctx, a.properties.Aars, []string{})
-	exportableStaticLibs := []string{}
-	// TODO(b/240716882): investigate and handle static_libs deps that are not imports. They are not supported for export by Bazel.
-	for _, depName := range a.properties.Static_libs {
-		if dep, ok := ctx.ModuleFromName(depName); ok {
-			switch dep.(type) {
-			case *AARImport, *Import:
-				exportableStaticLibs = append(exportableStaticLibs, depName)
-			}
-		}
-	}
-	name := android.RemoveOptionalPrebuiltPrefix(a.Name())
-	deps := android.BazelLabelForModuleDeps(ctx, android.LastUniqueStrings(android.CopyOf(append(a.properties.Static_libs, a.properties.Libs...))))
-	exports := android.BazelLabelForModuleDeps(ctx, android.LastUniqueStrings(exportableStaticLibs))
-
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "aar_import",
-			Bzl_load_location: "//build/bazel/rules/android:aar_import.bzl",
-		},
-		android.CommonAttributes{Name: name},
-		&bazelAndroidLibraryImport{
-			Aar:         aars.Includes[0],
-			Deps:        bazel.MakeLabelListAttribute(deps),
-			Exports:     bazel.MakeLabelListAttribute(exports),
-			Sdk_version: bazel.StringAttribute{Value: a.properties.Sdk_version},
-		},
-	)
-
-	neverlink := true
-	ctx.CreateBazelTargetModule(
-		AndroidLibraryBazelTargetModuleProperties(),
-		android.CommonAttributes{Name: name + "-neverlink"},
-		&bazelAndroidLibrary{
-			javaLibraryAttributes: &javaLibraryAttributes{
-				Neverlink: bazel.BoolAttribute{Value: &neverlink},
-				Exports:   bazel.MakeSingleLabelListAttribute(bazel.Label{Label: ":" + name}),
-				javaCommonAttributes: &javaCommonAttributes{
-					Sdk_version: bazel.StringAttribute{Value: a.properties.Sdk_version},
-				},
-			},
-		},
-	)
-
-}
-func AndroidLibraryBazelTargetModuleProperties() bazel.BazelTargetModuleProperties {
-	return bazel.BazelTargetModuleProperties{
-		Rule_class:        "android_library",
-		Bzl_load_location: "//build/bazel/rules/android:android_library.bzl",
-	}
-}
-
-func (a *AndroidLibrary) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	commonAttrs, bp2buildInfo, supported := a.convertLibraryAttrsBp2Build(ctx)
-	if !supported {
-		return
-	}
-
-	depLabels := bp2buildInfo.DepLabels
-
-	deps := depLabels.Deps
-	if !commonAttrs.Srcs.IsEmpty() {
-		deps.Append(depLabels.StaticDeps) // we should only append these if there are sources to use them
-	} else if !depLabels.Deps.IsEmpty() {
-		// android_library does not accept deps when there are no srcs because
-		// there is no compilation happening, but it accepts exports.
-		// The non-empty deps here are unnecessary as deps on the android_library
-		// since they aren't being propagated to any dependencies.
-		// So we can drop deps here.
-		deps = bazel.LabelListAttribute{}
-	}
-	name := a.Name()
-	props := AndroidLibraryBazelTargetModuleProperties()
-
-	aaptAttrs, supported := a.convertAaptAttrsWithBp2Build(ctx)
-	if !supported {
-		return
-	}
-	if hasJavaResources := aaptAttrs.ConvertJavaResources(ctx, commonAttrs); hasJavaResources {
-		return
-	}
-	ctx.CreateBazelTargetModule(
-		props,
-		android.CommonAttributes{Name: name},
-		&bazelAndroidLibrary{
-			&javaLibraryAttributes{
-				javaCommonAttributes: commonAttrs,
-				Deps:                 deps,
-				Exports:              depLabels.StaticDeps,
-			},
-			aaptAttrs,
-		},
-	)
-
-	neverlink := true
-	ctx.CreateBazelTargetModule(
-		props,
-		android.CommonAttributes{Name: name + "-neverlink"},
-		&bazelAndroidLibrary{
-			javaLibraryAttributes: &javaLibraryAttributes{
-				Neverlink: bazel.BoolAttribute{Value: &neverlink},
-				Exports:   bazel.MakeSingleLabelListAttribute(bazel.Label{Label: ":" + name}),
-				javaCommonAttributes: &javaCommonAttributes{
-					Sdk_version:  bazel.StringAttribute{Value: a.deviceProperties.Sdk_version},
-					Java_version: bazel.StringAttribute{Value: a.properties.Java_version},
-				},
-			},
-		},
-	)
-}
diff --git a/java/androidmk.go b/java/androidmk.go
index a15ef1a..809f9b5 100644
--- a/java/androidmk.go
+++ b/java/androidmk.go
@@ -19,6 +19,7 @@
 	"io"
 	"strings"
 
+	"android/soong/aconfig"
 	"android/soong/android"
 
 	"github.com/google/blueprint/proptools"
@@ -128,8 +129,7 @@
 					if library.dexpreopter.configPath != nil {
 						entries.SetPath("LOCAL_SOONG_DEXPREOPT_CONFIG", library.dexpreopter.configPath)
 					}
-
-					entries.SetOptionalPaths("LOCAL_ACONFIG_FILES", library.getTransitiveAconfigFiles().ToList())
+					aconfig.SetAconfigFileMkEntries(&library.ModuleBase, entries, library.mergedAconfigFiles)
 				},
 			},
 		})
@@ -306,7 +306,7 @@
 					if len(binary.dexpreopter.builtInstalled) > 0 {
 						entries.SetString("LOCAL_SOONG_BUILT_INSTALLED", binary.dexpreopter.builtInstalled)
 					}
-					entries.SetOptionalPaths("LOCAL_ACONFIG_FILES", binary.getTransitiveAconfigFiles().ToList())
+					aconfig.SetAconfigFileMkEntries(&binary.ModuleBase, entries, binary.mergedAconfigFiles)
 				},
 			},
 			ExtraFooters: []android.AndroidMkExtraFootersFunc{
@@ -459,7 +459,7 @@
 				entries.SetOptionalPaths("LOCAL_SOONG_LINT_REPORTS", app.linter.reports)
 
 				if app.Name() != "framework-res" {
-					entries.SetOptionalPaths("LOCAL_ACONFIG_FILES", app.getTransitiveAconfigFiles().ToList())
+					aconfig.SetAconfigFileMkEntries(&app.ModuleBase, entries, app.mergedAconfigFiles)
 				}
 			},
 		},
@@ -537,7 +537,7 @@
 		entries.SetPath("LOCAL_FULL_MANIFEST_FILE", a.mergedManifestFile)
 		entries.SetPath("LOCAL_SOONG_EXPORT_PROGUARD_FLAGS", a.combinedExportedProguardFlagsFile)
 		entries.SetBoolIfTrue("LOCAL_UNINSTALLABLE_MODULE", true)
-		entries.SetOptionalPaths("LOCAL_ACONFIG_FILES", a.getTransitiveAconfigFiles().ToList())
+		aconfig.SetAconfigFileMkEntries(&a.ModuleBase, entries, a.mergedAconfigFiles)
 	})
 
 	return entriesList
diff --git a/java/app.go b/java/app.go
index 0f46b4e..ee82a32 100755
--- a/java/app.go
+++ b/java/app.go
@@ -22,17 +22,17 @@
 	"path/filepath"
 	"strings"
 
+	"android/soong/aconfig"
 	"android/soong/testing"
+
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/proptools"
 
 	"android/soong/android"
-	"android/soong/bazel"
 	"android/soong/cc"
 	"android/soong/dexpreopt"
 	"android/soong/genrule"
 	"android/soong/tradefed"
-	"android/soong/ui/metrics/bp2build_metrics_proto"
 )
 
 func init() {
@@ -170,10 +170,12 @@
 	// binaries would be installed by default (in PRODUCT_PACKAGES) the other binary will be removed
 	// from PRODUCT_PACKAGES.
 	Overrides []string
+
+	// Names of aconfig_declarations modules that specify aconfig flags that the app depends on.
+	Flags_packages []string
 }
 
 type AndroidApp struct {
-	android.BazelModuleBase
 	Library
 	aapt
 	android.OverridableModuleBase
@@ -316,6 +318,10 @@
 				`must be names of android_app_certificate modules in the form ":module"`)
 		}
 	}
+
+	for _, aconfig_declaration := range a.overridableAppProperties.Flags_packages {
+		ctx.AddDependency(ctx.Module(), aconfigDeclarationTag, aconfig_declaration)
+	}
 }
 
 func (a *AndroidTestHelperApp) GenerateAndroidBuildActions(ctx android.ModuleContext) {
@@ -500,13 +506,27 @@
 	if a.Updatable() {
 		a.aapt.defaultManifestVersion = android.DefaultUpdatableModuleVersion
 	}
+
+	var aconfigTextFilePaths android.Paths
+	ctx.VisitDirectDepsWithTag(aconfigDeclarationTag, func(dep android.Module) {
+		if provider, ok := ctx.OtherModuleProvider(dep, aconfig.DeclarationsProviderKey).(aconfig.DeclarationsProviderData); ok {
+			aconfigTextFilePaths = append(aconfigTextFilePaths, provider.IntermediateDumpOutputPath)
+		} else {
+			ctx.ModuleErrorf("Only aconfig_declarations module type is allowed for "+
+				"flags_packages property, but %s is not aconfig_declarations module type",
+				dep.Name(),
+			)
+		}
+	})
+
 	a.aapt.buildActions(ctx,
 		aaptBuildActionOptions{
-			android.SdkContext(a),
-			a.classLoaderContexts,
-			a.usesLibraryProperties.Exclude_uses_libs,
-			a.enforceDefaultTargetSdkVersion(),
-			aaptLinkFlags,
+			sdkContext:                     android.SdkContext(a),
+			classLoaderContexts:            a.classLoaderContexts,
+			excludedLibs:                   a.usesLibraryProperties.Exclude_uses_libs,
+			enforceDefaultTargetSdkVersion: a.enforceDefaultTargetSdkVersion(),
+			extraLinkFlags:                 aaptLinkFlags,
+			aconfigTextFiles:               aconfigTextFilePaths,
 		},
 	)
 
@@ -1143,7 +1163,6 @@
 	android.InitDefaultableModule(module)
 	android.InitOverridableModule(module, &module.overridableAppProperties.Overrides)
 	android.InitApexModule(module)
-	android.InitBazelModule(module)
 
 	android.AddLoadHook(module, func(ctx android.LoadHookContext) {
 		a := ctx.Module().(*AndroidApp)
@@ -1228,8 +1247,6 @@
 	testConfig       android.Path
 	extraTestConfigs android.Paths
 	data             android.Paths
-
-	android.BazelModuleBase
 }
 
 func (a *AndroidTest) InstallInTestcases() bool {
@@ -1356,7 +1373,6 @@
 	android.InitDefaultableModule(module)
 	android.InitOverridableModule(module, &module.overridableAppProperties.Overrides)
 
-	android.InitBazelModule(module)
 	return module
 }
 
@@ -1380,8 +1396,6 @@
 	AndroidApp
 
 	appTestHelperAppProperties appTestHelperAppProperties
-
-	android.BazelModuleBase
 }
 
 func (a *AndroidTestHelperApp) InstallInTestcases() bool {
@@ -1413,13 +1427,11 @@
 	android.InitAndroidMultiTargetsArchModule(module, android.DeviceSupported, android.MultilibCommon)
 	android.InitDefaultableModule(module)
 	android.InitApexModule(module)
-	android.InitBazelModule(module)
 	return module
 }
 
 type AndroidAppCertificate struct {
 	android.ModuleBase
-	android.BazelModuleBase
 
 	properties  AndroidAppCertificateProperties
 	Certificate Certificate
@@ -1436,7 +1448,6 @@
 	module := &AndroidAppCertificate{}
 	module.AddProperties(&module.properties)
 	android.InitAndroidModule(module)
-	android.InitBazelModule(module)
 	return module
 }
 
@@ -1713,255 +1724,3 @@
 func (u *usesLibrary) verifyUsesLibrariesAPK(ctx android.ModuleContext, apk android.Path) {
 	u.verifyUsesLibraries(ctx, apk, nil) // for APKs manifest_check does not write output file
 }
-
-// For Bazel / bp2build
-
-type bazelAndroidAppCertificateAttributes struct {
-	Certificate string
-}
-
-func (m *AndroidAppCertificate) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	androidAppCertificateBp2Build(ctx, m)
-}
-
-func androidAppCertificateBp2Build(ctx android.Bp2buildMutatorContext, module *AndroidAppCertificate) {
-	var certificate string
-	if module.properties.Certificate != nil {
-		certificate = *module.properties.Certificate
-	}
-
-	attrs := &bazelAndroidAppCertificateAttributes{
-		Certificate: certificate,
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "android_app_certificate",
-		Bzl_load_location: "//build/bazel/rules/android:android_app_certificate.bzl",
-	}
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: module.Name()}, attrs)
-}
-
-type manifestValueAttribute struct {
-	MinSdkVersion    *string
-	TargetSdkVersion *string
-}
-
-type bazelAndroidAppAttributes struct {
-	*javaCommonAttributes
-	*bazelAapt
-	Deps             bazel.LabelListAttribute
-	Custom_package   *string
-	Certificate      bazel.LabelAttribute
-	Certificate_name bazel.StringAttribute
-	Manifest_values  *manifestValueAttribute
-	Optimize         *bool
-	Proguard_specs   bazel.LabelListAttribute
-	Updatable        *bool
-}
-
-func (b bazelAapt) ConvertJavaResources(ctx android.Bp2buildMutatorContext, javaAttrs *javaCommonAttributes) bool {
-	// TODO (b/300470246) bp2build support for java_resources & java_resource_dirs in android rules
-	hasJavaResources := !javaAttrs.javaResourcesAttributes.Resources.IsEmpty()
-	if hasJavaResources {
-		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_UNSUPPORTED, "(b/300470246) java resources in android_* module")
-	}
-	return hasJavaResources
-}
-
-func convertWithBp2build(ctx android.Bp2buildMutatorContext, a *AndroidApp) (bool, android.CommonAttributes, *bazelAndroidAppAttributes) {
-	aapt, supported := a.convertAaptAttrsWithBp2Build(ctx)
-	if !supported {
-		return false, android.CommonAttributes{}, &bazelAndroidAppAttributes{}
-	}
-	if a.appProperties.Jni_uses_platform_apis != nil {
-		ctx.MarkBp2buildUnconvertible(
-			bp2build_metrics_proto.UnconvertedReasonType_UNSUPPORTED,
-			"TODO - b/299360988: Add bp2build support for jni_uses_platform_apis",
-		)
-		return false, android.CommonAttributes{}, &bazelAndroidAppAttributes{}
-	}
-	if a.appProperties.Jni_uses_sdk_apis != nil {
-		ctx.MarkBp2buildUnconvertible(
-			bp2build_metrics_proto.UnconvertedReasonType_UNSUPPORTED,
-			"TODO - b/299360988: Add bp2build support for jni_uses_sdk_apis",
-		)
-		return false, android.CommonAttributes{}, &bazelAndroidAppAttributes{}
-	}
-
-	certificate, certificateName := android.BazelStringOrLabelFromProp(ctx, a.overridableAppProperties.Certificate)
-
-	manifestValues := &manifestValueAttribute{
-		MinSdkVersion:    a.deviceProperties.Min_sdk_version,
-		TargetSdkVersion: a.deviceProperties.Target_sdk_version,
-	}
-
-	appAttrs := &bazelAndroidAppAttributes{
-		// TODO(b/209576404): handle package name override by product variable PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES
-		Custom_package:   a.overridableAppProperties.Package_name,
-		Certificate:      certificate,
-		Certificate_name: certificateName,
-		Manifest_values:  manifestValues,
-		Updatable:        a.appProperties.Updatable,
-	}
-
-	// As framework-res has no sources, no deps in the Bazel sense, and java compilation, dexing and optimization is skipped by
-	// Soong specifically for it, return early here before any of the conversion work for the above is attempted.
-	if ctx.ModuleName() == "framework-res" {
-		appAttrs.bazelAapt = aapt
-		return true, android.CommonAttributes{Name: a.Name(), SkipData: proptools.BoolPtr(true)}, appAttrs
-	}
-
-	// Optimization is..
-	// - enabled by default for android_app, android_test_helper_app
-	// - disabled by default for android_test
-	//
-	// TODO(b/192032291): Disable android_test_helper_app optimization by
-	// default after auditing downstream usage.
-	if a.dexProperties.Optimize.EnabledByDefault != a.dexer.effectiveOptimizeEnabled() {
-		// Property is explicitly defined by default from default, so emit the Bazel attribute.
-		appAttrs.Optimize = proptools.BoolPtr(a.dexer.effectiveOptimizeEnabled())
-	}
-
-	if a.dexer.effectiveOptimizeEnabled() {
-		handCraftedFlags := ""
-		if Bool(a.dexProperties.Optimize.Ignore_warnings) {
-			handCraftedFlags += "-ignorewarning "
-		}
-		if !Bool(a.dexProperties.Optimize.Shrink) {
-			handCraftedFlags += "-dontshrink "
-		}
-		if !Bool(a.dexProperties.Optimize.Optimize) {
-			handCraftedFlags += "-dontoptimize "
-		}
-		if !Bool(a.dexProperties.Optimize.Obfuscate) {
-			handCraftedFlags += "-dontobfuscate "
-		}
-		appAttrs.Proguard_specs = bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, a.dexProperties.Optimize.Proguard_flags_files))
-		if handCraftedFlags != "" {
-			generatedFlagFileRuleName := a.Name() + "_proguard_flags"
-			ctx.CreateBazelTargetModule(bazel.BazelTargetModuleProperties{
-				Rule_class: "genrule",
-			}, android.CommonAttributes{
-				Name:     generatedFlagFileRuleName,
-				SkipData: proptools.BoolPtr(true),
-			}, &genrule.BazelGenruleAttributes{
-				Outs: []string{a.Name() + "_proguard.flags"},
-				Cmd: bazel.StringAttribute{
-					Value: proptools.StringPtr("echo " + handCraftedFlags + "> $(OUTS)"),
-				},
-			})
-			appAttrs.Proguard_specs.Add(bazel.MakeLabelAttribute(":" + generatedFlagFileRuleName))
-		}
-	}
-
-	commonAttrs, bp2BuildInfo, supported := a.convertLibraryAttrsBp2Build(ctx)
-	if !supported {
-		return false, android.CommonAttributes{}, &bazelAndroidAppAttributes{}
-	}
-	if hasJavaResources := aapt.ConvertJavaResources(ctx, commonAttrs); hasJavaResources {
-		return false, android.CommonAttributes{}, &bazelAndroidAppAttributes{}
-	}
-
-	depLabels := bp2BuildInfo.DepLabels
-
-	deps := depLabels.Deps
-	deps.Append(depLabels.StaticDeps)
-
-	var jniDeps bazel.LabelListAttribute
-	archVariantProps := a.GetArchVariantProperties(ctx, &appProperties{})
-	for axis, configToProps := range archVariantProps {
-		for config, _props := range configToProps {
-			if archProps, ok := _props.(*appProperties); ok {
-				archJniLibs := android.BazelLabelForModuleDeps(
-					ctx,
-					android.LastUniqueStrings(android.CopyOf(archProps.Jni_libs)))
-				jniDeps.SetSelectValue(axis, config, archJniLibs)
-			}
-		}
-	}
-	deps.Append(jniDeps)
-
-	if !bp2BuildInfo.hasKotlin {
-		appAttrs.javaCommonAttributes = commonAttrs
-		appAttrs.bazelAapt = aapt
-		appAttrs.Deps = deps
-	} else {
-		ktName := a.Name() + "_kt"
-		ctx.CreateBazelTargetModule(
-			AndroidLibraryBazelTargetModuleProperties(),
-			android.CommonAttributes{Name: ktName},
-			&bazelAndroidLibrary{
-				javaLibraryAttributes: &javaLibraryAttributes{
-					javaCommonAttributes: commonAttrs,
-					Deps:                 deps,
-				},
-				bazelAapt: aapt,
-			},
-		)
-
-		appAttrs.bazelAapt = &bazelAapt{Manifest: aapt.Manifest}
-		appAttrs.Deps = bazel.MakeSingleLabelListAttribute(bazel.Label{Label: ":" + ktName})
-		appAttrs.javaCommonAttributes = &javaCommonAttributes{
-			Sdk_version: commonAttrs.Sdk_version,
-		}
-	}
-
-	return true, android.CommonAttributes{Name: a.Name(), SkipData: proptools.BoolPtr(true)}, appAttrs
-}
-
-// ConvertWithBp2build is used to convert android_app to Bazel.
-func (a *AndroidApp) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	if ok, commonAttrs, appAttrs := convertWithBp2build(ctx, a); ok {
-		var props bazel.BazelTargetModuleProperties
-		if ctx.ModuleName() == "framework-res" {
-			props = bazel.BazelTargetModuleProperties{
-				Rule_class:        "framework_resources",
-				Bzl_load_location: "//build/bazel/rules/android:framework_resources.bzl",
-			}
-		} else {
-			props = bazel.BazelTargetModuleProperties{
-				Rule_class:        "android_binary",
-				Bzl_load_location: "//build/bazel/rules/android:android_binary.bzl",
-			}
-		}
-		ctx.CreateBazelTargetModule(props, commonAttrs, appAttrs)
-	}
-
-}
-
-// ConvertWithBp2build is used to convert android_test to Bazel.
-func (at *AndroidTest) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	if ok, commonAttrs, appAttrs := convertWithBp2build(ctx, &at.AndroidApp); ok {
-		props := bazel.BazelTargetModuleProperties{
-			Rule_class:        "android_test",
-			Bzl_load_location: "//build/bazel/rules/android:android_test.bzl",
-		}
-
-		ctx.CreateBazelTargetModule(props, commonAttrs, appAttrs)
-	}
-
-}
-
-func (atha *AndroidTestHelperApp) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	if ok, commonAttrs, appAttrs := convertWithBp2build(ctx, &atha.AndroidApp); ok {
-		// an android_test_helper_app is an android_binary with testonly = True
-		commonAttrs.Testonly = proptools.BoolPtr(true)
-
-		// android_test_helper_app sets default values differently to android_app,
-		// https://cs.android.com/android/platform/superproject/main/+/main:build/soong/java/app.go;l=1273-1279;drc=e12c083198403ec694af6c625aed11327eb2bf7f
-		//
-		// installable: true (settable prop)
-		// use_embedded_native_libs: true (settable prop)
-		// lint.test: true (settable prop)
-		// AlwaysPackageNativeLibs: true (blueprint mutated prop)
-		// dexpreopt isTest: true (not prop)
-
-		props := bazel.BazelTargetModuleProperties{
-			Rule_class:        "android_binary",
-			Bzl_load_location: "//build/bazel/rules/android:android_binary.bzl",
-		}
-
-		ctx.CreateBazelTargetModule(props, commonAttrs, appAttrs)
-	}
-}
diff --git a/java/app_test.go b/java/app_test.go
index 5cb4a23..0936b28 100644
--- a/java/app_test.go
+++ b/java/app_test.go
@@ -4333,3 +4333,48 @@
 	)
 
 }
+
+func TestAppFlagsPackages(t *testing.T) {
+	ctx := testApp(t, `
+		android_app {
+			name: "foo",
+			srcs: ["a.java"],
+			sdk_version: "current",
+			flags_packages: [
+				"bar",
+				"baz",
+			],
+		}
+		aconfig_declarations {
+			name: "bar",
+			package: "com.example.package",
+			srcs: [
+				"bar.aconfig",
+			],
+		}
+		aconfig_declarations {
+			name: "baz",
+			package: "com.example.package",
+			srcs: [
+				"baz.aconfig",
+			],
+		}
+	`)
+
+	foo := ctx.ModuleForTests("foo", "android_common")
+
+	// android_app module depends on aconfig_declarations listed in flags_packages
+	android.AssertBoolEquals(t, "foo expected to depend on bar", true,
+		CheckModuleHasDependency(t, ctx, "foo", "android_common", "bar"))
+
+	android.AssertBoolEquals(t, "foo expected to depend on baz", true,
+		CheckModuleHasDependency(t, ctx, "foo", "android_common", "baz"))
+
+	aapt2LinkRule := foo.Rule("android/soong/java.aapt2Link")
+	linkInFlags := aapt2LinkRule.Args["inFlags"]
+	android.AssertStringDoesContain(t,
+		"aapt2 link command expected to pass feature flags arguments",
+		linkInFlags,
+		"--feature-flags @out/soong/.intermediates/bar/intermediate.txt --feature-flags @out/soong/.intermediates/baz/intermediate.txt",
+	)
+}
diff --git a/java/base.go b/java/base.go
index 734f5d4..7cd2820 100644
--- a/java/base.go
+++ b/java/base.go
@@ -20,11 +20,11 @@
 	"strconv"
 	"strings"
 
-	"android/soong/ui/metrics/bp2build_metrics_proto"
-
+	"github.com/google/blueprint"
 	"github.com/google/blueprint/pathtools"
 	"github.com/google/blueprint/proptools"
 
+	"android/soong/aconfig"
 	"android/soong/android"
 	"android/soong/dexpreopt"
 	"android/soong/java/config"
@@ -195,6 +195,12 @@
 
 	// If true, then only the headers are built and not the implementation jar.
 	Headers_only *bool
+
+	// A list of files or dependencies to make available to the build sandbox. This is
+	// useful if source files are symlinks, the targets of the symlinks must be listed here.
+	// Note that currently not all actions implemented by android_apps are sandboxed, so you
+	// may only see this being necessary in lint builds.
+	Compile_data []string `android:"path"`
 }
 
 // Properties that are specific to device modules. Host module factories should not add these when
@@ -406,7 +412,6 @@
 	android.ModuleBase
 	android.DefaultableModuleBase
 	android.ApexModuleBase
-	android.BazelModuleBase
 
 	// Functionality common to Module and Import.
 	embeddableInModuleAndImport
@@ -512,13 +517,8 @@
 	// or the module should override Stem().
 	stem string
 
-	// Aconfig "cache files" that went directly into this module.  Transitive ones are
-	// tracked via JavaInfo.TransitiveAconfigFiles
-	// TODO: Extract to something standalone to propagate tags via GeneratedJavaLibraryModule
-	aconfigIntermediates android.Paths
-
-	// Aconfig files for all transitive deps.  Also exposed via JavaInfo
-	transitiveAconfigFiles *android.DepSet[android.Path]
+	// Single aconfig "cache file" merged from this module and all dependencies.
+	mergedAconfigFiles map[string]android.Paths
 }
 
 func (j *Module) CheckStableSdkVersion(ctx android.BaseModuleContext) error {
@@ -1041,37 +1041,6 @@
 			// just adding a symlink under the root doesn't help.)
 			patchPaths := []string{".", ctx.Config().SoongOutDir()}
 
-			// b/150878007
-			//
-			// Workaround to support *Bazel-executed* JDK9 javac in Bazel's
-			// execution root for --patch-module. If this javac command line is
-			// invoked within Bazel's execution root working directory, the top
-			// level directories (e.g. libcore/, tools/, frameworks/) are all
-			// symlinks. JDK9 javac does not traverse into symlinks, which causes
-			// --patch-module to fail source file lookups when invoked in the
-			// execution root.
-			//
-			// Short of patching javac or enumerating *all* directories as possible
-			// input dirs, manually add the top level dir of the source files to be
-			// compiled.
-			topLevelDirs := map[string]bool{}
-			for _, srcFilePath := range srcFiles {
-				srcFileParts := strings.Split(srcFilePath.String(), "/")
-				// Ignore source files that are already in the top level directory
-				// as well as generated files in the out directory. The out
-				// directory may be an absolute path, which means srcFileParts[0] is the
-				// empty string, so check that as well. Note that "out" in Bazel's execution
-				// root is *not* a symlink, which doesn't cause problems for --patch-modules
-				// anyway, so it's fine to not apply this workaround for generated
-				// source files.
-				if len(srcFileParts) > 1 &&
-					srcFileParts[0] != "" &&
-					srcFileParts[0] != "out" {
-					topLevelDirs[srcFileParts[0]] = true
-				}
-			}
-			patchPaths = append(patchPaths, android.SortedKeys(topLevelDirs)...)
-
 			classPath := flags.classpath.FormJavaClassPath("")
 			if classPath != "" {
 				patchPaths = append(patchPaths, classPath)
@@ -1174,6 +1143,7 @@
 	uniqueSrcFiles = append(uniqueSrcFiles, uniqueJavaFiles...)
 	uniqueSrcFiles = append(uniqueSrcFiles, uniqueKtFiles...)
 	j.uniqueSrcFiles = uniqueSrcFiles
+	ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: uniqueSrcFiles.Strings()})
 
 	// We don't currently run annotation processors in turbine, which means we can't use turbine
 	// generated header jars when an annotation processor that generates API is enabled.  One
@@ -1713,6 +1683,7 @@
 		j.linter.compileSdkKind = j.SdkVersion(ctx).Kind
 		j.linter.javaLanguageLevel = flags.javaVersion.String()
 		j.linter.kotlinLanguageLevel = "1.3"
+		j.linter.compile_data = android.PathsForModuleSrc(ctx, j.properties.Compile_data)
 		if !apexInfo.IsForPlatform() && ctx.Config().UnbundledBuildApps() {
 			j.linter.buildModuleReportZip = true
 		}
@@ -1723,7 +1694,7 @@
 
 	ctx.CheckbuildFile(outputFile)
 
-	j.collectTransitiveAconfigFiles(ctx)
+	aconfig.CollectDependencyAconfigFiles(ctx, &j.mergedAconfigFiles)
 
 	ctx.SetProvider(JavaInfoProvider, JavaInfo{
 		HeaderJars:                     android.PathsIfNonNil(j.headerJarFile),
@@ -1740,7 +1711,6 @@
 		ExportedPluginClasses:          j.exportedPluginClasses,
 		ExportedPluginDisableTurbine:   j.exportedDisableTurbine,
 		JacocoReportClassesFile:        j.jacocoReportClassesFile,
-		TransitiveAconfigFiles:         j.transitiveAconfigFiles,
 	})
 
 	// Save the output file with no relative path so that it doesn't end up in a subdirectory when used as a resource
@@ -2081,34 +2051,6 @@
 	return Bool(j.properties.Installable)
 }
 
-func (j *Module) collectTransitiveAconfigFiles(ctx android.ModuleContext) {
-	// Aconfig files from this module
-	mine := j.aconfigIntermediates
-
-	// Aconfig files from transitive dependencies
-	fromDeps := []*android.DepSet[android.Path]{}
-	ctx.VisitDirectDeps(func(module android.Module) {
-		dep := ctx.OtherModuleProvider(module, JavaInfoProvider).(JavaInfo)
-		if dep.TransitiveAconfigFiles != nil {
-			fromDeps = append(fromDeps, dep.TransitiveAconfigFiles)
-		}
-	})
-
-	// DepSet containing aconfig files myself and from dependencies
-	j.transitiveAconfigFiles = android.NewDepSet(android.POSTORDER, mine, fromDeps)
-}
-
-func (j *Module) AddAconfigIntermediate(path android.Path) {
-	j.aconfigIntermediates = append(j.aconfigIntermediates, path)
-}
-
-func (j *Module) getTransitiveAconfigFiles() *android.DepSet[android.Path] {
-	if j.transitiveAconfigFiles == nil {
-		panic(fmt.Errorf("java.Moduile: getTransitiveAconfigFiles called before collectTransitiveAconfigFiles module=%s", j.Name()))
-	}
-	return j.transitiveAconfigFiles
-}
-
 type sdkLinkType int
 
 const (
@@ -2410,22 +2352,3 @@
 }
 
 var _ ModuleWithStem = (*Module)(nil)
-
-func (j *Module) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	switch ctx.ModuleType() {
-	case "java_library", "java_library_host", "java_library_static", "tradefed_java_library_host":
-		if lib, ok := ctx.Module().(*Library); ok {
-			javaLibraryBp2Build(ctx, lib)
-		}
-	case "java_binary_host":
-		if binary, ok := ctx.Module().(*Binary); ok {
-			javaBinaryHostBp2Build(ctx, binary)
-		}
-	case "java_test_host":
-		if testHost, ok := ctx.Module().(*TestHost); ok {
-			javaTestHostBp2Build(ctx, testHost)
-		}
-	default:
-		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_TYPE_UNSUPPORTED, "")
-	}
-}
diff --git a/java/code_metadata_test.go b/java/code_metadata_test.go
new file mode 100644
index 0000000..4b05d9e
--- /dev/null
+++ b/java/code_metadata_test.go
@@ -0,0 +1,125 @@
+package java
+
+import (
+	"strings"
+	"testing"
+
+	"android/soong/android"
+	soongTesting "android/soong/testing"
+	"android/soong/testing/code_metadata_internal_proto"
+	"google.golang.org/protobuf/proto"
+)
+
+func TestCodeMetadata(t *testing.T) {
+	bp := `code_metadata {
+		name: "module-name",
+		teamId: "12345",
+		code: [
+			"foo",
+		]
+	}
+
+	java_sdk_library {
+		name: "foo",
+		srcs: ["a.java"],
+	}`
+	result := runCodeMetadataTest(t, android.FixtureExpectsNoErrors, bp)
+
+	module := result.ModuleForTests(
+		"module-name", "",
+	).Module().(*soongTesting.CodeMetadataModule)
+
+	// Check that the provider has the right contents
+	data := result.ModuleProvider(
+		module, soongTesting.CodeMetadataProviderKey,
+	).(soongTesting.CodeMetadataProviderData)
+	if !strings.HasSuffix(
+		data.IntermediatePath.String(), "/intermediateCodeMetadata.pb",
+	) {
+		t.Errorf(
+			"Missing intermediates path in provider: %s",
+			data.IntermediatePath.String(),
+		)
+	}
+
+	buildParamsSlice := module.BuildParamsForTests()
+	var metadata = ""
+	for _, params := range buildParamsSlice {
+		if params.Rule.String() == "android/soong/android.writeFile" {
+			metadata = params.Args["content"]
+		}
+	}
+
+	metadataList := make([]*code_metadata_internal_proto.CodeMetadataInternal_TargetOwnership, 0, 2)
+	teamId := "12345"
+	bpFilePath := "Android.bp"
+	targetName := "foo"
+	srcFile := []string{"a.java"}
+	expectedMetadataProto := code_metadata_internal_proto.CodeMetadataInternal_TargetOwnership{
+		TrendyTeamId: &teamId,
+		TargetName:   &targetName,
+		Path:         &bpFilePath,
+		SourceFiles:  srcFile,
+	}
+	metadataList = append(metadataList, &expectedMetadataProto)
+
+	CodeMetadataMetadata := code_metadata_internal_proto.CodeMetadataInternal{TargetOwnershipList: metadataList}
+	protoData, _ := proto.Marshal(&CodeMetadataMetadata)
+	rawData := string(protoData)
+	formattedData := strings.ReplaceAll(rawData, "\n", "\\n")
+	expectedMetadata := "'" + formattedData + "\\n'"
+
+	if metadata != expectedMetadata {
+		t.Errorf(
+			"Retrieved metadata: %s is not equal to expectedMetadata: %s", metadata,
+			expectedMetadata,
+		)
+	}
+
+	// Tests for all_test_spec singleton.
+	singleton := result.SingletonForTests("all_code_metadata")
+	rule := singleton.Rule("all_code_metadata_rule")
+	prebuiltOs := result.Config.PrebuiltOS()
+	expectedCmd := "out/soong/host/" + prebuiltOs + "/bin/metadata -rule code_metadata -inputFile out/soong/all_code_metadata_paths.rsp -outputFile out/soong/ownership/all_code_metadata.pb"
+	expectedOutputFile := "out/soong/ownership/all_code_metadata.pb"
+	expectedInputFile := "out/soong/.intermediates/module-name/intermediateCodeMetadata.pb"
+	if !strings.Contains(
+		strings.TrimSpace(rule.Output.String()),
+		expectedOutputFile,
+	) {
+		t.Errorf(
+			"Retrieved singletonOutputFile: %s is not equal to expectedSingletonOutputFile: %s",
+			rule.Output.String(), expectedOutputFile,
+		)
+	}
+
+	if !strings.Contains(
+		strings.TrimSpace(rule.Inputs[0].String()),
+		expectedInputFile,
+	) {
+		t.Errorf(
+			"Retrieved singletonInputFile: %s is not equal to expectedSingletonInputFile: %s",
+			rule.Inputs[0].String(), expectedInputFile,
+		)
+	}
+
+	if !strings.Contains(
+		strings.TrimSpace(rule.RuleParams.Command),
+		expectedCmd,
+	) {
+		t.Errorf(
+			"Retrieved cmd: %s doesn't contain expectedCmd: %s",
+			rule.RuleParams.Command, expectedCmd,
+		)
+	}
+}
+func runCodeMetadataTest(
+		t *testing.T, errorHandler android.FixtureErrorHandler, bp string,
+) *android.TestResult {
+	return android.GroupFixturePreparers(
+		soongTesting.PrepareForTestWithTestingBuildComponents, prepareForJavaTest,
+		PrepareForTestWithJavaSdkLibraryFiles, FixtureWithLastReleaseApis("foo"),
+	).
+		ExtendWithErrorHandler(errorHandler).
+		RunTestWithBp(t, bp)
+}
diff --git a/java/config/config.go b/java/config/config.go
index 0098130..d80ed41 100644
--- a/java/config/config.go
+++ b/java/config/config.go
@@ -221,10 +221,6 @@
 	hostJNIToolVariableWithSdkToolsPrebuilt("SignapkJniLibrary", "libconscrypt_openjdk_jni")
 }
 
-func BazelJavaToolchainVars(config android.Config) string {
-	return android.BazelToolchainVars(config, exportedVars)
-}
-
 func hostBinToolVariableWithSdkToolsPrebuilt(name, tool string) {
 	pctx.VariableFunc(name, func(ctx android.PackageVarContext) string {
 		if ctx.Config().AlwaysUsePrebuiltSdks() {
diff --git a/java/config/droidstubs.go b/java/config/droidstubs.go
index b7aab5a..7029fee 100644
--- a/java/config/droidstubs.go
+++ b/java/config/droidstubs.go
@@ -57,7 +57,7 @@
 	MetalavaAnnotationsWarningsFlags = strings.Join(metalavaAnnotationsWarningsFlags, " ")
 
 	metalavaHideFlaggedApis = []string{
-		"--hide-annotation",
+		"--revert-annotation",
 		"android.annotation.FlaggedApi",
 	}
 
diff --git a/java/device_host_converter.go b/java/device_host_converter.go
index c5ba245..ee8a15a 100644
--- a/java/device_host_converter.go
+++ b/java/device_host_converter.go
@@ -19,16 +19,12 @@
 	"io"
 
 	"android/soong/android"
-	"android/soong/bazel"
 	"android/soong/dexpreopt"
-
-	"github.com/google/blueprint/proptools"
 )
 
 type DeviceHostConverter struct {
 	android.ModuleBase
 	android.DefaultableModuleBase
-	android.BazelModuleBase
 
 	properties DeviceHostConverterProperties
 
@@ -80,7 +76,6 @@
 	module.AddProperties(&module.properties)
 
 	InitJavaModule(module, android.DeviceSupported)
-	android.InitBazelModule(module)
 	return module
 }
 
@@ -193,32 +188,3 @@
 		},
 	}
 }
-
-type bazelDeviceHostConverterAttributes struct {
-	Exports bazel.LabelListAttribute
-}
-
-func (d *DeviceHostConverter) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "java_host_for_device",
-			Bzl_load_location: "//build/bazel/rules/java:host_for_device.bzl",
-		},
-		android.CommonAttributes{Name: d.Name()},
-		&bazelDeviceHostConverterAttributes{
-			Exports: bazel.MakeLabelListAttribute(android.BazelLabelForModuleDeps(ctx, d.properties.Libs)),
-		},
-	)
-	neverLinkAttrs := &javaLibraryAttributes{
-		Exports:   bazel.MakeSingleLabelListAttribute(bazel.Label{Label: ":" + d.Name()}),
-		Neverlink: bazel.BoolAttribute{Value: proptools.BoolPtr(true)},
-		javaCommonAttributes: &javaCommonAttributes{
-			Sdk_version: bazel.StringAttribute{Value: proptools.StringPtr("none")},
-		},
-	}
-	ctx.CreateBazelTargetModule(
-		javaLibraryBazelTargetModuleProperties(),
-		android.CommonAttributes{Name: d.Name() + "-neverlink"},
-		neverLinkAttrs)
-
-}
diff --git a/java/droiddoc.go b/java/droiddoc.go
index f7d7de6..b0d5376 100644
--- a/java/droiddoc.go
+++ b/java/droiddoc.go
@@ -22,7 +22,6 @@
 	"github.com/google/blueprint/proptools"
 
 	"android/soong/android"
-	"android/soong/bazel"
 	"android/soong/java/config"
 )
 
@@ -852,7 +851,6 @@
 
 type ExportedDroiddocDir struct {
 	android.ModuleBase
-	android.BazelModuleBase
 
 	properties ExportedDroiddocDirProperties
 
@@ -865,7 +863,6 @@
 	module := &ExportedDroiddocDir{}
 	module.AddProperties(&module.properties)
 	android.InitAndroidModule(module)
-	android.InitBazelModule(module)
 	return module
 }
 
@@ -877,28 +874,6 @@
 	d.deps = android.PathsForModuleSrc(ctx, []string{filepath.Join(path, "**/*")})
 }
 
-// ConvertWithBp2build implements android.BazelModule.
-func (d *ExportedDroiddocDir) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	props := bazel.BazelTargetModuleProperties{
-		// Use the native py_library rule.
-		Rule_class:        "droiddoc_exported_dir",
-		Bzl_load_location: "//build/bazel/rules/droiddoc:droiddoc_exported_dir.bzl",
-	}
-
-	type BazelAttrs struct {
-		Dir  *string
-		Srcs bazel.LabelListAttribute
-	}
-
-	attrs := &BazelAttrs{
-		Dir:  proptools.StringPtr(*d.properties.Path),
-		Srcs: bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, []string{filepath.Join(*d.properties.Path, "**/*")})),
-	}
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: d.Name()}, attrs)
-
-}
-
 // Defaults
 type DocDefaults struct {
 	android.ModuleBase
diff --git a/java/droidstubs.go b/java/droidstubs.go
index 6b8d21f..e7ccc1b 100644
--- a/java/droidstubs.go
+++ b/java/droidstubs.go
@@ -18,7 +18,6 @@
 	"fmt"
 	"path/filepath"
 	"regexp"
-	"sort"
 	"strings"
 
 	"github.com/google/blueprint/proptools"
@@ -894,28 +893,6 @@
 	}
 )
 
-// A helper function that returns the api surface of the corresponding java_api_contribution Bazel target
-// The api_surface is populated using the naming convention of the droidstubs module.
-func bazelApiSurfaceName(name string) string {
-	// Sort the keys so that longer strings appear first
-	// Otherwise substrings like system will match both system and system_server
-	sortedKeys := make([]string, 0)
-	for key := range droidstubsModuleNamingToSdkKind {
-		sortedKeys = append(sortedKeys, key)
-	}
-	sort.Slice(sortedKeys, func(i, j int) bool {
-		return len(sortedKeys[i]) > len(sortedKeys[j])
-	})
-	for _, sortedKey := range sortedKeys {
-		if strings.Contains(name, sortedKey) {
-			sdkKind := droidstubsModuleNamingToSdkKind[sortedKey]
-			return sdkKind.String() + "api"
-		}
-	}
-	// Default is publicapi
-	return android.SdkPublic.String() + "api"
-}
-
 func StubsDefaultsFactory() android.Module {
 	module := &DocDefaults{}
 
diff --git a/java/droidstubs_test.go b/java/droidstubs_test.go
index f86e1ac..17cad89 100644
--- a/java/droidstubs_test.go
+++ b/java/droidstubs_test.go
@@ -84,7 +84,7 @@
 	for _, c := range testcases {
 		m := ctx.ModuleForTests(c.moduleName, "android_common")
 		manifest := m.Output("metalava.sbox.textproto")
-		sboxProto := android.RuleBuilderSboxProtoForTests(t, manifest)
+		sboxProto := android.RuleBuilderSboxProtoForTests(t, ctx, manifest)
 		cmdline := String(sboxProto.Commands[0].Command)
 		android.AssertStringContainsEquals(t, "api-versions generation flag", cmdline, "--generate-api-levels", c.generate_xml)
 		if c.expectedJarFilename != "" {
@@ -133,7 +133,7 @@
 
 	m := ctx.ModuleForTests("foo-stubs", "android_common")
 	manifest := m.Output("metalava.sbox.textproto")
-	cmd := String(android.RuleBuilderSboxProtoForTests(t, manifest).Commands[0].Command)
+	cmd := String(android.RuleBuilderSboxProtoForTests(t, ctx, manifest).Commands[0].Command)
 	r := regexp.MustCompile(`--android-jar-pattern [^ ]+/android.jar`)
 	return r.FindAllString(cmd, -1)
 }
@@ -212,7 +212,7 @@
 		t.Errorf("Expected inputs %q, got %q", w, g)
 	}
 
-	manifest := android.RuleBuilderSboxProtoForTests(t, m.Output("metalava.sbox.textproto"))
+	manifest := android.RuleBuilderSboxProtoForTests(t, ctx, m.Output("metalava.sbox.textproto"))
 	if g, w := manifest.Commands[0].GetCommand(), "reference __SBOX_SANDBOX_DIR__/out/.intermediates/foo/gen/foo.txt"; !strings.Contains(g, w) {
 		t.Errorf("Expected command to contain %q, got %q", w, g)
 	}
@@ -302,53 +302,11 @@
 		})
 	m := ctx.ModuleForTests("baz-stubs", "android_common")
 	manifest := m.Output("metalava.sbox.textproto")
-	cmdline := String(android.RuleBuilderSboxProtoForTests(t, manifest).Commands[0].Command)
+	cmdline := String(android.RuleBuilderSboxProtoForTests(t, ctx, manifest).Commands[0].Command)
 	android.AssertStringDoesContain(t, "sdk-extensions-root present", cmdline, "--sdk-extensions-root sdk/extensions")
 	android.AssertStringDoesContain(t, "sdk-extensions-info present", cmdline, "--sdk-extensions-info sdk/extensions/info.txt")
 }
 
-func TestApiSurfaceFromDroidStubsName(t *testing.T) {
-	testCases := []struct {
-		desc               string
-		name               string
-		expectedApiSurface string
-	}{
-		{
-			desc:               "Default is publicapi",
-			name:               "mydroidstubs",
-			expectedApiSurface: "publicapi",
-		},
-		{
-			desc:               "name contains system substring",
-			name:               "mydroidstubs.system.suffix",
-			expectedApiSurface: "systemapi",
-		},
-		{
-			desc:               "name contains system_server substring",
-			name:               "mydroidstubs.system_server.suffix",
-			expectedApiSurface: "system-serverapi",
-		},
-		{
-			desc:               "name contains module_lib substring",
-			name:               "mydroidstubs.module_lib.suffix",
-			expectedApiSurface: "module-libapi",
-		},
-		{
-			desc:               "name contains test substring",
-			name:               "mydroidstubs.test.suffix",
-			expectedApiSurface: "testapi",
-		},
-		{
-			desc:               "name contains intra.core substring",
-			name:               "mydroidstubs.intra.core.suffix",
-			expectedApiSurface: "intracoreapi",
-		},
-	}
-	for _, tc := range testCases {
-		android.AssertStringEquals(t, tc.desc, tc.expectedApiSurface, bazelApiSurfaceName(tc.name))
-	}
-}
-
 func TestDroidStubsApiContributionGeneration(t *testing.T) {
 	ctx, _ := testJavaWithFS(t, `
 		droidstubs {
@@ -434,6 +392,6 @@
 
 	m := result.ModuleForTests("foo", "android_common")
 	manifest := m.Output("metalava.sbox.textproto")
-	cmdline := String(android.RuleBuilderSboxProtoForTests(t, manifest).Commands[0].Command)
-	android.AssertStringDoesContain(t, "flagged api hide command not included", cmdline, "--hide-annotation android.annotation.FlaggedApi")
+	cmdline := String(android.RuleBuilderSboxProtoForTests(t, result.TestContext, manifest).Commands[0].Command)
+	android.AssertStringDoesContain(t, "flagged api hide command not included", cmdline, "--revert-annotation android.annotation.FlaggedApi")
 }
diff --git a/java/gen.go b/java/gen.go
index 638da25..68a9b53 100644
--- a/java/gen.go
+++ b/java/gen.go
@@ -129,19 +129,7 @@
 			baseDir = filepath.Clean(baseDir)
 			baseDirSeen := android.InList(baseDir, baseDirs) || android.InList(baseDir, excludeDirsStrings)
 
-			// For go/bp2build mixed builds, a file may be listed under a
-			// directory in the Bazel output tree that is symlinked to a
-			// directory under the android source tree. We should only
-			// include one copy of this directory so that the AIDL tool
-			// doesn't find multiple definitions of the same AIDL class.
-			// This code comes into effect when filegroups are used in mixed builds.
-			bazelPathPrefix := android.PathForBazelOut(ctx, "").String()
-			bazelBaseDir, err := filepath.Rel(bazelPathPrefix, baseDir)
-			bazelBaseDirSeen := err == nil &&
-				android.InList(bazelBaseDir, baseDirs) ||
-				android.InList(bazelBaseDir, excludeDirsStrings)
-
-			if baseDir != "" && !baseDirSeen && !bazelBaseDirSeen {
+			if baseDir != "" && !baseDirSeen {
 				baseDirs = append(baseDirs, baseDir)
 			}
 		}
diff --git a/java/generated_java_library.go b/java/generated_java_library.go
index 930bfd2..40f780c 100644
--- a/java/generated_java_library.go
+++ b/java/generated_java_library.go
@@ -35,8 +35,6 @@
 	// Called from inside GenerateAndroidBuildActions. Add the build rules to
 	// make the srcjar, and return the path to it.
 	GenerateSourceJarBuildActions(module *GeneratedJavaLibraryModule, ctx android.ModuleContext) android.Path
-
-	Bp2build(ctx android.Bp2buildMutatorContext, module *GeneratedJavaLibraryModule)
 }
 
 // GeneratedJavaLibraryModuleFactory provides a utility for modules that are generated
@@ -57,7 +55,6 @@
 	module.addHostAndDeviceProperties()
 	module.initModuleAndImport(module)
 	android.InitApexModule(module)
-	android.InitBazelModule(module)
 	InitJavaModule(module, android.HostAndDeviceSupported)
 	if properties != nil {
 		module.AddProperties(properties)
@@ -110,7 +107,3 @@
 	module.Library.properties.Generated_srcjars = append(module.Library.properties.Generated_srcjars, srcJarPath)
 	module.Library.GenerateAndroidBuildActions(ctx)
 }
-
-func (module *GeneratedJavaLibraryModule) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	module.callbacks.Bp2build(ctx, module)
-}
diff --git a/java/generated_java_library_test.go b/java/generated_java_library_test.go
index 7fbbfee..be816cd 100644
--- a/java/generated_java_library_test.go
+++ b/java/generated_java_library_test.go
@@ -37,13 +37,9 @@
 }
 
 func (callbacks *JavaGenLibTestCallbacks) GenerateSourceJarBuildActions(module *GeneratedJavaLibraryModule, ctx android.ModuleContext) android.Path {
-	module.AddAconfigIntermediate(android.PathForOutput(ctx, "aconfig_cache_file"))
 	return android.PathForOutput(ctx, "blah.srcjar")
 }
 
-func (callbacks *JavaGenLibTestCallbacks) Bp2build(ctx android.Bp2buildMutatorContext, module *GeneratedJavaLibraryModule) {
-}
-
 func testGenLib(t *testing.T, errorHandler android.FixtureErrorHandler, bp string) *android.TestResult {
 	return android.GroupFixturePreparers(
 		PrepareForIntegrationTestWithJava,
diff --git a/java/genrule.go b/java/genrule.go
index 208e1f4..b84225f 100644
--- a/java/genrule.go
+++ b/java/genrule.go
@@ -65,7 +65,6 @@
 
 	android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibCommon)
 	android.InitDefaultableModule(module)
-	android.InitBazelModule(module)
 
 	return module
 }
@@ -79,7 +78,6 @@
 
 	android.InitAndroidArchModule(module, android.HostSupported, android.MultilibCommon)
 	android.InitDefaultableModule(module)
-	android.InitBazelModule(module)
 
 	return module
 }
diff --git a/java/java.go b/java/java.go
index 9f30ad3..9be8bfd 100644
--- a/java/java.go
+++ b/java/java.go
@@ -24,12 +24,8 @@
 	"sort"
 	"strings"
 
-	"android/soong/bazel"
-	"android/soong/bazel/cquery"
 	"android/soong/remoteexec"
 	"android/soong/testing"
-	"android/soong/ui/metrics/bp2build_metrics_proto"
-
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/proptools"
 
@@ -297,15 +293,6 @@
 	// JacocoReportClassesFile is the path to a jar containing uninstrumented classes that will be
 	// instrumented by jacoco.
 	JacocoReportClassesFile android.Path
-
-	// set of aconfig flags for all transitive libs deps
-	// TODO(joeo): It would be nice if this were over in the aconfig package instead of here.
-	// In order to do that, generated_java_library would need a way doing
-	// collectTransitiveAconfigFiles with one of the callbacks, and having that automatically
-	// propagated. If we were to clean up more of the stuff on JavaInfo that's not part of
-	// core java rules (e.g. AidlIncludeDirs), then maybe adding more framework to do that would be
-	// worth it.
-	TransitiveAconfigFiles *android.DepSet[android.Path]
 }
 
 var JavaInfoProvider = blueprint.NewProvider(JavaInfo{})
@@ -418,6 +405,7 @@
 	syspropPublicStubDepTag = dependencyTag{name: "sysprop public stub"}
 	javaApiContributionTag  = dependencyTag{name: "java-api-contribution"}
 	depApiSrcsTag           = dependencyTag{name: "dep-api-srcs"}
+	aconfigDeclarationTag   = dependencyTag{name: "aconfig-declaration"}
 	jniInstallTag           = installDependencyTag{name: "jni install"}
 	binaryInstallTag        = installDependencyTag{name: "binary install"}
 	usesLibReqTag           = makeUsesLibraryDependencyTag(dexpreopt.AnySdkVersion, false)
@@ -917,7 +905,6 @@
 	module.initModuleAndImport(module)
 
 	android.InitApexModule(module)
-	android.InitBazelModule(module)
 	InitJavaModule(module, android.HostAndDeviceSupported)
 	return module
 }
@@ -939,7 +926,6 @@
 	module.Module.properties.Installable = proptools.BoolPtr(true)
 
 	android.InitApexModule(module)
-	android.InitBazelModule(module)
 	InitJavaModule(module, android.HostSupported)
 	return module
 }
@@ -1449,8 +1435,6 @@
 		nil,
 		nil)
 
-	android.InitBazelModule(module)
-
 	InitJavaModuleMultiTargets(module, android.HostSupported)
 
 	return module
@@ -1591,7 +1575,6 @@
 
 	android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibCommonFirst)
 	android.InitDefaultableModule(module)
-	android.InitBazelModule(module)
 
 	return module
 }
@@ -1610,7 +1593,6 @@
 
 	android.InitAndroidArchModule(module, android.HostSupported, android.MultilibCommonFirst)
 	android.InitDefaultableModule(module)
-	android.InitBazelModule(module)
 	return module
 }
 
@@ -2105,7 +2087,6 @@
 	android.ModuleBase
 	android.DefaultableModuleBase
 	android.ApexModuleBase
-	android.BazelModuleBase
 	prebuilt android.Prebuilt
 
 	// Functionality common to Module and Import.
@@ -2204,7 +2185,6 @@
 }
 
 func (j *Import) commonBuildActions(ctx android.ModuleContext) {
-	//TODO(b/231322772) these should come from Bazel once available
 	j.sdkVersion = j.SdkVersion(ctx)
 	j.minSdkVersion = j.MinSdkVersion(ctx)
 
@@ -2506,7 +2486,6 @@
 
 	android.InitPrebuiltModule(module, &module.properties.Jars)
 	android.InitApexModule(module)
-	android.InitBazelModule(module)
 	InitJavaModule(module, android.HostAndDeviceSupported)
 	return module
 }
@@ -2523,7 +2502,6 @@
 
 	android.InitPrebuiltModule(module, &module.properties.Jars)
 	android.InitApexModule(module)
-	android.InitBazelModule(module)
 	InitJavaModule(module, android.HostSupported)
 	return module
 }
@@ -2820,695 +2798,6 @@
 	}
 }
 
-type javaResourcesAttributes struct {
-	Resources             bazel.LabelListAttribute
-	Resource_strip_prefix *string
-	Additional_resources  bazel.LabelListAttribute `blueprint:"mutated"`
-}
-
-func (m *Library) getResourceFilegroupStripPrefix(ctx android.Bp2buildMutatorContext, resourceFilegroup string) (*string, bool) {
-	if otherM, ok := ctx.ModuleFromName(resourceFilegroup); ok {
-		if fg, isFilegroup := otherM.(android.FileGroupPath); isFilegroup {
-			return proptools.StringPtr(filepath.Join(ctx.OtherModuleDir(otherM), fg.GetPath(ctx))), true
-		}
-	}
-	return proptools.StringPtr(""), false
-}
-
-func (m *Library) convertJavaResourcesAttributes(ctx android.Bp2buildMutatorContext) *javaResourcesAttributes {
-	var resources bazel.LabelList
-	var resourceStripPrefix *string
-
-	additionalJavaResourcesMap := make(map[string]*javaResourcesAttributes)
-
-	if m.properties.Java_resources != nil {
-		for _, res := range m.properties.Java_resources {
-			if prefix, isFilegroup := m.getResourceFilegroupStripPrefix(ctx, res); isFilegroup {
-				otherM, _ := ctx.ModuleFromName(res)
-				resourcesTargetName := ctx.ModuleName() + "_filegroup_resources_" + otherM.Name()
-				additionalJavaResourcesMap[resourcesTargetName] = &javaResourcesAttributes{
-					Resources:             bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, []string{res})),
-					Resource_strip_prefix: prefix,
-				}
-			} else {
-				resources.Append(android.BazelLabelForModuleSrc(ctx, []string{res}))
-			}
-		}
-
-		if !resources.IsEmpty() {
-			resourceStripPrefix = proptools.StringPtr(ctx.ModuleDir())
-		}
-	}
-
-	//TODO(b/179889880) handle case where glob includes files outside package
-	resDeps := ResourceDirsToFiles(
-		ctx,
-		m.properties.Java_resource_dirs,
-		m.properties.Exclude_java_resource_dirs,
-		m.properties.Exclude_java_resources,
-	)
-
-	for _, resDep := range resDeps {
-		dir, files := resDep.dir, resDep.files
-
-		// Bazel includes the relative path from the WORKSPACE root when placing the resource
-		// inside the JAR file, so we need to remove that prefix
-		prefix := proptools.StringPtr(dir.String())
-		resourcesTargetName := ctx.ModuleName() + "_resource_dir_" + dir.String()
-		additionalJavaResourcesMap[resourcesTargetName] = &javaResourcesAttributes{
-			Resources:             bazel.MakeLabelListAttribute(bazel.MakeLabelList(android.RootToModuleRelativePaths(ctx, files))),
-			Resource_strip_prefix: prefix,
-		}
-	}
-
-	var additionalResourceLabels bazel.LabelList
-	if len(additionalJavaResourcesMap) > 0 {
-		var additionalResources []string
-		for resName, _ := range additionalJavaResourcesMap {
-			additionalResources = append(additionalResources, resName)
-		}
-		sort.Strings(additionalResources)
-
-		for i, resName := range additionalResources {
-			resAttr := additionalJavaResourcesMap[resName]
-			if resourceStripPrefix == nil && i == 0 {
-				resourceStripPrefix = resAttr.Resource_strip_prefix
-				resources = resAttr.Resources.Value
-			} else if !resAttr.Resources.IsEmpty() {
-				ctx.CreateBazelTargetModule(
-					bazel.BazelTargetModuleProperties{
-						Rule_class:        "java_resources",
-						Bzl_load_location: "//build/bazel/rules/java:java_resources.bzl",
-					},
-					android.CommonAttributes{Name: resName},
-					resAttr,
-				)
-				additionalResourceLabels.Append(android.BazelLabelForModuleSrc(ctx, []string{resName}))
-			}
-		}
-
-	}
-
-	return &javaResourcesAttributes{
-		Resources:             bazel.MakeLabelListAttribute(resources),
-		Resource_strip_prefix: resourceStripPrefix,
-		Additional_resources:  bazel.MakeLabelListAttribute(additionalResourceLabels),
-	}
-}
-
-type javaCommonAttributes struct {
-	*javaResourcesAttributes
-	*kotlinAttributes
-	Srcs                    bazel.LabelListAttribute
-	Plugins                 bazel.LabelListAttribute
-	Javacopts               bazel.StringListAttribute
-	Sdk_version             bazel.StringAttribute
-	Java_version            bazel.StringAttribute
-	Errorprone_force_enable bazel.BoolAttribute
-	Javac_shard_size        *int64
-}
-
-type javaDependencyLabels struct {
-	// Dependencies which DO NOT contribute to the API visible to upstream dependencies.
-	Deps bazel.LabelListAttribute
-	// Dependencies which DO contribute to the API visible to upstream dependencies.
-	StaticDeps bazel.LabelListAttribute
-}
-
-type eventLogTagsAttributes struct {
-	Srcs bazel.LabelListAttribute
-}
-
-type aidlLibraryAttributes struct {
-	Srcs bazel.LabelListAttribute
-	Tags bazel.StringListAttribute
-}
-
-type javaAidlLibraryAttributes struct {
-	Deps bazel.LabelListAttribute
-	Tags bazel.StringListAttribute
-}
-
-// bp2BuildJavaInfo has information needed for the conversion of  java*_modules
-// that is needed bor Bp2Build conversion but that requires different handling
-// depending on the module type.
-type bp2BuildJavaInfo struct {
-	// separates dependencies into dynamic dependencies and static dependencies.
-	DepLabels *javaDependencyLabels
-	hasKotlin bool
-}
-
-func javaXsdTargetName(xsd android.XsdConfigBp2buildTargets) string {
-	return xsd.JavaBp2buildTargetName()
-}
-
-// convertLibraryAttrsBp2Build returns a javaCommonAttributes struct with
-// converted attributes shared across java_* modules and a bp2BuildJavaInfo struct
-// which has other non-attribute information needed for bp2build conversion
-// that needs different handling depending on the module types, and thus needs
-// to be returned to the calling function.
-func (m *Library) convertLibraryAttrsBp2Build(ctx android.Bp2buildMutatorContext) (*javaCommonAttributes, *bp2BuildJavaInfo, bool) {
-	var srcs bazel.LabelListAttribute
-	var deps bazel.LabelListAttribute
-	var staticDeps bazel.LabelListAttribute
-
-	if proptools.String(m.deviceProperties.Sdk_version) == "" && m.DeviceSupported() {
-		// TODO(b/297356704): handle platform apis in bp2build
-		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_PROPERTY_UNSUPPORTED, "sdk_version unset")
-		return &javaCommonAttributes{}, &bp2BuildJavaInfo{}, false
-	} else if proptools.String(m.deviceProperties.Sdk_version) == "core_platform" {
-		// TODO(b/297356582): handle core_platform in bp2build
-		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_PROPERTY_UNSUPPORTED, "sdk_version core_platform")
-		return &javaCommonAttributes{}, &bp2BuildJavaInfo{}, false
-	}
-
-	archVariantProps := m.GetArchVariantProperties(ctx, &CommonProperties{})
-	for axis, configToProps := range archVariantProps {
-		for config, p := range configToProps {
-			if archProps, ok := p.(*CommonProperties); ok {
-				archSrcs := android.BazelLabelForModuleSrcExcludes(ctx, archProps.Srcs, archProps.Exclude_srcs)
-				srcs.SetSelectValue(axis, config, archSrcs)
-				if archProps.Jarjar_rules != nil {
-					ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_PROPERTY_UNSUPPORTED, "jarjar_rules")
-					return &javaCommonAttributes{}, &bp2BuildJavaInfo{}, false
-				}
-			}
-		}
-	}
-	srcs.Append(
-		bazel.MakeLabelListAttribute(
-			android.BazelLabelForModuleSrcExcludes(ctx,
-				m.properties.Openjdk9.Srcs,
-				m.properties.Exclude_srcs)))
-	srcs.ResolveExcludes()
-
-	javaSrcPartition := "java"
-	protoSrcPartition := "proto"
-	xsdSrcPartition := "xsd"
-	logtagSrcPartition := "logtag"
-	aidlSrcPartition := "aidl"
-	kotlinPartition := "kotlin"
-	srcPartitions := bazel.PartitionLabelListAttribute(ctx, &srcs, bazel.LabelPartitions{
-		javaSrcPartition:   bazel.LabelPartition{Extensions: []string{".java"}, Keep_remainder: true},
-		logtagSrcPartition: bazel.LabelPartition{Extensions: []string{".logtags", ".logtag"}},
-		protoSrcPartition:  android.ProtoSrcLabelPartition,
-		aidlSrcPartition:   android.AidlSrcLabelPartition,
-		xsdSrcPartition:    bazel.LabelPartition{LabelMapper: android.XsdLabelMapper(javaXsdTargetName)},
-		kotlinPartition:    bazel.LabelPartition{Extensions: []string{".kt"}},
-	})
-
-	javaSrcs := srcPartitions[javaSrcPartition]
-	kotlinSrcs := srcPartitions[kotlinPartition]
-	javaSrcs.Append(kotlinSrcs)
-
-	staticDeps.Append(srcPartitions[xsdSrcPartition])
-
-	if !srcPartitions[logtagSrcPartition].IsEmpty() {
-		logtagsLibName := m.Name() + "_logtags"
-		ctx.CreateBazelTargetModule(
-			bazel.BazelTargetModuleProperties{
-				Rule_class:        "event_log_tags",
-				Bzl_load_location: "//build/bazel/rules/java:event_log_tags.bzl",
-			},
-			android.CommonAttributes{Name: logtagsLibName},
-			&eventLogTagsAttributes{
-				Srcs: srcPartitions[logtagSrcPartition],
-			},
-		)
-
-		logtagsSrcs := bazel.MakeLabelList([]bazel.Label{{Label: ":" + logtagsLibName}})
-		javaSrcs.Append(bazel.MakeLabelListAttribute(logtagsSrcs))
-	}
-
-	if !srcPartitions[aidlSrcPartition].IsEmpty() {
-		aidlLibs, aidlSrcs := srcPartitions[aidlSrcPartition].Partition(func(src bazel.Label) bool {
-			return android.IsConvertedToAidlLibrary(ctx, src.OriginalModuleName)
-		})
-
-		apexAvailableTags := android.ApexAvailableTagsWithoutTestApexes(ctx, ctx.Module())
-
-		if !aidlSrcs.IsEmpty() {
-			aidlLibName := m.Name() + "_aidl_library"
-			ctx.CreateBazelTargetModule(
-				bazel.BazelTargetModuleProperties{
-					Rule_class:        "aidl_library",
-					Bzl_load_location: "//build/bazel/rules/aidl:aidl_library.bzl",
-				},
-				android.CommonAttributes{Name: aidlLibName},
-				&aidlLibraryAttributes{
-					Srcs: aidlSrcs,
-					Tags: apexAvailableTags,
-				},
-			)
-			aidlLibs.Add(&bazel.LabelAttribute{Value: &bazel.Label{Label: ":" + aidlLibName}})
-		}
-
-		javaAidlLibName := m.Name() + "_java_aidl_library"
-		ctx.CreateBazelTargetModule(
-			bazel.BazelTargetModuleProperties{
-				Rule_class:        "java_aidl_library",
-				Bzl_load_location: "//build/bazel/rules/java:java_aidl_library.bzl",
-			},
-			android.CommonAttributes{Name: javaAidlLibName},
-			&javaAidlLibraryAttributes{
-				Deps: aidlLibs,
-				Tags: apexAvailableTags,
-			},
-		)
-
-		staticDeps.Append(bazel.MakeSingleLabelListAttribute(bazel.Label{Label: ":" + javaAidlLibName}))
-	}
-
-	var javacopts bazel.StringListAttribute //[]string
-	plugins := bazel.MakeLabelListAttribute(
-		android.BazelLabelForModuleDeps(ctx, m.properties.Plugins),
-	)
-	if m.properties.Javacflags != nil || m.properties.Openjdk9.Javacflags != nil {
-		javacopts = bazel.MakeStringListAttribute(
-			append(append([]string{}, m.properties.Javacflags...), m.properties.Openjdk9.Javacflags...))
-	}
-
-	epEnabled := m.properties.Errorprone.Enabled
-	epJavacflags := m.properties.Errorprone.Javacflags
-	var errorproneForceEnable bazel.BoolAttribute
-	if epEnabled == nil {
-		//TODO(b/227504307) add configuration that depends on RUN_ERROR_PRONE environment variable
-	} else if *epEnabled {
-		plugins.Append(bazel.MakeLabelListAttribute(android.BazelLabelForModuleDeps(ctx, m.properties.Errorprone.Extra_check_modules)))
-		javacopts.Append(bazel.MakeStringListAttribute(epJavacflags))
-		errorproneForceEnable.Value = epEnabled
-	} else {
-		javacopts.Append(bazel.MakeStringListAttribute([]string{"-XepDisableAllChecks"}))
-	}
-
-	resourcesAttrs := m.convertJavaResourcesAttributes(ctx)
-
-	commonAttrs := &javaCommonAttributes{
-		Srcs:                    javaSrcs,
-		javaResourcesAttributes: resourcesAttrs,
-		Plugins:                 plugins,
-		Javacopts:               javacopts,
-		Java_version:            bazel.StringAttribute{Value: m.properties.Java_version},
-		Sdk_version:             bazel.StringAttribute{Value: m.deviceProperties.Sdk_version},
-		Errorprone_force_enable: errorproneForceEnable,
-		Javac_shard_size:        m.properties.Javac_shard_size,
-	}
-
-	for axis, configToProps := range archVariantProps {
-		for config, _props := range configToProps {
-			if archProps, ok := _props.(*CommonProperties); ok {
-				var libLabels []bazel.Label
-				for _, d := range archProps.Libs {
-					neverlinkLabel := android.BazelLabelForModuleDepSingle(ctx, d)
-					neverlinkLabel.Label = neverlinkLabel.Label + "-neverlink"
-					libLabels = append(libLabels, neverlinkLabel)
-				}
-				deps.SetSelectValue(axis, config, bazel.MakeLabelList(libLabels))
-			}
-		}
-	}
-
-	depLabels := &javaDependencyLabels{}
-	deps.Append(resourcesAttrs.Additional_resources)
-	depLabels.Deps = deps
-
-	for axis, configToProps := range archVariantProps {
-		for config, _props := range configToProps {
-			if archProps, ok := _props.(*CommonProperties); ok {
-				archStaticLibs := android.BazelLabelForModuleDeps(
-					ctx,
-					android.LastUniqueStrings(android.CopyOf(archProps.Static_libs)))
-				depLabels.StaticDeps.SetSelectValue(axis, config, archStaticLibs)
-			}
-		}
-	}
-	depLabels.StaticDeps.Append(staticDeps)
-
-	var additionalProtoDeps bazel.LabelListAttribute
-	additionalProtoDeps.Append(depLabels.Deps)
-	additionalProtoDeps.Append(depLabels.StaticDeps)
-	protoDepLabel := bp2buildProto(ctx, &m.Module, srcPartitions[protoSrcPartition], additionalProtoDeps)
-	// Soong does not differentiate between a java_library and the Bazel equivalent of
-	// a java_proto_library + proto_library pair. Instead, in Soong proto sources are
-	// listed directly in the srcs of a java_library, and the classes produced
-	// by protoc are included directly in the resulting JAR. Thus upstream dependencies
-	// that depend on a java_library with proto sources can link directly to the protobuf API,
-	// and so this should be a static dependency.
-	if protoDepLabel != nil {
-		depLabels.StaticDeps.Append(bazel.MakeSingleLabelListAttribute(*protoDepLabel))
-	}
-
-	hasKotlin := !kotlinSrcs.IsEmpty()
-	commonAttrs.kotlinAttributes = &kotlinAttributes{
-		Kotlincflags: &m.properties.Kotlincflags,
-	}
-	if len(m.properties.Common_srcs) != 0 {
-		hasKotlin = true
-		commonAttrs.kotlinAttributes.Common_srcs = bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, m.properties.Common_srcs))
-	}
-
-	bp2BuildInfo := &bp2BuildJavaInfo{
-		DepLabels: depLabels,
-		hasKotlin: hasKotlin,
-	}
-
-	return commonAttrs, bp2BuildInfo, true
-}
-
-type javaLibraryAttributes struct {
-	*javaCommonAttributes
-	Deps      bazel.LabelListAttribute
-	Exports   bazel.LabelListAttribute
-	Neverlink bazel.BoolAttribute
-}
-
-type kotlinAttributes struct {
-	Common_srcs  bazel.LabelListAttribute
-	Kotlincflags *[]string
-}
-
-func ktJvmLibraryBazelTargetModuleProperties() bazel.BazelTargetModuleProperties {
-	return bazel.BazelTargetModuleProperties{
-		Rule_class:        "kt_jvm_library",
-		Bzl_load_location: "//build/bazel/rules/kotlin:kt_jvm_library.bzl",
-	}
-}
-
-func javaLibraryBazelTargetModuleProperties() bazel.BazelTargetModuleProperties {
-	return bazel.BazelTargetModuleProperties{
-		Rule_class:        "java_library",
-		Bzl_load_location: "//build/bazel/rules/java:library.bzl",
-	}
-}
-
-func javaLibraryBp2Build(ctx android.Bp2buildMutatorContext, m *Library) {
-	commonAttrs, bp2BuildInfo, supported := m.convertLibraryAttrsBp2Build(ctx)
-	if !supported {
-		return
-	}
-	depLabels := bp2BuildInfo.DepLabels
-
-	deps := depLabels.Deps
-	exports := depLabels.StaticDeps
-	if !commonAttrs.Srcs.IsEmpty() {
-		deps.Append(exports) // we should only append these if there are sources to use them
-	} else if !deps.IsEmpty() {
-		// java_library does not accept deps when there are no srcs because
-		// there is no compilation happening, but it accepts exports.
-		// The non-empty deps here are unnecessary as deps on the java_library
-		// since they aren't being propagated to any dependencies.
-		// So we can drop deps here.
-		deps = bazel.LabelListAttribute{}
-	}
-	var props bazel.BazelTargetModuleProperties
-	attrs := &javaLibraryAttributes{
-		javaCommonAttributes: commonAttrs,
-		Deps:                 deps,
-		Exports:              exports,
-	}
-	name := m.Name()
-
-	if !bp2BuildInfo.hasKotlin {
-		props = javaLibraryBazelTargetModuleProperties()
-	} else {
-		props = ktJvmLibraryBazelTargetModuleProperties()
-	}
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: name}, attrs)
-	neverlinkProp := true
-	neverLinkAttrs := &javaLibraryAttributes{
-		Exports:   bazel.MakeSingleLabelListAttribute(bazel.Label{Label: ":" + name}),
-		Neverlink: bazel.BoolAttribute{Value: &neverlinkProp},
-		javaCommonAttributes: &javaCommonAttributes{
-			Sdk_version:  bazel.StringAttribute{Value: m.deviceProperties.Sdk_version},
-			Java_version: bazel.StringAttribute{Value: m.properties.Java_version},
-		},
-	}
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: name + "-neverlink"}, neverLinkAttrs)
-
-}
-
-type javaBinaryHostAttributes struct {
-	*javaCommonAttributes
-	Deps         bazel.LabelListAttribute
-	Runtime_deps bazel.LabelListAttribute
-	Main_class   string
-	Jvm_flags    bazel.StringListAttribute
-}
-
-// JavaBinaryHostBp2Build is for java_binary_host bp2build.
-func javaBinaryHostBp2Build(ctx android.Bp2buildMutatorContext, m *Binary) {
-	commonAttrs, bp2BuildInfo, supported := m.convertLibraryAttrsBp2Build(ctx)
-	if !supported {
-		return
-	}
-	depLabels := bp2BuildInfo.DepLabels
-
-	deps := depLabels.Deps
-	deps.Append(depLabels.StaticDeps)
-	if m.binaryProperties.Jni_libs != nil {
-		deps.Append(bazel.MakeLabelListAttribute(android.BazelLabelForModuleDeps(ctx, m.binaryProperties.Jni_libs)))
-	}
-
-	var runtimeDeps bazel.LabelListAttribute
-	if commonAttrs.Srcs.IsEmpty() {
-		// if there are no sources, then the dependencies can only be used at runtime
-		runtimeDeps = deps
-		deps = bazel.LabelListAttribute{}
-	}
-
-	mainClass := ""
-	if m.binaryProperties.Main_class != nil {
-		mainClass = *m.binaryProperties.Main_class
-	}
-	if m.properties.Manifest != nil {
-		mainClassInManifest, err := android.GetMainClassInManifest(ctx.Config(), android.PathForModuleSrc(ctx, *m.properties.Manifest).String())
-		if err != nil {
-			return
-		}
-		mainClass = mainClassInManifest
-	}
-
-	// Attribute jvm_flags
-	var jvmFlags bazel.StringListAttribute
-	if m.binaryProperties.Jni_libs != nil {
-		jniLibPackages := []string{}
-		for _, jniLib := range m.binaryProperties.Jni_libs {
-			if jniLibModule, exists := ctx.ModuleFromName(jniLib); exists {
-				otherDir := ctx.OtherModuleDir(jniLibModule)
-				jniLibPackages = append(jniLibPackages, filepath.Join(otherDir, jniLib))
-			}
-		}
-		jniLibPaths := []string{}
-		for _, jniLibPackage := range jniLibPackages {
-			// See cs/f:.*/third_party/bazel/.*java_stub_template.txt for the use of RUNPATH
-			jniLibPaths = append(jniLibPaths, "$${RUNPATH}"+jniLibPackage)
-		}
-		jvmFlags = bazel.MakeStringListAttribute([]string{"-Djava.library.path=" + strings.Join(jniLibPaths, ":")})
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "java_binary",
-		Bzl_load_location: "@rules_java//java:defs.bzl",
-	}
-	binAttrs := &javaBinaryHostAttributes{
-		Runtime_deps: runtimeDeps,
-		Main_class:   mainClass,
-		Jvm_flags:    jvmFlags,
-	}
-
-	if commonAttrs.Srcs.IsEmpty() {
-		binAttrs.javaCommonAttributes = commonAttrs
-		ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: m.Name()}, binAttrs)
-		return
-	}
-
-	libInfo := libraryCreationInfo{
-		deps:      deps,
-		attrs:     commonAttrs,
-		baseName:  m.Name(),
-		hasKotlin: bp2BuildInfo.hasKotlin,
-	}
-	libName := createLibraryTarget(ctx, libInfo)
-	binAttrs.Runtime_deps.Add(&bazel.LabelAttribute{Value: &bazel.Label{Label: ":" + libName}})
-
-	// Create the BazelTargetModule.
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: m.Name()}, binAttrs)
-}
-
-type javaTestHostAttributes struct {
-	*javaCommonAttributes
-	Srcs         bazel.LabelListAttribute
-	Deps         bazel.LabelListAttribute
-	Runtime_deps bazel.LabelListAttribute
-}
-
-// javaTestHostBp2Build is for java_test_host bp2build.
-func javaTestHostBp2Build(ctx android.Bp2buildMutatorContext, m *TestHost) {
-	commonAttrs, bp2BuildInfo, supported := m.convertLibraryAttrsBp2Build(ctx)
-	if !supported {
-		return
-	}
-	depLabels := bp2BuildInfo.DepLabels
-
-	deps := depLabels.Deps
-	deps.Append(depLabels.StaticDeps)
-
-	var runtimeDeps bazel.LabelListAttribute
-	attrs := &javaTestHostAttributes{
-		Runtime_deps: runtimeDeps,
-	}
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "java_test",
-		Bzl_load_location: "//build/bazel/rules/java:test.bzl",
-	}
-
-	if commonAttrs.Srcs.IsEmpty() {
-		// if there are no sources, then the dependencies can only be used at runtime
-		attrs.Runtime_deps = deps
-		attrs.javaCommonAttributes = commonAttrs
-		ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: m.Name()}, attrs)
-		return
-	}
-
-	libInfo := libraryCreationInfo{
-		deps:      deps,
-		attrs:     commonAttrs,
-		baseName:  m.Name(),
-		hasKotlin: bp2BuildInfo.hasKotlin,
-	}
-	libName := createLibraryTarget(ctx, libInfo)
-
-	attrs.Srcs = commonAttrs.Srcs
-	attrs.Deps = deps
-	attrs.Runtime_deps.Add(&bazel.LabelAttribute{Value: &bazel.Label{Label: ":" + libName}})
-	// Create the BazelTargetModule.
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: m.Name()}, attrs)
-}
-
-// libraryCreationInfo encapsulates the info needed to create java_library target from
-// java_binary_host or java_test_host.
-type libraryCreationInfo struct {
-	deps      bazel.LabelListAttribute
-	attrs     *javaCommonAttributes
-	baseName  string
-	hasKotlin bool
-}
-
-// helper function that creates java_library target from java_binary_host or java_test_host,
-// and returns the library target name,
-func createLibraryTarget(ctx android.Bp2buildMutatorContext, libInfo libraryCreationInfo) string {
-	libName := libInfo.baseName + "_lib"
-	var libProps bazel.BazelTargetModuleProperties
-	if libInfo.hasKotlin {
-		libProps = ktJvmLibraryBazelTargetModuleProperties()
-	} else {
-		libProps = javaLibraryBazelTargetModuleProperties()
-	}
-	libAttrs := &javaLibraryAttributes{
-		Deps:                 libInfo.deps,
-		javaCommonAttributes: libInfo.attrs,
-	}
-
-	ctx.CreateBazelTargetModule(libProps, android.CommonAttributes{Name: libName}, libAttrs)
-	return libName
-}
-
-type bazelJavaImportAttributes struct {
-	Jars    bazel.LabelListAttribute
-	Exports bazel.LabelListAttribute
-}
-
-// java_import bp2Build converter.
-func (i *Import) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	var jars bazel.LabelListAttribute
-	archVariantProps := i.GetArchVariantProperties(ctx, &ImportProperties{})
-	for axis, configToProps := range archVariantProps {
-		for config, _props := range configToProps {
-			if archProps, ok := _props.(*ImportProperties); ok {
-				archJars := android.BazelLabelForModuleSrcExcludes(ctx, archProps.Jars, []string(nil))
-				jars.SetSelectValue(axis, config, archJars)
-			}
-		}
-	}
-
-	attrs := &bazelJavaImportAttributes{
-		Jars: jars,
-	}
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "java_import",
-		Bzl_load_location: "//build/bazel/rules/java:import.bzl",
-	}
-
-	name := android.RemoveOptionalPrebuiltPrefix(i.Name())
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: name}, attrs)
-
-	neverlink := true
-	neverlinkAttrs := &javaLibraryAttributes{
-		Neverlink: bazel.BoolAttribute{Value: &neverlink},
-		Exports:   bazel.MakeSingleLabelListAttribute(bazel.Label{Label: ":" + name}),
-		javaCommonAttributes: &javaCommonAttributes{
-			Sdk_version: bazel.StringAttribute{Value: proptools.StringPtr("none")},
-		},
-	}
-	ctx.CreateBazelTargetModule(
-		javaLibraryBazelTargetModuleProperties(),
-		android.CommonAttributes{Name: name + "-neverlink"},
-		neverlinkAttrs)
-}
-
-var _ android.MixedBuildBuildable = (*Import)(nil)
-
-func (i *Import) getBazelModuleLabel(ctx android.BaseModuleContext) string {
-	return android.RemoveOptionalPrebuiltPrefixFromBazelLabel(i.GetBazelLabel(ctx, i))
-}
-
-func (i *Import) ProcessBazelQueryResponse(ctx android.ModuleContext) {
-	i.commonBuildActions(ctx)
-
-	bazelCtx := ctx.Config().BazelContext
-	filePaths, err := bazelCtx.GetOutputFiles(i.getBazelModuleLabel(ctx), android.GetConfigKey(ctx))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-
-	bazelJars := android.Paths{}
-	for _, bazelOutputFile := range filePaths {
-		bazelJars = append(bazelJars, android.PathForBazelOut(ctx, bazelOutputFile))
-	}
-
-	jarName := android.RemoveOptionalPrebuiltPrefix(i.Name()) + ".jar"
-	outputFile := android.PathForModuleOut(ctx, "bazelCombined", jarName)
-	TransformJarsToJar(ctx, outputFile, "combine prebuilt jars", bazelJars,
-		android.OptionalPath{}, // manifest
-		false,                  // stripDirEntries
-		[]string{},             // filesToStrip
-		[]string{},             // dirsToStrip
-	)
-	i.combinedClasspathFile = outputFile
-
-	ctx.SetProvider(JavaInfoProvider, JavaInfo{
-		HeaderJars:                     android.PathsIfNonNil(i.combinedClasspathFile),
-		ImplementationAndResourcesJars: android.PathsIfNonNil(i.combinedClasspathFile),
-		ImplementationJars:             android.PathsIfNonNil(i.combinedClasspathFile),
-		// TODO(b/240308299) include AIDL information from Bazel
-		// TODO: aconfig files?
-	})
-
-	i.maybeInstall(ctx, jarName, outputFile)
-}
-
-func (i *Import) QueueBazelCall(ctx android.BaseModuleContext) {
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(i.getBazelModuleLabel(ctx), cquery.GetOutputFiles, android.GetConfigKey(ctx))
-}
-
-func (i *Import) IsMixedBuildSupported(ctx android.BaseModuleContext) bool {
-	return true
-}
-
 type JavaApiContributionImport struct {
 	JavaApiContribution
 
diff --git a/java/java_test.go b/java/java_test.go
index 81119a7..8e83fc4 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -26,6 +26,7 @@
 
 	"github.com/google/blueprint/proptools"
 
+	"android/soong/aconfig"
 	"android/soong/android"
 	"android/soong/cc"
 	"android/soong/dexpreopt"
@@ -47,6 +48,8 @@
 	cc.PrepareForTestWithCcBuildComponents,
 	// Include all the default java modules.
 	PrepareForTestWithDexpreopt,
+	// Include aconfig modules.
+	aconfig.PrepareForTestWithAconfigBuildComponents,
 )
 
 func TestMain(m *testing.M) {
@@ -1202,7 +1205,7 @@
 		expected := "java.base=.:out/soong"
 		checkPatchModuleFlag(t, ctx, "bar", expected)
 		expected = "java.base=" + strings.Join([]string{
-			".", "out/soong", "dir", "dir2", "nested", defaultModuleToPath("ext"), defaultModuleToPath("framework")}, ":")
+			".", "out/soong", defaultModuleToPath("ext"), defaultModuleToPath("framework")}, ":")
 		checkPatchModuleFlag(t, ctx, "baz", expected)
 	})
 }
@@ -1287,43 +1290,6 @@
 	}
 }
 
-func TestAidlIncludeDirFromConvertedFileGroupWithPathPropInMixedBuilds(t *testing.T) {
-	// TODO(b/247782695), TODO(b/242847534) Fix mixed builds for filegroups
-	t.Skip("Re-enable once filegroups are corrected for mixed builds")
-	bp := `
-	filegroup {
-		name: "foo_aidl",
-		srcs: ["aidl/foo/IFoo.aidl"],
-		path: "aidl/foo",
-		bazel_module: { label: "//:foo_aidl" },
-	}
-	java_library {
-		name: "foo",
-		srcs: [":foo_aidl"],
-	}
-`
-
-	outBaseDir := "out/bazel/output"
-	result := android.GroupFixturePreparers(
-		prepareForJavaTest,
-		android.PrepareForTestWithFilegroup,
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: outBaseDir,
-				LabelToOutputFiles: map[string][]string{
-					"//:foo_aidl": []string{"aidl/foo/IFoo.aidl"},
-				},
-			}
-		}),
-	).RunTestWithBp(t, bp)
-
-	aidlCommand := result.ModuleForTests("foo", "android_common").Rule("aidl").RuleParams.Command
-	expectedAidlFlag := "-I" + outBaseDir + "/execroot/__main__/aidl/foo"
-	if !strings.Contains(aidlCommand, expectedAidlFlag) {
-		t.Errorf("aidl command %q does not contain %q", aidlCommand, expectedAidlFlag)
-	}
-}
-
 func TestAidlFlagsArePassedToTheAidlCompiler(t *testing.T) {
 	ctx, _ := testJava(t, `
 		java_library {
@@ -1740,85 +1706,6 @@
 	}
 }
 
-func TestImportMixedBuild(t *testing.T) {
-	bp := `
-		java_import {
-			name: "baz",
-			jars: [
-				"test1.jar",
-				"test2.jar",
-			],
-			bazel_module: { label: "//foo/bar:baz" },
-		}
-	`
-
-	ctx := android.GroupFixturePreparers(
-		prepareForJavaTest,
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: "outputbase",
-				LabelToOutputFiles: map[string][]string{
-					"//foo/bar:baz": []string{"test1.jar", "test2.jar"},
-				},
-			}
-		}),
-	).RunTestWithBp(t, bp)
-
-	bazMod := ctx.ModuleForTests("baz", "android_common").Module()
-	producer := bazMod.(android.OutputFileProducer)
-	expectedOutputFiles := []string{".intermediates/baz/android_common/bazelCombined/baz.jar"}
-
-	outputFiles, err := producer.OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting java_import outputfiles %s", err)
-	}
-	actualOutputFiles := android.NormalizePathsForTesting(outputFiles)
-	android.AssertDeepEquals(t, "Output files are produced", expectedOutputFiles, actualOutputFiles)
-
-	javaInfoProvider := ctx.ModuleProvider(bazMod, JavaInfoProvider)
-	javaInfo, ok := javaInfoProvider.(JavaInfo)
-	if !ok {
-		t.Error("could not get JavaInfo from java_import module")
-	}
-	android.AssertDeepEquals(t, "Header JARs are produced", expectedOutputFiles, android.NormalizePathsForTesting(javaInfo.HeaderJars))
-	android.AssertDeepEquals(t, "Implementation/Resources JARs are produced", expectedOutputFiles, android.NormalizePathsForTesting(javaInfo.ImplementationAndResourcesJars))
-	android.AssertDeepEquals(t, "Implementation JARs are produced", expectedOutputFiles, android.NormalizePathsForTesting(javaInfo.ImplementationJars))
-}
-
-func TestGenAidlIncludeFlagsForMixedBuilds(t *testing.T) {
-	bazelOutputBaseDir := filepath.Join("out", "bazel")
-	result := android.GroupFixturePreparers(
-		PrepareForIntegrationTestWithJava,
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: bazelOutputBaseDir,
-			}
-		}),
-	).RunTest(t)
-
-	ctx := &android.TestPathContext{TestResult: result}
-
-	srcDirectory := filepath.Join("frameworks", "base")
-	srcDirectoryAlreadyIncluded := filepath.Join("frameworks", "base", "core", "java")
-	bazelSrcDirectory := android.PathForBazelOut(ctx, srcDirectory)
-	bazelSrcDirectoryAlreadyIncluded := android.PathForBazelOut(ctx, srcDirectoryAlreadyIncluded)
-	srcs := android.Paths{
-		android.PathForTestingWithRel(bazelSrcDirectory.String(), "bazelAidl.aidl"),
-		android.PathForTestingWithRel(bazelSrcDirectory.String(), "bazelAidl2.aidl"),
-		android.PathForTestingWithRel(bazelSrcDirectoryAlreadyIncluded.String(), "bazelAidlExclude.aidl"),
-		android.PathForTestingWithRel(bazelSrcDirectoryAlreadyIncluded.String(), "bazelAidl2Exclude.aidl"),
-	}
-	dirsAlreadyIncluded := android.Paths{
-		android.PathForTesting(srcDirectoryAlreadyIncluded),
-	}
-
-	expectedFlags := " -Iout/bazel/execroot/__main__/frameworks/base"
-	flags := genAidlIncludeFlags(ctx, srcs, dirsAlreadyIncluded)
-	if flags != expectedFlags {
-		t.Errorf("expected flags to be %q; was %q", expectedFlags, flags)
-	}
-}
-
 func TestDeviceBinaryWrapperGeneration(t *testing.T) {
 	// Scenario 1: java_binary has main_class property in its bp
 	ctx, _ := testJava(t, `
@@ -1921,7 +1808,7 @@
 	for _, c := range testcases {
 		m := ctx.ModuleForTests(c.moduleName, "android_common")
 		manifest := m.Output("metalava.sbox.textproto")
-		sboxProto := android.RuleBuilderSboxProtoForTests(t, manifest)
+		sboxProto := android.RuleBuilderSboxProtoForTests(t, ctx.TestContext, manifest)
 		manifestCommand := sboxProto.Commands[0].GetCommand()
 		sourceFilesFlag := "--source-files " + strings.Join(c.sourceTextFileDirs, " ")
 		android.AssertStringDoesContain(t, "source text files not present", manifestCommand, sourceFilesFlag)
@@ -2026,7 +1913,7 @@
 	for _, c := range testcases {
 		m := ctx.ModuleForTests(c.moduleName, "android_common")
 		manifest := m.Output("metalava.sbox.textproto")
-		sboxProto := android.RuleBuilderSboxProtoForTests(t, manifest)
+		sboxProto := android.RuleBuilderSboxProtoForTests(t, ctx.TestContext, manifest)
 		manifestCommand := sboxProto.Commands[0].GetCommand()
 		sourceFilesFlag := "--source-files " + strings.Join(c.sourceTextFileDirs, " ")
 		android.AssertStringDoesContain(t, "source text files not present", manifestCommand, sourceFilesFlag)
@@ -2316,7 +2203,7 @@
 
 	m := ctx.ModuleForTests("bar1", "android_common")
 	manifest := m.Output("metalava.sbox.textproto")
-	sboxProto := android.RuleBuilderSboxProtoForTests(t, manifest)
+	sboxProto := android.RuleBuilderSboxProtoForTests(t, ctx.TestContext, manifest)
 	manifestCommand := sboxProto.Commands[0].GetCommand()
 	android.AssertStringDoesContain(t, "Command expected to contain full_api_surface_stub output jar", manifestCommand, "lib1.jar")
 }
@@ -2480,7 +2367,7 @@
 	`)
 	m := ctx.ModuleForTests("foo", "android_common")
 	manifest := m.Output("metalava.sbox.textproto")
-	sboxProto := android.RuleBuilderSboxProtoForTests(t, manifest)
+	sboxProto := android.RuleBuilderSboxProtoForTests(t, ctx.TestContext, manifest)
 	manifestCommand := sboxProto.Commands[0].GetCommand()
 	sourceFilesFlag := "--source-files current.txt"
 	android.AssertStringDoesContain(t, "source text files not present", manifestCommand, sourceFilesFlag)
@@ -2501,7 +2388,7 @@
 	`)
 	m := ctx.ModuleForTests("foo", "android_common")
 	manifest := m.Output("metalava.sbox.textproto")
-	sboxProto := android.RuleBuilderSboxProtoForTests(t, manifest)
+	sboxProto := android.RuleBuilderSboxProtoForTests(t, ctx, manifest)
 	manifestCommand := sboxProto.Commands[0].GetCommand()
 
 	// Api files are sorted from the narrowest api scope to the widest api scope.
@@ -2543,7 +2430,7 @@
 	`)
 	m := result.ModuleForTests(apiScopePublic.apiLibraryModuleName("foo"), "android_common")
 	manifest := m.Output("metalava.sbox.textproto")
-	sboxProto := android.RuleBuilderSboxProtoForTests(t, manifest)
+	sboxProto := android.RuleBuilderSboxProtoForTests(t, result.TestContext, manifest)
 	manifestCommand := sboxProto.Commands[0].GetCommand()
 	classPathFlag := "--classpath __SBOX_SANDBOX_DIR__/out/.intermediates/bar/android_common/turbine-combined/bar.jar"
 	android.AssertStringDoesContain(t, "command expected to contain classpath flag", manifestCommand, classPathFlag)
diff --git a/java/lint.go b/java/lint.go
index 34720e5..eb46ea8 100644
--- a/java/lint.go
+++ b/java/lint.go
@@ -93,6 +93,7 @@
 	outputs                 lintOutputs
 	properties              LintProperties
 	extraMainlineLintErrors []string
+	compile_data            android.Paths
 
 	reports android.Paths
 
@@ -448,7 +449,7 @@
 
 	srcsList := android.PathForModuleOut(ctx, "lint", "lint-srcs.list")
 	srcsListRsp := android.PathForModuleOut(ctx, "lint-srcs.list.rsp")
-	rule.Command().Text("cp").FlagWithRspFileInputList("", srcsListRsp, l.srcs).Output(srcsList)
+	rule.Command().Text("cp").FlagWithRspFileInputList("", srcsListRsp, l.srcs).Output(srcsList).Implicits(l.compile_data)
 
 	lintPaths := l.writeLintProjectXML(ctx, rule, srcsList)
 
@@ -491,6 +492,7 @@
 
 	cmd.BuiltTool("lint").ImplicitTool(ctx.Config().HostJavaToolPath(ctx, "lint.jar")).
 		Flag("--quiet").
+		Flag("--include-aosp-issues").
 		FlagWithInput("--project ", lintPaths.projectXML).
 		FlagWithInput("--config ", lintPaths.configXML).
 		FlagWithOutput("--html ", html).
diff --git a/java/lint_defaults.txt b/java/lint_defaults.txt
index 8494d02..b8ce95c 100644
--- a/java/lint_defaults.txt
+++ b/java/lint_defaults.txt
@@ -122,10 +122,10 @@
 --warning_check RemoteViewLayout
 --warning_check SupportAnnotationUsage
 --warning_check UniqueConstants
-
-# TODO(b/294098365): these checks fail in AOSP, but pass downstream
---warning_check ForegroundServiceType
---warning_check MutableImplicitPendingIntent
+--warning_check UseSdkSuppress
+# TODO(b/303434307) The intent is for this to be set to error severity
+# once existing violations are cleaned up
+--warning_check FlaggedApi
 
 --warning_check ExactAlarm
 --warning_check ExpiredTargetSdkVersion
diff --git a/java/lint_test.go b/java/lint_test.go
index ec901aa..5e6b8bc 100644
--- a/java/lint_test.go
+++ b/java/lint_test.go
@@ -39,7 +39,7 @@
 
 	foo := ctx.ModuleForTests("foo", "android_common")
 
-	sboxProto := android.RuleBuilderSboxProtoForTests(t, foo.Output("lint.sbox.textproto"))
+	sboxProto := android.RuleBuilderSboxProtoForTests(t, ctx, foo.Output("lint.sbox.textproto"))
 	if !strings.Contains(*sboxProto.Commands[0].Command, "--baseline lint-baseline.xml") {
 		t.Error("did not pass --baseline flag")
 	}
@@ -61,7 +61,7 @@
 
 	foo := ctx.ModuleForTests("foo", "android_common")
 
-	sboxProto := android.RuleBuilderSboxProtoForTests(t, foo.Output("lint.sbox.textproto"))
+	sboxProto := android.RuleBuilderSboxProtoForTests(t, ctx, foo.Output("lint.sbox.textproto"))
 	if strings.Contains(*sboxProto.Commands[0].Command, "--baseline") {
 		t.Error("passed --baseline flag for non existent file")
 	}
@@ -108,7 +108,7 @@
 
 	foo := ctx.ModuleForTests("foo", "android_common")
 
-	sboxProto := android.RuleBuilderSboxProtoForTests(t, foo.Output("lint.sbox.textproto"))
+	sboxProto := android.RuleBuilderSboxProtoForTests(t, ctx, foo.Output("lint.sbox.textproto"))
 	if !strings.Contains(*sboxProto.Commands[0].Command, "--baseline mybaseline.xml") {
 		t.Error("did not use the correct file for baseline")
 	}
@@ -276,7 +276,7 @@
 			RunTestWithBp(t, thisBp)
 
 		foo := result.ModuleForTests("foo", "android_common")
-		sboxProto := android.RuleBuilderSboxProtoForTests(t, foo.Output("lint.sbox.textproto"))
+		sboxProto := android.RuleBuilderSboxProtoForTests(t, result.TestContext, foo.Output("lint.sbox.textproto"))
 		if !strings.Contains(*sboxProto.Commands[0].Command, "/"+testCase.expected_file) {
 			t.Error("did not use full api database for case", testCase)
 		}
diff --git a/java/platform_compat_config.go b/java/platform_compat_config.go
index 662a2d7..2197304 100644
--- a/java/platform_compat_config.go
+++ b/java/platform_compat_config.go
@@ -19,10 +19,7 @@
 	"path/filepath"
 
 	"android/soong/android"
-	"android/soong/bazel"
-
 	"github.com/google/blueprint"
-	"github.com/google/blueprint/proptools"
 )
 
 func init() {
@@ -57,7 +54,6 @@
 
 type platformCompatConfig struct {
 	android.ModuleBase
-	android.BazelModuleBase
 
 	properties     platformCompatConfigProperties
 	installDirPath android.InstallPath
@@ -126,29 +122,10 @@
 	}}
 }
 
-type bazelPlatformCompatConfigAttributes struct {
-	Src bazel.LabelAttribute
-}
-
-func (p *platformCompatConfig) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "platform_compat_config",
-		Bzl_load_location: "//build/bazel/rules/java:platform_compat_config.bzl",
-	}
-	attr := &bazelPlatformCompatConfigAttributes{
-		Src: *bazel.MakeLabelAttribute(
-			android.BazelLabelForModuleSrcSingle(ctx, proptools.String(p.properties.Src)).Label),
-	}
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{
-		Name: p.Name(),
-	}, attr)
-}
-
 func PlatformCompatConfigFactory() android.Module {
 	module := &platformCompatConfig{}
 	module.AddProperties(&module.properties)
 	android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibCommon)
-	android.InitBazelModule(module)
 	return module
 }
 
diff --git a/java/plugin.go b/java/plugin.go
index 4d4c199..9c4774a 100644
--- a/java/plugin.go
+++ b/java/plugin.go
@@ -16,7 +16,6 @@
 
 import (
 	"android/soong/android"
-	"android/soong/bazel"
 )
 
 func init() {
@@ -35,8 +34,6 @@
 
 	InitJavaModule(module, android.HostSupported)
 
-	android.InitBazelModule(module)
-
 	return module
 }
 
@@ -56,38 +53,3 @@
 	// parallelism and cause more recompilation for modules that depend on modules that use this plugin.
 	Generates_api *bool
 }
-
-type pluginAttributes struct {
-	*javaCommonAttributes
-	Deps            bazel.LabelListAttribute
-	Processor_class *string
-}
-
-// ConvertWithBp2build is used to convert android_app to Bazel.
-func (p *Plugin) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	pluginName := p.Name()
-	commonAttrs, bp2BuildInfo, supported := p.convertLibraryAttrsBp2Build(ctx)
-	if !supported {
-		return
-	}
-	depLabels := bp2BuildInfo.DepLabels
-
-	deps := depLabels.Deps
-	deps.Append(depLabels.StaticDeps)
-
-	var processorClass *string
-	if p.pluginProperties.Processor_class != nil {
-		processorClass = p.pluginProperties.Processor_class
-	}
-
-	attrs := &pluginAttributes{
-		javaCommonAttributes: commonAttrs,
-		Deps:                 deps,
-		Processor_class:      processorClass,
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class: "java_plugin",
-	}
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: pluginName}, attrs)
-}
diff --git a/java/prebuilt_apis.go b/java/prebuilt_apis.go
index 99cb99b..94e9c6c 100644
--- a/java/prebuilt_apis.go
+++ b/java/prebuilt_apis.go
@@ -127,41 +127,13 @@
 func prebuiltApiModuleName(mctx android.LoadHookContext, module, scope, version string) string {
 	return fmt.Sprintf("%s_%s_%s_%s", mctx.ModuleName(), scope, version, module)
 }
-
-func hasBazelPrebuilt(module string) bool {
-	return module == "android" || module == "core-for-system-modules"
-}
-
-func bazelPrebuiltApiModuleName(module, scope, version string) string {
-	bazelModule := module
-	switch module {
-	case "android":
-		bazelModule = "android_jar"
-	case "core-for-system-modules":
-		bazelModule = "core_jar"
-	}
-	bazelVersion := version
-	if version == "current" {
-		bazelVersion = strconv.Itoa(android.FutureApiLevelInt)
-	}
-	bazelScope := scope
-	switch scope {
-	case "module-lib":
-		bazelScope = "module"
-	case "system-server":
-		bazelScope = "system_server"
-	}
-	return fmt.Sprintf("//prebuilts/sdk:%s_%s_%s", bazelScope, bazelVersion, bazelModule)
-}
-
 func createImport(mctx android.LoadHookContext, module, scope, version, path, sdkVersion string, compileDex bool) {
 	props := struct {
-		Name         *string
-		Jars         []string
-		Sdk_version  *string
-		Installable  *bool
-		Compile_dex  *bool
-		Bazel_module android.BazelModuleProperties
+		Name        *string
+		Jars        []string
+		Sdk_version *string
+		Installable *bool
+		Compile_dex *bool
 	}{
 		Name:        proptools.StringPtr(prebuiltApiModuleName(mctx, module, scope, version)),
 		Jars:        []string{path},
@@ -169,10 +141,6 @@
 		Installable: proptools.BoolPtr(false),
 		Compile_dex: proptools.BoolPtr(compileDex),
 	}
-	if hasBazelPrebuilt(module) {
-		props.Bazel_module = android.BazelModuleProperties{
-			Label: proptools.StringPtr(bazelPrebuiltApiModuleName(module, scope, version))}
-	}
 	mctx.CreateModule(ImportFactory, &props)
 }
 
diff --git a/java/proto.go b/java/proto.go
index c88d3d7..e27ef2c 100644
--- a/java/proto.go
+++ b/java/proto.go
@@ -19,9 +19,6 @@
 	"strconv"
 
 	"android/soong/android"
-	"android/soong/bazel"
-
-	"github.com/google/blueprint/proptools"
 )
 
 const (
@@ -141,79 +138,3 @@
 
 	return flags
 }
-
-type protoAttributes struct {
-	Deps bazel.LabelListAttribute
-
-	// A list of proto_library targets that the proto_library in `deps` depends on
-	// This list is overestimation.
-	// Overestimation is necessary since Soong includes other protos via proto.include_dirs and not
-	// a specific .proto file module explicitly.
-	Transitive_deps bazel.LabelListAttribute
-
-	// This is the libs and the static_libs of the original java_library module.
-	// On the bazel side, after proto sources are generated in java_*_proto_library, a java_library
-	// will compile them. The libs and static_libs from the original java_library module need
-	// to be linked because they are necessary in compile-time classpath.
-	Additional_proto_deps bazel.LabelListAttribute
-
-	Sdk_version  bazel.StringAttribute
-	Java_version bazel.StringAttribute
-
-	Plugin bazel.LabelAttribute
-}
-
-func bp2buildProto(ctx android.Bp2buildMutatorContext, m *Module, protoSrcs bazel.LabelListAttribute, AdditionalProtoDeps bazel.LabelListAttribute) *bazel.Label {
-	protoInfo, ok := android.Bp2buildProtoProperties(ctx, &m.ModuleBase, protoSrcs)
-	if !ok {
-		return nil
-	}
-
-	typ := proptools.StringDefault(protoInfo.Type, protoTypeDefault)
-	var rule_class string
-	suffix := "_java_proto"
-	switch typ {
-	case "nano":
-		suffix += "_nano"
-		rule_class = "java_nano_proto_library"
-	case "micro":
-		suffix += "_micro"
-		rule_class = "java_micro_proto_library"
-	case "lite":
-		suffix += "_lite"
-		rule_class = "java_lite_proto_library"
-	case "stream":
-		suffix += "_stream"
-		rule_class = "java_stream_proto_library"
-	case "full":
-		rule_class = "java_proto_library"
-	default:
-		ctx.PropertyErrorf("proto.type", "cannot handle conversion at this time: %q", typ)
-	}
-
-	plugin := bazel.LabelAttribute{}
-	if m.protoProperties.Proto.Plugin != nil {
-		plugin.SetValue(android.BazelLabelForModuleDepSingle(ctx, "protoc-gen-"+*m.protoProperties.Proto.Plugin))
-	}
-
-	protoAttrs := &protoAttributes{
-		Deps:                  bazel.MakeLabelListAttribute(protoInfo.Proto_libs),
-		Transitive_deps:       bazel.MakeLabelListAttribute(protoInfo.Transitive_proto_libs),
-		Additional_proto_deps: AdditionalProtoDeps,
-		Java_version:          bazel.StringAttribute{Value: m.properties.Java_version},
-		Sdk_version:           bazel.StringAttribute{Value: m.deviceProperties.Sdk_version},
-		Plugin:                plugin,
-	}
-
-	name := m.Name() + suffix
-
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        rule_class,
-			Bzl_load_location: "//build/bazel/rules/java:proto.bzl",
-		},
-		android.CommonAttributes{Name: name},
-		protoAttrs)
-
-	return &bazel.Label{Label: ":" + name}
-}
diff --git a/java/robolectric.go b/java/robolectric.go
index a66b310..45621fd 100644
--- a/java/robolectric.go
+++ b/java/robolectric.go
@@ -67,7 +67,7 @@
 	// instead of the one built from source in external/robolectric-shadows.
 	Robolectric_prebuilt_version *string
 
-	// Use /external/robolectric rather than /external/robolectric-shadows as the version of robolectri
+	// Use /external/robolectric rather than /external/robolectric-shadows as the version of robolectric
 	// to use.  /external/robolectric closely tracks github's master, and will fully replace /external/robolectric-shadows
 	Upstream *bool
 }
diff --git a/java/sdk_library.go b/java/sdk_library.go
index fbfe509..176bda0 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -24,13 +24,10 @@
 	"strings"
 	"sync"
 
-	"android/soong/ui/metrics/bp2build_metrics_proto"
-
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/proptools"
 
 	"android/soong/android"
-	"android/soong/bazel"
 	"android/soong/dexpreopt"
 )
 
@@ -1238,8 +1235,6 @@
 type SdkLibrary struct {
 	Library
 
-	android.BazelModuleBase
-
 	sdkLibraryProperties sdkLibraryProperties
 
 	// Map from api scope to the scope specific property structure.
@@ -2318,47 +2313,9 @@
 			module.CreateInternalModules(ctx)
 		}
 	})
-	android.InitBazelModule(module)
 	return module
 }
 
-type bazelSdkLibraryAttributes struct {
-	Public        *bazel.Label
-	System        *bazel.Label
-	Test          *bazel.Label
-	Module_lib    *bazel.Label
-	System_server *bazel.Label
-}
-
-// java_sdk_library bp2build converter
-func (module *SdkLibrary) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	if ctx.ModuleType() != "java_sdk_library" {
-		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_TYPE_UNSUPPORTED, "")
-		return
-	}
-
-	nameToAttr := make(map[string]*bazel.Label)
-
-	for _, scope := range module.getGeneratedApiScopes(ctx) {
-		apiSurfaceFile := android.BazelLabelForModuleSrcSingle(ctx, path.Join(module.getApiDir(), scope.apiFilePrefix+"current.txt"))
-		nameToAttr[scope.name] = &apiSurfaceFile
-	}
-
-	attrs := bazelSdkLibraryAttributes{
-		Public:        nameToAttr["public"],
-		System:        nameToAttr["system"],
-		Test:          nameToAttr["test"],
-		Module_lib:    nameToAttr["module-lib"],
-		System_server: nameToAttr["system-server"],
-	}
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "java_sdk_library",
-		Bzl_load_location: "//build/bazel/rules/java:sdk_library.bzl",
-	}
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: module.Name()}, &attrs)
-}
-
 //
 // SDK library prebuilts
 //
@@ -2400,7 +2357,6 @@
 type SdkLibraryImport struct {
 	android.ModuleBase
 	android.DefaultableModuleBase
-	android.BazelModuleBase
 	prebuilt android.Prebuilt
 	android.ApexModuleBase
 
@@ -2484,7 +2440,6 @@
 
 	android.InitPrebuiltModule(module, &[]string{""})
 	android.InitApexModule(module)
-	android.InitBazelModule(module)
 	InitJavaModule(module, android.HostAndDeviceSupported)
 
 	module.SetDefaultableHook(func(mctx android.DefaultableHookContext) {
@@ -2495,33 +2450,6 @@
 	return module
 }
 
-// java_sdk_library bp2build converter
-func (i *SdkLibraryImport) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	nameToAttr := make(map[string]*bazel.Label)
-
-	for scope, props := range i.scopeProperties {
-		if api := proptools.String(props.Current_api); api != "" {
-			apiSurfaceFile := android.BazelLabelForModuleSrcSingle(ctx, api)
-			nameToAttr[scope.name] = &apiSurfaceFile
-		}
-	}
-
-	attrs := bazelSdkLibraryAttributes{
-		Public:        nameToAttr["public"],
-		System:        nameToAttr["system"],
-		Test:          nameToAttr["test"],
-		Module_lib:    nameToAttr["module-lib"],
-		System_server: nameToAttr["system-server"],
-	}
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "java_sdk_library",
-		Bzl_load_location: "//build/bazel/rules/java:sdk_library.bzl",
-	}
-
-	name := android.RemoveOptionalPrebuiltPrefix(i.Name())
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: name}, &attrs)
-}
-
 var _ PermittedPackagesForUpdatableBootJars = (*SdkLibraryImport)(nil)
 
 func (module *SdkLibraryImport) PermittedPackagesForUpdatableBootJars() []string {
diff --git a/java/test_spec_test.go b/java/test_spec_test.go
index 39aff4c..7f06785 100644
--- a/java/test_spec_test.go
+++ b/java/test_spec_test.go
@@ -27,7 +27,7 @@
 	java_test {
 		name: "java-test-module-name-two",
 	}`
-	result := runTest(t, android.FixtureExpectsNoErrors, bp)
+	result := runTestSpecTest(t, android.FixtureExpectsNoErrors, bp)
 
 	module := result.ModuleForTests(
 		"module-name", "",
@@ -78,7 +78,7 @@
 
 	if metadata != expectedMetadata {
 		t.Errorf(
-			"Retrieved metadata: %s is not equal to expectedMetadata: %s", metadata,
+			"Retrieved metadata: %s doesn't contain expectedMetadata: %s", metadata,
 			expectedMetadata,
 		)
 	}
@@ -121,11 +121,11 @@
 	}
 }
 
-func runTest(
-	t *testing.T, errorHandler android.FixtureErrorHandler, bp string,
+func runTestSpecTest(
+		t *testing.T, errorHandler android.FixtureErrorHandler, bp string,
 ) *android.TestResult {
 	return android.GroupFixturePreparers(
-		soongTesting.PrepareForTestWithTestSpecBuildComponents,
+		soongTesting.PrepareForTestWithTestingBuildComponents,
 		PrepareForIntegrationTestWithJava,
 	).
 		ExtendWithErrorHandler(errorHandler).
diff --git a/linkerconfig/linkerconfig.go b/linkerconfig/linkerconfig.go
index dad5892..8b52d86 100644
--- a/linkerconfig/linkerconfig.go
+++ b/linkerconfig/linkerconfig.go
@@ -19,11 +19,9 @@
 	"sort"
 	"strings"
 
-	"android/soong/ui/metrics/bp2build_metrics_proto"
 	"github.com/google/blueprint/proptools"
 
 	"android/soong/android"
-	"android/soong/bazel"
 	"android/soong/cc"
 	"android/soong/etc"
 )
@@ -54,7 +52,6 @@
 
 type linkerConfig struct {
 	android.ModuleBase
-	android.BazelModuleBase
 	properties linkerConfigProperties
 
 	outputFilePath android.OutputPath
@@ -103,29 +100,6 @@
 	ctx.InstallFile(l.installDirPath, l.outputFilePath.Base(), l.outputFilePath)
 }
 
-type linkerConfigAttributes struct {
-	Src bazel.LabelAttribute
-}
-
-func (l *linkerConfig) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	if l.properties.Src == nil {
-		ctx.PropertyErrorf("src", "empty src is not supported")
-		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_UNSUPPORTED, "")
-		return
-	}
-	src := android.BazelLabelForModuleSrcSingle(ctx, *l.properties.Src)
-	targetModuleProperties := bazel.BazelTargetModuleProperties{
-		Rule_class:        "linker_config",
-		Bzl_load_location: "//build/bazel/rules:linker_config.bzl",
-	}
-	ctx.CreateBazelTargetModule(
-		targetModuleProperties,
-		android.CommonAttributes{Name: l.Name()},
-		&linkerConfigAttributes{
-			Src: bazel.LabelAttribute{Value: &src},
-		})
-}
-
 func BuildLinkerConfig(ctx android.ModuleContext, builder *android.RuleBuilder,
 	input android.Path, otherModules []android.Module, output android.OutputPath) {
 
@@ -171,7 +145,6 @@
 	m := &linkerConfig{}
 	m.AddProperties(&m.properties)
 	android.InitAndroidArchModule(m, android.HostAndDeviceSupported, android.MultilibFirst)
-	android.InitBazelModule(m)
 	return m
 }
 
diff --git a/python/Android.bp b/python/Android.bp
index 87810c9..14e83c1 100644
--- a/python/Android.bp
+++ b/python/Android.bp
@@ -14,7 +14,6 @@
     ],
     srcs: [
         "binary.go",
-        "bp2build.go",
         "builder.go",
         "defaults.go",
         "library.go",
diff --git a/python/binary.go b/python/binary.go
index a5db2f6..85084a4 100644
--- a/python/binary.go
+++ b/python/binary.go
@@ -95,7 +95,6 @@
 	p.AddProperties(&p.binaryProperties)
 	android.InitAndroidArchModule(p, p.hod, p.multilib)
 	android.InitDefaultableModule(p)
-	android.InitBazelModule(p)
 	return p
 }
 
diff --git a/python/bp2build.go b/python/bp2build.go
deleted file mode 100644
index 3b283e4..0000000
--- a/python/bp2build.go
+++ /dev/null
@@ -1,240 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package python
-
-import (
-	"path/filepath"
-	"strings"
-
-	"github.com/google/blueprint/proptools"
-
-	"android/soong/android"
-	"android/soong/bazel"
-)
-
-type bazelPythonLibraryAttributes struct {
-	Srcs         bazel.LabelListAttribute
-	Deps         bazel.LabelListAttribute
-	Imports      bazel.StringListAttribute
-	Srcs_version *string
-}
-
-type bazelPythonProtoLibraryAttributes struct {
-	Deps bazel.LabelListAttribute
-
-	// A list of proto_library targets that the proto_library in `deps` depends on
-	// This list is overestimation.
-	// Overestimation is necessary since Soong includes other protos via proto.include_dirs and not
-	// a specific .proto file module explicitly.
-	Transitive_deps bazel.LabelListAttribute
-}
-
-type baseAttributes struct {
-	// TODO(b/200311466): Probably not translate b/c Bazel has no good equiv
-	//Pkg_path    bazel.StringAttribute
-	// TODO: Related to Pkg_bath and similarLy gated
-	//Is_internal bazel.BoolAttribute
-	// Combines Srcs and Exclude_srcs
-	Srcs bazel.LabelListAttribute
-	Deps bazel.LabelListAttribute
-	// Combines Data and Java_data (invariant)
-	Data    bazel.LabelListAttribute
-	Imports bazel.StringListAttribute
-}
-
-func (m *PythonLibraryModule) makeArchVariantBaseAttributes(ctx android.Bp2buildMutatorContext) baseAttributes {
-	var attrs baseAttributes
-	archVariantBaseProps := m.GetArchVariantProperties(ctx, &BaseProperties{})
-	for axis, configToProps := range archVariantBaseProps {
-		for config, props := range configToProps {
-			if baseProps, ok := props.(*BaseProperties); ok {
-				attrs.Srcs.SetSelectValue(axis, config,
-					android.BazelLabelForModuleSrcExcludes(ctx, baseProps.Srcs, baseProps.Exclude_srcs))
-				attrs.Deps.SetSelectValue(axis, config,
-					android.BazelLabelForModuleDeps(ctx, baseProps.Libs))
-				data := android.BazelLabelForModuleSrc(ctx, baseProps.Data)
-				data.Append(android.BazelLabelForModuleSrc(ctx, baseProps.Java_data))
-				attrs.Data.SetSelectValue(axis, config, data)
-			}
-		}
-	}
-
-	partitionedSrcs := bazel.PartitionLabelListAttribute(ctx, &attrs.Srcs, bazel.LabelPartitions{
-		"proto": android.ProtoSrcLabelPartition,
-		"py":    bazel.LabelPartition{Keep_remainder: true},
-	})
-	attrs.Srcs = partitionedSrcs["py"]
-
-	if !partitionedSrcs["proto"].IsEmpty() {
-		protoInfo, _ := android.Bp2buildProtoProperties(ctx, &m.ModuleBase, partitionedSrcs["proto"])
-
-		pyProtoLibraryName := m.Name() + "_py_proto"
-		ctx.CreateBazelTargetModule(bazel.BazelTargetModuleProperties{
-			Rule_class:        "py_proto_library",
-			Bzl_load_location: "//build/bazel/rules/python:py_proto.bzl",
-		}, android.CommonAttributes{
-			Name: pyProtoLibraryName,
-		}, &bazelPythonProtoLibraryAttributes{
-			Deps:            bazel.MakeLabelListAttribute(protoInfo.Proto_libs),
-			Transitive_deps: bazel.MakeLabelListAttribute(protoInfo.Transitive_proto_libs),
-		})
-
-		attrs.Deps.Add(bazel.MakeLabelAttribute(":" + pyProtoLibraryName))
-	}
-
-	// Bazel normally requires `import path.from.top.of.tree` statements in
-	// python code, but with soong you can directly import modules from libraries.
-	// Add "imports" attributes to the bazel library so it matches soong's behavior.
-	imports := "."
-	if m.properties.Pkg_path != nil {
-		// TODO(b/215119317) This is a hack to handle the fact that we don't convert
-		// pkg_path properly right now. If the folder structure that contains this
-		// Android.bp file matches pkg_path, we can set imports to an appropriate
-		// number of ../..s to emulate moving the files under a pkg_path folder.
-		pkg_path := filepath.Clean(*m.properties.Pkg_path)
-		if strings.HasPrefix(pkg_path, "/") {
-			ctx.ModuleErrorf("pkg_path cannot start with a /: %s", pkg_path)
-		}
-
-		if !strings.HasSuffix(ctx.ModuleDir(), "/"+pkg_path) && ctx.ModuleDir() != pkg_path {
-			ctx.ModuleErrorf("Currently, bp2build only supports pkg_paths that are the same as the folders the Android.bp file is in. pkg_path: %s, module directory: %s", pkg_path, ctx.ModuleDir())
-		}
-		numFolders := strings.Count(pkg_path, "/") + 1
-		dots := make([]string, numFolders)
-		for i := 0; i < numFolders; i++ {
-			dots[i] = ".."
-		}
-		imports = strings.Join(dots, "/")
-	}
-	attrs.Imports = bazel.MakeStringListAttribute([]string{imports})
-
-	return attrs
-}
-
-func (m *PythonLibraryModule) bp2buildPythonVersion(ctx android.Bp2buildMutatorContext) *string {
-	py3Enabled := proptools.BoolDefault(m.properties.Version.Py3.Enabled, true)
-	py2Enabled := proptools.BoolDefault(m.properties.Version.Py2.Enabled, false)
-	if py2Enabled && !py3Enabled {
-		return &pyVersion2
-	} else if !py2Enabled && py3Enabled {
-		return &pyVersion3
-	} else if !py2Enabled && !py3Enabled {
-		ctx.ModuleErrorf("bp2build converter doesn't understand having neither py2 nor py3 enabled")
-		return &pyVersion3
-	} else {
-		return &pyVersion2And3
-	}
-}
-
-type bazelPythonBinaryAttributes struct {
-	Main           *bazel.Label
-	Srcs           bazel.LabelListAttribute
-	Deps           bazel.LabelListAttribute
-	Python_version *string
-	Imports        bazel.StringListAttribute
-}
-
-func (p *PythonLibraryModule) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	// TODO(b/182306917): this doesn't fully handle all nested props versioned
-	// by the python version, which would have been handled by the version split
-	// mutator. This is sufficient for very simple python_library modules under
-	// Bionic.
-	baseAttrs := p.makeArchVariantBaseAttributes(ctx)
-	pyVersion := p.bp2buildPythonVersion(ctx)
-	if *pyVersion == pyVersion2And3 {
-		// Libraries default to python 2 and 3
-		pyVersion = nil
-	}
-
-	attrs := &bazelPythonLibraryAttributes{
-		Srcs:         baseAttrs.Srcs,
-		Deps:         baseAttrs.Deps,
-		Srcs_version: pyVersion,
-		Imports:      baseAttrs.Imports,
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		// Use the native py_library rule.
-		Rule_class: "py_library",
-	}
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{
-		Name: p.Name(),
-		Data: baseAttrs.Data,
-	}, attrs)
-}
-
-func (p *PythonBinaryModule) bp2buildBinaryProperties(ctx android.Bp2buildMutatorContext) (*bazelPythonBinaryAttributes, bazel.LabelListAttribute) {
-	// TODO(b/182306917): this doesn't fully handle all nested props versioned
-	// by the python version, which would have been handled by the version split
-	// mutator. This is sufficient for very simple python_binary_host modules
-	// under Bionic.
-
-	baseAttrs := p.makeArchVariantBaseAttributes(ctx)
-	pyVersion := p.bp2buildPythonVersion(ctx)
-	if *pyVersion == pyVersion3 {
-		// Binaries default to python 3
-		pyVersion = nil
-	} else if *pyVersion == pyVersion2And3 {
-		ctx.ModuleErrorf("error for '%s' module: bp2build's python_binary_host converter "+
-			"does not support converting a module that is enabled for both Python 2 and 3 at the "+
-			"same time.", p.Name())
-	}
-
-	attrs := &bazelPythonBinaryAttributes{
-		Main:           nil,
-		Srcs:           baseAttrs.Srcs,
-		Deps:           baseAttrs.Deps,
-		Python_version: pyVersion,
-		Imports:        baseAttrs.Imports,
-	}
-
-	// main is optional.
-	if p.binaryProperties.Main != nil {
-		main := android.BazelLabelForModuleSrcSingle(ctx, *p.binaryProperties.Main)
-		attrs.Main = &main
-	}
-	return attrs, baseAttrs.Data
-}
-
-func (p *PythonBinaryModule) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	attrs, data := p.bp2buildBinaryProperties(ctx)
-
-	props := bazel.BazelTargetModuleProperties{
-		// Use the native py_binary rule.
-		Rule_class: "py_binary",
-	}
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{
-		Name: p.Name(),
-		Data: data,
-	}, attrs)
-}
-
-func (p *PythonTestModule) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	// Python tests are currently exactly the same as binaries, but with a different module type
-	attrs, data := p.bp2buildBinaryProperties(ctx)
-
-	props := bazel.BazelTargetModuleProperties{
-		// Use the native py_binary rule.
-		Rule_class:        "py_test",
-		Bzl_load_location: "//build/bazel/rules/python:py_test.bzl",
-	}
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{
-		Name: p.Name(),
-		Data: data,
-	}, attrs)
-}
diff --git a/python/python.go b/python/python.go
index 7d77ca7..79b1515 100644
--- a/python/python.go
+++ b/python/python.go
@@ -129,7 +129,6 @@
 type PythonLibraryModule struct {
 	android.ModuleBase
 	android.DefaultableModuleBase
-	android.BazelModuleBase
 
 	properties      BaseProperties
 	protoProperties android.ProtoProperties
@@ -197,14 +196,6 @@
 	return String(p.properties.Pkg_path)
 }
 
-// PkgPath is the "public" version of `getPkgPath` that is only available during bp2build
-func (p *PythonLibraryModule) PkgPath(ctx android.BazelConversionContext) *string {
-	if ctx.Config().BuildMode != android.Bp2build {
-		ctx.ModuleErrorf("PkgPath is only supported in bp2build mode")
-	}
-	return p.properties.Pkg_path
-}
-
 func (p *PythonLibraryModule) getBaseProperties() *BaseProperties {
 	return &p.properties
 }
@@ -215,7 +206,6 @@
 	p.AddProperties(&p.properties, &p.protoProperties)
 	android.InitAndroidArchModule(p, p.hod, p.multilib)
 	android.InitDefaultableModule(p)
-	android.InitBazelModule(p)
 	return p
 }
 
@@ -430,6 +420,7 @@
 // GenerateAndroidBuildActions performs build actions common to all Python modules
 func (p *PythonLibraryModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
 	expandedSrcs := android.PathsForModuleSrcExcludes(ctx, p.properties.Srcs, p.properties.Exclude_srcs)
+	ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: expandedSrcs.Strings()})
 
 	// expand data files from "data" property.
 	expandedData := android.PathsForModuleSrc(ctx, p.properties.Data)
diff --git a/python/test.go b/python/test.go
index cd7c73b..f15a8fc 100644
--- a/python/test.go
+++ b/python/test.go
@@ -102,7 +102,6 @@
 	p.AddProperties(&p.testProperties)
 	android.InitAndroidArchModule(p, p.hod, p.multilib)
 	android.InitDefaultableModule(p)
-	android.InitBazelModule(p)
 	if p.isTestHost() && p.testProperties.Test_options.Unit_test == nil {
 		p.testProperties.Test_options.Unit_test = proptools.BoolPtr(true)
 	}
@@ -188,8 +187,6 @@
 		panic(fmt.Errorf("unknown python test runner '%s', should be 'tradefed' or 'mobly'", runner))
 	}
 
-	p.installedDest = ctx.InstallFile(installDir(ctx, "nativetest", "nativetest64", ctx.ModuleName()), p.installSource.Base(), p.installSource)
-
 	for _, dataSrcPath := range android.PathsForModuleSrc(ctx, p.testProperties.Data) {
 		p.data = append(p.data, android.DataPath{SrcPath: dataSrcPath})
 	}
@@ -206,6 +203,11 @@
 			p.data = append(p.data, android.DataPath{SrcPath: javaDataSrcPath})
 		}
 	}
+
+	installDir := installDir(ctx, "nativetest", "nativetest64", ctx.ModuleName())
+	installedData := ctx.InstallTestData(installDir, p.data)
+	p.installedDest = ctx.InstallFile(installDir, p.installSource.Base(), p.installSource, installedData...)
+
 	ctx.SetProvider(testing.TestModuleProviderKey, testing.TestModuleProviderData{})
 }
 
@@ -227,8 +229,6 @@
 
 			entries.SetBoolIfTrue("LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG", !BoolDefault(p.binaryProperties.Auto_gen_config, true))
 
-			entries.AddStrings("LOCAL_TEST_DATA", android.AndroidMkDataPaths(p.data)...)
-
 			p.testProperties.Test_options.SetAndroidMkEntries(entries)
 		})
 
diff --git a/rust/Android.bp b/rust/Android.bp
index c5b2000..637042d 100644
--- a/rust/Android.bp
+++ b/rust/Android.bp
@@ -7,6 +7,7 @@
     pkgPath: "android/soong/rust",
     deps: [
         "soong",
+        "soong-aconfig",
         "soong-android",
         "soong-bloaty",
         "soong-cc",
diff --git a/rust/androidmk.go b/rust/androidmk.go
index c684e81..c355a56 100644
--- a/rust/androidmk.go
+++ b/rust/androidmk.go
@@ -17,8 +17,8 @@
 import (
 	"path/filepath"
 
+	"android/soong/aconfig"
 	"android/soong/android"
-	"android/soong/cc"
 )
 
 type AndroidMkContext interface {
@@ -67,7 +67,7 @@
 				if mod.UseVndk() {
 					entries.SetBool("LOCAL_USE_VNDK", true)
 				}
-
+				aconfig.SetAconfigFileMkEntries(mod.AndroidModuleBase(), entries, mod.mergedAconfigFiles)
 			},
 		},
 	}
@@ -114,8 +114,6 @@
 
 			test.Properties.Test_options.SetAndroidMkEntries(entries)
 		})
-
-	cc.AndroidMkWriteTestData(test.data, ret)
 }
 
 func (benchmark *benchmarkDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkEntries) {
@@ -216,33 +214,9 @@
 func (fuzz *fuzzDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkEntries) {
 	ctx.SubAndroidMk(ret, fuzz.binaryDecorator)
 
-	var fuzzFiles []string
-	for _, d := range fuzz.fuzzPackagedModule.Corpus {
-		fuzzFiles = append(fuzzFiles,
-			filepath.Dir(fuzz.fuzzPackagedModule.CorpusIntermediateDir.String())+":corpus/"+d.Base())
-	}
-
-	for _, d := range fuzz.fuzzPackagedModule.Data {
-		fuzzFiles = append(fuzzFiles,
-			filepath.Dir(fuzz.fuzzPackagedModule.DataIntermediateDir.String())+":data/"+d.Rel())
-	}
-
-	if fuzz.fuzzPackagedModule.Dictionary != nil {
-		fuzzFiles = append(fuzzFiles,
-			filepath.Dir(fuzz.fuzzPackagedModule.Dictionary.String())+":"+fuzz.fuzzPackagedModule.Dictionary.Base())
-	}
-
-	if fuzz.fuzzPackagedModule.Config != nil {
-		fuzzFiles = append(fuzzFiles,
-			filepath.Dir(fuzz.fuzzPackagedModule.Config.String())+":config.json")
-	}
-
 	ret.ExtraEntries = append(ret.ExtraEntries, func(ctx android.AndroidMkExtraEntriesContext,
 		entries *android.AndroidMkEntries) {
 		entries.SetBool("LOCAL_IS_FUZZ_TARGET", true)
-		if len(fuzzFiles) > 0 {
-			entries.AddStrings("LOCAL_TEST_DATA", fuzzFiles...)
-		}
 		if fuzz.installedSharedDeps != nil {
 			entries.AddStrings("LOCAL_FUZZ_INSTALLED_SHARED_DEPS", fuzz.installedSharedDeps...)
 		}
diff --git a/rust/binary.go b/rust/binary.go
index 5e7e922..9969513 100644
--- a/rust/binary.go
+++ b/rust/binary.go
@@ -15,10 +15,7 @@
 package rust
 
 import (
-	"fmt"
-
 	"android/soong/android"
-	"android/soong/bazel"
 )
 
 func init() {
@@ -63,8 +60,6 @@
 func NewRustBinary(hod android.HostOrDeviceSupported) (*Module, *binaryDecorator) {
 	module := newModule(hod, android.MultilibFirst)
 
-	android.InitBazelModule(module)
-
 	binary := &binaryDecorator{
 		baseCompiler: NewBaseCompiler("bin", "", InstallInSystem),
 	}
@@ -185,88 +180,3 @@
 func (binary *binaryDecorator) testBinary() bool {
 	return false
 }
-
-type rustBinaryLibraryAttributes struct {
-	Srcs            bazel.LabelListAttribute
-	Compile_data    bazel.LabelListAttribute
-	Crate_name      bazel.StringAttribute
-	Edition         bazel.StringAttribute
-	Crate_features  bazel.StringListAttribute
-	Deps            bazel.LabelListAttribute
-	Proc_macro_deps bazel.LabelListAttribute
-	Rustc_flags     bazel.StringListAttribute
-}
-
-func binaryBp2build(ctx android.Bp2buildMutatorContext, m *Module) {
-	binary := m.compiler.(*binaryDecorator)
-
-	var srcs bazel.LabelList
-	var compileData bazel.LabelList
-
-	if binary.baseCompiler.Properties.Srcs[0] == "src/main.rs" {
-		srcs = android.BazelLabelForModuleSrc(ctx, []string{"src/**/*.rs"})
-		compileData = android.BazelLabelForModuleSrc(
-			ctx,
-			[]string{
-				"src/**/*.proto",
-				"examples/**/*.rs",
-				"**/*.md",
-				"templates/**/*.template",
-			},
-		)
-	} else {
-		srcs = android.BazelLabelForModuleSrc(ctx, binary.baseCompiler.Properties.Srcs)
-	}
-
-	deps := android.BazelLabelForModuleDeps(ctx, append(
-		binary.baseCompiler.Properties.Rustlibs,
-	))
-
-	procMacroDeps := android.BazelLabelForModuleDeps(ctx, binary.baseCompiler.Properties.Proc_macros)
-
-	var rustcFLags []string
-	for _, cfg := range binary.baseCompiler.Properties.Cfgs {
-		rustcFLags = append(rustcFLags, fmt.Sprintf("--cfg=%s", cfg))
-	}
-
-	attrs := &rustBinaryLibraryAttributes{
-		Srcs: bazel.MakeLabelListAttribute(
-			srcs,
-		),
-		Compile_data: bazel.MakeLabelListAttribute(
-			compileData,
-		),
-		Crate_name: bazel.StringAttribute{
-			Value: &binary.baseCompiler.Properties.Crate_name,
-		},
-		Edition: bazel.StringAttribute{
-			Value: binary.baseCompiler.Properties.Edition,
-		},
-		Crate_features: bazel.StringListAttribute{
-			Value: binary.baseCompiler.Properties.Features,
-		},
-		Deps: bazel.MakeLabelListAttribute(
-			deps,
-		),
-		Proc_macro_deps: bazel.MakeLabelListAttribute(
-			procMacroDeps,
-		),
-		Rustc_flags: bazel.StringListAttribute{
-			Value: append(
-				rustcFLags,
-				binary.baseCompiler.Properties.Flags...,
-			),
-		},
-	}
-
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "rust_binary",
-			Bzl_load_location: "@rules_rust//rust:defs.bzl",
-		},
-		android.CommonAttributes{
-			Name: m.Name(),
-		},
-		attrs,
-	)
-}
diff --git a/rust/bindgen.go b/rust/bindgen.go
index ffe532f..1cc1574 100644
--- a/rust/bindgen.go
+++ b/rust/bindgen.go
@@ -174,6 +174,15 @@
 		cflags = append(cflags, "-D__ANDROID_VNDK__")
 		if ctx.RustModule().InVendor() {
 			cflags = append(cflags, "-D__ANDROID_VENDOR__")
+
+			vendorApiLevel := ctx.Config().VendorApiLevel()
+			if vendorApiLevel == "" {
+				// TODO(b/314036847): This is a fallback for UDC targets.
+				// This must be a build failure when UDC is no longer built
+				// from this source tree.
+				vendorApiLevel = ctx.Config().PlatformSdkVersion().String()
+			}
+			cflags = append(cflags, "-D__ANDROID_VENDOR_API__="+vendorApiLevel)
 		} else if ctx.RustModule().InProduct() {
 			cflags = append(cflags, "-D__ANDROID_PRODUCT__")
 		}
diff --git a/rust/compiler.go b/rust/compiler.go
index d453a5d..a8c5473 100644
--- a/rust/compiler.go
+++ b/rust/compiler.go
@@ -239,6 +239,8 @@
 
 	distFile android.OptionalPath
 
+	installDeps android.InstallPaths
+
 	// unstripped output file.
 	unstrippedOutputFile android.Path
 
@@ -538,7 +540,12 @@
 
 func (compiler *baseCompiler) install(ctx ModuleContext) {
 	path := ctx.RustModule().OutputFile()
-	compiler.path = ctx.InstallFile(compiler.installDir(ctx), path.Path().Base(), path.Path())
+	compiler.path = ctx.InstallFile(compiler.installDir(ctx), path.Path().Base(), path.Path(), compiler.installDeps...)
+}
+
+func (compiler *baseCompiler) installTestData(ctx ModuleContext, data []android.DataPath) {
+	installedData := ctx.InstallTestData(compiler.installDir(ctx), data)
+	compiler.installDeps = append(compiler.installDeps, installedData...)
 }
 
 func (compiler *baseCompiler) getStem(ctx ModuleContext) string {
diff --git a/rust/config/global.go b/rust/config/global.go
index 3802bdd..377ae58 100644
--- a/rust/config/global.go
+++ b/rust/config/global.go
@@ -51,8 +51,6 @@
 		"-C force-unwind-tables=yes",
 		// Use v0 mangling to distinguish from C++ symbols
 		"-C symbol-mangling-version=v0",
-		// This flag requires to have no space so that when it's exported to bazel
-		// it can be removed. See aosp/2768339
 		"--color=always",
 		"-Z dylib-lto",
 		"-Z link-native-libraries=no",
@@ -72,6 +70,8 @@
 		"-C panic=abort",
 		// Generate additional debug info for AutoFDO
 		"-Z debug-info-for-profiling",
+		// Android has ELF TLS on platform
+		"-Z tls-model=global-dynamic",
 	}
 
 	deviceGlobalLinkFlags = []string{
@@ -143,8 +143,3 @@
 	}
 	return RustDefaultVersion
 }
-
-// BazelRustToolchainVars returns a string with
-func BazelRustToolchainVars(config android.Config) string {
-	return android.BazelToolchainVars(config, ExportedVars)
-}
diff --git a/rust/fuzz.go b/rust/fuzz.go
index 4c04ce8..bacfa2d 100644
--- a/rust/fuzz.go
+++ b/rust/fuzz.go
@@ -15,12 +15,11 @@
 package rust
 
 import (
-	"path/filepath"
-
 	"android/soong/android"
 	"android/soong/cc"
 	"android/soong/fuzz"
 	"android/soong/rust/config"
+	"path/filepath"
 )
 
 func init() {
@@ -131,12 +130,6 @@
 }
 
 func (fuzz *fuzzDecorator) install(ctx ModuleContext) {
-	fuzz.binaryDecorator.baseCompiler.dir = filepath.Join(
-		"fuzz", ctx.Target().Arch.ArchType.String(), ctx.ModuleName())
-	fuzz.binaryDecorator.baseCompiler.dir64 = filepath.Join(
-		"fuzz", ctx.Target().Arch.ArchType.String(), ctx.ModuleName())
-	fuzz.binaryDecorator.baseCompiler.install(ctx)
-
 	fuzz.fuzzPackagedModule = cc.PackageFuzzModule(ctx, fuzz.fuzzPackagedModule, pctx)
 
 	installBase := "fuzz"
@@ -157,4 +150,30 @@
 				cc.SharedLibrarySymbolsInstallLocation(install, installBase, ctx.Arch().ArchType.String()))
 		}
 	}
+
+	var fuzzData []android.DataPath
+	for _, d := range fuzz.fuzzPackagedModule.Corpus {
+		fuzzData = append(fuzzData, android.DataPath{SrcPath: d, RelativeInstallPath: "corpus", WithoutRel: true})
+	}
+
+	for _, d := range fuzz.fuzzPackagedModule.Data {
+		fuzzData = append(fuzzData, android.DataPath{SrcPath: d, RelativeInstallPath: "data"})
+	}
+
+	if d := fuzz.fuzzPackagedModule.Dictionary; d != nil {
+		fuzzData = append(fuzzData, android.DataPath{SrcPath: d, WithoutRel: true})
+	}
+
+	if d := fuzz.fuzzPackagedModule.Config; d != nil {
+		fuzzData = append(fuzzData, android.DataPath{SrcPath: d, WithoutRel: true})
+	}
+
+	fuzz.binaryDecorator.baseCompiler.dir = filepath.Join(
+		"fuzz", ctx.Target().Arch.ArchType.String(), ctx.ModuleName())
+	fuzz.binaryDecorator.baseCompiler.dir64 = filepath.Join(
+		"fuzz", ctx.Target().Arch.ArchType.String(), ctx.ModuleName())
+	fuzz.binaryDecorator.baseCompiler.installTestData(ctx, fuzzData)
+
+	fuzz.binaryDecorator.baseCompiler.install(ctx)
+
 }
diff --git a/rust/library.go b/rust/library.go
index c0ff741..199ffbb 100644
--- a/rust/library.go
+++ b/rust/library.go
@@ -21,10 +21,7 @@
 	"strings"
 
 	"android/soong/android"
-	"android/soong/bazel"
 	"android/soong/cc"
-
-	"github.com/google/blueprint/proptools"
 )
 
 var (
@@ -402,8 +399,6 @@
 func NewRustLibrary(hod android.HostOrDeviceSupported) (*Module, *libraryDecorator) {
 	module := newModule(hod, android.MultilibBoth)
 
-	android.InitBazelModule(module)
-
 	library := &libraryDecorator{
 		MutatedProperties: LibraryMutatedProperties{
 			BuildDylib:  false,
@@ -801,184 +796,3 @@
 	// TODO(185577950): If support for generated headers is added, they need to be collected here as well.
 	l.collectedSnapshotHeaders = ret
 }
-
-type rustLibraryAttributes struct {
-	commonLibraryAttrs
-}
-
-type commonLibraryAttrs struct {
-	Srcs            bazel.LabelListAttribute
-	Compile_data    bazel.LabelListAttribute
-	Crate_name      bazel.StringAttribute
-	Edition         bazel.StringAttribute
-	Crate_features  bazel.StringListAttribute
-	Deps            bazel.LabelListAttribute
-	Rustc_flags     bazel.StringListAttribute
-	Proc_macro_deps bazel.LabelListAttribute
-}
-
-func commonLibraryAttrsBp2build(ctx android.Bp2buildMutatorContext, m *Module) *commonLibraryAttrs {
-	lib := m.compiler.(*libraryDecorator)
-
-	srcs, compileData := srcsAndCompileDataAttrs(ctx, *lib.baseCompiler)
-
-	deps := android.BazelLabelForModuleDeps(ctx, append(
-		lib.baseCompiler.Properties.Rustlibs,
-		lib.baseCompiler.Properties.Rlibs...,
-	))
-
-	cargoBuildScript := cargoBuildScriptBp2build(ctx, m)
-	if cargoBuildScript != nil {
-		deps.Add(&bazel.Label{
-			Label: ":" + *cargoBuildScript,
-		})
-	}
-
-	procMacroDeps := android.BazelLabelForModuleDeps(ctx, lib.baseCompiler.Properties.Proc_macros)
-
-	var rustcFLags []string
-	for _, cfg := range lib.baseCompiler.Properties.Cfgs {
-		rustcFLags = append(rustcFLags, fmt.Sprintf("--cfg=%s", cfg))
-	}
-
-	return &commonLibraryAttrs{
-		Srcs: bazel.MakeLabelListAttribute(
-			srcs,
-		),
-		Compile_data: bazel.MakeLabelListAttribute(
-			compileData,
-		),
-		Crate_name: bazel.StringAttribute{
-			Value: &lib.baseCompiler.Properties.Crate_name,
-		},
-		Edition: bazel.StringAttribute{
-			Value: lib.baseCompiler.Properties.Edition,
-		},
-		Crate_features: bazel.StringListAttribute{
-			Value: lib.baseCompiler.Properties.Features,
-		},
-		Deps: bazel.MakeLabelListAttribute(
-			deps,
-		),
-		Proc_macro_deps: bazel.MakeLabelListAttribute(
-			procMacroDeps,
-		),
-		Rustc_flags: bazel.StringListAttribute{
-			Value: append(
-				rustcFLags,
-				lib.baseCompiler.Properties.Flags...,
-			),
-		},
-	}
-
-}
-
-func libraryBp2build(ctx android.Bp2buildMutatorContext, m *Module) {
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "rust_library",
-			Bzl_load_location: "@rules_rust//rust:defs.bzl",
-		},
-		android.CommonAttributes{
-			Name: m.Name(),
-		},
-		commonLibraryAttrsBp2build(ctx, m),
-	)
-}
-
-type cargoBuildScriptAttributes struct {
-	Srcs    bazel.LabelListAttribute
-	Edition bazel.StringAttribute
-	Version bazel.StringAttribute
-}
-
-func cargoBuildScriptBp2build(ctx android.Bp2buildMutatorContext, m *Module) *string {
-	// Soong treats some crates like libprotobuf as special in that they have
-	// cargo build script ran to produce an out folder and check it into AOSP
-	// For example, https://cs.android.com/android/platform/superproject/main/+/main:external/rust/crates/protobuf/out/
-	// is produced by cargo build script https://cs.android.com/android/platform/superproject/main/+/main:external/rust/crates/protobuf/build.rs
-	// The out folder is then fed into `rust_library` by a genrule
-	// https://cs.android.com/android/platform/superproject/main/+/main:external/rust/crates/protobuf/Android.bp;l=22
-	// This allows Soong to decouple from cargo completely.
-
-	// Soong decouples from cargo so that it has control over cc compilation.
-	// https://cs.android.com/android/platform/superproject/main/+/main:development/scripts/cargo2android.py;l=1033-1041;drc=8449944a50a0445a5ecaf9b7aed12608c81bf3f1
-	// generates a `cc_library_static` module to have custom cc flags.
-	// Since bp2build will convert the cc modules to cc targets which include the cflags,
-	// Bazel does not need to have this optimization.
-
-	// Performance-wise: rust_library -> cargo_build_script vs rust_library -> genrule (like Soong)
-	// don't have any major difference in build time in Bazel. So using cargo_build_script does not slow
-	// down the build.
-
-	// The benefit of using `cargo_build_script` here is that it would take care of setting correct
-	// `OUT_DIR` for us - similar to what Soong does here
-	// https://cs.android.com/android/platform/superproject/main/+/main:build/soong/rust/builder.go;l=202-218;drc=f29ca58e88c5846bbe8955e5192135e5ab4f14a1
-
-	// TODO(b/297364081): cargo2android.py has logic for when generate/not cc_library_static and out directory
-	// bp2build might be able use the same logic for when to use `cargo_build_script`.
-	// For now, we're building libprotobuf_build_script as a one-off until we have a more principled solution
-	if m.Name() != "libprotobuf" {
-		return nil
-	}
-
-	lib := m.compiler.(*libraryDecorator)
-
-	name := m.Name() + "_build_script"
-	attrs := &cargoBuildScriptAttributes{
-		Srcs: bazel.MakeLabelListAttribute(
-			android.BazelLabelForModuleSrc(ctx, []string{"build.rs"}),
-		),
-		Edition: bazel.StringAttribute{
-			Value: lib.baseCompiler.Properties.Edition,
-		},
-		Version: bazel.StringAttribute{
-			Value: lib.baseCompiler.Properties.Cargo_pkg_version,
-		},
-	}
-
-	// TODO(b/290790800): Remove the restriction when rust toolchain for android is implemented
-	var restriction bazel.BoolAttribute
-	restriction.SetSelectValue(bazel.OsConfigurationAxis, "android", proptools.BoolPtr(false))
-
-	ctx.CreateBazelTargetModuleWithRestrictions(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "cargo_build_script",
-			Bzl_load_location: "@rules_rust//cargo:cargo_build_script.bzl",
-		},
-		android.CommonAttributes{
-			Name: name,
-		},
-		attrs,
-		restriction,
-	)
-
-	return &name
-}
-
-type ffiStaticAttributes struct {
-	commonLibraryAttrs
-	Export_includes bazel.StringListAttribute
-}
-
-func ffiStaticBp2build(ctx android.Bp2buildMutatorContext, m *Module) {
-	lib := m.compiler.(*libraryDecorator)
-
-	attrs := &ffiStaticAttributes{
-		Export_includes: bazel.StringListAttribute{
-			Value: lib.Properties.Include_dirs,
-		},
-		commonLibraryAttrs: *commonLibraryAttrsBp2build(ctx, m),
-	}
-
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "rust_ffi_static",
-			Bzl_load_location: "//build/bazel/rules/rust:rust_ffi_static.bzl",
-		},
-		android.CommonAttributes{
-			Name: m.Name(),
-		},
-		attrs,
-	)
-}
diff --git a/rust/proc_macro.go b/rust/proc_macro.go
index c18d5ec..b491449 100644
--- a/rust/proc_macro.go
+++ b/rust/proc_macro.go
@@ -15,10 +15,7 @@
 package rust
 
 import (
-	"fmt"
-
 	"android/soong/android"
-	"android/soong/bazel"
 )
 
 func init() {
@@ -50,8 +47,6 @@
 func NewProcMacro(hod android.HostOrDeviceSupported) (*Module, *procMacroDecorator) {
 	module := newModule(hod, android.MultilibFirst)
 
-	android.InitBazelModule(module)
-
 	procMacro := &procMacroDecorator{
 		baseCompiler: NewBaseCompiler("lib", "lib64", InstallInSystem),
 		flagExporter: NewFlagExporter(),
@@ -103,65 +98,3 @@
 	// Proc_macros are never installed
 	return false
 }
-
-type procMacroAttributes struct {
-	Srcs           bazel.LabelListAttribute
-	Compile_data   bazel.LabelListAttribute
-	Crate_name     bazel.StringAttribute
-	Edition        bazel.StringAttribute
-	Crate_features bazel.StringListAttribute
-	Deps           bazel.LabelListAttribute
-	Rustc_flags    bazel.StringListAttribute
-}
-
-func procMacroBp2build(ctx android.Bp2buildMutatorContext, m *Module) {
-	procMacro := m.compiler.(*procMacroDecorator)
-	srcs, compileData := srcsAndCompileDataAttrs(ctx, *procMacro.baseCompiler)
-	deps := android.BazelLabelForModuleDeps(ctx, append(
-		procMacro.baseCompiler.Properties.Rustlibs,
-		procMacro.baseCompiler.Properties.Rlibs...,
-	))
-
-	var rustcFLags []string
-	for _, cfg := range procMacro.baseCompiler.Properties.Cfgs {
-		rustcFLags = append(rustcFLags, fmt.Sprintf("--cfg=%s", cfg))
-	}
-
-	attrs := &procMacroAttributes{
-		Srcs: bazel.MakeLabelListAttribute(
-			srcs,
-		),
-		Compile_data: bazel.MakeLabelListAttribute(
-			compileData,
-		),
-		Crate_name: bazel.StringAttribute{
-			Value: &procMacro.baseCompiler.Properties.Crate_name,
-		},
-		Edition: bazel.StringAttribute{
-			Value: procMacro.baseCompiler.Properties.Edition,
-		},
-		Crate_features: bazel.StringListAttribute{
-			Value: procMacro.baseCompiler.Properties.Features,
-		},
-		Deps: bazel.MakeLabelListAttribute(
-			deps,
-		),
-		Rustc_flags: bazel.StringListAttribute{
-			Value: append(
-				rustcFLags,
-				procMacro.baseCompiler.Properties.Flags...,
-			),
-		},
-	}
-	// m.IsConvertedByBp2build()
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "rust_proc_macro",
-			Bzl_load_location: "@rules_rust//rust:defs.bzl",
-		},
-		android.CommonAttributes{
-			Name: m.Name(),
-		},
-		attrs,
-	)
-}
diff --git a/rust/protobuf.go b/rust/protobuf.go
index 2982efd..8d231bb 100644
--- a/rust/protobuf.go
+++ b/rust/protobuf.go
@@ -19,10 +19,7 @@
 	"strings"
 
 	"android/soong/android"
-	"android/soong/bazel"
 	"android/soong/cc"
-
-	"github.com/google/blueprint/proptools"
 )
 
 var (
@@ -282,77 +279,5 @@
 
 	module := NewSourceProviderModule(hod, protobuf, false, false)
 
-	android.InitBazelModule(module)
-
 	return module, protobuf
 }
-
-type rustProtoAttributes struct {
-	Srcs       bazel.LabelListAttribute
-	Crate_name bazel.StringAttribute
-	Deps       bazel.LabelListAttribute
-}
-
-type protoLibraryAttributes struct {
-	Srcs bazel.LabelListAttribute
-}
-
-func protoLibraryBp2build(ctx android.Bp2buildMutatorContext, m *Module) {
-	var protoFiles []string
-
-	for _, propsInterface := range m.sourceProvider.SourceProviderProps() {
-		if possibleProps, ok := propsInterface.(*ProtobufProperties); ok {
-			protoFiles = possibleProps.Protos
-			break
-		}
-	}
-
-	protoLibraryName := m.Name() + "_proto"
-
-	protoDeps := bazel.LabelListAttribute{
-		Value: bazel.LabelList{
-			Includes: []bazel.Label{
-				{
-					Label:              ":" + protoLibraryName,
-					OriginalModuleName: m.Name(),
-				},
-			},
-		},
-	}
-
-	// TODO(b/295918553): Remove androidRestriction after rust toolchain for android is checked in.
-	var androidRestriction bazel.BoolAttribute
-	androidRestriction.SetSelectValue(bazel.OsConfigurationAxis, "android", proptools.BoolPtr(false))
-
-	ctx.CreateBazelTargetModuleWithRestrictions(
-		bazel.BazelTargetModuleProperties{
-			Rule_class: "proto_library",
-		},
-		android.CommonAttributes{
-			Name: protoLibraryName,
-		},
-		&protoLibraryAttributes{
-			Srcs: bazel.MakeLabelListAttribute(
-				android.BazelLabelForModuleSrc(ctx, protoFiles),
-			),
-		},
-		androidRestriction,
-	)
-
-	ctx.CreateBazelTargetModuleWithRestrictions(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "rust_proto_library",
-			Bzl_load_location: "@rules_rust//proto/protobuf:defs.bzl",
-		},
-		android.CommonAttributes{
-			Name: m.Name(),
-		},
-		&rustProtoAttributes{
-			Crate_name: bazel.StringAttribute{
-				Value: proptools.StringPtr(m.CrateName()),
-			},
-			Deps: protoDeps,
-		},
-		androidRestriction,
-	)
-}
diff --git a/rust/rust.go b/rust/rust.go
index d4d33c7..02ec22d 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -18,14 +18,12 @@
 	"fmt"
 	"strings"
 
-	"android/soong/bazel"
 	"android/soong/bloaty"
 	"android/soong/testing"
-	"android/soong/ui/metrics/bp2build_metrics_proto"
-
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/proptools"
 
+	"android/soong/aconfig"
 	"android/soong/android"
 	"android/soong/cc"
 	cc_config "android/soong/cc/config"
@@ -175,7 +173,8 @@
 
 	transitiveAndroidMkSharedLibs *android.DepSet[string]
 
-	android.BazelModuleBase
+	// Aconfig files for all transitive deps.  Also exposed via TransitiveDeclarationsInfo
+	mergedAconfigFiles map[string]android.Paths
 }
 
 func (mod *Module) Header() bool {
@@ -951,6 +950,7 @@
 			sourceLib := sourceMod.(*Module).compiler.(*libraryDecorator)
 			mod.sourceProvider.setOutputFiles(sourceLib.sourceProvider.Srcs())
 		}
+		ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: mod.sourceProvider.Srcs().Strings()})
 	}
 
 	if mod.compiler != nil && !mod.compiler.Disabled() {
@@ -1005,6 +1005,8 @@
 	if mod.testModule {
 		ctx.SetProvider(testing.TestModuleProviderKey, testing.TestModuleProviderData{})
 	}
+
+	aconfig.CollectDependencyAconfigFiles(ctx, &mod.mergedAconfigFiles)
 }
 
 func (mod *Module) deps(ctx DepsContext) Deps {
@@ -1849,48 +1851,6 @@
 	return ""
 }
 
-func (m *Module) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	if ctx.ModuleType() == "rust_library_host" || ctx.ModuleType() == "rust_library" {
-		libraryBp2build(ctx, m)
-	} else if ctx.ModuleType() == "rust_proc_macro" {
-		procMacroBp2build(ctx, m)
-	} else if ctx.ModuleType() == "rust_binary_host" {
-		binaryBp2build(ctx, m)
-	} else if ctx.ModuleType() == "rust_protobuf_host" || ctx.ModuleType() == "rust_protobuf" {
-		protoLibraryBp2build(ctx, m)
-	} else if ctx.ModuleType() == "rust_ffi_static" {
-		ffiStaticBp2build(ctx, m)
-	} else {
-		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_TYPE_UNSUPPORTED, "")
-	}
-}
-
-// This is a workaround by assuming the conventions that rust crate repos are structured
-// while waiting for the sandboxing work to complete.
-// TODO(b/297344471): When crate_root prop is set which enforces inputs sandboxing,
-// always use `srcs` and `compile_data` props to generate `srcs` and `compile_data` attributes
-// instead of using globs.
-func srcsAndCompileDataAttrs(ctx android.Bp2buildMutatorContext, c baseCompiler) (bazel.LabelList, bazel.LabelList) {
-	var srcs bazel.LabelList
-	var compileData bazel.LabelList
-
-	if c.Properties.Srcs[0] == "src/lib.rs" {
-		srcs = android.BazelLabelForModuleSrc(ctx, []string{"src/**/*.rs"})
-		compileData = android.BazelLabelForModuleSrc(
-			ctx,
-			[]string{
-				"src/**/*.proto",
-				"examples/**/*.rs",
-				"**/*.md",
-			},
-		)
-	} else {
-		srcs = android.BazelLabelForModuleSrc(ctx, c.Properties.Srcs)
-	}
-
-	return srcs, compileData
-}
-
 var Bool = proptools.Bool
 var BoolDefault = proptools.BoolDefault
 var String = proptools.String
diff --git a/rust/test.go b/rust/test.go
index 7ffc367..6619af6 100644
--- a/rust/test.go
+++ b/rust/test.go
@@ -189,6 +189,7 @@
 	if ctx.Host() && test.Properties.Test_options.Unit_test == nil {
 		test.Properties.Test_options.Unit_test = proptools.BoolPtr(true)
 	}
+	test.binaryDecorator.installTestData(ctx, test.data)
 	test.binaryDecorator.install(ctx)
 }
 
diff --git a/scripts/strip.sh b/scripts/strip.sh
index 71cb1c6..8d69f0d 100755
--- a/scripts/strip.sh
+++ b/scripts/strip.sh
@@ -29,6 +29,7 @@
 #   --keep-symbols
 #   --keep-symbols-and-debug-frame
 #   --remove-build-id
+#   --windows
 
 set -o pipefail
 
@@ -43,6 +44,7 @@
         --keep-symbols                  Keep symbols in out-file
         --keep-symbols-and-debug-frame  Keep symbols and .debug_frame in out-file
         --remove-build-id               Remove the gnu build-id section in out-file
+        --windows                       Input file is Windows DLL or executable
 EOF
     exit 1
 }
@@ -50,7 +52,11 @@
 do_strip() {
     # GNU strip --strip-all does not strip .ARM.attributes,
     # so we tell llvm-strip to keep it too.
-    "${CLANG_BIN}/llvm-strip" --strip-all --keep-section=.ARM.attributes "${infile}" -o "${outfile}.tmp"
+    local keep_section=--keep-section=.ARM.attributes
+    if [ -n "${windows}" ]; then
+      keep_section=
+    fi
+    "${CLANG_BIN}/llvm-strip" --strip-all ${keep_section} "${infile}" -o "${outfile}.tmp"
 }
 
 do_strip_keep_symbols_and_debug_frame() {
@@ -149,6 +155,7 @@
                 keep-symbols) keep_symbols=true ;;
                 keep-symbols-and-debug-frame) keep_symbols_and_debug_frame=true ;;
                 remove-build-id) remove_build_id=true ;;
+                windows) windows=true ;;
                 *) echo "Unknown option --${OPTARG}"; usage ;;
             esac;;
         ?) usage ;;
diff --git a/sdk/Android.bp b/sdk/Android.bp
index f42b478..f436320 100644
--- a/sdk/Android.bp
+++ b/sdk/Android.bp
@@ -18,6 +18,7 @@
         "bp.go",
         "build_release.go",
         "exports.go",
+        "genrule.go",
         "member_trait.go",
         "member_type.go",
         "sdk.go",
@@ -30,6 +31,7 @@
         "cc_sdk_test.go",
         "compat_config_sdk_test.go",
         "exports_test.go",
+        "genrule_test.go",
         "java_sdk_test.go",
         "license_sdk_test.go",
         "member_trait_test.go",
diff --git a/sdk/genrule.go b/sdk/genrule.go
new file mode 100644
index 0000000..347ab05
--- /dev/null
+++ b/sdk/genrule.go
@@ -0,0 +1,44 @@
+// Copyright 2023 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//	http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+package sdk
+
+import (
+	"android/soong/android"
+	"android/soong/genrule"
+)
+
+func init() {
+	registerGenRuleBuildComponents(android.InitRegistrationContext)
+}
+
+func registerGenRuleBuildComponents(ctx android.RegistrationContext) {
+	ctx.RegisterModuleType("sdk_genrule", SdkGenruleFactory)
+}
+
+// sdk_genrule_host is a genrule that can depend on sdk and sdk_snapshot module types
+//
+// What this means is that it's a genrule with only the "common_os" variant.
+// sdk modules have 3 variants: host, android, and common_os. The common_os one depends
+// on the host/device ones and packages their result into a final snapshot zip.
+// Genrules probably want access to this snapshot zip when they depend on an sdk module,
+// which means they want to depend on the common_os variant and not the host/android
+// variants.
+func SdkGenruleFactory() android.Module {
+	module := genrule.NewGenRule()
+
+	android.InitCommonOSAndroidMultiTargetsArchModule(module, android.NeitherHostNorDeviceSupported, android.MultilibCommon)
+	android.InitDefaultableModule(module)
+
+	return module
+}
diff --git a/sdk/genrule_test.go b/sdk/genrule_test.go
new file mode 100644
index 0000000..6e52a3d
--- /dev/null
+++ b/sdk/genrule_test.go
@@ -0,0 +1,52 @@
+// Copyright 2018 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package sdk
+
+import (
+	"testing"
+
+	"android/soong/android"
+	"android/soong/genrule"
+	"android/soong/java"
+)
+
+func TestSdkGenrule(t *testing.T) {
+	// Test that an sdk_genrule can depend on an sdk, and that a genrule can depend on an sdk_genrule
+	bp := `
+				sdk {
+					name: "my_sdk",
+				}
+				sdk_genrule {
+					name: "my_sdk_genrule",
+					tool_files: ["tool"],
+					cmd: "$(location tool) $(in) $(out)",
+					srcs: [":my_sdk"],
+					out: ["out"],
+				}
+				genrule {
+					name: "my_regular_genrule",
+					srcs: [":my_sdk_genrule"],
+					out: ["out"],
+					cmd: "cp $(in) $(out)",
+				}
+			`
+	android.GroupFixturePreparers(
+		// if java components aren't registered, the sdk module doesn't create a snapshot for some reason.
+		java.PrepareForTestWithJavaBuildComponents,
+		genrule.PrepareForTestWithGenRuleBuildComponents,
+		PrepareForTestWithSdkBuildComponents,
+		android.FixtureRegisterWithContext(registerGenRuleBuildComponents),
+	).RunTestWithBp(t, bp)
+}
diff --git a/sdk/sdk.go b/sdk/sdk.go
index 4d4a2a2..fd16ab6 100644
--- a/sdk/sdk.go
+++ b/sdk/sdk.go
@@ -222,6 +222,18 @@
 	}}
 }
 
+func (s *sdk) OutputFiles(tag string) (android.Paths, error) {
+	switch tag {
+	case "":
+		if s.snapshotFile.Valid() {
+			return []android.Path{s.snapshotFile.Path()}, nil
+		}
+		return nil, fmt.Errorf("snapshot file not defined. This is most likely because this isn't the common_os variant of this module")
+	default:
+		return nil, fmt.Errorf("unknown tag %q", tag)
+	}
+}
+
 // gatherTraits gathers the traits from the dynamically generated trait specific properties.
 //
 // Returns a map from member name to the set of required traits.
diff --git a/sh/sh_binary.go b/sh/sh_binary.go
index 1bebc60..1e27375 100644
--- a/sh/sh_binary.go
+++ b/sh/sh_binary.go
@@ -17,7 +17,6 @@
 import (
 	"fmt"
 	"path/filepath"
-	"sort"
 	"strings"
 
 	"android/soong/testing"
@@ -25,7 +24,6 @@
 	"github.com/google/blueprint/proptools"
 
 	"android/soong/android"
-	"android/soong/bazel"
 	"android/soong/cc"
 	"android/soong/snapshot"
 	"android/soong/tradefed"
@@ -156,7 +154,6 @@
 
 type ShBinary struct {
 	android.ModuleBase
-	android.BazelModuleBase
 
 	properties shBinaryProperties
 
@@ -174,7 +171,7 @@
 
 	installDir android.InstallPath
 
-	data       android.Paths
+	data       []android.DataPath
 	testConfig android.Path
 
 	dataModules map[string]android.Path
@@ -273,6 +270,7 @@
 		Output: s.outputFilePath,
 		Input:  s.sourceFilePath,
 	})
+	ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: []string{s.sourceFilePath.String()}})
 }
 
 func (s *ShBinary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
@@ -360,10 +358,21 @@
 		return
 	}
 	s.dataModules[relPath] = path
+	s.data = append(s.data, android.DataPath{SrcPath: path})
 }
 
 func (s *ShTest) GenerateAndroidBuildActions(ctx android.ModuleContext) {
 	s.ShBinary.generateAndroidBuildActions(ctx)
+
+	expandedData := android.PathsForModuleSrc(ctx, s.testProperties.Data)
+	// Emulate the data property for java_data dependencies.
+	for _, javaData := range ctx.GetDirectDepsWithTag(shTestJavaDataTag) {
+		expandedData = append(expandedData, android.OutputFilesForModule(ctx, javaData, "")...)
+	}
+	for _, d := range expandedData {
+		s.data = append(s.data, android.DataPath{SrcPath: d})
+	}
+
 	testDir := "nativetest"
 	if ctx.Target().Arch.ArchType.Multilib == "lib64" {
 		testDir = "nativetest64"
@@ -380,15 +389,6 @@
 	} else {
 		s.installDir = android.PathForModuleInstall(ctx, testDir, s.Name())
 	}
-	s.installedFile = ctx.InstallExecutable(s.installDir, s.outputFilePath.Base(), s.outputFilePath)
-
-	expandedData := android.PathsForModuleSrc(ctx, s.testProperties.Data)
-
-	// Emulate the data property for java_data dependencies.
-	for _, javaData := range ctx.GetDirectDepsWithTag(shTestJavaDataTag) {
-		expandedData = append(expandedData, android.OutputFilesForModule(ctx, javaData, "")...)
-	}
-	s.data = expandedData
 
 	var configs []tradefed.Config
 	if Bool(s.testProperties.Require_root) {
@@ -437,7 +437,7 @@
 				if _, exist := s.dataModules[relPath]; exist {
 					return
 				}
-				relocatedLib := android.PathForModuleOut(ctx, "relocated", relPath)
+				relocatedLib := android.PathForModuleOut(ctx, "relocated").Join(ctx, relPath)
 				ctx.Build(pctx, android.BuildParams{
 					Rule:   android.Cp,
 					Input:  cc.OutputFile().Path(),
@@ -453,6 +453,10 @@
 			ctx.PropertyErrorf(property, "%q of type %q is not supported", dep.Name(), ctx.OtherModuleType(dep))
 		}
 	})
+
+	installedData := ctx.InstallTestData(s.installDir, s.data)
+	s.installedFile = ctx.InstallExecutable(s.installDir, s.outputFilePath.Base(), s.outputFilePath, installedData...)
+
 	ctx.SetProvider(testing.TestModuleProviderKey, testing.TestModuleProviderData{})
 }
 
@@ -473,24 +477,6 @@
 				if s.testConfig != nil {
 					entries.SetPath("LOCAL_FULL_TEST_CONFIG", s.testConfig)
 				}
-				for _, d := range s.data {
-					rel := d.Rel()
-					path := d.String()
-					if !strings.HasSuffix(path, rel) {
-						panic(fmt.Errorf("path %q does not end with %q", path, rel))
-					}
-					path = strings.TrimSuffix(path, rel)
-					entries.AddStrings("LOCAL_TEST_DATA", path+":"+rel)
-				}
-				relPaths := make([]string, 0)
-				for relPath, _ := range s.dataModules {
-					relPaths = append(relPaths, relPath)
-				}
-				sort.Strings(relPaths)
-				for _, relPath := range relPaths {
-					dir := strings.TrimSuffix(s.dataModules[relPath].String(), relPath)
-					entries.AddStrings("LOCAL_TEST_DATA", dir+":"+relPath)
-				}
 				if s.testProperties.Data_bins != nil {
 					entries.AddStrings("LOCAL_TEST_DATA_BINS", s.testProperties.Data_bins...)
 				}
@@ -502,18 +488,15 @@
 	}}
 }
 
-func initShBinaryModule(s *ShBinary, useBazel bool) {
+func initShBinaryModule(s *ShBinary) {
 	s.AddProperties(&s.properties)
-	if useBazel {
-		android.InitBazelModule(s)
-	}
 }
 
 // sh_binary is for a shell script or batch file to be installed as an
 // executable binary to <partition>/bin.
 func ShBinaryFactory() android.Module {
 	module := &ShBinary{}
-	initShBinaryModule(module, true)
+	initShBinaryModule(module)
 	android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibFirst)
 	return module
 }
@@ -522,7 +505,7 @@
 // to $(HOST_OUT)/bin.
 func ShBinaryHostFactory() android.Module {
 	module := &ShBinary{}
-	initShBinaryModule(module, true)
+	initShBinaryModule(module)
 	android.InitAndroidArchModule(module, android.HostSupported, android.MultilibFirst)
 	return module
 }
@@ -530,7 +513,7 @@
 // sh_test defines a shell script based test module.
 func ShTestFactory() android.Module {
 	module := &ShTest{}
-	initShBinaryModule(&module.ShBinary, true)
+	initShBinaryModule(&module.ShBinary)
 	module.AddProperties(&module.testProperties)
 
 	android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibFirst)
@@ -540,7 +523,7 @@
 // sh_test_host defines a shell script based test module that runs on a host.
 func ShTestHostFactory() android.Module {
 	module := &ShTest{}
-	initShBinaryModule(&module.ShBinary, true)
+	initShBinaryModule(&module.ShBinary)
 	module.AddProperties(&module.testProperties)
 	// Default sh_test_host to unit_tests = true
 	if module.testProperties.Test_options.Unit_test == nil {
@@ -551,117 +534,6 @@
 	return module
 }
 
-type bazelShBinaryAttributes struct {
-	Srcs     bazel.LabelListAttribute
-	Filename *string
-	Sub_dir  *string
-	// Bazel also supports the attributes below, but (so far) these are not required for Bionic
-	// deps
-	// data
-	// args
-	// compatible_with
-	// deprecation
-	// distribs
-	// env
-	// exec_compatible_with
-	// exec_properties
-	// features
-	// licenses
-	// output_licenses
-	// restricted_to
-	// tags
-	// target_compatible_with
-	// testonly
-	// toolchains
-	// visibility
-}
-
-type bazelShTestAttributes struct {
-	Srcs      bazel.LabelListAttribute
-	Data      bazel.LabelListAttribute
-	Data_bins bazel.LabelListAttribute
-	Tags      bazel.StringListAttribute
-	Runs_on   bazel.StringListAttribute
-	tradefed.TestConfigAttributes
-}
-
-func (m *ShBinary) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	srcs := bazel.MakeLabelListAttribute(
-		android.BazelLabelForModuleSrc(ctx, []string{*m.properties.Src}))
-
-	var filename *string
-	if m.properties.Filename != nil {
-		filename = m.properties.Filename
-	}
-
-	var subDir *string
-	if m.properties.Sub_dir != nil {
-		subDir = m.properties.Sub_dir
-	}
-
-	attrs := &bazelShBinaryAttributes{
-		Srcs:     srcs,
-		Filename: filename,
-		Sub_dir:  subDir,
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "sh_binary",
-		Bzl_load_location: "//build/bazel/rules:sh_binary.bzl",
-	}
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: m.Name()}, attrs)
-}
-
-func (m *ShTest) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	srcs := bazel.MakeLabelListAttribute(
-		android.BazelLabelForModuleSrc(ctx, []string{*m.properties.Src}))
-
-	dataBins := bazel.MakeLabelListAttribute(android.BazelLabelForModuleDeps(ctx, m.testProperties.Data_bins))
-
-	var combinedData bazel.LabelList
-	combinedData.Append(android.BazelLabelForModuleSrc(ctx, m.testProperties.Data))
-	combinedData.Append(android.BazelLabelForModuleDeps(ctx, m.testProperties.Data_bins))
-	combinedData.Append(android.BazelLabelForModuleDeps(ctx, m.testProperties.Data_libs))
-	data := bazel.MakeLabelListAttribute(combinedData)
-
-	tags := bazel.MakeStringListAttribute(
-		m.testProperties.Test_options.Tags)
-
-	testConfigAttributes := tradefed.GetTestConfigAttributes(
-		ctx,
-		m.testProperties.Test_config,
-		[]string{},
-		m.testProperties.Auto_gen_config,
-		m.testProperties.Test_suites,
-		m.testProperties.Test_config_template,
-		nil,
-		nil,
-	)
-
-	unitTest := m.testProperties.Test_options.Unit_test
-
-	runs_on := bazel.MakeStringListAttribute(android.RunsOn(
-		m.ModuleBase.HostSupported(),
-		m.ModuleBase.DeviceSupported(),
-		(unitTest != nil && *unitTest)))
-
-	attrs := &bazelShTestAttributes{
-		Srcs:                 srcs,
-		Data:                 data,
-		Data_bins:            dataBins,
-		Tags:                 tags,
-		Runs_on:              runs_on,
-		TestConfigAttributes: testConfigAttributes,
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "sh_test",
-		Bzl_load_location: "//build/bazel/rules:sh_test.bzl",
-	}
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: m.Name()}, attrs)
-}
-
 var Bool = proptools.Bool
 
 var _ snapshot.RelativeInstallPath = (*ShBinary)(nil)
diff --git a/sh/sh_binary_test.go b/sh/sh_binary_test.go
index 5fcb58d..37450b0 100644
--- a/sh/sh_binary_test.go
+++ b/sh/sh_binary_test.go
@@ -135,7 +135,7 @@
 		if arch == "darwin_x86_64" {
 			libExt = ".dylib"
 		}
-		relocated := variant.Output("relocated/lib64/libbar" + libExt)
+		relocated := variant.Output(filepath.Join("out/soong/.intermediates/foo", arch, "relocated/lib64/libbar"+libExt))
 		expectedInput := "out/soong/.intermediates/libbar/" + arch + "_shared/libbar" + libExt
 		android.AssertPathRelativeToTopEquals(t, "relocation input", expectedInput, relocated.Input)
 
@@ -204,18 +204,19 @@
 	`)
 
 	buildOS := config.BuildOS.String()
-	variant := ctx.ModuleForTests("foo", buildOS+"_x86_64")
+	variant := buildOS + "_x86_64"
+	foo := ctx.ModuleForTests("foo", variant)
 
-	relocated := variant.Output("relocated/lib64/libbar.so")
+	relocated := foo.Output(filepath.Join("out/soong/.intermediates/foo", variant, "relocated/lib64/libbar.so"))
 	expectedInput := "out/soong/.intermediates/libbar/android_arm64_armv8-a_shared/libbar.so"
 	android.AssertPathRelativeToTopEquals(t, "relocation input", expectedInput, relocated.Input)
 
-	mod := variant.Module().(*ShTest)
+	mod := foo.Module().(*ShTest)
 	entries := android.AndroidMkEntriesForTest(t, ctx, mod)[0]
 	expectedData := []string{
 		"out/soong/.intermediates/bar/android_arm64_armv8-a/:bar",
 		// libbar has been relocated, and so has a variant that matches the host arch.
-		"out/soong/.intermediates/foo/" + buildOS + "_x86_64/relocated/:lib64/libbar.so",
+		"out/soong/.intermediates/foo/" + variant + "/relocated/:lib64/libbar.so",
 	}
 	actualData := entries.EntryMap["LOCAL_TEST_DATA"]
 	android.AssertStringPathsRelativeToTopEquals(t, "LOCAL_TEST_DATA", config, expectedData, actualData)
diff --git a/sysprop/Android.bp b/sysprop/Android.bp
index 7f51000..1d5eb31 100644
--- a/sysprop/Android.bp
+++ b/sysprop/Android.bp
@@ -9,10 +9,8 @@
         "blueprint",
         "soong",
         "soong-android",
-        "soong-bp2build",
         "soong-cc",
         "soong-java",
-        "soong-sysprop-bp2build",
     ],
     srcs: [
         "sysprop_library.go",
@@ -20,7 +18,6 @@
     ],
     testSrcs: [
         "sysprop_test.go",
-        "sysprop_library_conversion_test.go",
     ],
     pluginFor: ["soong_build"],
 }
diff --git a/sysprop/bp2build/Android.bp b/sysprop/bp2build/Android.bp
deleted file mode 100644
index 1b9eda8..0000000
--- a/sysprop/bp2build/Android.bp
+++ /dev/null
@@ -1,16 +0,0 @@
-package {
-    default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-bootstrap_go_package {
-    name: "soong-sysprop-bp2build",
-    pkgPath: "android/soong/sysprop/bp2build",
-    deps: [
-        "soong-android",
-        "soong-bazel",
-    ],
-    srcs: [
-        "bp2build.go",
-    ],
-    pluginFor: ["soong_build"],
-}
diff --git a/sysprop/bp2build/bp2build.go b/sysprop/bp2build/bp2build.go
deleted file mode 100644
index 18991de..0000000
--- a/sysprop/bp2build/bp2build.go
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright (C) 2019 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package bp2build
-
-import (
-	"android/soong/android"
-	"android/soong/bazel"
-)
-
-type SyspropLibraryLabels struct {
-	SyspropLibraryLabel  string
-	CcSharedLibraryLabel string
-	CcStaticLibraryLabel string
-	JavaLibraryLabel     string
-}
-
-// TODO(b/240463568): Additional properties will be added for API validation
-type bazelSyspropLibraryAttributes struct {
-	Srcs bazel.LabelListAttribute
-	Tags bazel.StringListAttribute
-}
-
-func Bp2buildBaseSyspropLibrary(ctx android.Bp2buildMutatorContext, name string, srcs bazel.LabelListAttribute) {
-	apexAvailableTags := android.ApexAvailableTagsWithoutTestApexes(ctx.(android.Bp2buildMutatorContext), ctx.Module())
-
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "sysprop_library",
-			Bzl_load_location: "//build/bazel/rules/sysprop:sysprop_library.bzl",
-		},
-		android.CommonAttributes{Name: name},
-		&bazelSyspropLibraryAttributes{
-			Srcs: srcs,
-			Tags: apexAvailableTags,
-		},
-	)
-}
-
-type bazelCcSyspropLibraryAttributes struct {
-	Dep             bazel.LabelAttribute
-	Min_sdk_version *string
-	Tags            bazel.StringListAttribute
-}
-
-func Bp2buildSyspropCc(ctx android.Bp2buildMutatorContext, labels SyspropLibraryLabels, minSdkVersion *string) {
-	apexAvailableTags := android.ApexAvailableTagsWithoutTestApexes(ctx.(android.Bp2buildMutatorContext), ctx.Module())
-
-	attrs := &bazelCcSyspropLibraryAttributes{
-		Dep:             *bazel.MakeLabelAttribute(":" + labels.SyspropLibraryLabel),
-		Min_sdk_version: minSdkVersion,
-		Tags:            apexAvailableTags,
-	}
-
-	if labels.CcSharedLibraryLabel != "" {
-		ctx.CreateBazelTargetModule(
-			bazel.BazelTargetModuleProperties{
-				Rule_class:        "cc_sysprop_library_shared",
-				Bzl_load_location: "//build/bazel/rules/cc:cc_sysprop_library.bzl",
-			},
-			android.CommonAttributes{Name: labels.CcSharedLibraryLabel},
-			attrs)
-	}
-	if labels.CcStaticLibraryLabel != "" {
-		ctx.CreateBazelTargetModule(
-			bazel.BazelTargetModuleProperties{
-				Rule_class:        "cc_sysprop_library_static",
-				Bzl_load_location: "//build/bazel/rules/cc:cc_sysprop_library.bzl",
-			},
-			android.CommonAttributes{Name: labels.CcStaticLibraryLabel},
-			attrs)
-	}
-}
-
-type bazelJavaLibraryAttributes struct {
-	Dep             bazel.LabelAttribute
-	Min_sdk_version *string
-	Tags            bazel.StringListAttribute
-}
-
-func Bp2buildSyspropJava(ctx android.Bp2buildMutatorContext, labels SyspropLibraryLabels, minSdkVersion *string) {
-	apexAvailableTags := android.ApexAvailableTagsWithoutTestApexes(ctx.(android.Bp2buildMutatorContext), ctx.Module())
-
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "java_sysprop_library",
-			Bzl_load_location: "//build/bazel/rules/java:java_sysprop_library.bzl",
-		},
-		android.CommonAttributes{Name: labels.JavaLibraryLabel},
-		&bazelJavaLibraryAttributes{
-			Dep:             *bazel.MakeLabelAttribute(":" + labels.SyspropLibraryLabel),
-			Min_sdk_version: minSdkVersion,
-			Tags:            apexAvailableTags,
-		})
-}
diff --git a/sysprop/sysprop_library.go b/sysprop/sysprop_library.go
index 8bf5f14..c89c6b0 100644
--- a/sysprop/sysprop_library.go
+++ b/sysprop/sysprop_library.go
@@ -23,10 +23,6 @@
 	"path"
 	"sync"
 
-	"android/soong/bazel"
-	"android/soong/sysprop/bp2build"
-	"android/soong/ui/metrics/bp2build_metrics_proto"
-
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/proptools"
 
@@ -129,7 +125,6 @@
 type syspropLibrary struct {
 	android.ModuleBase
 	android.ApexModuleBase
-	android.BazelModuleBase
 
 	properties syspropLibraryProperties
 
@@ -238,10 +233,6 @@
 	return m.BaseModuleName() + "_java_gen_public"
 }
 
-func (m *syspropLibrary) bp2buildJavaImplementationModuleName() string {
-	return m.BaseModuleName() + "_java_library"
-}
-
 func (m *syspropLibrary) BaseModuleName() string {
 	return m.ModuleBase.Name()
 }
@@ -254,12 +245,13 @@
 // generated java_library will depend on these API files.
 func (m *syspropLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
 	baseModuleName := m.BaseModuleName()
-
-	for _, syspropFile := range android.PathsForModuleSrc(ctx, m.properties.Srcs) {
+	srcs := android.PathsForModuleSrc(ctx, m.properties.Srcs)
+	for _, syspropFile := range srcs {
 		if syspropFile.Ext() != ".sysprop" {
 			ctx.PropertyErrorf("srcs", "srcs contains non-sysprop file %q", syspropFile.String())
 		}
 	}
+	ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: srcs.Strings()})
 
 	if ctx.Failed() {
 		return
@@ -277,7 +269,7 @@
 	rule.Command().
 		BuiltTool("sysprop_api_dump").
 		Output(m.dumpedApiFile).
-		Inputs(android.PathsForModuleSrc(ctx, m.properties.Srcs))
+		Inputs(srcs)
 	rule.Build(baseModuleName+"_api_dump", baseModuleName+" api dump")
 
 	// check API rule
@@ -389,7 +381,6 @@
 	)
 	android.InitAndroidModule(m)
 	android.InitApexModule(m)
-	android.InitBazelModule(m)
 	android.AddLoadHook(m, func(ctx android.LoadHookContext) { syspropLibraryHook(ctx, m) })
 	return m
 }
@@ -423,9 +414,6 @@
 	Min_sdk_version    *string
 	Cflags             []string
 	Ldflags            []string
-	Bazel_module       struct {
-		Label *string
-	}
 }
 
 type javaLibraryProperties struct {
@@ -442,10 +430,6 @@
 	SyspropPublicStub string
 	Apex_available    []string
 	Min_sdk_version   *string
-	Bazel_module      struct {
-		Bp2build_available *bool
-		Label              *string
-	}
 }
 
 func syspropLibraryHook(ctx android.LoadHookContext, m *syspropLibrary) {
@@ -491,14 +475,6 @@
 			"Unknown value %s: must be one of Platform, Vendor or Odm", m.Owner())
 	}
 
-	var label *string
-	if b, ok := ctx.Module().(android.Bazelable); ok && b.ShouldConvertWithBp2build(ctx) {
-		// TODO: b/295566168 - this will need to change once build files are checked in to account for
-		// checked in modules in mixed builds
-		label = proptools.StringPtr(
-			fmt.Sprintf("//%s:%s", ctx.ModuleDir(), m.CcImplementationModuleName()))
-	}
-
 	// Generate a C++ implementation library.
 	// cc_library can receive *.sysprop files as their srcs, generating sources itself.
 	ccProps := ccLibraryProperties{}
@@ -520,7 +496,6 @@
 	ccProps.Min_sdk_version = m.properties.Cpp.Min_sdk_version
 	ccProps.Cflags = m.properties.Cpp.Cflags
 	ccProps.Ldflags = m.properties.Cpp.Ldflags
-	ccProps.Bazel_module.Label = label
 	ctx.CreateModule(cc.LibraryFactory, &ccProps)
 
 	scope := "internal"
@@ -565,13 +540,6 @@
 		SyspropPublicStub: publicStub,
 		Apex_available:    m.ApexProperties.Apex_available,
 		Min_sdk_version:   m.properties.Java.Min_sdk_version,
-		Bazel_module: struct {
-			Bp2build_available *bool
-			Label              *string
-		}{
-			Label: proptools.StringPtr(
-				fmt.Sprintf("//%s:%s", ctx.ModuleDir(), m.bp2buildJavaImplementationModuleName())),
-		},
 	})
 
 	if publicStub != "" {
@@ -589,12 +557,6 @@
 			Sdk_version: proptools.StringPtr("core_current"),
 			Libs:        []string{javaSyspropStub},
 			Stem:        proptools.StringPtr(m.BaseModuleName()),
-			Bazel_module: struct {
-				Bp2build_available *bool
-				Label              *string
-			}{
-				Bp2build_available: proptools.BoolPtr(false),
-			},
 		})
 	}
 
@@ -608,20 +570,3 @@
 		*libraries = append(*libraries, "//"+ctx.ModuleDir()+":"+ctx.ModuleName())
 	}
 }
-
-// TODO(b/240463568): Additional properties will be added for API validation
-func (m *syspropLibrary) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	if m.Owner() != "Platform" {
-		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_UNSUPPORTED, "Only sysprop libraries owned by platform are supported at this time")
-		return
-	}
-	labels := bp2build.SyspropLibraryLabels{
-		SyspropLibraryLabel:  m.BaseModuleName(),
-		CcSharedLibraryLabel: m.CcImplementationModuleName(),
-		CcStaticLibraryLabel: cc.BazelLabelNameForStaticModule(m.CcImplementationModuleName()),
-		JavaLibraryLabel:     m.bp2buildJavaImplementationModuleName(),
-	}
-	bp2build.Bp2buildBaseSyspropLibrary(ctx, labels.SyspropLibraryLabel, bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, m.properties.Srcs)))
-	bp2build.Bp2buildSyspropCc(ctx, labels, m.properties.Cpp.Min_sdk_version)
-	bp2build.Bp2buildSyspropJava(ctx, labels, m.properties.Java.Min_sdk_version)
-}
diff --git a/sysprop/sysprop_library_conversion_test.go b/sysprop/sysprop_library_conversion_test.go
deleted file mode 100644
index dabcc92..0000000
--- a/sysprop/sysprop_library_conversion_test.go
+++ /dev/null
@@ -1,195 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package sysprop
-
-import (
-	"testing"
-
-	"android/soong/bp2build"
-)
-
-func TestSyspropLibrarySimple(t *testing.T) {
-	bp2build.RunBp2BuildTestCaseSimple(t, bp2build.Bp2buildTestCase{
-		Description:                "sysprop_library simple",
-		ModuleTypeUnderTest:        "sysprop_library",
-		ModuleTypeUnderTestFactory: syspropLibraryFactory,
-		Filesystem: map[string]string{
-			"foo.sysprop": "",
-			"bar.sysprop": "",
-		},
-		Blueprint: `
-sysprop_library {
-	name: "sysprop_foo",
-	srcs: [
-		"foo.sysprop",
-		"bar.sysprop",
-	],
-	property_owner: "Platform",
-}
-`,
-		ExpectedBazelTargets: []string{
-			bp2build.MakeBazelTargetNoRestrictions("sysprop_library",
-				"sysprop_foo",
-				bp2build.AttrNameToString{
-					"srcs": `[
-        "foo.sysprop",
-        "bar.sysprop",
-    ]`,
-				}),
-			bp2build.MakeBazelTargetNoRestrictions("cc_sysprop_library_shared",
-				"libsysprop_foo",
-				bp2build.AttrNameToString{
-					"dep": `":sysprop_foo"`,
-				}),
-			bp2build.MakeBazelTargetNoRestrictions("cc_sysprop_library_static",
-				"libsysprop_foo_bp2build_cc_library_static",
-				bp2build.AttrNameToString{
-					"dep": `":sysprop_foo"`,
-				}),
-			bp2build.MakeBazelTargetNoRestrictions("java_sysprop_library",
-				"sysprop_foo_java_library",
-				bp2build.AttrNameToString{
-					"dep": `":sysprop_foo"`,
-				}),
-		},
-	})
-}
-
-func TestSyspropLibraryCppMinSdkVersion(t *testing.T) {
-	bp2build.RunBp2BuildTestCaseSimple(t, bp2build.Bp2buildTestCase{
-		Description:                "sysprop_library with cpp min_sdk_version",
-		ModuleTypeUnderTest:        "sysprop_library",
-		ModuleTypeUnderTestFactory: syspropLibraryFactory,
-		Filesystem: map[string]string{
-			"foo.sysprop": "",
-			"bar.sysprop": "",
-		},
-		Blueprint: `
-sysprop_library {
-	name: "sysprop_foo",
-	srcs: [
-		"foo.sysprop",
-		"bar.sysprop",
-	],
-	cpp: {
-		min_sdk_version: "5",
-	},
-	property_owner: "Platform",
-}
-`,
-		ExpectedBazelTargets: []string{
-			bp2build.MakeBazelTargetNoRestrictions("sysprop_library",
-				"sysprop_foo",
-				bp2build.AttrNameToString{
-					"srcs": `[
-        "foo.sysprop",
-        "bar.sysprop",
-    ]`,
-				}),
-			bp2build.MakeBazelTargetNoRestrictions("cc_sysprop_library_shared",
-				"libsysprop_foo",
-				bp2build.AttrNameToString{
-					"dep":             `":sysprop_foo"`,
-					"min_sdk_version": `"5"`,
-				}),
-			bp2build.MakeBazelTargetNoRestrictions("cc_sysprop_library_static",
-				"libsysprop_foo_bp2build_cc_library_static",
-				bp2build.AttrNameToString{
-					"dep":             `":sysprop_foo"`,
-					"min_sdk_version": `"5"`,
-				}),
-			bp2build.MakeBazelTargetNoRestrictions("java_sysprop_library",
-				"sysprop_foo_java_library",
-				bp2build.AttrNameToString{
-					"dep": `":sysprop_foo"`,
-				}),
-		},
-	})
-}
-
-func TestSyspropLibraryJavaMinSdkVersion(t *testing.T) {
-	bp2build.RunBp2BuildTestCaseSimple(t, bp2build.Bp2buildTestCase{
-		Description:                "sysprop_library with java min_sdk_version",
-		ModuleTypeUnderTest:        "sysprop_library",
-		ModuleTypeUnderTestFactory: syspropLibraryFactory,
-		Filesystem: map[string]string{
-			"foo.sysprop": "",
-			"bar.sysprop": "",
-		},
-		Blueprint: `
-sysprop_library {
-	name: "sysprop_foo",
-	srcs: [
-		"foo.sysprop",
-		"bar.sysprop",
-	],
-	java: {
-		min_sdk_version: "5",
-	},
-	property_owner: "Platform",
-}
-`,
-		ExpectedBazelTargets: []string{
-			bp2build.MakeBazelTargetNoRestrictions("sysprop_library",
-				"sysprop_foo",
-				bp2build.AttrNameToString{
-					"srcs": `[
-        "foo.sysprop",
-        "bar.sysprop",
-    ]`,
-				}),
-			bp2build.MakeBazelTargetNoRestrictions("cc_sysprop_library_shared",
-				"libsysprop_foo",
-				bp2build.AttrNameToString{
-					"dep": `":sysprop_foo"`,
-				}),
-			bp2build.MakeBazelTargetNoRestrictions("cc_sysprop_library_static",
-				"libsysprop_foo_bp2build_cc_library_static",
-				bp2build.AttrNameToString{
-					"dep": `":sysprop_foo"`,
-				}),
-			bp2build.MakeBazelTargetNoRestrictions("java_sysprop_library",
-				"sysprop_foo_java_library",
-				bp2build.AttrNameToString{
-					"dep":             `":sysprop_foo"`,
-					"min_sdk_version": `"5"`,
-				}),
-		},
-	})
-}
-
-func TestSyspropLibraryOwnerNotPlatformUnconvertible(t *testing.T) {
-	bp2build.RunBp2BuildTestCaseSimple(t, bp2build.Bp2buildTestCase{
-		Description:                "sysprop_library simple",
-		ModuleTypeUnderTest:        "sysprop_library",
-		ModuleTypeUnderTestFactory: syspropLibraryFactory,
-		Filesystem: map[string]string{
-			"foo.sysprop": "",
-			"bar.sysprop": "",
-		},
-		Blueprint: `
-sysprop_library {
-	name: "sysprop_foo",
-	srcs: [
-		"foo.sysprop",
-		"bar.sysprop",
-	],
-	property_owner: "Vendor",
-	device_specific: true,
-}
-`,
-		ExpectedBazelTargets: []string{},
-	})
-}
diff --git a/testing/Android.bp b/testing/Android.bp
index 18dccb3..43040b0 100644
--- a/testing/Android.bp
+++ b/testing/Android.bp
@@ -8,11 +8,14 @@
     deps: [
         "blueprint",
         "soong-android",
+        "soong-testing-code_metadata_internal_proto",
         "soong-testing-test_spec_proto",
 
     ],
     srcs: [
+        "all_code_metadata.go",
         "all_test_specs.go",
+        "code_metadata.go",
         "test_spec.go",
         "init.go",
         "test.go",
diff --git a/testing/OWNERS b/testing/OWNERS
new file mode 100644
index 0000000..03bcdf1
--- /dev/null
+++ b/testing/OWNERS
@@ -0,0 +1,4 @@
+dariofreni@google.com
+joeo@google.com
+ronish@google.com
+caditya@google.com
diff --git a/testing/all_code_metadata.go b/testing/all_code_metadata.go
new file mode 100644
index 0000000..16d7aae
--- /dev/null
+++ b/testing/all_code_metadata.go
@@ -0,0 +1,51 @@
+package testing
+
+import (
+	"android/soong/android"
+)
+
+const fileContainingCodeMetadataFilePaths = "all_code_metadata_paths.rsp"
+const allCodeMetadataFile = "all_code_metadata.pb"
+
+func AllCodeMetadataFactory() android.Singleton {
+	return &allCodeMetadataSingleton{}
+}
+
+type allCodeMetadataSingleton struct {
+	// Path where the collected metadata is stored after successful validation.
+	outputPath android.OutputPath
+}
+
+func (this *allCodeMetadataSingleton) GenerateBuildActions(ctx android.SingletonContext) {
+	var intermediateMetadataPaths android.Paths
+
+	ctx.VisitAllModules(
+		func(module android.Module) {
+			if !ctx.ModuleHasProvider(module, CodeMetadataProviderKey) {
+				return
+			}
+			intermediateMetadataPaths = append(
+				intermediateMetadataPaths, ctx.ModuleProvider(
+					module, CodeMetadataProviderKey,
+				).(CodeMetadataProviderData).IntermediatePath,
+			)
+		},
+	)
+
+	rspFile := android.PathForOutput(ctx, fileContainingCodeMetadataFilePaths)
+	this.outputPath = android.PathForOutput(ctx, ownershipDirectory, allCodeMetadataFile)
+
+	rule := android.NewRuleBuilder(pctx, ctx)
+	cmd := rule.Command().
+		BuiltTool("metadata").
+		FlagWithArg("-rule ", "code_metadata").
+		FlagWithRspFileInputList("-inputFile ", rspFile, intermediateMetadataPaths)
+	cmd.FlagWithOutput("-outputFile ", this.outputPath)
+	rule.Build("all_code_metadata_rule", "Generate all code metadata")
+
+	ctx.Phony("all_code_metadata", this.outputPath)
+}
+
+func (this *allCodeMetadataSingleton) MakeVars(ctx android.MakeVarsContext) {
+	ctx.DistForGoal("code_metadata", this.outputPath)
+}
diff --git a/testing/code_metadata.go b/testing/code_metadata.go
new file mode 100644
index 0000000..9e20ec6
--- /dev/null
+++ b/testing/code_metadata.go
@@ -0,0 +1,138 @@
+// Copyright 2020 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package testing
+
+import (
+	"path/filepath"
+
+	"android/soong/android"
+	"android/soong/testing/code_metadata_internal_proto"
+	"github.com/google/blueprint"
+	"google.golang.org/protobuf/proto"
+)
+
+func CodeMetadataFactory() android.Module {
+	module := &CodeMetadataModule{}
+
+	android.InitAndroidModule(module)
+	android.InitDefaultableModule(module)
+	module.AddProperties(&module.properties)
+
+	return module
+}
+
+type CodeMetadataModule struct {
+	android.ModuleBase
+	android.DefaultableModuleBase
+
+	// Properties for "code_metadata"
+	properties struct {
+		// Specifies the name of the code_config.
+		Name string
+		// Specifies the team ID.
+		TeamId string
+		// Specifies the list of modules that this code_metadata covers.
+		Code []string
+		// An optional field to specify if multiple ownerships for source files is allowed.
+		MultiOwnership bool
+	}
+}
+
+type codeDepTagType struct {
+	blueprint.BaseDependencyTag
+}
+
+var codeDepTag = codeDepTagType{}
+
+func (module *CodeMetadataModule) DepsMutator(ctx android.BottomUpMutatorContext) {
+	// Validate Properties
+	if len(module.properties.TeamId) == 0 {
+		ctx.PropertyErrorf(
+			"TeamId",
+			"Team Id not found in the code_metadata module. Hint: Maybe the teamId property hasn't been properly specified.",
+		)
+	}
+	if !isInt(module.properties.TeamId) {
+		ctx.PropertyErrorf(
+			"TeamId", "Invalid value for Team ID. The Team ID must be an integer.",
+		)
+	}
+	if len(module.properties.Code) == 0 {
+		ctx.PropertyErrorf(
+			"Code",
+			"Targets to be attributed cannot be empty. Hint: Maybe the code property hasn't been properly specified.",
+		)
+	}
+	ctx.AddDependency(ctx.Module(), codeDepTag, module.properties.Code...)
+}
+
+// Provider published by CodeMetadata
+type CodeMetadataProviderData struct {
+	IntermediatePath android.WritablePath
+}
+
+var CodeMetadataProviderKey = blueprint.NewProvider(CodeMetadataProviderData{})
+
+func (module *CodeMetadataModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
+	metadataList := make(
+		[]*code_metadata_internal_proto.CodeMetadataInternal_TargetOwnership, 0,
+		len(module.properties.Code),
+	)
+	bpFilePath := filepath.Join(ctx.ModuleDir(), ctx.BlueprintsFile())
+
+	for _, m := range ctx.GetDirectDepsWithTag(codeDepTag) {
+		targetName := m.Name()
+		var moduleSrcs []string
+		if ctx.OtherModuleHasProvider(m, blueprint.SrcsFileProviderKey) {
+			moduleSrcs = ctx.OtherModuleProvider(
+				m, blueprint.SrcsFileProviderKey,
+			).(blueprint.SrcsFileProviderData).SrcPaths
+		}
+		if module.properties.MultiOwnership {
+			metadata := &code_metadata_internal_proto.CodeMetadataInternal_TargetOwnership{
+				TargetName:     &targetName,
+				TrendyTeamId:   &module.properties.TeamId,
+				Path:           &bpFilePath,
+				MultiOwnership: &module.properties.MultiOwnership,
+				SourceFiles:    moduleSrcs,
+			}
+			metadataList = append(metadataList, metadata)
+		} else {
+			metadata := &code_metadata_internal_proto.CodeMetadataInternal_TargetOwnership{
+				TargetName:   &targetName,
+				TrendyTeamId: &module.properties.TeamId,
+				Path:         &bpFilePath,
+				SourceFiles:  moduleSrcs,
+			}
+			metadataList = append(metadataList, metadata)
+		}
+
+	}
+	codeMetadata := &code_metadata_internal_proto.CodeMetadataInternal{TargetOwnershipList: metadataList}
+	protoData, err := proto.Marshal(codeMetadata)
+	if err != nil {
+		ctx.ModuleErrorf("Error marshaling code metadata: %s", err.Error())
+		return
+	}
+	intermediatePath := android.PathForModuleOut(
+		ctx, "intermediateCodeMetadata.pb",
+	)
+	android.WriteFileRule(ctx, intermediatePath, string(protoData))
+
+	ctx.SetProvider(
+		CodeMetadataProviderKey,
+		CodeMetadataProviderData{IntermediatePath: intermediatePath},
+	)
+}
diff --git a/testing/code_metadata_internal_proto/Android.bp b/testing/code_metadata_internal_proto/Android.bp
new file mode 100644
index 0000000..a534cc2
--- /dev/null
+++ b/testing/code_metadata_internal_proto/Android.bp
@@ -0,0 +1,29 @@
+// Copyright 2022 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+bootstrap_go_package {
+    name: "soong-testing-code_metadata_internal_proto",
+    pkgPath: "android/soong/testing/code_metadata_internal_proto",
+    deps: [
+            "golang-protobuf-reflect-protoreflect",
+            "golang-protobuf-runtime-protoimpl",
+        ],
+    srcs: [
+        "code_metadata_internal.pb.go",
+    ],
+}
diff --git a/testing/code_metadata_internal_proto/OWNERS b/testing/code_metadata_internal_proto/OWNERS
new file mode 100644
index 0000000..03bcdf1
--- /dev/null
+++ b/testing/code_metadata_internal_proto/OWNERS
@@ -0,0 +1,4 @@
+dariofreni@google.com
+joeo@google.com
+ronish@google.com
+caditya@google.com
diff --git a/testing/code_metadata_internal_proto/code_metadata_internal.pb.go b/testing/code_metadata_internal_proto/code_metadata_internal.pb.go
new file mode 100644
index 0000000..ecb8b86
--- /dev/null
+++ b/testing/code_metadata_internal_proto/code_metadata_internal.pb.go
@@ -0,0 +1,277 @@
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// 	protoc-gen-go v1.30.0
+// 	protoc        v3.21.12
+// source: code_metadata_internal.proto
+
+package code_metadata_internal_proto
+
+import (
+	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
+	sync "sync"
+)
+
+const (
+	// Verify that this generated code is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+	// Verify that runtime/protoimpl is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type CodeMetadataInternal struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	// List of all code targets and their metadata.
+	TargetOwnershipList []*CodeMetadataInternal_TargetOwnership `protobuf:"bytes,1,rep,name=target_ownership_list,json=targetOwnershipList" json:"target_ownership_list,omitempty"`
+}
+
+func (x *CodeMetadataInternal) Reset() {
+	*x = CodeMetadataInternal{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_code_metadata_internal_proto_msgTypes[0]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *CodeMetadataInternal) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CodeMetadataInternal) ProtoMessage() {}
+
+func (x *CodeMetadataInternal) ProtoReflect() protoreflect.Message {
+	mi := &file_code_metadata_internal_proto_msgTypes[0]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use CodeMetadataInternal.ProtoReflect.Descriptor instead.
+func (*CodeMetadataInternal) Descriptor() ([]byte, []int) {
+	return file_code_metadata_internal_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *CodeMetadataInternal) GetTargetOwnershipList() []*CodeMetadataInternal_TargetOwnership {
+	if x != nil {
+		return x.TargetOwnershipList
+	}
+	return nil
+}
+
+type CodeMetadataInternal_TargetOwnership struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	// REQUIRED: Name of the build target
+	TargetName *string `protobuf:"bytes,1,opt,name=target_name,json=targetName" json:"target_name,omitempty"`
+	// REQUIRED: Code location of the target.
+	// To be used to support legacy/backup systems that use OWNERS file and is
+	// also required for our dashboard to support per code location basis UI
+	Path *string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"`
+	// REQUIRED: Team ID of the team that owns this target.
+	TrendyTeamId *string `protobuf:"bytes,3,opt,name=trendy_team_id,json=trendyTeamId" json:"trendy_team_id,omitempty"`
+	// OPTIONAL: The src files of the target.
+	// To be used to determine ownership of a file for ownership
+	SourceFiles []string `protobuf:"bytes,4,rep,name=source_files,json=sourceFiles" json:"source_files,omitempty"`
+	// OPTIONAL: Specify if multiple ownerships of the source files are allowed.
+	MultiOwnership *bool `protobuf:"varint,5,opt,name=multi_ownership,json=multiOwnership" json:"multi_ownership,omitempty"`
+}
+
+func (x *CodeMetadataInternal_TargetOwnership) Reset() {
+	*x = CodeMetadataInternal_TargetOwnership{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_code_metadata_internal_proto_msgTypes[1]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *CodeMetadataInternal_TargetOwnership) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CodeMetadataInternal_TargetOwnership) ProtoMessage() {}
+
+func (x *CodeMetadataInternal_TargetOwnership) ProtoReflect() protoreflect.Message {
+	mi := &file_code_metadata_internal_proto_msgTypes[1]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use CodeMetadataInternal_TargetOwnership.ProtoReflect.Descriptor instead.
+func (*CodeMetadataInternal_TargetOwnership) Descriptor() ([]byte, []int) {
+	return file_code_metadata_internal_proto_rawDescGZIP(), []int{0, 0}
+}
+
+func (x *CodeMetadataInternal_TargetOwnership) GetTargetName() string {
+	if x != nil && x.TargetName != nil {
+		return *x.TargetName
+	}
+	return ""
+}
+
+func (x *CodeMetadataInternal_TargetOwnership) GetPath() string {
+	if x != nil && x.Path != nil {
+		return *x.Path
+	}
+	return ""
+}
+
+func (x *CodeMetadataInternal_TargetOwnership) GetTrendyTeamId() string {
+	if x != nil && x.TrendyTeamId != nil {
+		return *x.TrendyTeamId
+	}
+	return ""
+}
+
+func (x *CodeMetadataInternal_TargetOwnership) GetSourceFiles() []string {
+	if x != nil {
+		return x.SourceFiles
+	}
+	return nil
+}
+
+func (x *CodeMetadataInternal_TargetOwnership) GetMultiOwnership() bool {
+	if x != nil && x.MultiOwnership != nil {
+		return *x.MultiOwnership
+	}
+	return false
+}
+
+var File_code_metadata_internal_proto protoreflect.FileDescriptor
+
+var file_code_metadata_internal_proto_rawDesc = []byte{
+	0x0a, 0x1c, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f,
+	0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1c,
+	0x63, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x69, 0x6e,
+	0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc9, 0x02, 0x0a,
+	0x14, 0x43, 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x49, 0x6e, 0x74,
+	0x65, 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x76, 0x0a, 0x15, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f,
+	0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01,
+	0x20, 0x03, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61,
+	0x64, 0x61, 0x74, 0x61, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72,
+	0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
+	0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4f,
+	0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x13, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,
+	0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0xb8, 0x01,
+	0x0a, 0x0f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69,
+	0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61,
+	0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x79,
+	0x5f, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c,
+	0x74, 0x72, 0x65, 0x6e, 0x64, 0x79, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c,
+	0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03,
+	0x28, 0x09, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12,
+	0x27, 0x0a, 0x0f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68,
+	0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x4f,
+	0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x42, 0x34, 0x5a, 0x32, 0x61, 0x6e, 0x64, 0x72,
+	0x6f, 0x69, 0x64, 0x2f, 0x73, 0x6f, 0x6f, 0x6e, 0x67, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e,
+	0x67, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f,
+	0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+}
+
+var (
+	file_code_metadata_internal_proto_rawDescOnce sync.Once
+	file_code_metadata_internal_proto_rawDescData = file_code_metadata_internal_proto_rawDesc
+)
+
+func file_code_metadata_internal_proto_rawDescGZIP() []byte {
+	file_code_metadata_internal_proto_rawDescOnce.Do(func() {
+		file_code_metadata_internal_proto_rawDescData = protoimpl.X.CompressGZIP(file_code_metadata_internal_proto_rawDescData)
+	})
+	return file_code_metadata_internal_proto_rawDescData
+}
+
+var file_code_metadata_internal_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
+var file_code_metadata_internal_proto_goTypes = []interface{}{
+	(*CodeMetadataInternal)(nil),                 // 0: code_metadata_internal_proto.CodeMetadataInternal
+	(*CodeMetadataInternal_TargetOwnership)(nil), // 1: code_metadata_internal_proto.CodeMetadataInternal.TargetOwnership
+}
+var file_code_metadata_internal_proto_depIdxs = []int32{
+	1, // 0: code_metadata_internal_proto.CodeMetadataInternal.target_ownership_list:type_name -> code_metadata_internal_proto.CodeMetadataInternal.TargetOwnership
+	1, // [1:1] is the sub-list for method output_type
+	1, // [1:1] is the sub-list for method input_type
+	1, // [1:1] is the sub-list for extension type_name
+	1, // [1:1] is the sub-list for extension extendee
+	0, // [0:1] is the sub-list for field type_name
+}
+
+func init() { file_code_metadata_internal_proto_init() }
+func file_code_metadata_internal_proto_init() {
+	if File_code_metadata_internal_proto != nil {
+		return
+	}
+	if !protoimpl.UnsafeEnabled {
+		file_code_metadata_internal_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*CodeMetadataInternal); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_code_metadata_internal_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*CodeMetadataInternal_TargetOwnership); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+	}
+	type x struct{}
+	out := protoimpl.TypeBuilder{
+		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+			RawDescriptor: file_code_metadata_internal_proto_rawDesc,
+			NumEnums:      0,
+			NumMessages:   2,
+			NumExtensions: 0,
+			NumServices:   0,
+		},
+		GoTypes:           file_code_metadata_internal_proto_goTypes,
+		DependencyIndexes: file_code_metadata_internal_proto_depIdxs,
+		MessageInfos:      file_code_metadata_internal_proto_msgTypes,
+	}.Build()
+	File_code_metadata_internal_proto = out.File
+	file_code_metadata_internal_proto_rawDesc = nil
+	file_code_metadata_internal_proto_goTypes = nil
+	file_code_metadata_internal_proto_depIdxs = nil
+}
diff --git a/testing/code_metadata_internal_proto/code_metadata_internal.proto b/testing/code_metadata_internal_proto/code_metadata_internal.proto
new file mode 100644
index 0000000..14edc0f
--- /dev/null
+++ b/testing/code_metadata_internal_proto/code_metadata_internal.proto
@@ -0,0 +1,40 @@
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto2";
+package code_metadata_internal_proto;
+option go_package = "android/soong/testing/code_metadata_internal_proto";
+
+message CodeMetadataInternal {
+
+  message TargetOwnership {
+    // REQUIRED: Name of the build target
+    optional string target_name = 1;
+
+    // REQUIRED: Code location of the target.
+    // To be used to support legacy/backup systems that use OWNERS file and is
+    // also required for our dashboard to support per code location basis UI
+    optional string path = 2;
+
+    // REQUIRED: Team ID of the team that owns this target.
+    optional string trendy_team_id = 3;
+
+    // OPTIONAL: The src files of the target.
+    // To be used to determine ownership of a file for ownership
+    repeated string source_files = 4;
+
+    // OPTIONAL: Specify if multiple ownerships of the source files are allowed.
+    optional bool multi_ownership = 5;
+  }
+
+  // List of all code targets and their metadata.
+  repeated TargetOwnership target_ownership_list = 1;
+}
diff --git a/testing/code_metadata_internal_proto/regen.sh b/testing/code_metadata_internal_proto/regen.sh
new file mode 100644
index 0000000..f101a02
--- /dev/null
+++ b/testing/code_metadata_internal_proto/regen.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+aprotoc --go_out=paths=source_relative:. code_metadata_internal.proto
diff --git a/testing/code_metadata_proto/Android.bp b/testing/code_metadata_proto/Android.bp
new file mode 100644
index 0000000..8fcca19
--- /dev/null
+++ b/testing/code_metadata_proto/Android.bp
@@ -0,0 +1,29 @@
+// Copyright 2022 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+bootstrap_go_package {
+    name: "soong-testing-code_metadata_proto",
+    pkgPath: "android/soong/testing/code_metadata_proto",
+    deps: [
+            "golang-protobuf-reflect-protoreflect",
+            "golang-protobuf-runtime-protoimpl",
+        ],
+    srcs: [
+        "code_metadata.pb.go",
+    ],
+}
diff --git a/testing/code_metadata_proto/OWNERS b/testing/code_metadata_proto/OWNERS
new file mode 100644
index 0000000..03bcdf1
--- /dev/null
+++ b/testing/code_metadata_proto/OWNERS
@@ -0,0 +1,4 @@
+dariofreni@google.com
+joeo@google.com
+ronish@google.com
+caditya@google.com
diff --git a/testing/code_metadata_proto/code_metadata.pb.go b/testing/code_metadata_proto/code_metadata.pb.go
new file mode 100644
index 0000000..711bf7a
--- /dev/null
+++ b/testing/code_metadata_proto/code_metadata.pb.go
@@ -0,0 +1,263 @@
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// 	protoc-gen-go v1.30.0
+// 	protoc        v3.21.12
+// source: code_metadata.proto
+
+package code_metadata_proto
+
+import (
+	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
+	sync "sync"
+)
+
+const (
+	// Verify that this generated code is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+	// Verify that runtime/protoimpl is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type CodeMetadata struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	// List of all code targets and their metadata.
+	TargetOwnershipList []*CodeMetadata_TargetOwnership `protobuf:"bytes,1,rep,name=target_ownership_list,json=targetOwnershipList" json:"target_ownership_list,omitempty"`
+}
+
+func (x *CodeMetadata) Reset() {
+	*x = CodeMetadata{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_code_metadata_proto_msgTypes[0]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *CodeMetadata) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CodeMetadata) ProtoMessage() {}
+
+func (x *CodeMetadata) ProtoReflect() protoreflect.Message {
+	mi := &file_code_metadata_proto_msgTypes[0]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use CodeMetadata.ProtoReflect.Descriptor instead.
+func (*CodeMetadata) Descriptor() ([]byte, []int) {
+	return file_code_metadata_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *CodeMetadata) GetTargetOwnershipList() []*CodeMetadata_TargetOwnership {
+	if x != nil {
+		return x.TargetOwnershipList
+	}
+	return nil
+}
+
+type CodeMetadata_TargetOwnership struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	// REQUIRED: Name of the build target
+	TargetName *string `protobuf:"bytes,1,opt,name=target_name,json=targetName" json:"target_name,omitempty"`
+	// REQUIRED: Code location of the target.
+	// To be used to support legacy/backup systems that use OWNERS file and is
+	// also required for our dashboard to support per code location basis UI
+	Path *string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"`
+	// REQUIRED: Team ID of the team that owns this target.
+	TrendyTeamId *string `protobuf:"bytes,3,opt,name=trendy_team_id,json=trendyTeamId" json:"trendy_team_id,omitempty"`
+	// OPTIONAL: The src files of the target.
+	// To be used to determine ownership of a file for ownership
+	SourceFiles []string `protobuf:"bytes,4,rep,name=source_files,json=sourceFiles" json:"source_files,omitempty"`
+}
+
+func (x *CodeMetadata_TargetOwnership) Reset() {
+	*x = CodeMetadata_TargetOwnership{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_code_metadata_proto_msgTypes[1]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *CodeMetadata_TargetOwnership) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CodeMetadata_TargetOwnership) ProtoMessage() {}
+
+func (x *CodeMetadata_TargetOwnership) ProtoReflect() protoreflect.Message {
+	mi := &file_code_metadata_proto_msgTypes[1]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use CodeMetadata_TargetOwnership.ProtoReflect.Descriptor instead.
+func (*CodeMetadata_TargetOwnership) Descriptor() ([]byte, []int) {
+	return file_code_metadata_proto_rawDescGZIP(), []int{0, 0}
+}
+
+func (x *CodeMetadata_TargetOwnership) GetTargetName() string {
+	if x != nil && x.TargetName != nil {
+		return *x.TargetName
+	}
+	return ""
+}
+
+func (x *CodeMetadata_TargetOwnership) GetPath() string {
+	if x != nil && x.Path != nil {
+		return *x.Path
+	}
+	return ""
+}
+
+func (x *CodeMetadata_TargetOwnership) GetTrendyTeamId() string {
+	if x != nil && x.TrendyTeamId != nil {
+		return *x.TrendyTeamId
+	}
+	return ""
+}
+
+func (x *CodeMetadata_TargetOwnership) GetSourceFiles() []string {
+	if x != nil {
+		return x.SourceFiles
+	}
+	return nil
+}
+
+var File_code_metadata_proto protoreflect.FileDescriptor
+
+var file_code_metadata_proto_rawDesc = []byte{
+	0x0a, 0x13, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e,
+	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61,
+	0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x02, 0x0a, 0x0c, 0x43,
+	0x6f, 0x64, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x65, 0x0a, 0x15, 0x74,
+	0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x5f,
+	0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x63, 0x6f, 0x64,
+	0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x2e, 0x43, 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61,
+	0x72, 0x67, 0x65, 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x13, 0x74,
+	0x61, 0x72, 0x67, 0x65, 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4c, 0x69,
+	0x73, 0x74, 0x1a, 0x8f, 0x01, 0x0a, 0x0f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4f, 0x77, 0x6e,
+	0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,
+	0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72,
+	0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18,
+	0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x74,
+	0x72, 0x65, 0x6e, 0x64, 0x79, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x79, 0x54, 0x65, 0x61, 0x6d, 0x49,
+	0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65,
+	0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46,
+	0x69, 0x6c, 0x65, 0x73, 0x42, 0x2b, 0x5a, 0x29, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x2f,
+	0x73, 0x6f, 0x6f, 0x6e, 0x67, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x63, 0x6f,
+	0x64, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x74,
+	0x6f,
+}
+
+var (
+	file_code_metadata_proto_rawDescOnce sync.Once
+	file_code_metadata_proto_rawDescData = file_code_metadata_proto_rawDesc
+)
+
+func file_code_metadata_proto_rawDescGZIP() []byte {
+	file_code_metadata_proto_rawDescOnce.Do(func() {
+		file_code_metadata_proto_rawDescData = protoimpl.X.CompressGZIP(file_code_metadata_proto_rawDescData)
+	})
+	return file_code_metadata_proto_rawDescData
+}
+
+var file_code_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
+var file_code_metadata_proto_goTypes = []interface{}{
+	(*CodeMetadata)(nil),                 // 0: code_metadata_proto.CodeMetadata
+	(*CodeMetadata_TargetOwnership)(nil), // 1: code_metadata_proto.CodeMetadata.TargetOwnership
+}
+var file_code_metadata_proto_depIdxs = []int32{
+	1, // 0: code_metadata_proto.CodeMetadata.target_ownership_list:type_name -> code_metadata_proto.CodeMetadata.TargetOwnership
+	1, // [1:1] is the sub-list for method output_type
+	1, // [1:1] is the sub-list for method input_type
+	1, // [1:1] is the sub-list for extension type_name
+	1, // [1:1] is the sub-list for extension extendee
+	0, // [0:1] is the sub-list for field type_name
+}
+
+func init() { file_code_metadata_proto_init() }
+func file_code_metadata_proto_init() {
+	if File_code_metadata_proto != nil {
+		return
+	}
+	if !protoimpl.UnsafeEnabled {
+		file_code_metadata_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*CodeMetadata); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_code_metadata_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*CodeMetadata_TargetOwnership); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+	}
+	type x struct{}
+	out := protoimpl.TypeBuilder{
+		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+			RawDescriptor: file_code_metadata_proto_rawDesc,
+			NumEnums:      0,
+			NumMessages:   2,
+			NumExtensions: 0,
+			NumServices:   0,
+		},
+		GoTypes:           file_code_metadata_proto_goTypes,
+		DependencyIndexes: file_code_metadata_proto_depIdxs,
+		MessageInfos:      file_code_metadata_proto_msgTypes,
+	}.Build()
+	File_code_metadata_proto = out.File
+	file_code_metadata_proto_rawDesc = nil
+	file_code_metadata_proto_goTypes = nil
+	file_code_metadata_proto_depIdxs = nil
+}
diff --git a/testing/code_metadata_proto/code_metadata.proto b/testing/code_metadata_proto/code_metadata.proto
new file mode 100644
index 0000000..2548363
--- /dev/null
+++ b/testing/code_metadata_proto/code_metadata.proto
@@ -0,0 +1,37 @@
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto2";
+package code_metadata_proto;
+option go_package = "android/soong/testing/code_metadata_proto";
+
+message CodeMetadata {
+
+  message TargetOwnership {
+    // REQUIRED: Name of the build target
+    optional string target_name = 1;
+
+    // REQUIRED: Code location of the target.
+    // To be used to support legacy/backup systems that use OWNERS file and is
+    // also required for our dashboard to support per code location basis UI
+    optional string path = 2;
+
+    // REQUIRED: Team ID of the team that owns this target.
+    optional string trendy_team_id = 3;
+
+    // OPTIONAL: The src files of the target.
+    // To be used to determine ownership of a file for ownership
+    repeated string source_files = 4;
+  }
+
+  // List of all code targets and their metadata.
+  repeated TargetOwnership target_ownership_list = 1;
+}
diff --git a/testing/code_metadata_proto/regen.sh b/testing/code_metadata_proto/regen.sh
new file mode 100644
index 0000000..ffe06f7
--- /dev/null
+++ b/testing/code_metadata_proto/regen.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+aprotoc --go_out=paths=source_relative:. code_metadata.proto
diff --git a/testing/init.go b/testing/init.go
index 206b430..edcbf59 100644
--- a/testing/init.go
+++ b/testing/init.go
@@ -28,6 +28,8 @@
 }
 
 func RegisterBuildComponents(ctx android.RegistrationContext) {
+	ctx.RegisterModuleType("code_metadata", CodeMetadataFactory)
 	ctx.RegisterModuleType("test_spec", TestSpecFactory)
+	ctx.RegisterParallelSingletonType("all_code_metadata", AllCodeMetadataFactory)
 	ctx.RegisterParallelSingletonType("all_test_specs", AllTestSpecsFactory)
 }
diff --git a/testing/test.go b/testing/test.go
index 44824e4..cd97a8f 100644
--- a/testing/test.go
+++ b/testing/test.go
@@ -18,4 +18,4 @@
 	"android/soong/android"
 )
 
-var PrepareForTestWithTestSpecBuildComponents = android.FixtureRegisterWithContext(RegisterBuildComponents)
+var PrepareForTestWithTestingBuildComponents = android.FixtureRegisterWithContext(RegisterBuildComponents)
diff --git a/testing/test_spec.go b/testing/test_spec.go
index c370f71..58d9c23 100644
--- a/testing/test_spec.go
+++ b/testing/test_spec.go
@@ -40,7 +40,6 @@
 type TestSpecModule struct {
 	android.ModuleBase
 	android.DefaultableModuleBase
-	android.BazelModuleBase
 
 	// Properties for "test_spec"
 	properties struct {
diff --git a/tradefed/Android.bp b/tradefed/Android.bp
index a161108..f0336a3 100644
--- a/tradefed/Android.bp
+++ b/tradefed/Android.bp
@@ -11,7 +11,6 @@
     ],
     srcs: [
         "autogen.go",
-        "autogen_bazel.go",
         "config.go",
         "makevars.go",
     ],
diff --git a/tradefed/autogen_bazel.go b/tradefed/autogen_bazel.go
deleted file mode 100644
index cc16176..0000000
--- a/tradefed/autogen_bazel.go
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package tradefed
-
-import (
-	"android/soong/android"
-	"android/soong/bazel"
-
-	"github.com/google/blueprint/proptools"
-)
-
-const (
-	InstrumentationTestConfigTemplate  = "build/make/core/instrumentation_test_config_template.xml"
-	JavaTestConfigTemplate             = "build/make/core/java_test_config_template.xml"
-	JavaHostTestConfigTemplate         = "build/make/core/java_host_test_config_template.xml"
-	JavaHostUnitTestConfigTemplate     = "build/make/core/java_host_unit_test_config_template.xml"
-	NativeBenchmarkTestConfigTemplate  = "build/make/core/native_benchmark_test_config_template.xml"
-	NativeHostTestConfigTemplate       = "build/make/core/native_host_test_config_template.xml"
-	NativeTestConfigTemplate           = "build/make/core/native_test_config_template.xml"
-	PythonBinaryHostTestConfigTemplate = "build/make/core/python_binary_host_test_config_template.xml"
-	RustDeviceTestConfigTemplate       = "build/make/core/rust_device_test_config_template.xml"
-	RustHostTestConfigTemplate         = "build/make/core/rust_host_test_config_template.xml"
-	RustDeviceBenchmarkConfigTemplate  = "build/make/core/rust_device_benchmark_config_template.xml"
-	RustHostBenchmarkConfigTemplate    = "build/make/core/rust_host_benchmark_config_template.xml"
-	RobolectricTestConfigTemplate      = "build/make/core/robolectric_test_config_template.xml"
-	ShellTestConfigTemplate            = "build/make/core/shell_test_config_template.xml"
-)
-
-type TestConfigAttributes struct {
-	Test_config    *bazel.Label
-	Dynamic_config *bazel.Label
-
-	Auto_generate_test_config *bool
-	Template_test_config      *bazel.Label
-	Template_configs          []string
-	Template_install_base     *string
-}
-
-func GetTestConfigAttributes(
-	ctx android.Bp2buildMutatorContext,
-	testConfig *string,
-	extraTestConfigs []string,
-	autoGenConfig *bool,
-	testSuites []string,
-	template *string,
-	templateConfigs []Config,
-	templateInstallBase *string) TestConfigAttributes {
-
-	attrs := TestConfigAttributes{}
-
-	dynamicConfig := "DynamicConfig.xml"
-	c, _ := android.BazelStringOrLabelFromProp(ctx, &dynamicConfig)
-	attrs.Dynamic_config = c.Value
-
-	attrs.Test_config = GetTestConfig(ctx, testConfig)
-	// do not generate a test config if
-	// 1) test config already found
-	// 2) autoGenConfig == false
-	// 3) CTS tests and no template specified.
-	// CTS Modules can be used for test data, so test config files must be explicitly specified.
-	if (attrs.Template_test_config != nil) ||
-		proptools.Bool(autoGenConfig) == false ||
-		(template == nil && !android.InList("cts", testSuites)) {
-
-		return attrs
-	}
-
-	// Add properties for the bazel rule to generate a test config
-	// since a test config was not specified.
-	templateLabel := android.BazelLabelForModuleSrcSingle(ctx, *template)
-	attrs.Template_test_config = &templateLabel
-	attrs.Auto_generate_test_config = autoGenConfig
-	var configStrings []string
-	for _, c := range templateConfigs {
-		configString := proptools.NinjaAndShellEscape(c.Config())
-		configStrings = append(configStrings, configString)
-	}
-	attrs.Template_configs = configStrings
-	attrs.Template_install_base = templateInstallBase
-	return attrs
-}
-
-func GetTestConfig(
-	ctx android.Bp2buildMutatorContext,
-	testConfig *string,
-) *bazel.Label {
-
-	if testConfig != nil {
-		c, _ := android.BazelStringOrLabelFromProp(ctx, testConfig)
-		if c.Value != nil {
-			return c.Value
-		}
-	}
-
-	// check for default AndroidTest.xml
-	defaultTestConfigPath := "AndroidTest.xml"
-	c, _ := android.BazelStringOrLabelFromProp(ctx, &defaultTestConfigPath)
-	return c.Value
-}
diff --git a/tradefed/suite_harness/tradefed_binary.go b/tradefed/suite_harness/tradefed_binary.go
index 1ce94bc..96fb354 100644
--- a/tradefed/suite_harness/tradefed_binary.go
+++ b/tradefed/suite_harness/tradefed_binary.go
@@ -35,6 +35,7 @@
 	Short_name                    string
 	Full_name                     string
 	Version                       string
+	Suite_arch                    string
 	Prepend_platform_version_name bool
 }
 
@@ -67,6 +68,7 @@
 				Name:       &genName,
 				Short_name: tfb.Short_name,
 				Full_name:  tfb.Full_name,
+				Suite_arch: tfb.Suite_arch,
 				Version:    version,
 			})
 
@@ -95,6 +97,7 @@
 	Short_name string
 	Full_name  string
 	Version    string
+	Suite_arch string
 }
 
 type tradefedBinaryGen struct {
@@ -127,13 +130,19 @@
 func (tfg *tradefedBinaryGen) GenerateAndroidBuildActions(ctx android.ModuleContext) {
 	buildNumberFile := ctx.Config().BuildNumberFile(ctx)
 	outputFile := android.PathForModuleOut(ctx, "test-suite-info.properties")
+
+	arch := strings.ReplaceAll(tfg.properties.Suite_arch, " ", "")
+	if arch == "" {
+		arch = ctx.Config().DevicePrimaryArchType().String()
+	}
+
 	ctx.Build(pctx, android.BuildParams{
 		Rule:      tradefedBinaryGenRule,
 		Output:    outputFile,
 		OrderOnly: android.Paths{buildNumberFile},
 		Args: map[string]string{
 			"buildNumberFile": buildNumberFile.String(),
-			"arch":            ctx.Config().DevicePrimaryArchType().String(),
+			"arch":            arch,
 			"name":            tfg.properties.Short_name,
 			"fullname":        tfg.properties.Full_name,
 			"version":         tfg.properties.Version,
diff --git a/ui/build/Android.bp b/ui/build/Android.bp
index 959ae4c..21453ba 100644
--- a/ui/build/Android.bp
+++ b/ui/build/Android.bp
@@ -46,7 +46,6 @@
         "soong-ui-tracer",
     ],
     srcs: [
-        "bazel_metrics.go",
         "build.go",
         "cleanbuild.go",
         "config.go",
@@ -75,7 +74,6 @@
         "proc_sync_test.go",
         "rbe_test.go",
         "staging_snapshot_test.go",
-        "upload_test.go",
         "util_test.go",
     ],
     darwin: {
diff --git a/ui/build/bazel_metrics.go b/ui/build/bazel_metrics.go
deleted file mode 100644
index 3f9fbb1..0000000
--- a/ui/build/bazel_metrics.go
+++ /dev/null
@@ -1,136 +0,0 @@
-// Copyright 2023 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//	http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package build
-
-// This file contains functionality to parse bazel profile data into
-// a bazel_metrics proto, defined in build/soong/ui/metrics/bazel_metrics_proto
-// These metrics are later uploaded in upload.go
-
-import (
-	"bufio"
-	"os"
-	"strconv"
-	"strings"
-
-	"android/soong/shared"
-	"google.golang.org/protobuf/proto"
-
-	bazel_metrics_proto "android/soong/ui/metrics/bazel_metrics_proto"
-)
-
-func parseTimingToNanos(str string) int64 {
-	millisString := removeDecimalPoint(str)
-	timingMillis, _ := strconv.ParseInt(millisString, 10, 64)
-	return timingMillis * 1000000
-}
-
-func parsePercentageToTenThousandths(str string) int32 {
-	percentageString := removeDecimalPoint(str)
-	//remove the % at the end of the string
-	percentage := strings.ReplaceAll(percentageString, "%", "")
-	percentagePortion, _ := strconv.ParseInt(percentage, 10, 32)
-	return int32(percentagePortion)
-}
-
-func removeDecimalPoint(numString string) string {
-	// The format is always 0.425 or 10.425
-	return strings.ReplaceAll(numString, ".", "")
-}
-
-func parseTotal(line string) int64 {
-	words := strings.Fields(line)
-	timing := words[3]
-	return parseTimingToNanos(timing)
-}
-
-func parsePhaseTiming(line string) bazel_metrics_proto.PhaseTiming {
-	words := strings.Fields(line)
-	getPhaseNameAndTimingAndPercentage := func([]string) (string, int64, int32) {
-		// Sample lines include:
-		// Total launch phase time   0.011 s    2.59%
-		// Total target pattern evaluation phase time  0.011 s    2.59%
-		var beginning int
-		var end int
-		for ind, word := range words {
-			if word == "Total" {
-				beginning = ind + 1
-			} else if beginning > 0 && word == "phase" {
-				end = ind
-				break
-			}
-		}
-		phaseName := strings.Join(words[beginning:end], " ")
-
-		// end is now "phase" - advance by 2 for timing and 4 for percentage
-		percentageString := words[end+4]
-		timingString := words[end+2]
-		timing := parseTimingToNanos(timingString)
-		percentagePortion := parsePercentageToTenThousandths(percentageString)
-		return phaseName, timing, percentagePortion
-	}
-
-	phaseName, timing, portion := getPhaseNameAndTimingAndPercentage(words)
-	phaseTiming := bazel_metrics_proto.PhaseTiming{}
-	phaseTiming.DurationNanos = &timing
-	phaseTiming.PortionOfBuildTime = &portion
-
-	phaseTiming.PhaseName = &phaseName
-	return phaseTiming
-}
-
-// This method takes a file created by bazel's --analyze-profile mode and
-// writes bazel metrics data to the provided filepath.
-func ProcessBazelMetrics(bazelProfileFile string, bazelMetricsFile string, ctx Context, config Config) {
-	if bazelProfileFile == "" {
-		return
-	}
-
-	readBazelProto := func(filepath string) bazel_metrics_proto.BazelMetrics {
-		//serialize the proto, write it
-		bazelMetrics := bazel_metrics_proto.BazelMetrics{}
-
-		file, err := os.ReadFile(filepath)
-		if err != nil {
-			ctx.Fatalln("Error reading metrics file\n", err)
-		}
-
-		scanner := bufio.NewScanner(strings.NewReader(string(file)))
-		scanner.Split(bufio.ScanLines)
-
-		var phaseTimings []*bazel_metrics_proto.PhaseTiming
-		for scanner.Scan() {
-			line := scanner.Text()
-			if strings.HasPrefix(line, "Total run time") {
-				total := parseTotal(line)
-				bazelMetrics.Total = &total
-			} else if strings.HasPrefix(line, "Total") {
-				phaseTiming := parsePhaseTiming(line)
-				phaseTimings = append(phaseTimings, &phaseTiming)
-			}
-		}
-		bazelMetrics.PhaseTimings = phaseTimings
-		bazelMetrics.BesId = proto.String(config.besId)
-
-		return bazelMetrics
-	}
-
-	if _, err := os.Stat(bazelProfileFile); err != nil {
-		// We can assume bazel didn't run if the profile doesn't exist
-		return
-	}
-	bazelProto := readBazelProto(bazelProfileFile)
-	bazelProto.ExitCode = proto.Int32(config.bazelExitCode)
-	shared.Save(&bazelProto, bazelMetricsFile)
-}
diff --git a/ui/build/build.go b/ui/build/build.go
index 9d5c330..9a9eccd 100644
--- a/ui/build/build.go
+++ b/ui/build/build.go
@@ -135,22 +135,6 @@
 	RunBuildTests  = 1 << iota
 )
 
-// checkBazelMode fails the build if there are conflicting arguments for which bazel
-// build mode to use.
-func checkBazelMode(ctx Context, config Config) {
-	count := 0
-	if config.bazelProdMode {
-		count++
-	}
-	if config.bazelStagingMode {
-		count++
-	}
-	if count > 1 {
-		ctx.Fatalln("Conflicting bazel mode.\n" +
-			"Do not specify more than one of --bazel-mode and --bazel-mode-staging ")
-	}
-}
-
 // checkProblematicFiles fails the build if existing Android.mk or CleanSpec.mk files are found at the root of the tree.
 func checkProblematicFiles(ctx Context) {
 	files := []string{"Android.mk", "CleanSpec.mk"}
@@ -262,8 +246,6 @@
 
 	defer waitForDist(ctx)
 
-	checkBazelMode(ctx, config)
-
 	// checkProblematicFiles aborts the build if Android.mk or CleanSpec.mk are found at the root of the tree.
 	checkProblematicFiles(ctx)
 
@@ -283,11 +265,16 @@
 	}
 
 	rbeCh := make(chan bool)
+	var rbePanic any
 	if config.StartRBE() {
 		cleanupRBELogsDir(ctx, config)
+		checkRBERequirements(ctx, config)
 		go func() {
+			defer func() {
+				rbePanic = recover()
+				close(rbeCh)
+			}()
 			startRBE(ctx, config)
-			close(rbeCh)
 		}()
 		defer DumpRBEMetrics(ctx, config, filepath.Join(config.LogsDir(), "rbe_metrics.pb"))
 	} else {
@@ -345,6 +332,11 @@
 	}
 
 	<-rbeCh
+	if rbePanic != nil {
+		// If there was a ctx.Fatal in startRBE, rethrow it.
+		panic(rbePanic)
+	}
+
 	if what&RunNinja != 0 {
 		if what&RunKati != 0 {
 			installCleanIfNecessary(ctx, config)
diff --git a/ui/build/config.go b/ui/build/config.go
index 613fc65..5085c68 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -72,7 +72,6 @@
 	checkbuild               bool
 	dist                     bool
 	jsonModuleGraph          bool
-	bp2build                 bool
 	queryview                bool
 	reportMkMetrics          bool // Collect and report mk2bp migration progress metrics.
 	soongDocs                bool
@@ -87,9 +86,7 @@
 	skipMetricsUpload        bool
 	buildStartedTime         int64 // For metrics-upload-only - manually specify a build-started time
 	buildFromSourceStub      bool
-	ensureAllowlistIntegrity bool   // For CI builds - make sure modules are mixed-built
-	bazelExitCode            int32  // For b runs - necessary for updating NonZeroExit
-	besId                    string // For b runs, to identify the BuildEventService logs
+	ensureAllowlistIntegrity bool // For CI builds - make sure modules are mixed-built
 
 	// From the product config
 	katiArgs        []string
@@ -108,16 +105,11 @@
 
 	pathReplaced bool
 
-	bazelProdMode    bool
-	bazelStagingMode bool
-
 	// Set by multiproduct_kati
 	emptyNinjaFile bool
 
 	metricsUploader string
 
-	bazelForceEnabledModules string
-
 	includeTags    []string
 	sourceRootDirs []string
 
@@ -450,11 +442,6 @@
 		}
 	}
 
-	bpd := ret.BazelMetricsDir()
-	if err := os.RemoveAll(bpd); err != nil {
-		ctx.Fatalf("Unable to remove bazel profile directory %q: %v", bpd, err)
-	}
-
 	c := Config{ret}
 	storeConfigMetrics(ctx, c)
 	return c
@@ -535,12 +522,10 @@
 
 func buildConfig(config Config) *smpb.BuildConfig {
 	c := &smpb.BuildConfig{
-		ForceUseGoma:                proto.Bool(config.ForceUseGoma()),
-		UseGoma:                     proto.Bool(config.UseGoma()),
-		UseRbe:                      proto.Bool(config.UseRBE()),
-		BazelMixedBuild:             proto.Bool(config.BazelBuildEnabled()),
-		ForceDisableBazelMixedBuild: proto.Bool(config.IsBazelMixedBuildForceDisabled()),
-		NinjaWeightListSource:       getNinjaWeightListSourceInMetric(config.NinjaWeightListSource()),
+		ForceUseGoma:          proto.Bool(config.ForceUseGoma()),
+		UseGoma:               proto.Bool(config.UseGoma()),
+		UseRbe:                proto.Bool(config.UseRBE()),
+		NinjaWeightListSource: getNinjaWeightListSourceInMetric(config.NinjaWeightListSource()),
 	}
 	c.Targets = append(c.Targets, config.arguments...)
 
@@ -794,10 +779,6 @@
 			c.reportMkMetrics = true
 		} else if arg == "--multitree-build" {
 			c.multitreeBuild = true
-		} else if arg == "--bazel-mode" {
-			c.bazelProdMode = true
-		} else if arg == "--bazel-mode-staging" {
-			c.bazelStagingMode = true
 		} else if arg == "--search-api-dir" {
 			c.searchApiDir = true
 		} else if strings.HasPrefix(arg, "--ninja_weight_source=") {
@@ -832,8 +813,6 @@
 			buildCmd = strings.TrimPrefix(buildCmd, "\"")
 			buildCmd = strings.TrimSuffix(buildCmd, "\"")
 			ctx.Metrics.SetBuildCommand([]string{buildCmd})
-		} else if strings.HasPrefix(arg, "--bazel-force-enabled-modules=") {
-			c.bazelForceEnabledModules = strings.TrimPrefix(arg, "--bazel-force-enabled-modules=")
 		} else if strings.HasPrefix(arg, "--build-started-time-unix-millis=") {
 			buildTimeStr := strings.TrimPrefix(arg, "--build-started-time-unix-millis=")
 			val, err := strconv.ParseInt(buildTimeStr, 10, 64)
@@ -878,8 +857,6 @@
 			c.dist = true
 		} else if arg == "json-module-graph" {
 			c.jsonModuleGraph = true
-		} else if arg == "bp2build" {
-			c.bp2build = true
 		} else if arg == "queryview" {
 			c.queryview = true
 		} else if arg == "soong_docs" {
@@ -976,13 +953,12 @@
 		return true
 	}
 
-	if !c.JsonModuleGraph() && !c.Bp2Build() && !c.Queryview() && !c.SoongDocs() {
+	if !c.JsonModuleGraph() && !c.Queryview() && !c.SoongDocs() {
 		// Command line was empty, the default Ninja target is built
 		return true
 	}
 
-	// bp2build + dist may be used to dist bp2build logs but does not require SoongBuildInvocation
-	if c.Dist() && !c.Bp2Build() {
+	if c.Dist() {
 		return true
 	}
 
@@ -1012,14 +988,6 @@
 	return c.ninjaArgs
 }
 
-func (c *configImpl) BazelOutDir() string {
-	return filepath.Join(c.OutDir(), "bazel")
-}
-
-func (c *configImpl) bazelOutputBase() string {
-	return filepath.Join(c.BazelOutDir(), "output")
-}
-
 func (c *configImpl) SoongOutDir() string {
 	return filepath.Join(c.OutDir(), "soong")
 }
@@ -1058,14 +1026,6 @@
 	return shared.JoinPath(c.SoongOutDir(), usedEnvFile+"."+tag)
 }
 
-func (c *configImpl) Bp2BuildFilesMarkerFile() string {
-	return shared.JoinPath(c.SoongOutDir(), "bp2build_files_marker")
-}
-
-func (c *configImpl) Bp2BuildWorkspaceMarkerFile() string {
-	return shared.JoinPath(c.SoongOutDir(), "bp2build_workspace_marker")
-}
-
 func (c *configImpl) SoongDocsHtml() string {
 	return shared.JoinPath(c.SoongOutDir(), "docs/soong_build.html")
 }
@@ -1111,10 +1071,6 @@
 	return c.jsonModuleGraph
 }
 
-func (c *configImpl) Bp2Build() bool {
-	return c.bp2build
-}
-
 func (c *configImpl) Queryview() bool {
 	return c.queryview
 }
@@ -1306,7 +1262,7 @@
 
 func (c *configImpl) UseRBE() bool {
 	// These alternate modes of running Soong do not use RBE / reclient.
-	if c.Bp2Build() || c.Queryview() || c.JsonModuleGraph() {
+	if c.Queryview() || c.JsonModuleGraph() {
 		return false
 	}
 
@@ -1323,10 +1279,6 @@
 	return false
 }
 
-func (c *configImpl) BazelBuildEnabled() bool {
-	return c.bazelProdMode || c.bazelStagingMode
-}
-
 func (c *configImpl) StartRBE() bool {
 	if !c.UseRBE() {
 		return false
@@ -1679,12 +1631,6 @@
 	return absDir
 }
 
-// BazelMetricsDir returns the <logs dir>/bazel_metrics directory
-// where the bazel profiles are located.
-func (c *configImpl) BazelMetricsDir() string {
-	return filepath.Join(c.LogsDir(), "bazel_metrics")
-}
-
 // MkFileMetrics returns the file path for make-related metrics.
 func (c *configImpl) MkMetrics() string {
 	return filepath.Join(c.LogsDir(), "mk_metrics.pb")
@@ -1698,28 +1644,6 @@
 	return c.emptyNinjaFile
 }
 
-func (c *configImpl) IsBazelMixedBuildForceDisabled() bool {
-	return c.Environment().IsEnvTrue("BUILD_BROKEN_DISABLE_BAZEL")
-}
-
-func (c *configImpl) IsPersistentBazelEnabled() bool {
-	return c.Environment().IsEnvTrue("USE_PERSISTENT_BAZEL")
-}
-
-// GetBazeliskBazelVersion returns the Bazel version to use for this build,
-// or the empty string if the current canonical prod Bazel should be used.
-// This environment variable should only be set to debug the build system.
-// The Bazel version, if set, will be passed to Bazelisk, and Bazelisk will
-// handle downloading and invoking the correct Bazel binary.
-func (c *configImpl) GetBazeliskBazelVersion() string {
-	value, _ := c.Environment().Get("USE_BAZEL_VERSION")
-	return value
-}
-
-func (c *configImpl) BazelModulesForceEnabledByFlag() string {
-	return c.bazelForceEnabledModules
-}
-
 func (c *configImpl) SkipMetricsUpload() bool {
 	return c.skipMetricsUpload
 }
@@ -1737,10 +1661,6 @@
 	return time.UnixMilli(c.buildStartedTime)
 }
 
-func (c *configImpl) BazelExitCode() int32 {
-	return c.bazelExitCode
-}
-
 func GetMetricsUploader(topDir string, env *Environment) string {
 	if p, ok := env.Get("METRICS_UPLOADER"); ok {
 		metricsUploader := filepath.Join(topDir, p)
diff --git a/ui/build/config_test.go b/ui/build/config_test.go
index 545f727..5182b12 100644
--- a/ui/build/config_test.go
+++ b/ui/build/config_test.go
@@ -1017,157 +1017,57 @@
 		name                string
 		environ             Environment
 		arguments           []string
-		useBazel            bool
-		bazelProdMode       bool
-		bazelStagingMode    bool
 		expectedBuildConfig *smpb.BuildConfig
 	}{
 		{
 			name:    "none set",
 			environ: Environment{},
 			expectedBuildConfig: &smpb.BuildConfig{
-				ForceUseGoma:                proto.Bool(false),
-				UseGoma:                     proto.Bool(false),
-				UseRbe:                      proto.Bool(false),
-				BazelMixedBuild:             proto.Bool(false),
-				ForceDisableBazelMixedBuild: proto.Bool(false),
-				NinjaWeightListSource:       smpb.BuildConfig_NOT_USED.Enum(),
+				ForceUseGoma:          proto.Bool(false),
+				UseGoma:               proto.Bool(false),
+				UseRbe:                proto.Bool(false),
+				NinjaWeightListSource: smpb.BuildConfig_NOT_USED.Enum(),
 			},
 		},
 		{
 			name:    "force use goma",
 			environ: Environment{"FORCE_USE_GOMA=1"},
 			expectedBuildConfig: &smpb.BuildConfig{
-				ForceUseGoma:                proto.Bool(true),
-				UseGoma:                     proto.Bool(false),
-				UseRbe:                      proto.Bool(false),
-				BazelMixedBuild:             proto.Bool(false),
-				ForceDisableBazelMixedBuild: proto.Bool(false),
-				NinjaWeightListSource:       smpb.BuildConfig_NOT_USED.Enum(),
+				ForceUseGoma:          proto.Bool(true),
+				UseGoma:               proto.Bool(false),
+				UseRbe:                proto.Bool(false),
+				NinjaWeightListSource: smpb.BuildConfig_NOT_USED.Enum(),
 			},
 		},
 		{
 			name:    "use goma",
 			environ: Environment{"USE_GOMA=1"},
 			expectedBuildConfig: &smpb.BuildConfig{
-				ForceUseGoma:                proto.Bool(false),
-				UseGoma:                     proto.Bool(true),
-				UseRbe:                      proto.Bool(false),
-				BazelMixedBuild:             proto.Bool(false),
-				ForceDisableBazelMixedBuild: proto.Bool(false),
-				NinjaWeightListSource:       smpb.BuildConfig_NOT_USED.Enum(),
+				ForceUseGoma:          proto.Bool(false),
+				UseGoma:               proto.Bool(true),
+				UseRbe:                proto.Bool(false),
+				NinjaWeightListSource: smpb.BuildConfig_NOT_USED.Enum(),
 			},
 		},
 		{
 			name:    "use rbe",
 			environ: Environment{"USE_RBE=1"},
 			expectedBuildConfig: &smpb.BuildConfig{
-				ForceUseGoma:                proto.Bool(false),
-				UseGoma:                     proto.Bool(false),
-				UseRbe:                      proto.Bool(true),
-				BazelMixedBuild:             proto.Bool(false),
-				ForceDisableBazelMixedBuild: proto.Bool(false),
-				NinjaWeightListSource:       smpb.BuildConfig_NOT_USED.Enum(),
-			},
-		},
-		{
-			name:    "disable mixed builds",
-			environ: Environment{"BUILD_BROKEN_DISABLE_BAZEL=1"},
-			expectedBuildConfig: &smpb.BuildConfig{
-				ForceUseGoma:                proto.Bool(false),
-				UseGoma:                     proto.Bool(false),
-				UseRbe:                      proto.Bool(false),
-				BazelMixedBuild:             proto.Bool(false),
-				ForceDisableBazelMixedBuild: proto.Bool(true),
-				NinjaWeightListSource:       smpb.BuildConfig_NOT_USED.Enum(),
-			},
-		},
-		{
-			name:     "use bazel as ninja",
-			environ:  Environment{},
-			useBazel: true,
-			expectedBuildConfig: &smpb.BuildConfig{
-				ForceUseGoma:                proto.Bool(false),
-				UseGoma:                     proto.Bool(false),
-				UseRbe:                      proto.Bool(false),
-				BazelMixedBuild:             proto.Bool(false),
-				ForceDisableBazelMixedBuild: proto.Bool(false),
-				NinjaWeightListSource:       smpb.BuildConfig_NOT_USED.Enum(),
-			},
-		},
-		{
-			name:          "bazel mixed build from prod mode",
-			environ:       Environment{},
-			bazelProdMode: true,
-			expectedBuildConfig: &smpb.BuildConfig{
-				ForceUseGoma:                proto.Bool(false),
-				UseGoma:                     proto.Bool(false),
-				UseRbe:                      proto.Bool(false),
-				BazelMixedBuild:             proto.Bool(true),
-				ForceDisableBazelMixedBuild: proto.Bool(false),
-				NinjaWeightListSource:       smpb.BuildConfig_NOT_USED.Enum(),
-			},
-		},
-		{
-			name:             "bazel mixed build from staging mode",
-			environ:          Environment{},
-			bazelStagingMode: true,
-			expectedBuildConfig: &smpb.BuildConfig{
-				ForceUseGoma:                proto.Bool(false),
-				UseGoma:                     proto.Bool(false),
-				UseRbe:                      proto.Bool(false),
-				BazelMixedBuild:             proto.Bool(true),
-				ForceDisableBazelMixedBuild: proto.Bool(false),
-				NinjaWeightListSource:       smpb.BuildConfig_NOT_USED.Enum(),
-			},
-		},
-		{
-			name:      "specified targets",
-			environ:   Environment{},
-			useBazel:  true,
-			arguments: []string{"droid", "dist"},
-			expectedBuildConfig: &smpb.BuildConfig{
-				ForceUseGoma:                proto.Bool(false),
-				UseGoma:                     proto.Bool(false),
-				UseRbe:                      proto.Bool(false),
-				BazelMixedBuild:             proto.Bool(false),
-				Targets:                     []string{"droid", "dist"},
-				ForceDisableBazelMixedBuild: proto.Bool(false),
-				NinjaWeightListSource:       smpb.BuildConfig_NOT_USED.Enum(),
-			},
-		},
-		{
-			name: "all set",
-			environ: Environment{
-				"FORCE_USE_GOMA=1",
-				"USE_GOMA=1",
-				"USE_RBE=1",
-				"BUILD_BROKEN_DISABLE_BAZEL=1",
-			},
-			useBazel:      true,
-			bazelProdMode: true,
-			expectedBuildConfig: &smpb.BuildConfig{
-				ForceUseGoma:                proto.Bool(true),
-				UseGoma:                     proto.Bool(true),
-				UseRbe:                      proto.Bool(true),
-				BazelMixedBuild:             proto.Bool(true),
-				ForceDisableBazelMixedBuild: proto.Bool(true),
-				NinjaWeightListSource:       smpb.BuildConfig_NOT_USED.Enum(),
+				ForceUseGoma:          proto.Bool(false),
+				UseGoma:               proto.Bool(false),
+				UseRbe:                proto.Bool(true),
+				NinjaWeightListSource: smpb.BuildConfig_NOT_USED.Enum(),
 			},
 		},
 	}
 
-	ctx := testContext()
 	for _, tc := range tests {
 		t.Run(tc.name, func(t *testing.T) {
 			c := &configImpl{
-				environ:          &tc.environ,
-				bazelProdMode:    tc.bazelProdMode,
-				bazelStagingMode: tc.bazelStagingMode,
-				arguments:        tc.arguments,
+				environ:   &tc.environ,
+				arguments: tc.arguments,
 			}
 			config := Config{c}
-			checkBazelMode(ctx, config)
 			actualBuildConfig := buildConfig(config)
 			if expected := tc.expectedBuildConfig; !proto.Equal(expected, actualBuildConfig) {
 				t.Errorf("Build config mismatch.\n"+
diff --git a/ui/build/finder.go b/ui/build/finder.go
index 62079fe..d0bcf40 100644
--- a/ui/build/finder.go
+++ b/ui/build/finder.go
@@ -74,10 +74,6 @@
 			"AndroidProducts.mk",
 			// General Soong build definitions, using the Blueprint syntax.
 			"Android.bp",
-			// Bazel build definitions.
-			"BUILD.bazel",
-			// Bazel build definitions.
-			"BUILD",
 			// Kati clean definitions.
 			"CleanSpec.mk",
 			// Ownership definition.
@@ -85,13 +81,11 @@
 			// Test configuration for modules in directories that contain this
 			// file.
 			"TEST_MAPPING",
-			// Bazel top-level file to mark a directory as a Bazel workspace.
-			"WORKSPACE",
 			// METADATA file of packages
 			"METADATA",
 		},
-		// Bazel Starlark configuration files and all .mk files for product/board configuration.
-		IncludeSuffixes: []string{".bzl", ".mk"},
+		// .mk files for product/board configuration.
+		IncludeSuffixes: []string{".mk"},
 	}
 	dumpDir := config.FileListDir()
 	f, err = finder.New(cacheParams, filesystem, logger.New(ioutil.Discard),
@@ -111,17 +105,6 @@
 	return dirs
 }
 
-// Finds the list of Bazel-related files (BUILD, WORKSPACE and Starlark) in the tree.
-func findBazelFiles(entries finder.DirEntries) (dirNames []string, fileNames []string) {
-	matches := []string{}
-	for _, foundName := range entries.FileNames {
-		if foundName == "BUILD.bazel" || foundName == "BUILD" || foundName == "WORKSPACE" || strings.HasSuffix(foundName, ".bzl") {
-			matches = append(matches, foundName)
-		}
-	}
-	return entries.DirNames, matches
-}
-
 func findProductAndBoardConfigFiles(entries finder.DirEntries) (dirNames []string, fileNames []string) {
 	matches := []string{}
 	for _, foundName := range entries.FileNames {
@@ -177,13 +160,6 @@
 		ctx.Fatalf("Could not export product list: %v", err)
 	}
 
-	// Recursively look for all Bazel related files.
-	bazelFiles := f.FindMatching(".", findBazelFiles)
-	err = dumpListToFile(ctx, config, bazelFiles, filepath.Join(dumpDir, "bazel.list"))
-	if err != nil {
-		ctx.Fatalf("Could not export bazel BUILD list: %v", err)
-	}
-
 	// Recursively look for all OWNERS files.
 	owners := f.FindNamedAt(".", "OWNERS")
 	err = dumpListToFile(ctx, config, owners, filepath.Join(dumpDir, "OWNERS.list"))
diff --git a/ui/build/rbe.go b/ui/build/rbe.go
index 19a54df..fa04207 100644
--- a/ui/build/rbe.go
+++ b/ui/build/rbe.go
@@ -95,14 +95,10 @@
 	}
 }
 
-func startRBE(ctx Context, config Config) {
+func checkRBERequirements(ctx Context, config Config) {
 	if !config.GoogleProdCredsExist() && prodCredsAuthType(config) {
 		ctx.Fatalf("Unable to start RBE reproxy\nFAILED: Missing LOAS credentials.")
 	}
-	ctx.BeginTrace(metrics.RunSetupTool, "rbe_bootstrap")
-	defer ctx.EndTrace()
-
-	ctx.Status.Status("Starting rbe...")
 
 	if u := ulimitOrFatal(ctx, config, "-u"); u < rbeLeastNProcs {
 		ctx.Fatalf("max user processes is insufficient: %d; want >= %d.\n", u, rbeLeastNProcs)
@@ -115,6 +111,13 @@
 			ctx.Fatalf("Unable to create logs dir (%v) for RBE: %v", config.rbeProxyLogsDir, err)
 		}
 	}
+}
+
+func startRBE(ctx Context, config Config) {
+	ctx.BeginTrace(metrics.RunSetupTool, "rbe_bootstrap")
+	defer ctx.EndTrace()
+
+	ctx.Status.Status("Starting rbe...")
 
 	cmd := Command(ctx, config, "startRBE bootstrap", rbeCommand(ctx, config, bootstrapCmd))
 
diff --git a/ui/build/soong.go b/ui/build/soong.go
index 667f0c9..0bf8862 100644
--- a/ui/build/soong.go
+++ b/ui/build/soong.go
@@ -44,12 +44,10 @@
 	availableEnvFile = "soong.environment.available"
 	usedEnvFile      = "soong.environment.used"
 
-	soongBuildTag        = "build"
-	bp2buildFilesTag     = "bp2build_files"
-	bp2buildWorkspaceTag = "bp2build_workspace"
-	jsonModuleGraphTag   = "modulegraph"
-	queryviewTag         = "queryview"
-	soongDocsTag         = "soong_docs"
+	soongBuildTag      = "build"
+	jsonModuleGraphTag = "modulegraph"
+	queryviewTag       = "queryview"
+	soongDocsTag       = "soong_docs"
 
 	// bootstrapEpoch is used to determine if an incremental build is incompatible with the current
 	// version of bootstrap and needs cleaning before continuing the build.  Increment this for
@@ -275,7 +273,6 @@
 func bootstrapGlobFileList(config Config) []string {
 	return []string{
 		config.NamedGlobFile(getGlobPathName(config)),
-		config.NamedGlobFile(bp2buildFilesTag),
 		config.NamedGlobFile(jsonModuleGraphTag),
 		config.NamedGlobFile(queryviewTag),
 		config.NamedGlobFile(soongDocsTag),
@@ -295,18 +292,6 @@
 	if config.EmptyNinjaFile() {
 		mainSoongBuildExtraArgs = append(mainSoongBuildExtraArgs, "--empty-ninja-file")
 	}
-	if config.bazelProdMode {
-		mainSoongBuildExtraArgs = append(mainSoongBuildExtraArgs, "--bazel-mode")
-	}
-	if config.bazelStagingMode {
-		mainSoongBuildExtraArgs = append(mainSoongBuildExtraArgs, "--bazel-mode-staging")
-	}
-	if config.IsPersistentBazelEnabled() {
-		mainSoongBuildExtraArgs = append(mainSoongBuildExtraArgs, "--use-bazel-proxy")
-	}
-	if len(config.bazelForceEnabledModules) > 0 {
-		mainSoongBuildExtraArgs = append(mainSoongBuildExtraArgs, "--bazel-force-enabled-modules="+config.bazelForceEnabledModules)
-	}
 	if config.MultitreeBuild() {
 		mainSoongBuildExtraArgs = append(mainSoongBuildExtraArgs, "--multitree-build")
 	}
@@ -328,24 +313,6 @@
 			specificArgs: mainSoongBuildExtraArgs,
 		},
 		{
-			name:        bp2buildFilesTag,
-			description: fmt.Sprintf("converting Android.bp files to BUILD files at %s/bp2build", config.SoongOutDir()),
-			config:      config,
-			output:      config.Bp2BuildFilesMarkerFile(),
-			specificArgs: append(baseArgs,
-				"--bp2build_marker", config.Bp2BuildFilesMarkerFile(),
-			),
-		},
-		{
-			name:        bp2buildWorkspaceTag,
-			description: "Creating Bazel symlink forest",
-			config:      config,
-			output:      config.Bp2BuildWorkspaceMarkerFile(),
-			specificArgs: append(baseArgs,
-				"--symlink_forest_marker", config.Bp2BuildWorkspaceMarkerFile(),
-			),
-		},
-		{
 			name:        jsonModuleGraphTag,
 			description: fmt.Sprintf("generating the Soong module graph at %s", config.ModuleGraphFile()),
 			config:      config,
@@ -410,22 +377,6 @@
 			pbf.debugPort = delvePort
 		}
 		pbi := pbf.primaryBuilderInvocation()
-		// Some invocations require adjustment:
-		switch pbf.name {
-		case soongBuildTag:
-			if config.BazelBuildEnabled() {
-				// Mixed builds call Bazel from soong_build and they therefore need the
-				// Bazel workspace to be available. Make that so by adding a dependency on
-				// the bp2build marker file to the action that invokes soong_build .
-				pbi.OrderOnlyInputs = append(pbi.OrderOnlyInputs, config.Bp2BuildWorkspaceMarkerFile())
-			}
-		case bp2buildWorkspaceTag:
-			pbi.Inputs = append(pbi.Inputs,
-				config.Bp2BuildFilesMarkerFile(),
-				filepath.Join(config.FileListDir(), "bazel.list"))
-		case bp2buildFilesTag:
-			pbi.Inputs = append(pbi.Inputs, filepath.Join(config.FileListDir(), "METADATA.list"))
-		}
 		invocations = append(invocations, pbi)
 	}
 
@@ -603,16 +554,7 @@
 
 	soongBuildEnv := config.Environment().Copy()
 	soongBuildEnv.Set("TOP", os.Getenv("TOP"))
-	// For Bazel mixed builds.
-	soongBuildEnv.Set("BAZEL_PATH", "./build/bazel/bin/bazel")
-	// Bazel's HOME var is set to an output subdirectory which doesn't exist. This
-	// prevents Bazel from file I/O in the actual user HOME directory.
-	soongBuildEnv.Set("BAZEL_HOME", absPath(ctx, filepath.Join(config.BazelOutDir(), "bazelhome")))
-	soongBuildEnv.Set("BAZEL_OUTPUT_BASE", config.bazelOutputBase())
-	soongBuildEnv.Set("BAZEL_WORKSPACE", absPath(ctx, "."))
-	soongBuildEnv.Set("BAZEL_METRICS_DIR", config.BazelMetricsDir())
 	soongBuildEnv.Set("LOG_DIR", config.LogsDir())
-	soongBuildEnv.Set("BAZEL_DEPS_FILE", absPath(ctx, filepath.Join(config.BazelOutDir(), "bazel.list")))
 
 	// For Soong bootstrapping tests
 	if os.Getenv("ALLOW_MISSING_DEPENDENCIES") == "true" {
@@ -630,13 +572,9 @@
 
 		checkEnvironmentFile(ctx, soongBuildEnv, config.UsedEnvFile(soongBuildTag))
 
-		if config.BazelBuildEnabled() || config.Bp2Build() {
-			checkEnvironmentFile(ctx, soongBuildEnv, config.UsedEnvFile(bp2buildFilesTag))
-		} else {
-			// Remove bazel files in the event that bazel is disabled for the build.
-			// These files may have been left over from a previous bazel-enabled build.
-			cleanBazelFiles(config)
-		}
+		// Remove bazel files in the event that bazel is disabled for the build.
+		// These files may have been left over from a previous bazel-enabled build.
+		cleanBazelFiles(config)
 
 		if config.JsonModuleGraph() {
 			checkEnvironmentFile(ctx, soongBuildEnv, config.UsedEnvFile(jsonModuleGraphTag))
@@ -658,14 +596,6 @@
 		ctx.BeginTrace(metrics.RunSoong, "bootstrap")
 		defer ctx.EndTrace()
 
-		if config.IsPersistentBazelEnabled() {
-			bazelProxy := bazel.NewProxyServer(ctx.Logger, config.OutDir(), filepath.Join(config.SoongOutDir(), "workspace"), config.GetBazeliskBazelVersion())
-			if err := bazelProxy.Start(); err != nil {
-				ctx.Fatalf("Failed to create bazel proxy")
-			}
-			defer bazelProxy.Close()
-		}
-
 		fifo := filepath.Join(config.OutDir(), ".ninja_fifo")
 		nr := status.NewNinjaReader(ctx, ctx.Status.StartTool(), fifo)
 		defer nr.Close()
@@ -709,10 +639,6 @@
 		targets = append(targets, config.ModuleGraphFile())
 	}
 
-	if config.Bp2Build() {
-		targets = append(targets, config.Bp2BuildWorkspaceMarkerFile())
-	}
-
 	if config.Queryview() {
 		targets = append(targets, config.QueryviewMarkerFile())
 	}
diff --git a/ui/build/test_build.go b/ui/build/test_build.go
index 2efc732..c5dc4c5 100644
--- a/ui/build/test_build.go
+++ b/ui/build/test_build.go
@@ -15,47 +15,16 @@
 package build
 
 import (
+	"android/soong/ui/metrics"
+	"android/soong/ui/status"
 	"bufio"
 	"fmt"
 	"path/filepath"
-	"regexp"
 	"runtime"
 	"sort"
 	"strings"
-	"sync"
-
-	"android/soong/ui/metrics"
-	"android/soong/ui/status"
 )
 
-var (
-	// bazel output paths are in __main__/bazel-out/<config-specific-path>/bin
-	bazelOutputPathRegexOnce sync.Once
-	bazelOutputPathRegexp    *regexp.Regexp
-)
-
-func bazelOutputPathPattern(config Config) *regexp.Regexp {
-	bazelOutputPathRegexOnce.Do(func() {
-		// Bazel output files are in <Bazel output base>/execroot/__main__/bazel-out/<config>/bin
-		bazelOutRoot := filepath.Join(regexp.QuoteMeta(config.bazelOutputBase()), "execroot", "__main__", "bazel-out")
-		bazelOutputPathRegexp = regexp.MustCompile(bazelOutRoot + "/[^/]+/bin")
-	})
-	return bazelOutputPathRegexp
-}
-
-func ignoreBazelPath(config Config, path string) bool {
-	bazelRoot := filepath.Join(config.bazelOutputBase(), "execroot")
-	// Don't check bazel output regexp unless it is Bazel path
-	if strings.HasPrefix(path, bazelRoot) {
-		bazelOutputRegexp := bazelOutputPathPattern(config)
-		// if the file is a bazel path that is _not_ a Bazel generated file output, we rely on Bazel to
-		// ensure the paths to exist. If it _is_ a Bazel output path, we expect that it should be built
-		// by Ninja.
-		return !bazelOutputRegexp.MatchString(path)
-	}
-	return false
-}
-
 // Checks for files in the out directory that have a rule that depends on them but no rule to
 // create them. This catches a common set of build failures where a rule to generate a file is
 // deleted (either by deleting a module in an Android.mk file, or by modifying the build system
@@ -128,9 +97,6 @@
 			continue
 		}
 
-		if ignoreBazelPath(config, line) {
-			continue
-		}
 		danglingRules[line] = true
 	}
 
diff --git a/ui/build/upload_test.go b/ui/build/upload_test.go
deleted file mode 100644
index 1fcded9..0000000
--- a/ui/build/upload_test.go
+++ /dev/null
@@ -1,299 +0,0 @@
-// Copyright 2020 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package build
-
-import (
-	"errors"
-	"io/ioutil"
-	"os"
-	"path/filepath"
-	"reflect"
-	"sort"
-	"strconv"
-	"strings"
-	"testing"
-	"time"
-
-	"android/soong/ui/logger"
-)
-
-func writeBazelProfileFile(dir string) error {
-	contents := `
-
-=== PHASE SUMMARY INFORMATION ===
-
-Total launch phase time                              1.193 s   15.77%
-Total init phase time                                1.092 s   14.44%
-Total target pattern evaluation phase time           0.580 s    7.67%
-Total interleaved loading-and-analysis phase time    3.646 s   48.21%
-Total preparation phase time                         0.022 s    0.30%
-Total execution phase time                           0.993 s   13.13%
-Total finish phase time                              0.036 s    0.48%
----------------------------------------------------------------------
-Total run time                                       7.563 s  100.00%
-
-Critical path (178 ms):
-       Time Percentage   Description
-     178 ms  100.00%   action 'BazelWorkspaceStatusAction stable-status.txt'
-
-`
-	file := filepath.Join(dir, "bazel_metrics.txt")
-	return os.WriteFile(file, []byte(contents), 0666)
-}
-
-func TestPruneMetricsFiles(t *testing.T) {
-	rootDir := t.TempDir()
-
-	dirs := []string{
-		filepath.Join(rootDir, "d1"),
-		filepath.Join(rootDir, "d1", "d2"),
-		filepath.Join(rootDir, "d1", "d2", "d3"),
-	}
-
-	files := []string{
-		filepath.Join(rootDir, "d1", "f1"),
-		filepath.Join(rootDir, "d1", "d2", "f1"),
-		filepath.Join(rootDir, "d1", "d2", "d3", "f1"),
-	}
-
-	for _, d := range dirs {
-		if err := os.MkdirAll(d, 0777); err != nil {
-			t.Fatalf("got %v, expecting nil error for making directory %q", err, d)
-		}
-	}
-
-	for _, f := range files {
-		if err := ioutil.WriteFile(f, []byte{}, 0777); err != nil {
-			t.Fatalf("got %v, expecting nil error on writing file %q", err, f)
-		}
-	}
-
-	want := []string{
-		filepath.Join(rootDir, "d1", "f1"),
-		filepath.Join(rootDir, "d1", "d2", "f1"),
-		filepath.Join(rootDir, "d1", "d2", "d3", "f1"),
-	}
-
-	got := pruneMetricsFiles([]string{rootDir})
-
-	sort.Strings(got)
-	sort.Strings(want)
-
-	if !reflect.DeepEqual(got, want) {
-		t.Errorf("got %q, want %q after pruning metrics files", got, want)
-	}
-}
-
-func TestUploadMetrics(t *testing.T) {
-	ctx := testContext()
-	tests := []struct {
-		description string
-		uploader    string
-		createFiles bool
-		files       []string
-	}{{
-		description: "no metrics uploader",
-	}, {
-		description: "non-existent metrics files no upload",
-		uploader:    "echo",
-		files:       []string{"metrics_file_1", "metrics_file_2", "metrics_file_3, bazel_metrics.pb"},
-	}, {
-		description: "trigger upload",
-		uploader:    "echo",
-		createFiles: true,
-		files:       []string{"metrics_file_1", "metrics_file_2, bazel_metrics.pb"},
-	}}
-
-	for _, tt := range tests {
-		t.Run(tt.description, func(t *testing.T) {
-			defer logger.Recover(func(err error) {
-				t.Fatalf("got unexpected error: %v", err)
-			})
-
-			outDir, err := ioutil.TempDir("", "")
-			if err != nil {
-				t.Fatalf("failed to create out directory: %v", outDir)
-			}
-			defer os.RemoveAll(outDir)
-
-			// Supply our own tmpDir to delete the temp dir once the test is done.
-			orgTmpDir := tmpDir
-			tmpDir = func(string, string) (string, error) {
-				retDir := filepath.Join(outDir, "tmp_upload_dir")
-				if err := os.Mkdir(retDir, 0755); err != nil {
-					t.Fatalf("failed to create temporary directory %q: %v", retDir, err)
-				}
-				return retDir, nil
-			}
-			defer func() { tmpDir = orgTmpDir }()
-
-			metricsUploadDir := filepath.Join(outDir, ".metrics_uploader")
-			if err := os.Mkdir(metricsUploadDir, 0755); err != nil {
-				t.Fatalf("failed to create %q directory for oauth valid check: %v", metricsUploadDir, err)
-			}
-
-			var metricsFiles []string
-			if tt.createFiles {
-				for _, f := range tt.files {
-					filename := filepath.Join(outDir, f)
-					metricsFiles = append(metricsFiles, filename)
-					if err := ioutil.WriteFile(filename, []byte("test file"), 0644); err != nil {
-						t.Fatalf("failed to create a fake metrics file %q for uploading: %v", filename, err)
-					}
-				}
-			}
-			if err := writeBazelProfileFile(outDir); err != nil {
-				t.Fatalf("failed to create bazel profile file in dir: %v", outDir)
-			}
-
-			config := Config{&configImpl{
-				environ: &Environment{
-					"OUT_DIR=" + outDir,
-				},
-				buildDateTime:   strconv.FormatInt(time.Now().UnixNano()/int64(time.Millisecond), 10),
-				metricsUploader: tt.uploader,
-			}}
-
-			UploadMetrics(ctx, config, false, time.Now(), metricsFiles...)
-		})
-	}
-}
-
-func TestUploadMetricsErrors(t *testing.T) {
-	ctx := testContext()
-	tests := []struct {
-		description string
-		tmpDir      string
-		tmpDirErr   error
-		expectedErr string
-	}{{
-		description: "getTmpDir returned error",
-		tmpDirErr:   errors.New("getTmpDir failed"),
-		expectedErr: "getTmpDir failed",
-	}, {
-		description: "copyFile operation error",
-		tmpDir:      "/fake_dir",
-		expectedErr: "failed to copy",
-	}}
-
-	for _, tt := range tests {
-		t.Run(tt.description, func(t *testing.T) {
-			defer logger.Recover(func(err error) {
-				got := err.Error()
-				if !strings.Contains(got, tt.expectedErr) {
-					t.Errorf("got %q, want %q to be contained in error", got, tt.expectedErr)
-				}
-			})
-
-			outDir, err := ioutil.TempDir("", "")
-			if err != nil {
-				t.Fatalf("failed to create out directory: %v", outDir)
-			}
-			defer os.RemoveAll(outDir)
-
-			orgTmpDir := tmpDir
-			tmpDir = func(string, string) (string, error) {
-				return tt.tmpDir, tt.tmpDirErr
-			}
-			defer func() { tmpDir = orgTmpDir }()
-
-			metricsFile := filepath.Join(outDir, "metrics_file_1")
-			if err := ioutil.WriteFile(metricsFile, []byte("test file"), 0644); err != nil {
-				t.Fatalf("failed to create a fake metrics file %q for uploading: %v", metricsFile, err)
-			}
-
-			config := Config{&configImpl{
-				environ: &Environment{
-					"OUT_DIR=/bad",
-				},
-				metricsUploader: "echo",
-			}}
-
-			UploadMetrics(ctx, config, true, time.Now(), metricsFile)
-			t.Errorf("got nil, expecting %q as a failure", tt.expectedErr)
-		})
-	}
-}
-
-func TestParsePercentageToTenThousandths(t *testing.T) {
-	// 2.59% should be returned as 259 - representing 259/10000 of the build
-	percentage := parsePercentageToTenThousandths("2.59%")
-	if percentage != 259 {
-		t.Errorf("Expected percentage to be returned as ten-thousandths. Expected 259, have %d\n", percentage)
-	}
-
-	// Test without a leading digit
-	percentage = parsePercentageToTenThousandths(".52%")
-	if percentage != 52 {
-		t.Errorf("Expected percentage to be returned as ten-thousandths. Expected 52, have %d\n", percentage)
-	}
-}
-
-func TestParseTimingToNanos(t *testing.T) {
-	// This parses from seconds (with millis precision) and returns nanos
-	timingNanos := parseTimingToNanos("0.111")
-	if timingNanos != 111000000 {
-		t.Errorf("Error parsing timing. Expected 111000, have %d\n", timingNanos)
-	}
-
-	// Test without a leading digit
-	timingNanos = parseTimingToNanos(".112")
-	if timingNanos != 112000000 {
-		t.Errorf("Error parsing timing. Expected 112000, have %d\n", timingNanos)
-	}
-}
-
-func TestParsePhaseTiming(t *testing.T) {
-	// Sample lines include:
-	// Total launch phase time   0.011 s    2.59%
-	// Total target pattern evaluation phase time  0.012 s    4.59%
-
-	line1 := "Total launch phase time   0.011 s    2.59%"
-	timing := parsePhaseTiming(line1)
-
-	if timing.GetPhaseName() != "launch" {
-		t.Errorf("Failed to parse phase name. Expected launch, have %s\n", timing.GetPhaseName())
-	} else if timing.GetDurationNanos() != 11000000 {
-		t.Errorf("Failed to parse duration nanos. Expected 11000000, have %d\n", timing.GetDurationNanos())
-	} else if timing.GetPortionOfBuildTime() != 259 {
-		t.Errorf("Failed to parse portion of build time. Expected 259, have %d\n", timing.GetPortionOfBuildTime())
-	}
-
-	// Test with a multiword phase name
-	line2 := "Total target pattern evaluation phase  time  0.012 s    4.59%"
-
-	timing = parsePhaseTiming(line2)
-	if timing.GetPhaseName() != "target pattern evaluation" {
-		t.Errorf("Failed to parse phase name. Expected target pattern evaluation, have %s\n", timing.GetPhaseName())
-	} else if timing.GetDurationNanos() != 12000000 {
-		t.Errorf("Failed to parse duration nanos. Expected 12000000, have %d\n", timing.GetDurationNanos())
-	} else if timing.GetPortionOfBuildTime() != 459 {
-		t.Errorf("Failed to parse portion of build time. Expected 459, have %d\n", timing.GetPortionOfBuildTime())
-	}
-}
-
-func TestParseTotal(t *testing.T) {
-	// Total line is in the form of:
-	// Total run time                                       7.563 s  100.00%
-
-	line := "Total run time                                       7.563 s  100.00%"
-
-	total := parseTotal(line)
-
-	// Only the seconds field is parsed, as nanos
-	if total != 7563000000 {
-		t.Errorf("Failed to parse total build time. Expected 7563000000, have %d\n", total)
-	}
-}
diff --git a/ui/status/ninja.go b/ui/status/ninja.go
index 1e97908..f4e3fb8 100644
--- a/ui/status/ninja.go
+++ b/ui/status/ninja.go
@@ -194,7 +194,7 @@
 
 			if estimatedDuration > 0 {
 				n.status.SetEstimatedTime(time.Now().Add(estimatedDuration))
-				n.status.Verbose(fmt.Sprintf("parallelism: %d, estimiated from total time: %s, critical path time: %s",
+				n.status.Verbose(fmt.Sprintf("parallelism: %d, estimated from total time: %s, critical path time: %s",
 					parallelism,
 					estimatedDurationFromTotal,
 					estimatedDurationFromCriticalPath))
diff --git a/xml/Android.bp b/xml/Android.bp
index d4753de..1542930 100644
--- a/xml/Android.bp
+++ b/xml/Android.bp
@@ -9,7 +9,6 @@
         "blueprint",
         "blueprint-pathtools",
         "soong",
-        "soong-bp2build",
         "soong-android",
         "soong-etc",
     ],
@@ -19,7 +18,6 @@
     ],
     testSrcs: [
         "xml_test.go",
-        "xml_conversion_test.go",
     ],
     pluginFor: ["soong_build"],
 }
diff --git a/xml/xml.go b/xml/xml.go
index 65fe12a..c281078 100644
--- a/xml/xml.go
+++ b/xml/xml.go
@@ -16,7 +16,6 @@
 
 import (
 	"android/soong/android"
-	"android/soong/bazel"
 	"android/soong/etc"
 
 	"github.com/google/blueprint"
@@ -68,8 +67,6 @@
 }
 
 type prebuiltEtcXml struct {
-	android.BazelModuleBase
-
 	etc.PrebuiltEtc
 
 	properties prebuiltEtcXmlProperties
@@ -132,44 +129,5 @@
 	etc.InitPrebuiltEtcModule(&module.PrebuiltEtc, "etc")
 	// This module is device-only
 	android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
-	android.InitBazelModule(module)
 	return module
 }
-
-type bazelPrebuiltEtcXmlAttributes struct {
-	Src               bazel.LabelAttribute
-	Filename          bazel.LabelAttribute
-	Dir               string
-	Installable       bazel.BoolAttribute
-	Filename_from_src bazel.BoolAttribute
-	Schema            *string
-}
-
-func (p *prebuiltEtcXml) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	baseAttrs, convertible := p.PrebuiltEtc.Bp2buildHelper(ctx)
-
-	if !convertible {
-		return
-	}
-
-	var schema *string
-	if p.properties.Schema != nil {
-		schema = p.properties.Schema
-	}
-
-	attrs := &bazelPrebuiltEtcXmlAttributes{
-		Src:               baseAttrs.Src,
-		Filename:          baseAttrs.Filename,
-		Dir:               baseAttrs.Dir,
-		Installable:       baseAttrs.Installable,
-		Filename_from_src: baseAttrs.Filename_from_src,
-		Schema:            schema,
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "prebuilt_xml",
-		Bzl_load_location: "//build/bazel/rules/prebuilt_xml.bzl",
-	}
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: p.Name()}, attrs)
-}
diff --git a/xml/xml_conversion_test.go b/xml/xml_conversion_test.go
deleted file mode 100644
index c052b44..0000000
--- a/xml/xml_conversion_test.go
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright 2022 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package xml
-
-import (
-	"android/soong/android"
-	"android/soong/bp2build"
-
-	"testing"
-)
-
-func runXmlPrebuiltEtcTestCase(t *testing.T, tc bp2build.Bp2buildTestCase) {
-	t.Helper()
-	(&tc).ModuleTypeUnderTest = "prebuilt_etc_xml"
-	(&tc).ModuleTypeUnderTestFactory = PrebuiltEtcXmlFactory
-	bp2build.RunBp2BuildTestCase(t, registerXmlModuleTypes, tc)
-}
-
-func registerXmlModuleTypes(ctx android.RegistrationContext) {
-}
-
-func TestXmlPrebuiltEtcSimple(t *testing.T) {
-	runXmlPrebuiltEtcTestCase(t, bp2build.Bp2buildTestCase{
-		Description: "prebuilt_etc_xml - simple example",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-prebuilt_etc_xml {
-    name: "foo",
-    src: "fooSrc",
-    filename: "fooFileName",
-    sub_dir: "fooDir",
-    schema: "foo.dtd",
-}
-`,
-		ExpectedBazelTargets: []string{
-			bp2build.MakeBazelTarget("prebuilt_xml", "foo", bp2build.AttrNameToString{
-				"src":      `"fooSrc"`,
-				"filename": `"fooFileName"`,
-				"dir":      `"etc/fooDir"`,
-				"schema":   `"foo.dtd"`,
-			})}})
-}
-
-func TestXmlPrebuiltEtcFilenameFromSrc(t *testing.T) {
-	runXmlPrebuiltEtcTestCase(t, bp2build.Bp2buildTestCase{
-		Description: "prebuilt_etc_xml - filenameFromSrc True  ",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-prebuilt_etc_xml {
-    name: "foo",
-    src: "fooSrc",
-    filename_from_src: true,
-    sub_dir: "fooDir",
-    schema: "foo.dtd",
-}
-`,
-		ExpectedBazelTargets: []string{
-			bp2build.MakeBazelTarget("prebuilt_xml", "foo", bp2build.AttrNameToString{
-				"src":      `"fooSrc"`,
-				"filename": `"fooSrc"`,
-				"dir":      `"etc/fooDir"`,
-				"schema":   `"foo.dtd"`,
-			})}})
-}
-
-func TestXmlPrebuiltEtcFilenameAndFilenameFromSrc(t *testing.T) {
-	runXmlPrebuiltEtcTestCase(t, bp2build.Bp2buildTestCase{
-		Description: "prebuilt_etc_xml - filename provided and filenameFromSrc True  ",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-prebuilt_etc_xml {
-    name: "foo",
-    src: "fooSrc",
-    filename: "fooFileName",
-    filename_from_src: true,
-    sub_dir: "fooDir",
-    schema: "foo.dtd",
-}
-`,
-		ExpectedBazelTargets: []string{
-			bp2build.MakeBazelTarget("prebuilt_xml", "foo", bp2build.AttrNameToString{
-				"src":      `"fooSrc"`,
-				"filename": `"fooFileName"`,
-				"dir":      `"etc/fooDir"`,
-				"schema":   `"foo.dtd"`,
-			})}})
-}
-
-func TestXmlPrebuiltEtcFileNameFromSrcMultipleSrcs(t *testing.T) {
-	runXmlPrebuiltEtcTestCase(t, bp2build.Bp2buildTestCase{
-		Description: "prebuilt_etc - filename_from_src is true but there are multiple srcs",
-		Filesystem:  map[string]string{},
-		Blueprint: `
-prebuilt_etc_xml {
-    name: "foo",
-    filename_from_src: true,
-    arch: {
-        arm: {
-            src: "barSrc",
-        },
-        arm64: {
-            src: "bazSrc",
-        },
-    }
-}
-`,
-		ExpectedBazelTargets: []string{
-			bp2build.MakeBazelTarget("prebuilt_xml", "foo", bp2build.AttrNameToString{
-				"filename_from_src": `True`,
-				"dir":               `"etc"`,
-				"src": `select({
-        "//build/bazel_common_rules/platforms/arch:arm": "barSrc",
-        "//build/bazel_common_rules/platforms/arch:arm64": "bazSrc",
-        "//conditions:default": None,
-    })`,
-			})}})
-}
