Relax restriction on sharded annotation processors

Bug: 77284273
Test: m framework
Change-Id: If617bcf65b5d04ecb81227a9a8b76bbd78ea8598
This commit is contained in:
Ashley Rose
2019-01-16 17:34:08 -05:00
parent d4a393466a
commit e36efcfa93

View File

@@ -998,12 +998,11 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path
if ctx.Device() && !ctx.Config().IsEnvFalse("TURBINE_ENABLED") { if ctx.Device() && !ctx.Config().IsEnvFalse("TURBINE_ENABLED") {
if j.properties.Javac_shard_size != nil && *(j.properties.Javac_shard_size) > 0 { if j.properties.Javac_shard_size != nil && *(j.properties.Javac_shard_size) > 0 {
enable_sharding = true enable_sharding = true
if len(j.properties.Annotation_processors) != 0 || // Formerly, there was a check here that prevented annotation processors
len(j.properties.Annotation_processor_classes) != 0 { // from being used when sharding was enabled, as some annotation processors
ctx.PropertyErrorf("javac_shard_size", // do not function correctly in sharded environments. It was removed to
"%q cannot be set when annotation processors are enabled.", // allow for the use of annotation processors that do function correctly
j.properties.Javac_shard_size) // with sharding enabled. See: b/77284273.
}
} }
j.headerJarFile = j.compileJavaHeader(ctx, uniqueSrcFiles, srcJars, deps, flags, jarName, kotlinJars) j.headerJarFile = j.compileJavaHeader(ctx, uniqueSrcFiles, srcJars, deps, flags, jarName, kotlinJars)
if ctx.Failed() { if ctx.Failed() {