summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go26
1 files changed, 23 insertions, 3 deletions
diff --git a/java/java.go b/java/java.go
index 719915ef9..82b53be1d 100644
--- a/java/java.go
+++ b/java/java.go
@@ -304,6 +304,9 @@ type CompilerDeviceProperties struct {
// whether to generate Binder#GetTransaction name method.
Generate_get_transaction_name *bool
+
+ // list of flags that will be passed to the AIDL compiler
+ Flags []string
}
// If true, export a copy of the module as a -hostdex module for host testing.
@@ -872,6 +875,8 @@ func (j *Module) aidlFlags(ctx android.ModuleContext, aidlPreprocess android.Opt
var flags []string
var deps android.Paths
+ flags = append(flags, j.deviceProperties.Aidl.Flags...)
+
if aidlPreprocess.Valid() {
flags = append(flags, "-p"+aidlPreprocess.String())
deps = append(deps, aidlPreprocess.Path())
@@ -1505,11 +1510,11 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
j.compiledJavaSrcs = uniqueSrcFiles
j.compiledSrcJars = srcJars
- enable_sharding := false
+ enableSharding := false
var headerJarFileWithoutJarjar android.Path
if ctx.Device() && !ctx.Config().IsEnvFalse("TURBINE_ENABLED") && !deps.disableTurbine {
if j.properties.Javac_shard_size != nil && *(j.properties.Javac_shard_size) > 0 {
- enable_sharding = true
+ enableSharding = true
// Formerly, there was a check here that prevented annotation processors
// from being used when sharding was enabled, as some annotation processors
// do not function correctly in sharded environments. It was removed to
@@ -1535,7 +1540,7 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
extraJarDeps = append(extraJarDeps, errorprone)
}
- if enable_sharding {
+ if enableSharding {
flags.classpath = append(flags.classpath, headerJarFileWithoutJarjar)
shardSize := int(*(j.properties.Javac_shard_size))
var shardSrcs []android.Paths
@@ -2707,6 +2712,7 @@ type Import struct {
hiddenAPI
dexer
+ dexpreopter
properties ImportProperties
@@ -2832,6 +2838,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 +2965,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