diff options
author | 2020-01-10 17:16:44 +0000 | |
---|---|---|
committer | 2020-01-15 11:17:57 +0000 | |
commit | 90169baf0ec21c57cb89132c91a4119e12de51df (patch) | |
tree | 55cb740a189b9f17b80e12f72c917e2b4e4cf20e /java/system_modules.go | |
parent | cded5ecfc3e51052cd8353c8867f2bdcd0535756 (diff) |
Added java_system_modules_import
A prebuilt version of java_system_modules. It does not import the
generated system module, it generates the system module from imported
java libraries in the same way that java_system_modules does. It just
acts as a prebuilt, i.e. can have the same base name as another module
type and the one to use is selected at runtime.
Bug: 142940300
Test: m nothing
Change-Id: I126db49d18294fcd6e2b7ad0237f83e9c2fdef7a
Diffstat (limited to 'java/system_modules.go')
-rw-r--r-- | java/system_modules.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/java/system_modules.go b/java/system_modules.go index 81e5cb462..92297c416 100644 --- a/java/system_modules.go +++ b/java/system_modules.go @@ -35,6 +35,7 @@ func init() { func RegisterSystemModulesBuildComponents(ctx android.RegistrationContext) { ctx.RegisterModuleType("java_system_modules", SystemModulesFactory) + ctx.RegisterModuleType("java_system_modules_import", systemModulesImportFactory) } var ( @@ -160,3 +161,30 @@ func (system *SystemModules) AndroidMk() android.AndroidMkData { }, } } + +// A prebuilt version of java_system_modules. It does not import the +// generated system module, it generates the system module from imported +// java libraries in the same way that java_system_modules does. It just +// acts as a prebuilt, i.e. can have the same base name as another module +// type and the one to use is selected at runtime. +func systemModulesImportFactory() android.Module { + module := &systemModulesImport{} + module.AddProperties(&module.properties) + android.InitPrebuiltModule(module, &module.properties.Libs) + android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibCommon) + android.InitDefaultableModule(module) + return module +} + +type systemModulesImport struct { + SystemModules + prebuilt android.Prebuilt +} + +func (system *systemModulesImport) Name() string { + return system.prebuilt.Name(system.ModuleBase.Name()) +} + +func (system *systemModulesImport) Prebuilt() *android.Prebuilt { + return &system.prebuilt +} |