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.
fennec/production
Grisha Kruglov 4 years ago committed by Grisha Kruglov
parent aa0b8f65b1
commit 0e47f55c24

@ -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)

Loading…
Cancel
Save