Nico Weber | 967d1f1 | 2018-08-17 02:42:02 | [diff] [blame] | 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 | |
| 7 | import("//build/util/lastchange.gni") |
| 8 | |
Eli Ribble | eecced2 | 2019-03-26 01:05:23 | [diff] [blame] | 9 | declare_args() { |
| 10 | # This should be the filename of a script that prints a single line |
| 11 | # containing an integer that's a unix timestamp in UTC. |
| 12 | # This timestamp is used as build time and will be compiled into |
| 13 | # other code. |
| 14 | # |
| 15 | # This argument may look unused. Before removing please check with the |
| 16 | # chromecast team to see if they still use it internally. |
| 17 | compute_build_timestamp = "compute_build_timestamp.py" |
| 18 | } |
| 19 | |
Nico Weber | 967d1f1 | 2018-08-17 02:42:02 | [diff] [blame] | 20 | if (is_official_build) { |
| 21 | official_name = "official" |
| 22 | } else { |
| 23 | official_name = "default" |
| 24 | } |
| 25 | |
| 26 | # This will return a timestamp that's different each day (official builds) |
Nico Weber | ce33a6a | 2018-08-17 15:40:50 | [diff] [blame] | 27 | # or each month (regular builds). Just rely on gn rerunning due to other |
Nico Weber | 967d1f1 | 2018-08-17 02:42:02 | [diff] [blame] | 28 | # changes to keep this up to date. (Bots run gn on each build, and for devs |
| 29 | # the timestamp being 100% accurate doesn't matter.) |
| 30 | # See compute_build_timestamp.py for tradeoffs for picking the timestamp. |
Eli Ribble | eecced2 | 2019-03-26 01:05:23 | [diff] [blame] | 31 | build_timestamp = exec_script(compute_build_timestamp, |
Nico Weber | 967d1f1 | 2018-08-17 02:42:02 | [diff] [blame] | 32 | [ official_name ], |
| 33 | "trim string", |
| 34 | [ lastchange_file ]) |