Close #15979: Add MOZILLA_OFFICIAL flag for release builds

When we build release APKs on Mozilla infrastructure, we want a way to
know this in code for features that would only work on them.
upstream-sync
Jonathan Almeida 3 years ago committed by Jonathan Almeida
parent e754c1acc0
commit 81e08b2e7f

@ -360,6 +360,16 @@ android.applicationVariants.all { variant ->
buildConfigField 'String', 'NIMBUS_ENDPOINT', 'null'
println("--")
}
// -------------------------------------------------------------------------------------------------
// BuildConfig: Set flag for official builds; similar to MOZILLA_OFFICIAL in mozilla-central.
// -------------------------------------------------------------------------------------------------
if (project.hasProperty("official") || gradle.hasProperty("localProperties.official")) {
buildConfigField 'Boolean', 'MOZILLA_OFFICIAL', 'true'
} else {
buildConfigField 'Boolean', 'MOZILLA_OFFICIAL', 'false'
}
}
androidExtensions {

@ -104,7 +104,10 @@ def add_nightly_version(config, tasks):
for task in tasks:
if task.pop("include-nightly-version", False):
task["run"]["gradlew"].append('-PversionName={}'.format(formated_date_time))
task["run"]["gradlew"].extend([
'-PversionName={}'.format(formated_date_time),
'-Pofficial'
])
yield task
@ -112,9 +115,10 @@ def add_nightly_version(config, tasks):
def add_release_version(config, tasks):
for task in tasks:
if task.pop("include-release-version", False):
task["run"]["gradlew"].append(
'-PversionName={}'.format(config.params["version"])
)
task["run"]["gradlew"].extend([
'-PversionName={}'.format(config.params["version"]),
'-Pofficial'
])
yield task

Loading…
Cancel
Save