Fix annotation processors in kotlin modules that generate resources
The kapt rule was only keeping the generated sources, and not the generated classes directory. The generated classes directory will contain resources generated by the annotation processor and needs to be added to the final jar. Test: m ApiFinder Bug: 153485543 Change-Id: I89197d0afcb1eee011c01aa400f9977e66f43768
This commit is contained in:
@@ -1350,8 +1350,10 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
|
||||
if len(flags.processorPath) > 0 {
|
||||
// Use kapt for annotation processing
|
||||
kaptSrcJar := android.PathForModuleOut(ctx, "kapt", "kapt-sources.jar")
|
||||
kotlinKapt(ctx, kaptSrcJar, kotlinSrcFiles, srcJars, flags)
|
||||
kaptResJar := android.PathForModuleOut(ctx, "kapt", "kapt-res.jar")
|
||||
kotlinKapt(ctx, kaptSrcJar, kaptResJar, kotlinSrcFiles, srcJars, flags)
|
||||
srcJars = append(srcJars, kaptSrcJar)
|
||||
kotlinJars = append(kotlinJars, kaptResJar)
|
||||
// Disable annotation processing in javac, it's already been handled by kapt
|
||||
flags.processorPath = nil
|
||||
flags.processors = nil
|
||||
|
Reference in New Issue
Block a user