From 4b9220af10de5e0ecd62a7215f2ee8f8a21d50c0 Mon Sep 17 00:00:00 2001 From: Jihoon Kang Date: Thu, 22 Aug 2024 22:11:04 +0000 Subject: [PATCH] Make java_sdk_library phony target depend on its stub jar Currently, the (from-text) stub jar depends on the check api timestamp of the same api scope droidstubs. However, building the top level sdk_library phony target does not trigger check api, as the top level java_sdk_library "depends" on the stub submodules but the top level phony target does not build the stubs generated by its submodule, nor the top level java_sdk_library generate any output files. In order to support the user's workflow of observing checkapi failure after modifying the api by running `m `, this change adds the paths to the stub jars as dependencies as the top level java_sdk_library phony target. Bug: 234113632 Test: modify source file api, run m and observe checkapi failure Change-Id: Iccd42c8ef7d5de20f71c347455c1a90d83a6c70c --- java/sdk_library.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java/sdk_library.go b/java/sdk_library.go index 4f95a997d..74f048dd0 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -1548,6 +1548,8 @@ func (module *SdkLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) scopeTag.extractDepInfo(ctx, to, scopePaths) exportedComponents[ctx.OtherModuleName(to)] = struct{}{} + + ctx.Phony(ctx.ModuleName(), scopePaths.stubsHeaderPath...) } if tag == implLibraryTag {