Support java libraries, binaries, and prebuilts
Add support for compiling java libraries (.jar files with
or without .dex), java binaries (.jar files with a wrapper
script to run them), and java prebuilts (for the SDK .jars)
Change-Id: Id624da64c92cf20c6d9577c6bb06e5b212af0d1b
diff --git a/common/arch.go b/common/arch.go
index 1758c0d..d4c17cf 100644
--- a/common/arch.go
+++ b/common/arch.go
@@ -31,6 +31,10 @@
Mips64 = newArch64("Mips64")
X86 = newArch32("X86")
X86_64 = newArch64("X86_64")
+
+ Common = ArchType{
+ Name: "common",
+ }
)
/*
@@ -254,6 +258,14 @@
HostOrDevice: Host,
ArchType: X86_64,
}
+ commonDevice = Arch{
+ HostOrDevice: Device,
+ ArchType: Common,
+ }
+ commonHost = Arch{
+ HostOrDevice: Host,
+ ArchType: Common,
+ }
)
func ArchMutator(mctx blueprint.EarlyMutatorContext) {
@@ -269,11 +281,18 @@
arches := []Arch{}
if module.base().HostSupported() {
- arches = append(arches, host64Arch)
+ switch module.base().commonProperties.Compile_multilib {
+ case "common":
+ arches = append(arches, commonHost)
+ default:
+ arches = append(arches, host64Arch)
+ }
}
if module.base().DeviceSupported() {
switch module.base().commonProperties.Compile_multilib {
+ case "common":
+ arches = append(arches, commonDevice)
case "both":
arches = append(arches, arm64Arch, armArch)
case "first", "64":
@@ -345,6 +364,10 @@
// Rewrite the module's properties structs to contain arch-specific values.
func (a *AndroidModuleBase) setArchProperties(ctx blueprint.EarlyMutatorContext, arch Arch) {
+ if arch.ArchType == Common {
+ return
+ }
+
for i := range a.generalProperties {
generalPropsValue := reflect.ValueOf(a.generalProperties[i]).Elem()