aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2024-05-01 13:13:51 +0100
committerPaul Duffin <paulduffin@google.com>2024-05-02 08:30:27 +0100
commit2ced2eb07ff827ea7cd67ff6c4c6008cec42a998 (patch)
tree4cd4643a62964cfd78a55f37630e2803bcd5cd02
parent0141b4acad94d7ccffd6fbbce3cba5eae48a9b95 (diff)
downloadsoong-2ced2eb07ff827ea7cd67ff6c4c6008cec42a998.tar.gz
Clean up apiLevelsGenerationFlags deps gathering
Restructures the code a little to make it clear that extensions directories are distinct from dessert release directories. Bug: 337836752 Test: m --no-skip-soong-tests nothing Change-Id: I8ad68f0d112e62f8f1ddda1b6718119fe18eb8a9
-rw-r--r--java/droidstubs.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/java/droidstubs.go b/java/droidstubs.go
index 08caf9109..f065afbea 100644
--- a/java/droidstubs.go
+++ b/java/droidstubs.go
@@ -648,16 +648,17 @@ func (d *Droidstubs) apiLevelsGenerationFlags(ctx android.ModuleContext, cmd *an
// Grab the first extensions_dir and we find while scanning ExportedDroiddocDir.deps;
// ideally this should be read from prebuiltApis.properties.Extensions_*
for _, dep := range t.deps {
+ // Check to see if it matches an extension first.
+ depBase := dep.Base()
if extRegex.MatchString(dep.String()) && d.properties.Extensions_info_file != nil {
if extensions_dir == "" {
extensions_dir = t.dir.String() + "/extensions"
}
cmd.Implicit(dep)
- }
- if dep.Base() == filename {
+ } else if depBase == filename {
+ // Check to see if it matches a dessert release for an SDK, e.g. Android, Car, Wear, etc..
cmd.Implicit(dep)
- }
- if filename != "android.jar" && dep.Base() == "android.jar" {
+ } else if filename != "android.jar" && depBase == "android.jar" {
// Metalava implicitly searches these patterns:
// prebuilts/tools/common/api-versions/android-%/android.jar
// prebuilts/sdk/%/public/android.jar
@@ -1327,7 +1328,7 @@ func (d *Droidstubs) createApiContribution(ctx android.DefaultableHookContext) {
// use a strict naming convention
var (
droidstubsModuleNamingToSdkKind = map[string]android.SdkKind{
- //public is commented out since the core libraries use public in their java_sdk_library names
+ // public is commented out since the core libraries use public in their java_sdk_library names
"intracore": android.SdkIntraCore,
"intra.core": android.SdkIntraCore,
"system_server": android.SdkSystemServer,