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
Merged-In: Id6d997eef05f6511070677974219674f248cb754
(cherry picked from commit 59b92bfdb3)
This commit is contained in:
Colin Cross
2021-06-01 14:07:56 -07:00
parent 0f9eeb753d
commit 1072a71089
2 changed files with 6 additions and 12 deletions

View File

@@ -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 {

View File

@@ -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",
},
{