Commit 0e47f55c authored by Grisha Kruglov's avatar Grisha Kruglov Committed by Grisha Kruglov
Browse files

Only set real BUILD_DATE for non-debug builds

This avoids BuildConfig modifications between local dev builds,
and speeds up the builds by avoiding running tasks that depend on BuildConfig.

Locally, depending on exact build circumstances, this saves about 5% of build runtime
for simple code changes, and about 90% of build runtime for no-op builds.
parent aa0b8f65
......@@ -346,9 +346,13 @@ android.applicationVariants.all { variant ->
}
def buildDate = Config.generateBuildDate()
buildConfigField 'String', 'BUILD_DATE', '"' + buildDate + '"'
def variantName = variant.getName()
// Setting buildDate with every build changes the generated BuildConfig, which slows down the
// build. Only do this for non-debug builds, to speed-up builds produced during local development.
if (isDebug) {
buildConfigField 'String', 'BUILD_DATE', '"debug build"'
} else {
buildConfigField 'String', 'BUILD_DATE', '"' + buildDate + '"'
}
// -------------------------------------------------------------------------------------------------
// Adjust: Read token from local file if it exists (Only release builds)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment