using source path of aidl_hash_gen instead of output path
In the case of missing hash, aidl_hash_gen doesn't exist because of
build error. So provide source path instead.
Bug: 187841663
Test: run the command in error case
Change-Id: I5776c968bf4ac3062191c797c2ffe4aab10b2efd
diff --git a/build/aidl_api.go b/build/aidl_api.go
index 1f3e933..f452c8f 100644
--- a/build/aidl_api.go
+++ b/build/aidl_api.go
@@ -358,7 +358,8 @@
hashFile: android.ExistentPathForSource(ctx, hashFilePath),
}
if !dump.hashFile.Valid() {
- cmd := fmt.Sprintf(`(croot && aidl_hash_gen %s %s %s)`, apiDir, versionForHashGen(ver), hashFilePath)
+ // We should show the source path of hash_gen because aidl_hash_gen cannot be built due to build error.
+ cmd := fmt.Sprintf(`(croot && system/tools/aidl/build/hash_gen.sh %s %s %s)`, apiDir, versionForHashGen(ver), hashFilePath)
ctx.ModuleErrorf("A frozen aidl_interface must have '.hash' file, but %s-V%s doesn't have it. Use the command below to generate hash.\n%s\n",
m.properties.BaseName, ver, cmd)
}