diff --git a/app/build.gradle b/app/build.gradle index 2858b43d4a..a40549c89d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -262,6 +262,15 @@ android { buildConfigField "String", "BUILD_DISTRIBUTION_TYPE", "\"internal\"" } + nightly { + dimension 'distribution' + versionNameSuffix "-nightly-${getDateSuffix()}" + ext.websiteUpdateUrl = "null" + buildConfigField "boolean", "PLAY_STORE_DISABLED", "false" + buildConfigField "String", "NOPLAY_UPDATE_URL", "$ext.websiteUpdateUrl" + buildConfigField "String", "BUILD_DISTRIBUTION_TYPE", "\"internal\"" + } + study { dimension 'distribution' @@ -308,13 +317,17 @@ android { android.applicationVariants.all { variant -> variant.outputs.each { output -> - output.outputFileName = output.outputFileName.replace(".apk", "-${variant.versionName}.apk") - def abiName = output.getFilter("ABI") ?: 'universal' - def postFix = abiPostFix.get(abiName, 0) + if (output.baseName.contains('nightly')) { + output.versionCodeOverride = canonicalVersionCode * postFixSize + 5 + } else { + output.outputFileName = output.outputFileName.replace(".apk", "-${variant.versionName}.apk") + def abiName = output.getFilter("ABI") ?: 'universal' + def postFix = abiPostFix.get(abiName, 0) - if (postFix >= postFixSize) throw new AssertionError("postFix is too large") + if (postFix >= postFixSize) throw new AssertionError("postFix is too large") - output.versionCodeOverride = canonicalVersionCode * postFixSize + postFix + output.versionCodeOverride = canonicalVersionCode * postFixSize + postFix + } } } @@ -327,6 +340,12 @@ android { variant.setIgnore(true) } else if (distribution != 'study' && buildType == 'mock') { variant.setIgnore(true) + } else if (distribution == 'internal' && buildType != 'flipper' && buildType != 'perf' && buildType != 'release') { + variant.setIgnore(true) + } else if (distribution == 'nightly' && environment != 'prod') { + variant.setIgnore(true) + } else if (distribution == 'nightly' && buildType != 'flipper' && buildType != 'perf' && buildType != 'release') { + variant.setIgnore(true) } } @@ -600,3 +619,9 @@ def loadKeystoreProperties(filename) { return null; } } + +def getDateSuffix() { + def date = new Date() + def formattedDate = date.format('yyyy-MM-dd-HH:mm') + return formattedDate +} diff --git a/app/src/nightly/res/drawable/nightly_background.webp b/app/src/nightly/res/drawable/nightly_background.webp new file mode 100644 index 0000000000..318e27ce8c Binary files /dev/null and b/app/src/nightly/res/drawable/nightly_background.webp differ diff --git a/app/src/nightly/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/nightly/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000000..7620da1bdc --- /dev/null +++ b/app/src/nightly/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file