diff --git a/app/build.gradle b/app/build.gradle index f53fa7f88..936055f29 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,18 +7,9 @@ plugins { apply from: "../instance-build.gradle" -def getGitSha = { - def stdout = new ByteArrayOutputStream() - try { - exec { - commandLine 'git', 'rev-parse', '--short', 'HEAD' - standardOutput = stdout - } - } catch (Exception e) { - return "unknown" - } - return stdout.toString().trim() -} +final def gitSha = providers.exec { + commandLine('git', 'rev-parse', '--short=7', 'HEAD') +}.standardOutput.asText.get().trim() android { compileSdk 33 @@ -53,7 +44,7 @@ android { green { resValue "string", "app_name", APP_NAME + " Test" applicationIdSuffix ".test" - versionNameSuffix "-" + getGitSha() + versionNameSuffix "-" + gitSha } } @@ -70,7 +61,7 @@ android { } unitTests.all { systemProperty 'robolectric.logging.enabled', 'true' - } + } } sourceSets { androidTest.assets.srcDirs += files("$projectDir/schemas".toString()) @@ -79,7 +70,7 @@ android { // Exclude unneeded files added by libraries packagingOptions.resources.excludes += [ 'LICENSE_OFL', - 'LICENSE_UNICODE', + 'LICENSE_UNICODE', ] bundle { diff --git a/gradle.properties b/gradle.properties index 8144ece09..8c2ec857f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,5 +15,8 @@ org.gradle.jvmargs=-Xmx4096m # use parallel execution org.gradle.parallel=true +# https://docs.gradle.org/7.6/userguide/configuration_cache.html +org.gradle.unsafe.configuration-cache=true + android.enableR8.fullMode=true android.useAndroidX=true diff --git a/settings.gradle b/settings.gradle index 32c4eec71..1b76791c7 100644 --- a/settings.gradle +++ b/settings.gradle @@ -14,4 +14,6 @@ dependencyResolutionManagement { } } +enableFeaturePreview("STABLE_CONFIGURATION_CACHE") + include ':app'