Don't install java libraries by default
Very few java libraries need to be installed, most are statically
included in other modules. Device modules that are not installed
also don't need to be dexed, saving checkbuild time. Change the
default for java_library to not be installed, and allow libraries
that should be installed to specify installed: true. This makes
java_libary and java_library_static identical. It also simplifies
some corner cases when converting from Make to Soong if a module
is built for the host (which doesn't differentiate between static
and non-static/installable) and statically for the device, which
couldn't be represented in a single java_library in soong.
Bug: 110885583
Test: m checkbuild, compare presubmit target files
Change-Id: Idc0841c39a17cebd7bac3559c9408596d167a393
diff --git a/java/sdk_library.go b/java/sdk_library.go
index 5dfc32f..e4cfd41 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -331,7 +331,7 @@
props.Product_specific = proptools.BoolPtr(true)
}
- mctx.CreateModule(android.ModuleFactoryAdaptor(LibraryFactory(false)), &props)
+ mctx.CreateModule(android.ModuleFactoryAdaptor(LibraryFactory), &props)
}
// Creates a droiddoc module that creates stubs source files from the given full source
@@ -453,6 +453,7 @@
Soc_specific *bool
Device_specific *bool
Product_specific *bool
+ Installable *bool
Required []string
Errorprone struct {
Javacflags []string
@@ -463,6 +464,7 @@
props.Srcs = module.properties.Srcs
props.Libs = module.properties.Libs
props.Static_libs = module.properties.Static_libs
+ props.Installable = proptools.BoolPtr(true)
// XML file is installed along with the impl lib
props.Required = []string{module.xmlFileName()}
props.Errorprone.Javacflags = module.properties.Errorprone.Javacflags
@@ -475,7 +477,7 @@
props.Product_specific = proptools.BoolPtr(true)
}
- mctx.CreateModule(android.ModuleFactoryAdaptor(LibraryFactory(true)), &props, &module.deviceProperties)
+ mctx.CreateModule(android.ModuleFactoryAdaptor(LibraryFactory), &props, &module.deviceProperties)
}
// Creates the xml file that publicizes the runtime library