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

Commit 8f25d296 authored by Jihoon Kang's avatar Jihoon Kang Committed by Gerrit Code Review
Browse files

Revert "Remove compilation actions from java sdk library"

Revert submission 3070882-sdk_lib_remove_compilation

Reason for revert: Potential culprit for build breakage of barbet-ap2a-userdebug in git_main

Reverted changes: /q/submissionid:3070882-sdk_lib_remove_compilation

Change-Id: I5135760e13e0152480c68fe91a3c88564e9bc7cb
parent d831af42
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1122,7 +1122,7 @@ func AndroidMkEntriesForTest(t *testing.T, ctx *TestContext, mod blueprint.Modul

	entriesList := p.AndroidMkEntries()
	aconfigUpdateAndroidMkEntries(ctx, mod.(Module), &entriesList)
	for i := range entriesList {
	for i, _ := range entriesList {
		entriesList[i].fillInEntries(ctx, mod)
	}
	return entriesList
+1 −7
Original line number Diff line number Diff line
@@ -1672,13 +1672,7 @@ func apexFileForJavaModuleWithFile(ctx android.BaseModuleContext, module javaMod
	af.jacocoReportClassesFile = module.JacocoReportClassesFile()
	af.lintDepSets = module.LintDepSets()
	af.customStem = module.Stem() + ".jar"
	// TODO: b/338641779 - Remove special casing of sdkLibrary once bcpf and sscpf depends
	// on the implementation library
	if sdkLib, ok := module.(*java.SdkLibrary); ok {
		for _, install := range sdkLib.BuiltInstalledForApex() {
			af.requiredModuleNames = append(af.requiredModuleNames, install.FullModuleName())
		}
	} else if dexpreopter, ok := module.(java.DexpreopterInterface); ok {
	if dexpreopter, ok := module.(java.DexpreopterInterface); ok {
		for _, install := range dexpreopter.DexpreoptBuiltInstalledForApex() {
			af.requiredModuleNames = append(af.requiredModuleNames, install.FullModuleName())
		}
+2 −2
Original line number Diff line number Diff line
@@ -7167,7 +7167,7 @@ func TestJavaSDKLibrary_WithinApex(t *testing.T) {

	// The bar library should depend on the implementation jar.
	barLibrary := ctx.ModuleForTests("bar", "android_common_myapex").Rule("javac")
	if expected, actual := `^-classpath [^:]*/turbine-combined/foo\.jar$`, barLibrary.Args["classpath"]; !regexp.MustCompile(expected).MatchString(actual) {
	if expected, actual := `^-classpath [^:]*/turbine-combined/foo\.impl\.jar$`, barLibrary.Args["classpath"]; !regexp.MustCompile(expected).MatchString(actual) {
		t.Errorf("expected %q, found %#q", expected, actual)
	}
}
@@ -7308,7 +7308,7 @@ func TestJavaSDKLibrary_ImportPreferred(t *testing.T) {

	// The bar library should depend on the implementation jar.
	barLibrary := ctx.ModuleForTests("bar", "android_common_myapex").Rule("javac")
	if expected, actual := `^-classpath [^:]*/turbine-combined/foo\.jar$`, barLibrary.Args["classpath"]; !regexp.MustCompile(expected).MatchString(actual) {
	if expected, actual := `^-classpath [^:]*/turbine-combined/foo\.impl\.jar$`, barLibrary.Args["classpath"]; !regexp.MustCompile(expected).MatchString(actual) {
		t.Errorf("expected %q, found %#q", expected, actual)
	}
}
+2 −2
Original line number Diff line number Diff line
@@ -161,8 +161,8 @@ func TestJavaSdkLibrary_RequireXmlPermissionFile(t *testing.T) {
		moduleName string
		expected   []string
	}{
		{"foo-shared_library", []string{"foo-shared_library.impl", "foo-shared_library.xml"}},
		{"foo-no_shared_library", []string{"foo-no_shared_library.impl"}},
		{"foo-shared_library", []string{"foo-shared_library.xml"}},
		{"foo-no_shared_library", nil},
	}
	for _, tc := range testCases {
		mod := result.ModuleForTests(tc.moduleName, "android_common").Module()
+1 −5
Original line number Diff line number Diff line
@@ -1682,11 +1682,7 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars, extraClasspath
			j.dexJarFile = makeDexJarPathFromPath(dexOutputFile)

			// Dexpreopting
			libName := android.RemoveOptionalPrebuiltPrefix(ctx.ModuleName())
			if j.SdkLibraryName() != nil && strings.HasSuffix(ctx.ModuleName(), ".impl") {
				libName = strings.TrimSuffix(libName, ".impl")
			}
			j.dexpreopt(ctx, libName, dexOutputFile)
			j.dexpreopt(ctx, android.RemoveOptionalPrebuiltPrefix(ctx.ModuleName()), dexOutputFile)

			outputFile = dexOutputFile
		} else {
Loading