Remove framework-modules naming scheme
The naming_scheme property was not removed as it may be useful for future when migrating to java_sdk_library. Bug: 168301990 Test: m nothing Change-Id: Ie97dd60355a207f1312a2dd910f1fb25b46fd737
This commit is contained in:
@@ -575,9 +575,7 @@ func (paths *scopePaths) extractStubsSourceAndApiInfoFromApiStubsProvider(dep an
|
|||||||
type commonToSdkLibraryAndImportProperties struct {
|
type commonToSdkLibraryAndImportProperties struct {
|
||||||
// The naming scheme to use for the components that this module creates.
|
// The naming scheme to use for the components that this module creates.
|
||||||
//
|
//
|
||||||
// If not specified then it defaults to "default". The other allowable value is
|
// If not specified then it defaults to "default".
|
||||||
// "framework-modules" which matches the scheme currently used by framework modules
|
|
||||||
// for the equivalent components represented as separate Soong modules.
|
|
||||||
//
|
//
|
||||||
// This is a temporary mechanism to simplify conversion from separate modules for each
|
// This is a temporary mechanism to simplify conversion from separate modules for each
|
||||||
// component that follow a different naming pattern to the default one.
|
// component that follow a different naming pattern to the default one.
|
||||||
@@ -621,8 +619,6 @@ func (c *commonToSdkLibraryAndImport) initCommonAfterDefaultsApplied(ctx android
|
|||||||
switch schemeProperty {
|
switch schemeProperty {
|
||||||
case "default":
|
case "default":
|
||||||
c.namingScheme = &defaultNamingScheme{}
|
c.namingScheme = &defaultNamingScheme{}
|
||||||
case "framework-modules":
|
|
||||||
c.namingScheme = &frameworkModulesNamingScheme{}
|
|
||||||
default:
|
default:
|
||||||
ctx.PropertyErrorf("naming_scheme", "expected 'default' but was %q", schemeProperty)
|
ctx.PropertyErrorf("naming_scheme", "expected 'default' but was %q", schemeProperty)
|
||||||
return false
|
return false
|
||||||
@@ -1588,31 +1584,6 @@ func (s *defaultNamingScheme) apiModuleName(scope *apiScope, baseName string) st
|
|||||||
|
|
||||||
var _ sdkLibraryComponentNamingScheme = (*defaultNamingScheme)(nil)
|
var _ sdkLibraryComponentNamingScheme = (*defaultNamingScheme)(nil)
|
||||||
|
|
||||||
type frameworkModulesNamingScheme struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *frameworkModulesNamingScheme) moduleSuffix(scope *apiScope) string {
|
|
||||||
suffix := scope.name
|
|
||||||
if scope == apiScopeModuleLib {
|
|
||||||
suffix = "module_libs_"
|
|
||||||
}
|
|
||||||
return suffix
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *frameworkModulesNamingScheme) stubsLibraryModuleName(scope *apiScope, baseName string) string {
|
|
||||||
return fmt.Sprintf("%s-stubs-%sapi", baseName, s.moduleSuffix(scope))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *frameworkModulesNamingScheme) stubsSourceModuleName(scope *apiScope, baseName string) string {
|
|
||||||
return fmt.Sprintf("%s-stubs-srcs-%sapi", baseName, s.moduleSuffix(scope))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *frameworkModulesNamingScheme) apiModuleName(scope *apiScope, baseName string) string {
|
|
||||||
return fmt.Sprintf("%s-api-%sapi", baseName, s.moduleSuffix(scope))
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ sdkLibraryComponentNamingScheme = (*frameworkModulesNamingScheme)(nil)
|
|
||||||
|
|
||||||
func moduleStubLinkType(name string) (stub bool, ret linkType) {
|
func moduleStubLinkType(name string) (stub bool, ret linkType) {
|
||||||
// This suffix-based approach is fragile and could potentially mis-trigger.
|
// This suffix-based approach is fragile and could potentially mis-trigger.
|
||||||
// TODO(b/155164730): Clean this up when modules no longer reference sdk_lib stubs directly.
|
// TODO(b/155164730): Clean this up when modules no longer reference sdk_lib stubs directly.
|
||||||
|
@@ -1534,7 +1534,7 @@ func TestSnapshotWithJavaSdkLibrary_NamingScheme(t *testing.T) {
|
|||||||
apex_available: ["//apex_available:anyapex"],
|
apex_available: ["//apex_available:anyapex"],
|
||||||
srcs: ["Test.java"],
|
srcs: ["Test.java"],
|
||||||
sdk_version: "current",
|
sdk_version: "current",
|
||||||
naming_scheme: "framework-modules",
|
naming_scheme: "default",
|
||||||
public: {
|
public: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
},
|
},
|
||||||
@@ -1549,7 +1549,7 @@ java_sdk_library_import {
|
|||||||
name: "mysdk_myjavalib@current",
|
name: "mysdk_myjavalib@current",
|
||||||
sdk_member_name: "myjavalib",
|
sdk_member_name: "myjavalib",
|
||||||
apex_available: ["//apex_available:anyapex"],
|
apex_available: ["//apex_available:anyapex"],
|
||||||
naming_scheme: "framework-modules",
|
naming_scheme: "default",
|
||||||
shared_library: true,
|
shared_library: true,
|
||||||
public: {
|
public: {
|
||||||
jars: ["sdk_library/public/myjavalib-stubs.jar"],
|
jars: ["sdk_library/public/myjavalib-stubs.jar"],
|
||||||
@@ -1564,7 +1564,7 @@ java_sdk_library_import {
|
|||||||
name: "myjavalib",
|
name: "myjavalib",
|
||||||
prefer: false,
|
prefer: false,
|
||||||
apex_available: ["//apex_available:anyapex"],
|
apex_available: ["//apex_available:anyapex"],
|
||||||
naming_scheme: "framework-modules",
|
naming_scheme: "default",
|
||||||
shared_library: true,
|
shared_library: true,
|
||||||
public: {
|
public: {
|
||||||
jars: ["sdk_library/public/myjavalib-stubs.jar"],
|
jars: ["sdk_library/public/myjavalib-stubs.jar"],
|
||||||
@@ -1581,9 +1581,9 @@ sdk_snapshot {
|
|||||||
}
|
}
|
||||||
`),
|
`),
|
||||||
checkAllCopyRules(`
|
checkAllCopyRules(`
|
||||||
.intermediates/myjavalib-stubs-publicapi/android_common/javac/myjavalib-stubs-publicapi.jar -> sdk_library/public/myjavalib-stubs.jar
|
.intermediates/myjavalib.stubs/android_common/javac/myjavalib.stubs.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||||
.intermediates/myjavalib-stubs-srcs-publicapi/android_common/myjavalib-stubs-srcs-publicapi_api.txt -> sdk_library/public/myjavalib.txt
|
.intermediates/myjavalib.stubs.source/android_common/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||||
.intermediates/myjavalib-stubs-srcs-publicapi/android_common/myjavalib-stubs-srcs-publicapi_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
.intermediates/myjavalib.stubs.source/android_common/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||||
`),
|
`),
|
||||||
checkMergeZips(
|
checkMergeZips(
|
||||||
".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip",
|
".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip",
|
||||||
|
Reference in New Issue
Block a user