aboutsummaryrefslogtreecommitdiffstats
path: root/sysprop/sysprop_library.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2019-04-16 14:43:28 -0700
committerColin Cross <ccross@android.com>2019-04-16 21:46:28 +0000
commitf8b860a0fb98448dd44db835d5f146e8a50e5ef5 (patch)
treedd9e592e116916035dcfc5b84552a5ffef5139cf /sysprop/sysprop_library.go
parent819635624843ae286cefae6a9a89d3d90ed61cd8 (diff)
downloadbuild_soong-f8b860a0fb98448dd44db835d5f146e8a50e5ef5.tar.gz
build_soong-f8b860a0fb98448dd44db835d5f146e8a50e5ef5.tar.bz2
build_soong-f8b860a0fb98448dd44db835d5f146e8a50e5ef5.zip
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
Diffstat (limited to 'sysprop/sysprop_library.go')
-rw-r--r--sysprop/sysprop_library.go7
1 files changed, 2 insertions, 5 deletions
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
}