diff --git a/FlowCrypt/build.gradle.kts b/FlowCrypt/build.gradle.kts index 8d8fbbec62..b373a3fc99 100644 --- a/FlowCrypt/build.gradle.kts +++ b/FlowCrypt/build.gradle.kts @@ -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") } @@ -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 -> @@ -353,7 +372,7 @@ tasks.register("renameReleaseBuilds") { } tasks.register("copyReleaseApks") { - from("$buildDir") { + from("${layout.buildDirectory}") { include("**/*release*.apk") } diff --git a/script/prod-release.sh b/script/prod-release.sh index a7e0effca4..77f2a33b13 100755 --- a/script/prod-release.sh +++ b/script/prod-release.sh @@ -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 @@ -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