summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2017-10-09 14:59:32 -0700
committer Colin Cross <ccross@android.com> 2017-10-10 08:02:20 -0700
commit92430106c3c96d8a2cce2e4cb5a7746517c3965f (patch)
treefd27929e6a32e64813af65765afbfa0eec5bbc2e /java/java.go
parent89479facb9d8dbd7fb2838128b08a9fc5e74fe57 (diff)
Add hostdex support
If hostdex: true is specified for a java library, create an extra Make module that copies the dex jar to a module with a -hostdex suffix in the host output directory. Bug: 67600882 Test: m -j checkbuild Change-Id: I859dfaabeefdca714b566de94e00f74e03c85939
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go13
1 files changed, 3 insertions, 10 deletions
diff --git a/java/java.go b/java/java.go
index fde88e90f..5393b065f 100644
--- a/java/java.go
+++ b/java/java.go
@@ -125,16 +125,15 @@ type CompilerDeviceProperties struct {
// if not blank, set to the version of the sdk to compile against
Sdk_version string
- // Set for device java libraries, and for host versions of device java libraries
- // built for testing
- Dex bool `blueprint:"mutated"`
-
// directories to pass to aidl tool
Aidl_includes []string
// directories that should be added as include directories
// for any aidl sources of modules that depend on this module
Export_aidl_include_dirs []string
+
+ // If true, export a copy of the module as a -hostdex module for host testing.
+ Hostdex *bool
}
// Module contains the properties and members used by all java module types
@@ -279,8 +278,6 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) {
if sdkDep.useModule {
ctx.AddDependency(ctx.Module(), bootClasspathTag, sdkDep.module)
}
- } else {
- // TODO(ccross): add hostdex support
}
}
ctx.AddDependency(ctx.Module(), libTag, j.properties.Libs...)
@@ -508,7 +505,6 @@ func (j *Module) compile(ctx android.ModuleContext) {
j.classpathFile = outputFile
- // TODO(ccross): handle hostdex
if ctx.Device() && j.installable() {
dxFlags := j.deviceProperties.Dxflags
if false /* emma enabled */ {
@@ -622,7 +618,6 @@ func LibraryFactory(installable bool) func() android.Module {
if !installable {
module.properties.Installable = proptools.BoolPtr(false)
}
- module.deviceProperties.Dex = true
module.AddProperties(
&module.Module.properties,
@@ -680,8 +675,6 @@ func (j *Binary) DepsMutator(ctx android.BottomUpMutatorContext) {
func BinaryFactory() android.Module {
module := &Binary{}
- module.deviceProperties.Dex = true
-
module.AddProperties(
&module.Module.properties,
&module.Module.deviceProperties,