summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2020-06-03 17:56:14 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-06-03 17:56:14 +0000
commitd89338653f35be44b48e0bb04fb234e01e4c6db2 (patch)
tree44c35202816d399fe05a6444787e36cced69e47d /java/java.go
parent942feab5f13d70300488c71af1984a2f6ff27651 (diff)
parent2f0963ecd38abc04597adf546016184536871e53 (diff)
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
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/java/java.go b/java/java.go
index 0702e618f..d19c88e56 100644
--- a/java/java.go
+++ b/java/java.go
@@ -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