Merge "Enable turbine for api generating annotation processors when using kotlin" am: bbf5f8c158
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2046153 Change-Id: Ic38a9829e2b2e4bc28c7018974e29df11dd3b04d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
13
java/base.go
13
java/base.go
@@ -1048,6 +1048,12 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We don't currently run annotation processors in turbine, which means we can't use turbine
|
||||||
|
// generated header jars when an annotation processor that generates API is enabled. One
|
||||||
|
// exception (handled further below) is when kotlin sources are enabled, in which case turbine
|
||||||
|
// is used to run all of the annotation processors.
|
||||||
|
disableTurbine := deps.disableTurbine
|
||||||
|
|
||||||
// Collect .java files for AIDEGen
|
// Collect .java files for AIDEGen
|
||||||
j.expandIDEInfoCompiledSrcs = append(j.expandIDEInfoCompiledSrcs, uniqueSrcFiles.Strings()...)
|
j.expandIDEInfoCompiledSrcs = append(j.expandIDEInfoCompiledSrcs, uniqueSrcFiles.Strings()...)
|
||||||
|
|
||||||
@@ -1055,6 +1061,11 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
|
|||||||
var kotlinHeaderJars android.Paths
|
var kotlinHeaderJars android.Paths
|
||||||
|
|
||||||
if srcFiles.HasExt(".kt") {
|
if srcFiles.HasExt(".kt") {
|
||||||
|
// When using kotlin sources turbine is used to generate annotation processor sources,
|
||||||
|
// including for annotation processors that generate API, so we can use turbine for
|
||||||
|
// java sources too.
|
||||||
|
disableTurbine = false
|
||||||
|
|
||||||
// user defined kotlin flags.
|
// user defined kotlin flags.
|
||||||
kotlincFlags := j.properties.Kotlincflags
|
kotlincFlags := j.properties.Kotlincflags
|
||||||
CheckKotlincFlags(ctx, kotlincFlags)
|
CheckKotlincFlags(ctx, kotlincFlags)
|
||||||
@@ -1139,7 +1150,7 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
|
|||||||
|
|
||||||
enableSharding := false
|
enableSharding := false
|
||||||
var headerJarFileWithoutDepsOrJarjar android.Path
|
var headerJarFileWithoutDepsOrJarjar android.Path
|
||||||
if ctx.Device() && !ctx.Config().IsEnvFalse("TURBINE_ENABLED") && !deps.disableTurbine {
|
if ctx.Device() && !ctx.Config().IsEnvFalse("TURBINE_ENABLED") && !disableTurbine {
|
||||||
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 {
|
||||||
enableSharding = true
|
enableSharding = true
|
||||||
// Formerly, there was a check here that prevented annotation processors
|
// Formerly, there was a check here that prevented annotation processors
|
||||||
|
Reference in New Issue
Block a user