Use repeatable timestamps
This moves all of the date references under build/ to using a single
datetime that can be set manually using BUILD_DATETIME.
It also adds an option, OVERRIDE_C_DATE_TIME, that if set to true, will
redefine __DATE__ and __TIME__ for all C/C++ files so that it matches
BUILD_DATETIME.
Bug: 23117013
Change-Id: I880ef103a26bca86bd7bf42d58e62e740a6228c8
diff --git a/tools/buildinfo.sh b/tools/buildinfo.sh
index 1fb203a..2b0ad07 100755
--- a/tools/buildinfo.sh
+++ b/tools/buildinfo.sh
@@ -10,8 +10,8 @@
echo "ro.build.version.codename=$PLATFORM_VERSION_CODENAME"
echo "ro.build.version.all_codenames=$PLATFORM_VERSION_ALL_CODENAMES"
echo "ro.build.version.release=$PLATFORM_VERSION"
-echo "ro.build.date=`date`"
-echo "ro.build.date.utc=`date +%s`"
+echo "ro.build.date=`date -d \"$BUILD_DATETIME\"`"
+echo "ro.build.date.utc=`date -d \"$BUILD_DATETIME\" +%s`"
echo "ro.build.type=$TARGET_BUILD_TYPE"
echo "ro.build.user=$USER"
echo "ro.build.host=`hostname`"