diff options
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/java/java.go b/java/java.go index a23835bb8..2ac5a5b46 100644 --- a/java/java.go +++ b/java/java.go @@ -336,8 +336,8 @@ type Dependency interface { } type SdkLibraryDependency interface { - HeaderJars(linkType linkType) android.Paths - ImplementationJars(linkType linkType) android.Paths + HeaderJars(ctx android.BaseContext, sdkVersion string) android.Paths + ImplementationJars(ctx android.BaseContext, sdkVersion string) android.Paths } type SrcDependency interface { @@ -729,8 +729,7 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps { case SdkLibraryDependency: switch tag { case libTag: - linkType, _ := getLinkType(j, ctx.ModuleName()) - deps.classpath = append(deps.classpath, dep.HeaderJars(linkType)...) + deps.classpath = append(deps.classpath, dep.HeaderJars(ctx, j.sdkVersion())...) // names of sdk libs that are directly depended are exported j.exportedSdkLibs = append(j.exportedSdkLibs, otherName) default: @@ -748,6 +747,8 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps { deps.staticHeaderJars = append(deps.staticHeaderJars, dep.Srcs()...) case android.DefaultsDepTag, android.SourceDepTag: // Nothing to do + case publicApiFileTag, systemApiFileTag, testApiFileTag: + // Nothing to do default: ctx.ModuleErrorf("dependency on genrule %q may only be in srcs, libs, or static_libs", otherName) } @@ -997,12 +998,11 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path if ctx.Device() && !ctx.Config().IsEnvFalse("TURBINE_ENABLED") { if j.properties.Javac_shard_size != nil && *(j.properties.Javac_shard_size) > 0 { enable_sharding = true - if len(j.properties.Annotation_processors) != 0 || - len(j.properties.Annotation_processor_classes) != 0 { - ctx.PropertyErrorf("javac_shard_size", - "%q cannot be set when annotation processors are enabled.", - j.properties.Javac_shard_size) - } + // 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 + // allow for the use of annotation processors that do function correctly + // with sharding enabled. See: b/77284273. } j.headerJarFile = j.compileJavaHeader(ctx, uniqueSrcFiles, srcJars, deps, flags, jarName, kotlinJars) if ctx.Failed() { |