timestamp.gni 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. # Copyright 2018 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. #
  5. # Defines the build_timestamp variable.
  6. import("//build/util/lastchange.gni")
  7. declare_args() {
  8. # This should be the filename of a script that prints a single line
  9. # containing an integer that's a unix timestamp in UTC.
  10. # This timestamp is used as build time and will be compiled into
  11. # other code.
  12. #
  13. # This argument may look unused. Before removing please check with the
  14. # chromecast team to see if they still use it internally.
  15. compute_build_timestamp = "compute_build_timestamp.py"
  16. }
  17. if (is_official_build) {
  18. official_name = "official"
  19. } else {
  20. official_name = "default"
  21. }
  22. # This will return a timestamp that's different each day (official builds)
  23. # or each month (regular builds). Just rely on gn rerunning due to other
  24. # changes to keep this up to date. (Bots run gn on each build, and for devs
  25. # the timestamp being 100% accurate doesn't matter.)
  26. # See compute_build_timestamp.py for tradeoffs for picking the timestamp.
  27. build_timestamp = exec_script(compute_build_timestamp,
  28. [ official_name ],
  29. "trim string",
  30. [ lastchange_file ])