Improve suggested command in generate protolog error
The build compares the services.core.protolog.json file during the
compilation with the newly generated one. If there's a difference,
the user needs to copy the file and commit it manually. The error
message shows the command that can be used. This commit changes the
message to include absolute file paths such that the command can just be
copied and run. Previously the paths were relative to the "out"
directory requiring you to be in $ANDROID_BUILD_TOP to run it.
Test: "m checked-protolog.json" with a manually changed
services.core.protolog.json forced the check to fail, which showed the
error message.
Change-Id: I616fd940c5cf29d11863f6147d3e9e998b4af048
diff --git a/services/core/Android.bp b/services/core/Android.bp
index c8caab9..199fc22 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
@@ -74,8 +74,8 @@
"{ ! (diff $(out) $(location :services.core.protolog.json) | grep -q '^<') || " +
"{ echo -e '\\n\\n################################################################\\n#\\n" +
"# ERROR: ProtoLog viewer config is stale. To update it, run:\\n#\\n" +
- "# cp $(location :generate-protolog.json) " +
- "$(location :services.core.protolog.json)\\n#\\n" +
+ "# cp $${ANDROID_BUILD_TOP}/$(location :generate-protolog.json) " +
+ "$${ANDROID_BUILD_TOP}/$(location :services.core.protolog.json)\\n#\\n" +
"################################################################\\n\\n' >&2 && false; } }",
out: ["services.core.protolog.json"],
}