summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2020-06-03 17:31:13 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-06-03 17:31:13 +0000
commit2f0963ecd38abc04597adf546016184536871e53 (patch)
treeef2dc46543c79b1c732b0d7bb05685c8ec9d10e6 /java/java.go
parent46b02790a6d02e9c5317280fc6a18bdfb0babc26 (diff)
parent3747336d233103c9660d06699f6ac1bb86d405ce (diff)
Merge "Revert "Always run package check"" am: 3747336d23
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1323293 Change-Id: I4c17b88a3e2cd6d089ed2f8ea9e2592b9713ad1c
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 09df2ad43..76bfa86d6 100644
--- a/java/java.go
+++ b/java/java.go
@@ -463,6 +463,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
@@ -1518,10 +1521,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