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

Commit 3eaf747a authored by Romain Jobredeaux's avatar Romain Jobredeaux
Browse files

Call ResolveExcludes after arch-based sources computation in java.go

TEST: go test
Change-Id: I93a8ae5e0842dab03f73b0edb32841755d2ea435
parent 54d18347
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -755,3 +755,29 @@ func TestJavaLibraryArchVariantLibs(t *testing.T) {
		},
	})
}

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"],
    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/platforms/os:android": [],
        "//conditions:default": ["a.java"],
    })`,
			}),
			MakeNeverlinkDuplicateTarget("java_library", "java-lib-1"),
		},
	})
}
+1 −0
Original line number Diff line number Diff line
@@ -2660,6 +2660,7 @@ func (m *Library) convertLibraryAttrsBp2Build(ctx android.TopDownMutatorContext)
			}
		}
	}
	srcs.ResolveExcludes()

	javaSrcPartition := "java"
	protoSrcPartition := "proto"