summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2017-09-27 17:59:10 -0700
committerColin Cross <ccross@android.com>2017-09-29 14:02:22 -0700
commit59f1bb66eaaa9e189ba4764336d79f88efb5c0f7 (patch)
tree606bfbf5dba7a59565746e731d026aa0133e11d4 /java/java.go
parent40a367141686aaf5413979cd051cccfb5f29e26b (diff)
Only desugar/dx installable libraries
Don't waste time running dx on libraries that will never end up on the device. Test: m -j checkbuild Change-Id: Iad1750823d3261cd6ad6eb6aa00c74d45b9737a3
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/java/java.go b/java/java.go
index a0bcbfebc..f9193c557 100644
--- a/java/java.go
+++ b/java/java.go
@@ -464,7 +464,7 @@ func (j *Module) compile(ctx android.ModuleContext) {
j.classpathFile = outputFile
// TODO(ccross): handle hostdex
- if ctx.Device() && len(srcFiles) > 0 {
+ if ctx.Device() && len(srcFiles) > 0 && j.installable() {
dxFlags := j.deviceProperties.Dxflags
if false /* emma enabled */ {
// If you instrument class files that have local variable debug information in
@@ -538,6 +538,10 @@ func (j *Module) compile(ctx android.ModuleContext) {
j.outputFile = outputFile
}
+func (j *Module) installable() bool {
+ return j.properties.Installable == nil || *j.properties.Installable
+}
+
var _ Dependency = (*Library)(nil)
func (j *Module) ClasspathFiles() android.Paths {
@@ -569,7 +573,7 @@ type Library struct {
func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) {
j.compile(ctx)
- if j.properties.Installable == nil || *j.properties.Installable == true {
+ if j.installable() {
j.installFile = ctx.InstallFile(android.PathForModuleInstall(ctx, "framework"),
ctx.ModuleName()+".jar", j.outputFile)
}