diff options
author | Colin Cross <ccross@android.com> | 2018-10-02 22:03:40 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2018-10-08 15:20:56 -0700 |
commit | a4f08813a34418a07aa0ebd8b3e704f3a82081ef (patch) | |
tree | f1956fe9c05bf91f87f8efd3aafe8daff09e1c67 /java/java_test.go | |
parent | b1a5e9cadfdd0765f763883fd7410add24486ef6 (diff) |
Add support for JNI libraries to android_app modules
Make android_app modules a MultiTargets module, which means the
common variant will have a list of Targets that it needs to handle.
Collect JNI libraries for each Target, and package them into or
alongside the APK.
Bug: 80095087
Test: app_test.go
Change-Id: Iabd3921e1d4c4b4cfcc7e131a0b0d9ab83b0ebbb
Diffstat (limited to 'java/java_test.go')
-rw-r--r-- | java/java_test.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/java/java_test.go b/java/java_test.go index 82accd5a5..1bfd24bbc 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -15,8 +15,6 @@ package java import ( - "android/soong/android" - "android/soong/genrule" "fmt" "io/ioutil" "os" @@ -27,6 +25,10 @@ import ( "testing" "github.com/google/blueprint/proptools" + + "android/soong/android" + "android/soong/cc" + "android/soong/genrule" ) var buildDir string @@ -73,6 +75,7 @@ func testContext(config android.Config, bp string, ctx := android.NewTestArchContext() ctx.RegisterModuleType("android_app", android.ModuleFactoryAdaptor(AndroidAppFactory)) ctx.RegisterModuleType("android_library", android.ModuleFactoryAdaptor(AndroidLibraryFactory)) + ctx.RegisterModuleType("android_test", android.ModuleFactoryAdaptor(AndroidTestFactory)) ctx.RegisterModuleType("java_binary_host", android.ModuleFactoryAdaptor(BinaryHostFactory)) ctx.RegisterModuleType("java_library", android.ModuleFactoryAdaptor(LibraryFactory)) ctx.RegisterModuleType("java_library_host", android.ModuleFactoryAdaptor(LibraryHostFactory)) @@ -95,6 +98,16 @@ func testContext(config android.Config, bp string, ctx.TopDown("java_sdk_library", sdkLibraryMutator).Parallel() }) ctx.RegisterPreSingletonType("overlay", android.SingletonFactoryAdaptor(OverlaySingletonFactory)) + + // Register module types and mutators from cc needed for JNI testing + ctx.RegisterModuleType("cc_library", android.ModuleFactoryAdaptor(cc.LibraryFactory)) + ctx.RegisterModuleType("cc_object", android.ModuleFactoryAdaptor(cc.ObjectFactory)) + ctx.RegisterModuleType("toolchain_library", android.ModuleFactoryAdaptor(cc.ToolchainLibraryFactory)) + ctx.PreDepsMutators(func(ctx android.RegisterMutatorsContext) { + ctx.BottomUp("link", cc.LinkageMutator).Parallel() + ctx.BottomUp("begin", cc.BeginMutator).Parallel() + }) + ctx.Register() extraModules := []string{ |