From 563fdff73e7f8b368f9e26c85c6a7a001b9bcce5 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Sat, 11 Jun 2022 14:29:33 +0100 Subject: [PATCH] applying minor build speed improvements - disabling release build type - only including xxhdpi resources --- app/build.gradle | 14 ++++++++++++-- build.gradle | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5624f66..36dfe6f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,7 +13,17 @@ android { def versionJson = new groovy.json.JsonSlurper().parseText(rootProject.file('version.json').text) versionCode versionJson.code versionName versionJson.name - resConfigs "en" + + if (isDebugBuild) { + resConfigs "en", "xxhdpi" + variantFilter { variant -> + if (variant.buildType.name == "release") { + setIgnore(true) + } + } + } else { + resConfigs "en" + } } bundle { @@ -24,7 +34,7 @@ android { buildTypes { debug { - versionNameSuffix =" [debug]" + versionNameSuffix = " [debug]" matchingFallbacks = ['release'] signingConfig.storeFile rootProject.file("tools/debug.keystore") } diff --git a/build.gradle b/build.gradle index 34aec41..252aaa0 100644 --- a/build.gradle +++ b/build.gradle @@ -18,6 +18,8 @@ def launchTask = getGradle() .getTaskRequests() .toString() .toLowerCase() +def isReleaseBuild = launchTask.contains("release") +ext.isDebugBuild = !isReleaseBuild subprojects { tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { @@ -116,7 +118,6 @@ ext.applyAndroidLibraryModule = { project -> } ext.applyCrashlyticsIfRelease = { project -> - def isReleaseBuild = launchTask.contains("release") if (isReleaseBuild) { project.apply plugin: 'com.google.firebase.crashlytics' project.afterEvaluate {