Add defaults support for bootclasspath_fragment module type am: 9272dccb1e

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2906878

Change-Id: Ia17f45a63c30986af63fe18b39ba62cae6ee1247
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jihoon Kang
2024-01-13 01:33:08 +00:00
committed by Automerger Merge Worker
2 changed files with 9 additions and 0 deletions

View File

@@ -229,6 +229,7 @@ type SourceOnlyBootclasspathProperties struct {
type BootclasspathFragmentModule struct {
android.ModuleBase
android.DefaultableModuleBase
android.ApexModuleBase
ClasspathFragmentBase
@@ -267,6 +268,7 @@ func bootclasspathFragmentFactory() android.Module {
android.InitApexModule(m)
initClasspathFragment(m, BOOTCLASSPATH)
android.InitAndroidArchModule(m, android.DeviceSupported, android.MultilibCommon)
android.InitDefaultableModule(m)
android.AddLoadHook(m, func(ctx android.LoadHookContext) {
// If code coverage has been enabled for the framework then append the properties with
@@ -399,6 +401,11 @@ func (i BootclasspathFragmentApexContentInfo) ProfileInstallPathInApex() string
func (b *BootclasspathFragmentModule) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool {
tag := ctx.OtherModuleDependencyTag(dep)
// If the module is a default module, do not check the tag
if _, ok := dep.(*Defaults); ok {
return true
}
if IsBootclasspathFragmentContentDepTag(tag) {
// Boot image contents are automatically added to apex.
return true

View File

@@ -2726,6 +2726,8 @@ func DefaultsFactory() android.Module {
&LintProperties{},
&appTestHelperAppProperties{},
&JavaApiLibraryProperties{},
&bootclasspathFragmentProperties{},
&SourceOnlyBootclasspathProperties{},
)
android.InitDefaultsModule(module)