summaryrefslogtreecommitdiff
path: root/java/sdk.go
diff options
context:
space:
mode:
author Anton Hansson <hansson@google.com> 2021-02-10 14:52:42 +0000
committer Anton Hansson <hansson@google.com> 2021-02-11 09:17:10 +0000
commit973d31c75711b36a9e5300a5daad3258f163a34b (patch)
treef9d54b35b42330df15970f5d59dd43884d483658 /java/sdk.go
parent89886cbdb05cf4a4445a4fc7706ccff91fb310fd (diff)
Fix api_fingerprint.txt generation
Use the generated txt files as input instead of globbing for now non-existent files. Also add the system server api txt to the hash. Bug: 179807354 Test: verify out/soong/api_fingerprint.txt changes now Test: verify the command in the ninja file looks ok: grep api_fingerprint out/soong/build.ninja Change-Id: I7a49ca134eb93b22537a4f3054285eb15f8c4256
Diffstat (limited to 'java/sdk.go')
-rw-r--r--java/sdk.go26
1 files changed, 19 insertions, 7 deletions
diff --git a/java/sdk.go b/java/sdk.go
index a68abfb51..e82bd9c7b 100644
--- a/java/sdk.go
+++ b/java/sdk.go
@@ -640,14 +640,26 @@ func createAPIFingerprint(ctx android.SingletonContext) {
if ctx.Config().PlatformSdkCodename() == "REL" {
cmd.Text("echo REL >").Output(out)
- } else if !ctx.Config().AlwaysUsePrebuiltSdks() {
- in, err := ctx.GlobWithDeps("frameworks/base/api/*current.txt", nil)
- if err != nil {
- ctx.Errorf("error globbing API files: %s", err)
+ } else if ctx.Config().FrameworksBaseDirExists(ctx) && !ctx.Config().AlwaysUsePrebuiltSdks() {
+ cmd.Text("cat")
+ apiTxtFileModules := []string{
+ "frameworks-base-api-current.txt",
+ "frameworks-base-api-system-current.txt",
+ "frameworks-base-api-module-lib-current.txt",
}
-
- cmd.Text("cat").
- Inputs(android.PathsForSource(ctx, in)).
+ count := 0
+ ctx.VisitAllModules(func(module android.Module) {
+ name := ctx.ModuleName(module)
+ if android.InList(name, apiTxtFileModules) {
+ cmd.Inputs(android.OutputFilesForModule(ctx, module, ""))
+ count++
+ }
+ })
+ if count != len(apiTxtFileModules) {
+ ctx.Errorf("Could not find all the expected API modules %v, found %d\n", apiTxtFileModules, count)
+ return
+ }
+ cmd.Input(android.PathForSource(ctx, "frameworks/base/services/api/current.txt")).
Text("| md5sum | cut -d' ' -f1 >").
Output(out)
} else {