From f8b860a0fb98448dd44db835d5f146e8a50e5ef5 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 16 Apr 2019 14:43:28 -0700 Subject: Use LoadHook to create modules in java_sdk_library Creating new modules in a mutator is dangerous, as other mutators that need to see the new modules may already have run, in this case the prebuilts mutator. Move SdkLibraryMutator to a LoadHook instead. Also moves registering the LoadHook mutator to testing.go so it is registered for all tests. Test: m checkbuild Change-Id: I08bd76a0e6205d2ca27861058067a1562c339eed --- sysprop/sysprop_library.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sysprop/sysprop_library.go') diff --git a/sysprop/sysprop_library.go b/sysprop/sysprop_library.go index 48078d84..0313ecd0 100644 --- a/sysprop/sysprop_library.go +++ b/sysprop/sysprop_library.go @@ -18,6 +18,7 @@ import ( "android/soong/android" "android/soong/cc" "android/soong/java" + "github.com/google/blueprint" "github.com/google/blueprint/proptools" ) @@ -63,10 +64,6 @@ func (m *syspropLibrary) CcModuleName() string { return "lib" + m.Name() } -func (m *syspropLibrary) SyspropJavaModule() *java.SdkLibrary { - return &m.SdkLibrary -} - func syspropLibraryFactory() android.Module { m := &syspropLibrary{} @@ -77,7 +74,7 @@ func syspropLibraryFactory() android.Module { m.InitSdkLibraryProperties() android.InitAndroidMultiTargetsArchModule(m, android.DeviceSupported, "common") android.AddLoadHook(m, func(ctx android.LoadHookContext) { syspropLibraryHook(ctx, m) }) - + android.AddLoadHook(m, func(ctx android.LoadHookContext) { m.SdkLibrary.CreateInternalModules(ctx) }) return m } -- cgit v1.2.3