diff options
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/java/java.go b/java/java.go index aea1ef90d..5ed99f7e8 100644 --- a/java/java.go +++ b/java/java.go @@ -217,6 +217,25 @@ type CompilerDeviceProperties struct { // If set to true, compile dex regardless of installable. Defaults to false. Compile_dex *bool + Dex_preopt struct { + // If false, prevent dexpreopting and stripping the dex file from the final jar. Defaults to + // true. + Enabled *bool + + // If true, generate an app image (.art file) for this module. + App_image *bool + + // If true, use a checked-in profile to guide optimization. Defaults to false unless + // a matching profile is set or a profile is found in PRODUCT_DEX_PREOPT_PROFILE_DIR + // that matches the name of this module, in which case it is defaulted to true. + Profile_guided *bool + + // If set, provides the path to profile relative to the Android.bp file. If not set, + // defaults to searching for a file that matches the name of this module in the default + // profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found. + Profile *string + } + Optimize struct { // If false, disable all optimization. Defaults to true for android_app and android_test // modules, false for java_library and java_test modules. @@ -247,7 +266,6 @@ type CompilerDeviceProperties struct { System_modules *string UncompressDex bool `blueprint:"mutated"` - IsSDKLibrary bool `blueprint:"mutated"` } // Module contains the properties and members used by all java module types @@ -277,9 +295,6 @@ type Module struct { // output file containing classes.dex and resources dexJarFile android.Path - // output file that contains classes.dex if it should be in the output file - maybeStrippedDexJarFile android.Path - // output file containing uninstrumented classes that will be instrumented by jacoco jacocoReportClassesFile android.Path @@ -312,8 +327,6 @@ type Module struct { // list of source files, collected from compiledJavaSrcs and compiledSrcJars // filter out Exclude_srcs, will be used by android.IDEInfo struct expandIDEInfoCompiledSrcs []string - - dexpreopter } func (j *Module) Srcs() android.Paths { @@ -1319,15 +1332,7 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path j.dexJarFile = dexOutputFile - dexOutputFile = j.dexpreopt(ctx, dexOutputFile) - - j.maybeStrippedDexJarFile = dexOutputFile - outputFile = dexOutputFile - - if ctx.Failed() { - return - } } else { outputFile = implementationAndResourcesJar } @@ -1481,17 +1486,9 @@ type Library struct { } func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) { - j.dexpreopter.installPath = android.PathForModuleInstall(ctx, "framework", ctx.ModuleName()+".jar") - j.dexpreopter.isSDKLibrary = j.deviceProperties.IsSDKLibrary j.compile(ctx) if Bool(j.properties.Installable) || ctx.Host() { - if j.deviceProperties.UncompressDex { - alignedOutputFile := android.PathForModuleOut(ctx, "aligned", ctx.ModuleName()+".jar") - TransformZipAlign(ctx, alignedOutputFile, j.outputFile) - j.outputFile = alignedOutputFile - } - j.installFile = ctx.InstallFile(android.PathForModuleInstall(ctx, "framework"), ctx.ModuleName()+".jar", j.outputFile) } @@ -1507,7 +1504,6 @@ func LibraryFactory() android.Module { module.AddProperties( &module.Module.properties, &module.Module.deviceProperties, - &module.Module.dexpreoptProperties, &module.Module.protoProperties) InitJavaModule(module, android.HostAndDeviceSupported) @@ -1578,7 +1574,6 @@ func TestFactory() android.Module { module.AddProperties( &module.Module.properties, &module.Module.deviceProperties, - &module.Module.dexpreoptProperties, &module.Module.protoProperties, &module.testProperties) @@ -1675,7 +1670,6 @@ func BinaryFactory() android.Module { module.AddProperties( &module.Module.properties, &module.Module.deviceProperties, - &module.Module.dexpreoptProperties, &module.Module.protoProperties, &module.binaryProperties) @@ -1895,7 +1889,6 @@ func DefaultsFactory(props ...interface{}) android.Module { module.AddProperties( &CompilerProperties{}, &CompilerDeviceProperties{}, - &DexpreoptProperties{}, &android.ProtoProperties{}, &aaptProperties{}, &androidLibraryProperties{}, |