diff options
author | Bill Peckham <bpeckham@google.com> | 2020-12-23 16:13:04 -0800 |
---|---|---|
committer | Bill Peckham <bpeckham@google.com> | 2020-12-23 16:13:04 -0800 |
commit | ff89ffae0bc80e04ddb5dd216deaf8b52f0e6856 (patch) | |
tree | 9e6781972e32d43b69851091a489f152e89ce73d /java/java.go | |
parent | 7dbc5786e3af292c1e2e786e4a9ec82cea93f051 (diff) |
Automatically set uncompress_dex for java_import.
Setting uncompress_dex for java_import in the same way
as java_library enables using a java_import as an art
jar or a boot jar.
Bug: 175619567
Test: m nothing
Test: TestHiddenAPISingletonWithPrebuilt
Change-Id: I0b552a11d1630a014cf978520ccc5977fdf74066
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go index 04c49deb4..18dd9bda4 100644 --- a/java/java.go +++ b/java/java.go @@ -2707,6 +2707,7 @@ type Import struct { hiddenAPI dexer + dexpreopter properties ImportProperties @@ -2832,6 +2833,14 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) { } // Dex compilation + + j.dexpreopter.installPath = android.PathForModuleInstall(ctx, "framework", jarName) + if j.dexProperties.Uncompress_dex == nil { + // If the value was not force-set by the user, use reasonable default based on the module. + j.dexProperties.Uncompress_dex = proptools.BoolPtr(shouldUncompressDex(ctx, &j.dexpreopter)) + } + j.dexpreopter.uncompressedDex = *j.dexProperties.Uncompress_dex + var dexOutputFile android.ModuleOutPath dexOutputFile = j.dexer.compileDex(ctx, flags, j.minSdkVersion(), outputFile, jarName) if ctx.Failed() { @@ -2951,6 +2960,12 @@ func (j *Import) IDECustomizedModuleName() string { var _ android.PrebuiltInterface = (*Import)(nil) +func (j *Import) IsInstallable() bool { + return Bool(j.properties.Installable) +} + +var _ dexpreopterInterface = (*Import)(nil) + // java_import imports one or more `.jar` files into the build graph as if they were built by a java_library module. // // By default, a java_import has a single variant that expects a `.jar` file containing `.class` files that were |