Add compile_data for android apps

Compile_data is a property on rust rules to declare extra files
that are used by the compiler. In rust's case this happens commonly
with `include_str!()`.

Other compilers like javac or aapt2 don't often reach out to other
files, so it's not as neccessary. But they will follow symlinks.
We're making a change to only include symlinks themselves in sbox
sandboxes, and the targets of the symlinks must be listed
explicitly. For this, we need compile_data to list the targets
of symlinks.

Bug: 307824623
Test: m out/soong/.intermediates/frameworks/base/tools/aapt2/integration-tests/SymlinkTest/AaptSymlinkTest/android_common/lint/lint-baseline.xml with the symlink change
Change-Id: I33eb9cbe4b6eb25e3f33ea0ac9dade88c3d4a624
This commit is contained in:
Cole Faust
2023-12-08 12:27:24 -08:00
parent 25861686fe
commit df1efd7251
2 changed files with 10 additions and 1 deletions

View File

@@ -93,6 +93,7 @@ type linter struct {
outputs lintOutputs
properties LintProperties
extraMainlineLintErrors []string
compile_data android.Paths
reports android.Paths
@@ -448,7 +449,7 @@ func (l *linter) lint(ctx android.ModuleContext) {
srcsList := android.PathForModuleOut(ctx, "lint", "lint-srcs.list")
srcsListRsp := android.PathForModuleOut(ctx, "lint-srcs.list.rsp")
rule.Command().Text("cp").FlagWithRspFileInputList("", srcsListRsp, l.srcs).Output(srcsList)
rule.Command().Text("cp").FlagWithRspFileInputList("", srcsListRsp, l.srcs).Output(srcsList).Implicits(l.compile_data)
lintPaths := l.writeLintProjectXML(ctx, rule, srcsList)