Merge "java/lint: enable lint on non-generated srcjar" am: 5471f4ea83

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2086850

Change-Id: I64cfb7d36861629da385c7f73e04d12d3322b07a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Thiébaud Weksteen 2022-05-12 06:54:01 +00:00 committed by Automerger Merge Worker
commit 161080466b

View file

@ -1020,6 +1020,7 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
ctx.PropertyErrorf("common_srcs", "common_srcs must be .kt files")
}
nonGeneratedSrcJars := srcFiles.FilterByExt(".srcjar")
srcFiles = j.genSources(ctx, srcFiles, flags)
// Collect javac flags only after computing the full set of srcFiles to
@ -1492,8 +1493,8 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
}
j.linter.name = ctx.ModuleName()
j.linter.srcs = srcFiles
j.linter.srcJars = srcJars
j.linter.srcs = append(srcFiles, nonGeneratedSrcJars...)
j.linter.srcJars, _ = android.FilterPathList(srcJars, nonGeneratedSrcJars)
j.linter.classpath = append(append(android.Paths(nil), flags.bootClasspath...), flags.classpath...)
j.linter.classes = j.implementationJarFile
j.linter.minSdkVersion = lintSDKVersion(j.MinSdkVersion(ctx))