Fix incremental build issue in aapt2

Clear the directory with generated java files before generating
new files into the directory.  Fixes an issue where old, no longer
generated files could remain and end up in R.jar.

Test: m checkbuild
Change-Id: I174030c336c5b7e6fe1198a43714af565babd7e6
This commit is contained in:
Colin Cross 2018-10-17 15:42:59 -07:00
parent 094054ab07
commit 78e3cb096b
1 changed files with 2 additions and 1 deletions

View File

@ -111,7 +111,8 @@ func aapt2CompileDirs(ctx android.ModuleContext, flata android.WritablePath, dir
var aapt2LinkRule = pctx.AndroidStaticRule("aapt2Link",
blueprint.RuleParams{
Command: `${config.Aapt2Cmd} link -o $out $flags --java $genDir --proguard $proguardOptions ` +
Command: `rm -rf $genDir && ` +
`${config.Aapt2Cmd} link -o $out $flags --java $genDir --proguard $proguardOptions ` +
`--output-text-symbols ${rTxt} $inFlags && ` +
`${config.SoongZipCmd} -write_if_changed -jar -o $genJar -C $genDir -D $genDir &&` +
`${config.ExtractJarPackagesCmd} -i $genJar -o $extraPackages --prefix '--extra-packages '`,