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

Commit 2be18e8d authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 10929702 from f8a83c19 to 24Q1-release

Change-Id: Id59c79b57cc7a73cd9758e15fb74ee83792efbb4
parents dce7c716 f8a83c19
Loading
Loading
Loading
Loading
+32 −25
Original line number Diff line number Diff line
@@ -340,8 +340,12 @@ var (
		"packages/modules/adb/pairing_connection":            Bp2BuildDefaultTrueRecursively,
		"packages/modules/adb/proto":                         Bp2BuildDefaultTrueRecursively,
		"packages/modules/adb/tls":                           Bp2BuildDefaultTrueRecursively,
		"packages/modules/Connectivity/bpf_progs":            Bp2BuildDefaultTrueRecursively,
		"packages/modules/Connectivity/service-t":            Bp2BuildDefaultTrueRecursively,
		"packages/modules/Connectivity/service/native":       Bp2BuildDefaultTrueRecursively,
		"packages/modules/Connectivity/staticlibs/native":    Bp2BuildDefaultTrueRecursively,
		"packages/modules/Connectivity/staticlibs/netd/libnetdutils": Bp2BuildDefaultTrueRecursively,
		"packages/modules/Connectivity/staticlibs/netd":      Bp2BuildDefaultTrueRecursively,
		"packages/modules/Connectivity/tests/unit/jni":       Bp2BuildDefaultTrueRecursively,
		"packages/modules/Gki/libkver":                       Bp2BuildDefaultTrue,
		"packages/modules/NetworkStack/common/captiveportal": Bp2BuildDefaultTrue,
		"packages/modules/NeuralNetworks/apex":               Bp2BuildDefaultTrue,
@@ -997,6 +1001,9 @@ var (
		"tradefed-device-build-interfaces",
		"tradefed-invocation-interfaces",
		"tradefed-lib-core",

		"libandroid_net_connectivity_com_android_net_module_util_jni",
		"libservice-connectivity",
	}

	Bp2buildModuleTypeAlwaysConvertList = []string{
+11 −0
Original line number Diff line number Diff line
@@ -544,7 +544,18 @@ func (b *BazelModuleBase) shouldConvertWithBp2build(ctx shouldConvertModuleConte
	}

	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
+7 −1
Original line number Diff line number Diff line
@@ -1015,12 +1015,18 @@ func (c *config) FinalApiLevels() []ApiLevel {

func (c *config) PreviewApiLevels() []ApiLevel {
	var levels []ApiLevel
	for i, codename := range c.PlatformVersionActiveCodenames() {
	i := 0
	for _, codename := range c.PlatformVersionActiveCodenames() {
		if codename == "REL" {
			continue
		}

		levels = append(levels, ApiLevel{
			value:     codename,
			number:    i,
			isPreview: true,
		})
		i++
	}
	return levels
}
+59 −0
Original line number Diff line number Diff line
@@ -5178,6 +5178,7 @@ ndk_library {
		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"`,
@@ -5305,3 +5306,61 @@ cc_library_static {
		},
	})
}

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)
}
+0 −20
Original line number Diff line number Diff line
@@ -631,23 +631,3 @@ cc_test {
		},
	})
}

func TestCcTest_UnitTestFalse(t *testing.T) {
	runCcTestTestCase(t, ccTestBp2buildTestCase{
		description: "cc test with test_options.tags converted to tags",
		blueprint: `
cc_test {
    name: "mytest",
    host_supported: true,
    srcs: ["test.cpp"],
    test_options: { unit_test: false },
}
` + simpleModule("cc_library_static", "libgtest_main") +
			simpleModule("cc_library_static", "libgtest"),
		stubbedBuildDefinitions: []string{
			"libgtest_main",
			"libgtest",
		},
		targets: []testBazelTarget{},
	})
}
Loading