Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 404adeef authored by Anton Hansson's avatar Anton Hansson Committed by Gerrit Code Review
Browse files

Merge "Fix api_fingerprint.txt generation"

parents 36eb24b3 973d31c7
Loading
Loading
Loading
Loading
+19 −7
Original line number Diff line number Diff line
@@ -641,14 +641,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",
		}
		count := 0
		ctx.VisitAllModules(func(module android.Module) {
			name := ctx.ModuleName(module)
			if android.InList(name, apiTxtFileModules) {
				cmd.Inputs(android.OutputFilesForModule(ctx, module, ""))
				count++
			}

		cmd.Text("cat").
			Inputs(android.PathsForSource(ctx, in)).
		})
		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 {