Make java_library_static uninstallable by default
Static libraries are not dexed and are not installable on a device. Test: m -j checkbuild Change-Id: Iea01df381e6c8cf2439fdb87200895db6aac99e2
This commit is contained in:
parent
e81315b3b8
commit
a60ead85fc
25
java/java.go
25
java/java.go
|
@ -35,8 +35,8 @@ import (
|
||||||
func init() {
|
func init() {
|
||||||
android.RegisterModuleType("java_defaults", defaultsFactory)
|
android.RegisterModuleType("java_defaults", defaultsFactory)
|
||||||
|
|
||||||
android.RegisterModuleType("java_library", LibraryFactory)
|
android.RegisterModuleType("java_library", LibraryFactory(true))
|
||||||
android.RegisterModuleType("java_library_static", LibraryFactory)
|
android.RegisterModuleType("java_library_static", LibraryFactory(false))
|
||||||
android.RegisterModuleType("java_library_host", LibraryHostFactory)
|
android.RegisterModuleType("java_library_host", LibraryHostFactory)
|
||||||
android.RegisterModuleType("java_binary", BinaryFactory)
|
android.RegisterModuleType("java_binary", BinaryFactory)
|
||||||
android.RegisterModuleType("java_binary_host", BinaryHostFactory)
|
android.RegisterModuleType("java_binary_host", BinaryHostFactory)
|
||||||
|
@ -605,17 +605,22 @@ func (j *Library) DepsMutator(ctx android.BottomUpMutatorContext) {
|
||||||
j.deps(ctx)
|
j.deps(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
func LibraryFactory() android.Module {
|
func LibraryFactory(installable bool) func() android.Module {
|
||||||
module := &Library{}
|
return func() android.Module {
|
||||||
|
module := &Library{}
|
||||||
|
|
||||||
module.deviceProperties.Dex = true
|
if !installable {
|
||||||
|
module.properties.Installable = proptools.BoolPtr(false)
|
||||||
|
}
|
||||||
|
module.deviceProperties.Dex = true
|
||||||
|
|
||||||
module.AddProperties(
|
module.AddProperties(
|
||||||
&module.Module.properties,
|
&module.Module.properties,
|
||||||
&module.Module.deviceProperties)
|
&module.Module.deviceProperties)
|
||||||
|
|
||||||
InitJavaModule(module, android.HostAndDeviceSupported)
|
InitJavaModule(module, android.HostAndDeviceSupported)
|
||||||
return module
|
return module
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func LibraryHostFactory() android.Module {
|
func LibraryHostFactory() android.Module {
|
||||||
|
|
|
@ -56,7 +56,7 @@ func testJava(t *testing.T, bp string) *android.TestContext {
|
||||||
|
|
||||||
ctx := android.NewTestArchContext()
|
ctx := android.NewTestArchContext()
|
||||||
ctx.RegisterModuleType("android_app", android.ModuleFactoryAdaptor(AndroidAppFactory))
|
ctx.RegisterModuleType("android_app", android.ModuleFactoryAdaptor(AndroidAppFactory))
|
||||||
ctx.RegisterModuleType("java_library", android.ModuleFactoryAdaptor(LibraryFactory))
|
ctx.RegisterModuleType("java_library", android.ModuleFactoryAdaptor(LibraryFactory(true)))
|
||||||
ctx.RegisterModuleType("java_library_host", android.ModuleFactoryAdaptor(LibraryHostFactory))
|
ctx.RegisterModuleType("java_library_host", android.ModuleFactoryAdaptor(LibraryHostFactory))
|
||||||
ctx.RegisterModuleType("java_import", android.ModuleFactoryAdaptor(ImportFactory))
|
ctx.RegisterModuleType("java_import", android.ModuleFactoryAdaptor(ImportFactory))
|
||||||
ctx.RegisterModuleType("java_defaults", android.ModuleFactoryAdaptor(defaultsFactory))
|
ctx.RegisterModuleType("java_defaults", android.ModuleFactoryAdaptor(defaultsFactory))
|
||||||
|
|
Loading…
Reference in New Issue