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

Commit 59b92bfd authored by Colin Cross's avatar Colin Cross
Browse files

Ignore owner property when computing java_sdk_library dist subdirectory

The owner property is no longer used, the dist subdirectory is determined
by the dist_group property.

Bug: 186723288
Test: TestJavaSdkLibraryDist
Change-Id: Id6d997eef05f6511070677974219674f248cb754
parent 3dd66250
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -1233,14 +1233,7 @@ func (module *SdkLibrary) distStem() string {

// distGroup returns the subdirectory of the dist path of the stub artifacts.
func (module *SdkLibrary) distGroup() string {
	if group := proptools.String(module.sdkLibraryProperties.Dist_group); group != "" {
		return group
	}
	// TODO(b/186723288): Remove this once everything uses dist_group.
	if owner := module.ModuleBase.Owner(); owner != "" {
		return owner
	}
	return "unknown"
	return proptools.StringDefault(module.sdkLibraryProperties.Dist_group, "unknown")
}

func (module *SdkLibrary) latestApiFilegroupName(apiScope *apiScope) string {
+5 −4
Original line number Diff line number Diff line
@@ -846,7 +846,7 @@ func TestJavaSdkLibraryDist(t *testing.T) {
		PrepareForTestWithJavaSdkLibraryFiles,
	).RunTestWithBp(t, `
		java_sdk_library {
			name: "sdklib_no_owner",
			name: "sdklib_no_group",
			unsafe_ignore_missing_latest_api: true,
			srcs: ["foo.java"],
		}
@@ -887,9 +887,9 @@ func TestJavaSdkLibraryDist(t *testing.T) {
	}
	testCases := []testCase{
		{
			module:   "sdklib_no_owner",
			module:   "sdklib_no_group",
			distDir:  "apistubs/unknown/public",
			distStem: "sdklib_no_owner.jar",
			distStem: "sdklib_no_group.jar",
		},
		{
			module:   "sdklib_group_foo",
@@ -897,8 +897,9 @@ func TestJavaSdkLibraryDist(t *testing.T) {
			distStem: "sdklib_group_foo.jar",
		},
		{
			// Owner doesn't affect distDir after b/186723288.
			module:   "sdklib_owner_foo",
			distDir:  "apistubs/foo/public",
			distDir:  "apistubs/unknown/public",
			distStem: "sdklib_owner_foo.jar",
		},
		{