diff --git a/core/Makefile b/core/Makefile index e7c66ba04..41a169a5d 100644 --- a/core/Makefile +++ b/core/Makefile @@ -114,7 +114,7 @@ ifeq (,$(strip $(BUILD_FINGERPRINT))) ifneq ($(filter eng.%,$(BUILD_NUMBER)),) # Trim down BUILD_FINGERPRINT: the default BUILD_NUMBER makes it easily exceed # the Android system property length limit (PROPERTY_VALUE_MAX=92). - BF_BUILD_NUMBER := $(USER)$(shell date -d "$(BUILD_DATETIME)" +%m%d%H%M) + BF_BUILD_NUMBER := $(USER)$(shell date +%m%d%H%M) else BF_BUILD_NUMBER := $(BUILD_NUMBER) endif @@ -197,7 +197,6 @@ endif PRIVATE_BUILD_DESC="$(PRIVATE_BUILD_DESC)" \ BUILD_ID="$(BUILD_ID)" \ BUILD_DISPLAY_ID="$(BUILD_DISPLAY_ID)" \ - BUILD_DATETIME="$(BUILD_DATETIME_FROM_FILE)" \ BUILD_NUMBER="$(BUILD_NUMBER_FROM_FILE)" \ BOARD_BUILD_SYSTEM_ROOT_IMAGE="$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)" \ PLATFORM_VERSION="$(PLATFORM_VERSION)" \ @@ -247,8 +246,8 @@ $(INSTALLED_VENDOR_BUILD_PROP_TARGET): $(INSTALLED_BUILD_PROP_TARGET) @echo Target vendor buildinfo: $@ @mkdir -p $(dir $@) $(hide) echo > $@ - $(hide) echo ro.vendor.build.date=`date -d "$(BUILD_DATETIME_FROM_FILE)"`>>$@ - $(hide) echo ro.vendor.build.date.utc=`date -d "$(BUILD_DATETIME_FROM_FILE)" +%s`>>$@ + $(hide) echo ro.vendor.build.date=`date`>>$@ + $(hide) echo ro.vendor.build.date.utc=`date +%s`>>$@ $(hide) echo ro.vendor.build.fingerprint="$(BUILD_FINGERPRINT_FROM_FILE)">>$@ endif @@ -263,8 +262,8 @@ $(INSTALLED_BOOTIMAGE_BUILD_PROP_TARGET): $(INSTALLED_BUILD_PROP_TARGET) @echo Target bootimage buildinfo: $@ @mkdir -p $(dir $@) $(hide) echo > $@ - $(hide) echo ro.bootimage.build.date=`date -d "$(BUILD_DATETIME_FROM_FILE)"`>>$@ - $(hide) echo ro.bootimage.build.date.utc=`date -d "$(BUILD_DATETIME_FROM_FILE)" +%s`>>$@ + $(hide) echo ro.bootimage.build.date=`date`>>$@ + $(hide) echo ro.bootimage.build.date.utc=`date +%s`>>$@ $(hide) echo ro.bootimage.build.fingerprint="$(BUILD_FINGERPRINT_FROM_FILE)">>$@ # ----------------------------------------------------------------- diff --git a/core/config.mk b/core/config.mk index 4be443415..876161b6c 100644 --- a/core/config.mk +++ b/core/config.mk @@ -161,23 +161,6 @@ endif # are specific to the user's build configuration. include $(BUILD_SYSTEM)/envsetup.mk -# --------------------------------------------------------------- -# Allow the C/C++ macros __DATE__ and __TIME__ to be set to the -# build date and time, so that a build may be repeated. -# Write the date and time to a file so that the command line -# doesn't change every time, which would cause ninja to rebuild -# the files. -$(shell mkdir -p $(OUT_DIR) && \ - date -d "$(BUILD_DATETIME)" "+%b %_d %Y" > $(OUT_DIR)/build_c_date.txt && \ - date -d "$(BUILD_DATETIME)" +%T > $(OUT_DIR)/build_c_time.txt) -BUILD_DATETIME_C_DATE := $$(cat $(OUT_DIR)/build_c_date.txt) -BUILD_DATETIME_C_TIME := $$(cat $(OUT_DIR)/build_c_time.txt) - -ifeq ($(OVERRIDE_C_DATE_TIME),true) -COMMON_GLOBAL_CFLAGS += -Wno-builtin-macro-redefined -D__DATE__="\"$(BUILD_DATETIME_C_DATE)\"" -D__TIME__=\"$(BUILD_DATETIME_C_TIME)\" -COMMON_GLOBAL_CPPFLAGS += -Wno-builtin-macro-redefined -D__DATE__="\"$(BUILD_DATETIME_C_DATE)\"" -D__TIME__=\"$(BUILD_DATETIME_C_TIME)\" -endif - # The build system exposes several variables for where to find the kernel # headers: # TARGET_DEVICE_KERNEL_HEADERS is automatically created for the current diff --git a/core/droiddoc.mk b/core/droiddoc.mk index 37eade609..417d4fd49 100644 --- a/core/droiddoc.mk +++ b/core/droiddoc.mk @@ -132,7 +132,7 @@ droiddoc := \ $(full_target): PRIVATE_DOCLETPATH := $(HOST_OUT_JAVA_LIBRARIES)/jsilver$(COMMON_JAVA_PACKAGE_SUFFIX):$(HOST_OUT_JAVA_LIBRARIES)/doclava$(COMMON_JAVA_PACKAGE_SUFFIX) $(full_target): PRIVATE_CURRENT_BUILD := -hdf page.build $(BUILD_ID)-$(BUILD_NUMBER_FROM_FILE) -$(full_target): PRIVATE_CURRENT_TIME := -hdf page.now "$$(date -d "$(BUILD_DATETIME_FROM_FILE)" "+%d %b %Y %k:%M")" +$(full_target): PRIVATE_CURRENT_TIME := -hdf page.now "$$(date "+%d %b %Y %k:%M")" $(full_target): PRIVATE_CUSTOM_TEMPLATE_DIR := $(LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR) $(full_target): PRIVATE_IN_CUSTOM_ASSET_DIR := $(LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR)/$(LOCAL_DROIDDOC_CUSTOM_ASSET_DIR) $(full_target): PRIVATE_OUT_ASSET_DIR := $(out_dir)/$(LOCAL_DROIDDOC_ASSET_DIR) diff --git a/core/main.mk b/core/main.mk index 87bcd1370..b290ce1a9 100644 --- a/core/main.mk +++ b/core/main.mk @@ -102,11 +102,8 @@ else # !USE_NINJA # Write the build number to a file so it can be read back in # without changing the command line every time. Avoids rebuilds # when using ninja. -$(shell mkdir -p $(OUT_DIR) && \ - echo -n $(BUILD_NUMBER) > $(OUT_DIR)/build_number.txt && \ - echo -n "$(BUILD_DATETIME)" > $(OUT_DIR)/build_date.txt) +$(shell mkdir -p $(OUT_DIR) && echo -n $(BUILD_NUMBER) > $(OUT_DIR)/build_number.txt) BUILD_NUMBER_FROM_FILE := $$(cat $(OUT_DIR)/build_number.txt) -BUILD_DATETIME_FROM_FILE := $$(cat $(OUT_DIR)/build_date.txt) # CTS-specific config. -include cts/build/config.mk diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 9b2ecf264..f3b22973b 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -24,7 +24,6 @@ # DEFAULT_APP_TARGET_SDK # BUILD_ID # BUILD_NUMBER -# BUILD_DATETIME # # Look for an optional file containing overrides of the defaults, @@ -90,12 +89,6 @@ ifeq "" "$(BUILD_ID)" BUILD_ID := UNKNOWN endif -ifeq "" "$(BUILD_DATETIME)" - # Used to reproduce builds by setting the same time. Must be in a - # format understood by `date` - BUILD_DATETIME := $(shell date) -endif - ifeq "" "$(BUILD_NUMBER)" # BUILD_NUMBER should be set to the source control value that # represents the current state of the source code. E.g., a @@ -106,5 +99,5 @@ ifeq "" "$(BUILD_NUMBER)" # If no BUILD_NUMBER is set, create a useful "I am an engineering build # from this date/time" value. Make it start with a non-digit so that # anyone trying to parse it as an integer will probably get "0". - BUILD_NUMBER := eng.$(USER).$(shell date -d "$(BUILD_DATETIME)" +%Y%m%d.%H%M%S) + BUILD_NUMBER := eng.$(USER).$(shell date +%Y%m%d.%H%M%S) endif diff --git a/tools/buildinfo.sh b/tools/buildinfo.sh index 2b0ad07c1..1fb203abe 100755 --- a/tools/buildinfo.sh +++ b/tools/buildinfo.sh @@ -10,8 +10,8 @@ echo "ro.build.version.sdk=$PLATFORM_SDK_VERSION" 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 -d \"$BUILD_DATETIME\"`" -echo "ro.build.date.utc=`date -d \"$BUILD_DATETIME\" +%s`" +echo "ro.build.date=`date`" +echo "ro.build.date.utc=`date +%s`" echo "ro.build.type=$TARGET_BUILD_TYPE" echo "ro.build.user=$USER" echo "ro.build.host=`hostname`"