Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions FlowCrypt/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ android {
initWith(getByName("consumer"))
dimension = "standard"
versionNameSuffix = "_dev"
resourceConfigurations += setOf("en", "xxhdpi")
buildConfigField("boolean", "IS_MAIL_DEBUG_ENABLED", "true")
resValue("string", "gradle_is_mail_debug_enabled", "true")
}
Expand Down Expand Up @@ -334,6 +333,26 @@ tasks.register("checkCorrectBranch") {
}
}

tasks.register("checkReleaseBuildsSize") {
doLast {
android.applicationVariants.forEach { applicationVariant ->
if (applicationVariant.buildType.name == "release") {
applicationVariant.outputs.forEach { variantOutput ->
val apkFile = variantOutput.outputFile
//for now apk up to 50Mb is normal
val maxExpectedSizeInBytes = 50 * 1024 * 1024
if (apkFile.length() > maxExpectedSizeInBytes) {
throw GradleException(
"The generated release build is bigger then expected: " +
"expected = not big then $maxExpectedSizeInBytes, actual = ${apkFile.length()}"
)
}
}
}
}
}
}

tasks.register("renameReleaseBuilds") {
doLast {
android.applicationVariants.forEach { applicationVariant ->
Expand All @@ -353,7 +372,7 @@ tasks.register("renameReleaseBuilds") {
}

tasks.register<Copy>("copyReleaseApks") {
from("$buildDir") {
from("${layout.buildDirectory}") {
include("**/*release*.apk")
}

Expand Down
7 changes: 6 additions & 1 deletion script/prod-release.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

#
# © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
# Contributors: denbond7
#

set -euo pipefail

read -s -p "Android Keystore Password: " STORE_PWD
Expand All @@ -8,4 +13,4 @@ read -s -p "Android Signing Key Password: " KEY_PWD
echo ""

./gradlew --console=verbose clean lintConsumerRelease assembleConsumerRelease assembleEnterpriseRelease -PruntimeSign -PstorePassword="$STORE_PWD" -PkeyPassword="$KEY_PWD" --rerun-tasks
./gradlew --console=verbose checkCorrectBranch renameReleaseBuilds copyReleaseApks
./gradlew --console=verbose checkCorrectBranch checkReleaseBuildsSize renameReleaseBuilds copyReleaseApks