Enable stable config cache

This commit is contained in:
Goooler 2023-01-13 15:22:16 +08:00
parent 5187b7cb04
commit 20b8ad58aa
3 changed files with 11 additions and 15 deletions

View File

@ -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
}
}

View File

@ -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

View File

@ -14,4 +14,6 @@ dependencyResolutionManagement {
}
}
enableFeaturePreview("STABLE_CONFIGURATION_CACHE")
include ':app'