Merge "Revert "Always run package check"" am: 3747336d23 am: 2f0963ecd3

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

Change-Id: I3592365b63fab1597b2a41aafaa68e49d6f1e0f2
This commit is contained in:
Colin Cross
2020-06-03 17:56:14 +00:00
committed by Automerger Merge Worker
3 changed files with 34 additions and 11 deletions

View File

@@ -467,6 +467,9 @@ type Module struct {
// expanded Jarjar_rules
expandJarjarRules android.Path
// list of additional targets for checkbuild
additionalCheckedModules android.Paths
// Extra files generated by the module type to be added as java resources.
extraResources android.Paths
@@ -1527,10 +1530,10 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
// Check package restrictions if necessary.
if len(j.properties.Permitted_packages) > 0 {
// Check packages and copy input to package-checked file.
// Use the file copied after a successful package check as the output file for this
// module so that any dependencies on this module will trigger the package check.
outputFile = CheckJarPackages(ctx, outputFile, j.properties.Permitted_packages)
// Check packages and copy to package-checked file.
pkgckFile := android.PathForModuleOut(ctx, "package-check.stamp")
CheckJarPackages(ctx, pkgckFile, outputFile, j.properties.Permitted_packages)
j.additionalCheckedModules = append(j.additionalCheckedModules, pkgckFile)
if ctx.Failed() {
return