OSDN Git Service

Read BUILD_NUMBER from file in rules
authorColin Cross <ccross@android.com>
Fri, 17 Jul 2015 00:15:19 +0000 (17:15 -0700)
committerColin Cross <ccross@android.com>
Sat, 18 Jul 2015 19:15:04 +0000 (12:15 -0700)
commitf37b455858af45b36f14213696d2b55802a774c1
treecc397145b8468189537e2770fd0d9d9b6ddd877b
parent03e74d66c73558b517a56be75acc9a391c676ba8
Read BUILD_NUMBER from file in rules

Using $(BUILD_NUMBER) inside a rule causes odd behavior, as the rule
is different every time make is run, but since make doesn't depend
on the command line it only ends up being built with the new value
if some other dependency has changed.

To allow ninja, which does depend on the command line, to provide the
same behavior, store the build number in out/build_number.txt, and
use a shell expansion to cat the file in rules that use it.  This will
cause the rule command to stay identical between builds, while still
getting the new build number if the rule is rerun for a dependency.

Also use the same trick for BUILD_FINGERPRINT, and the date in
droiddoc rules.

Change-Id: I6c5e6b6b3ef4c613563d7f5604df0e401575ba5f
core/Makefile
core/definitions.mk
core/droiddoc.mk
core/main.mk