Skip to content
Snippets Groups Projects
Verified Commit a24e0482 authored by akwizgran's avatar akwizgran
Browse files

Add default build timestamp in case Git command fails.

parent 8fc83334
No related branches found
No related tags found
No related merge requests found
......@@ -245,8 +245,9 @@ android {
resValue "string", "app_name", "Briar"
buildConfigField "String", "GitHash",
"\"${getStdout(['git', 'rev-parse', '--short=7', 'HEAD'], 'No commit hash')}\""
def now = (long) (System.currentTimeMillis() / 1000)
buildConfigField "Long", "BuildTimestamp",
"${getStdout(['git', 'log', '-n', '1', '--format=%ct'], 0)}000L"
"${getStdout(['git', 'log', '-n', '1', '--format=%ct'], now)}000L"
}
buildTypes {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment