mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 21:59:54 +01:00
Merge branch 'deterministic-build-timestamp' into 'master'
Use git commit timestamp as build timestamp See merge request akwizgran/briar!798
This commit is contained in:
@@ -218,16 +218,16 @@ dependencyVerification {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
def getGitHash = { ->
|
def getStdout = { command, defaultValue ->
|
||||||
def stdout = new ByteArrayOutputStream()
|
def stdout = new ByteArrayOutputStream()
|
||||||
try {
|
try {
|
||||||
exec {
|
exec {
|
||||||
commandLine 'git', 'rev-parse', '--short=7', 'HEAD'
|
commandLine = command
|
||||||
standardOutput = stdout
|
standardOutput = stdout
|
||||||
}
|
}
|
||||||
return stdout.toString().trim()
|
return stdout.toString().trim()
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
return "No commit hash"
|
return defaultValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,8 +243,10 @@ android {
|
|||||||
applicationId "org.briarproject.briar.android"
|
applicationId "org.briarproject.briar.android"
|
||||||
resValue "string", "app_package", "org.briarproject.briar.android"
|
resValue "string", "app_package", "org.briarproject.briar.android"
|
||||||
resValue "string", "app_name", "Briar"
|
resValue "string", "app_name", "Briar"
|
||||||
buildConfigField "String", "GitHash", "\"${getGitHash()}\""
|
buildConfigField "String", "GitHash",
|
||||||
buildConfigField "Long", "BuildTimestamp", "${System.currentTimeMillis()}L"
|
"\"${getStdout(['git', 'rev-parse', '--short=7', 'HEAD'], 'No commit hash')}\""
|
||||||
|
buildConfigField "Long", "BuildTimestamp",
|
||||||
|
"${getStdout(['git', 'log', '-n', '1', '--date=unix', '--format=%cd'], 0)}000L"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
Reference in New Issue
Block a user