Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92026f2d authored by Dan Willemsen's avatar Dan Willemsen
Browse files

Revert "Use repeatable timestamps"

OSX `date` doesn't understand -d

This reverts commit 13ba6e00.

Change-Id: I5970032ff02cc07bd3b087e1eeb5f19b1e4194b4
parent 13ba6e00
Loading
Loading
Loading
Loading
+5 −6
Original line number Original line Diff line number Diff line
@@ -114,7 +114,7 @@ ifeq (,$(strip $(BUILD_FINGERPRINT)))
  ifneq ($(filter eng.%,$(BUILD_NUMBER)),)
  ifneq ($(filter eng.%,$(BUILD_NUMBER)),)
    # Trim down BUILD_FINGERPRINT: the default BUILD_NUMBER makes it easily exceed
    # Trim down BUILD_FINGERPRINT: the default BUILD_NUMBER makes it easily exceed
    # the Android system property length limit (PROPERTY_VALUE_MAX=92).
    # 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
  else
    BF_BUILD_NUMBER := $(BUILD_NUMBER)
    BF_BUILD_NUMBER := $(BUILD_NUMBER)
  endif
  endif
@@ -197,7 +197,6 @@ endif
			PRIVATE_BUILD_DESC="$(PRIVATE_BUILD_DESC)" \
			PRIVATE_BUILD_DESC="$(PRIVATE_BUILD_DESC)" \
			BUILD_ID="$(BUILD_ID)" \
			BUILD_ID="$(BUILD_ID)" \
			BUILD_DISPLAY_ID="$(BUILD_DISPLAY_ID)" \
			BUILD_DISPLAY_ID="$(BUILD_DISPLAY_ID)" \
			BUILD_DATETIME="$(BUILD_DATETIME_FROM_FILE)" \
			BUILD_NUMBER="$(BUILD_NUMBER_FROM_FILE)" \
			BUILD_NUMBER="$(BUILD_NUMBER_FROM_FILE)" \
			BOARD_BUILD_SYSTEM_ROOT_IMAGE="$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)" \
			BOARD_BUILD_SYSTEM_ROOT_IMAGE="$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)" \
			PLATFORM_VERSION="$(PLATFORM_VERSION)" \
			PLATFORM_VERSION="$(PLATFORM_VERSION)" \
@@ -247,8 +246,8 @@ $(INSTALLED_VENDOR_BUILD_PROP_TARGET): $(INSTALLED_BUILD_PROP_TARGET)
	@echo Target vendor buildinfo: $@
	@echo Target vendor buildinfo: $@
	@mkdir -p $(dir $@)
	@mkdir -p $(dir $@)
	$(hide) echo > $@
	$(hide) echo > $@
	$(hide) echo ro.vendor.build.date=`date -d "$(BUILD_DATETIME_FROM_FILE)"`>>$@
	$(hide) echo ro.vendor.build.date=`date`>>$@
	$(hide) echo ro.vendor.build.date.utc=`date -d "$(BUILD_DATETIME_FROM_FILE)" +%s`>>$@
	$(hide) echo ro.vendor.build.date.utc=`date +%s`>>$@
	$(hide) echo ro.vendor.build.fingerprint="$(BUILD_FINGERPRINT_FROM_FILE)">>$@
	$(hide) echo ro.vendor.build.fingerprint="$(BUILD_FINGERPRINT_FROM_FILE)">>$@
endif
endif


@@ -263,8 +262,8 @@ $(INSTALLED_BOOTIMAGE_BUILD_PROP_TARGET): $(INSTALLED_BUILD_PROP_TARGET)
	@echo Target bootimage buildinfo: $@
	@echo Target bootimage buildinfo: $@
	@mkdir -p $(dir $@)
	@mkdir -p $(dir $@)
	$(hide) echo > $@
	$(hide) echo > $@
	$(hide) echo ro.bootimage.build.date=`date -d "$(BUILD_DATETIME_FROM_FILE)"`>>$@
	$(hide) echo ro.bootimage.build.date=`date`>>$@
	$(hide) echo ro.bootimage.build.date.utc=`date -d "$(BUILD_DATETIME_FROM_FILE)" +%s`>>$@
	$(hide) echo ro.bootimage.build.date.utc=`date +%s`>>$@
	$(hide) echo ro.bootimage.build.fingerprint="$(BUILD_FINGERPRINT_FROM_FILE)">>$@
	$(hide) echo ro.bootimage.build.fingerprint="$(BUILD_FINGERPRINT_FROM_FILE)">>$@


# -----------------------------------------------------------------
# -----------------------------------------------------------------
+0 −17
Original line number Original line Diff line number Diff line
@@ -161,23 +161,6 @@ endif
# are specific to the user's build configuration.
# are specific to the user's build configuration.
include $(BUILD_SYSTEM)/envsetup.mk
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
# The build system exposes several variables for where to find the kernel
# headers:
# headers:
#   TARGET_DEVICE_KERNEL_HEADERS is automatically created for the current
#   TARGET_DEVICE_KERNEL_HEADERS is automatically created for the current
+1 −1
Original line number Original line Diff line number Diff line
@@ -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_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_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_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_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)
$(full_target): PRIVATE_OUT_ASSET_DIR := $(out_dir)/$(LOCAL_DROIDDOC_ASSET_DIR)
+1 −4
Original line number Original line Diff line number Diff line
@@ -102,11 +102,8 @@ else # !USE_NINJA
# Write the build number to a file so it can be read back in
# Write the build number to a file so it can be read back in
# without changing the command line every time.  Avoids rebuilds
# without changing the command line every time.  Avoids rebuilds
# when using ninja.
# when using ninja.
$(shell mkdir -p $(OUT_DIR) && \
$(shell mkdir -p $(OUT_DIR) && echo -n $(BUILD_NUMBER) > $(OUT_DIR)/build_number.txt)
    echo -n $(BUILD_NUMBER) > $(OUT_DIR)/build_number.txt && \
    echo -n "$(BUILD_DATETIME)" > $(OUT_DIR)/build_date.txt)
BUILD_NUMBER_FROM_FILE := $$(cat $(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.
# CTS-specific config.
-include cts/build/config.mk
-include cts/build/config.mk
+1 −8
Original line number Original line Diff line number Diff line
@@ -24,7 +24,6 @@
#     DEFAULT_APP_TARGET_SDK
#     DEFAULT_APP_TARGET_SDK
#     BUILD_ID
#     BUILD_ID
#     BUILD_NUMBER
#     BUILD_NUMBER
#     BUILD_DATETIME
#
#


# Look for an optional file containing overrides of the defaults,
# Look for an optional file containing overrides of the defaults,
@@ -90,12 +89,6 @@ ifeq "" "$(BUILD_ID)"
  BUILD_ID := UNKNOWN
  BUILD_ID := UNKNOWN
endif
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)"
ifeq "" "$(BUILD_NUMBER)"
  # BUILD_NUMBER should be set to the source control value that
  # BUILD_NUMBER should be set to the source control value that
  # represents the current state of the source code.  E.g., a
  # 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
  # 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
  # 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".
  # 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
endif
Loading