-
-
Notifications
You must be signed in to change notification settings - Fork 223
Description
Dep locks: https://docs.gradle.org/current/userguide/dependency_locking.html
Dynamic deps: https://docs.gradle.org/current/userguide/performance.html#minimize_dynamic_and_snapshot_versions
configurations.all {
resolutionStrategy {
cacheDynamicVersionsFor 4, 'hours'
cacheChangingModulesFor 10, 'minutes'
}
}plugins.withId("kotlin-kapt") {
kapt.useBuildCache = true
}Compiler: https://docs.gradle.org/current/userguide/performance.html#a_run_the_compiler_as_a_separate_process
tasks.withType(JavaCompile).configureEach {
options.fork = true
}Resource shrinking: https://developer.android.com/topic/performance/app-optimization/enable-app-optimization / https://developer.android.com/topic/performance/baselineprofiles/dex-layout-optimizations
// build.gradle
buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
dexLayoutOptimization = true
...
}
...
}
// github.com/celzero/rethink-app/blob/main/gradle.properties
android.r8.optimizedResourceShrinking=trueAfter analyzing build, if safe, enable configuration-cache: https://developer.android.com/build/optimize-your-build#use-the-configuration-cache
Convert bundled images to webp: https://developer.android.com/build/optimize-your-build#use_webp
JVM opts: https://developer.android.com/build/optimize-your-build#increase-the-jvm-heap-size
org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1gCreate a base app startup profile: https://developer.android.com/topic/performance/baselineprofiles/create-baselineprofile (see also: https://developer.android.com/topic/performance/baselineprofiles/dex-layout-optimizations#considerations)