Loading java/dexpreopt.go +9 −4 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ type dexpreopter struct { isPrivApp bool isSDKLibrary bool isTest bool isInstallable bool builtInstalled []string } Loading Loading @@ -74,6 +75,10 @@ func (d *dexpreopter) dexpreoptDisabled(ctx android.ModuleContext) bool { return true } if !d.isInstallable { return true } // TODO: contains no java code return false Loading java/dexpreopt_test.go +19 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,15 @@ func TestDexpreoptEnabled(t *testing.T) { }`, enabled: false, }, { name: "java test", bp: ` java_test { name: "foo", srcs: ["a.java"], }`, enabled: false, }, { name: "android test", bp: ` Loading @@ -100,6 +109,16 @@ func TestDexpreoptEnabled(t *testing.T) { }`, enabled: false, }, { name: "compile_dex", bp: ` java_library { name: "foo", srcs: ["a.java"], compile_dex: true, }`, enabled: false, }, } for _, test := range tests { Loading java/java.go +2 −0 Original line number Diff line number Diff line Loading @@ -1326,6 +1326,7 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path j.dexJarFile = dexOutputFile j.dexpreopter.isInstallable = Bool(j.properties.Installable) dexOutputFile = j.dexpreopt(ctx, dexOutputFile) j.maybeStrippedDexJarFile = dexOutputFile Loading Loading @@ -1601,6 +1602,7 @@ func TestFactory() android.Module { &module.testProperties) module.Module.properties.Installable = proptools.BoolPtr(true) module.Module.dexpreopter.isTest = true InitJavaModule(module, android.HostAndDeviceSupported) return module Loading Loading
java/dexpreopt.go +9 −4 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ type dexpreopter struct { isPrivApp bool isSDKLibrary bool isTest bool isInstallable bool builtInstalled []string } Loading Loading @@ -74,6 +75,10 @@ func (d *dexpreopter) dexpreoptDisabled(ctx android.ModuleContext) bool { return true } if !d.isInstallable { return true } // TODO: contains no java code return false Loading
java/dexpreopt_test.go +19 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,15 @@ func TestDexpreoptEnabled(t *testing.T) { }`, enabled: false, }, { name: "java test", bp: ` java_test { name: "foo", srcs: ["a.java"], }`, enabled: false, }, { name: "android test", bp: ` Loading @@ -100,6 +109,16 @@ func TestDexpreoptEnabled(t *testing.T) { }`, enabled: false, }, { name: "compile_dex", bp: ` java_library { name: "foo", srcs: ["a.java"], compile_dex: true, }`, enabled: false, }, } for _, test := range tests { Loading
java/java.go +2 −0 Original line number Diff line number Diff line Loading @@ -1326,6 +1326,7 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path j.dexJarFile = dexOutputFile j.dexpreopter.isInstallable = Bool(j.properties.Installable) dexOutputFile = j.dexpreopt(ctx, dexOutputFile) j.maybeStrippedDexJarFile = dexOutputFile Loading Loading @@ -1601,6 +1602,7 @@ func TestFactory() android.Module { &module.testProperties) module.Module.properties.Installable = proptools.BoolPtr(true) module.Module.dexpreopter.isTest = true InitJavaModule(module, android.HostAndDeviceSupported) return module Loading