Merge "Fix api_fingerprint.txt generation" am: 404adeefdc
am: c0777462c5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1581731 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Ia43c021f7af85264ae738b42cef5047419471ce1
This commit is contained in:
26
java/sdk.go
26
java/sdk.go
@@ -641,14 +641,26 @@ func createAPIFingerprint(ctx android.SingletonContext) {
|
|||||||
|
|
||||||
if ctx.Config().PlatformSdkCodename() == "REL" {
|
if ctx.Config().PlatformSdkCodename() == "REL" {
|
||||||
cmd.Text("echo REL >").Output(out)
|
cmd.Text("echo REL >").Output(out)
|
||||||
} else if !ctx.Config().AlwaysUsePrebuiltSdks() {
|
} else if ctx.Config().FrameworksBaseDirExists(ctx) && !ctx.Config().AlwaysUsePrebuiltSdks() {
|
||||||
in, err := ctx.GlobWithDeps("frameworks/base/api/*current.txt", nil)
|
cmd.Text("cat")
|
||||||
if err != nil {
|
apiTxtFileModules := []string{
|
||||||
ctx.Errorf("error globbing API files: %s", err)
|
"frameworks-base-api-current.txt",
|
||||||
|
"frameworks-base-api-system-current.txt",
|
||||||
|
"frameworks-base-api-module-lib-current.txt",
|
||||||
}
|
}
|
||||||
|
count := 0
|
||||||
cmd.Text("cat").
|
ctx.VisitAllModules(func(module android.Module) {
|
||||||
Inputs(android.PathsForSource(ctx, in)).
|
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 >").
|
Text("| md5sum | cut -d' ' -f1 >").
|
||||||
Output(out)
|
Output(out)
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user