# Project-wide Gradle settings. # IDE (e.g. Android Studio) users: # Gradle settings configured through the IDE *will override* # any settings specified in this file. # For more details on how to configure your build environment visit # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. # Default value: -Xmx512m -Xms256m -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError # Bugs: This will override important JVM argument defaults. Include all important JVM arguments if you wan to change arguments. See https://github.com/gradle/gradle/issues/19750 # 32GB 双工程并行构建起始预算:每个工程 Gradle 4g + Kotlin 3g。 # 堆上限不包含 worker、元空间和原生内存;完整构建峰值仍需实测。 org.gradle.jvmargs=-Xmx4g -Xms512m -XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseG1GC # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects org.gradle.parallel=true # 限制每次构建的并发工作数量,降低两个工程同时构建的内存峰值。 org.gradle.workers.max=2 # AndroidX package structure to make it clearer which packages are bundled with the # Android operating system, and which are packaged with your app's APK # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX android.enableJetifier=false # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official # android.enableNewResourceShrinker' is deprecated. # It was removed in version 8.0 of the Android Gradle plugin. # android.enableNewResourceShrinker=true android.experimental.enableNewResourceShrinker.preciseShrinking=true # https://blog.gradle.org/introducing-file-system-watching org.gradle.vfs.watch=true # Disable buildFeatures flags by default android.defaults.buildfeatures.resvalues=false android.defaults.buildfeatures.shaders=false # enables namespacing of each library's R class so that its R class includes only the resources declared in the library itself # and none from the library's dependencies, thereby reducing the size of the R class for that library. android.nonTransitiveRClass=true # https://chromiumdash.appspot.com/releases?platform=Android CronetVersion=128.0.6613.40 CronetMainVersion=128.0.0.0 android.injected.testOnly=false android.nonFinalResIds=true android.injected.androidTest.leaveApksInstalledAfterRun=true android.uniquePackageNames=false android.dependency.useConstraints=true android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false android.r8.strictFullModeForKeepRules=false org.gradle.configuration-cache=true org.gradle.java.installations.auto-detect=true org.gradle.java.installations.auto-download=false # 构建缓存:任务输入不变时复用输出,加速 clean build / 切换分支 / CI org.gradle.caching=true # 显式设置 Kotlin 堆上限,避免继承 Gradle 的最大堆。 kotlin.daemon.jvmargs=-Xmx3g -Xms256m -XX:MaxMetaspaceSize=512m -XX:+UseG1GC # Gradle 9.4+:显式开启 Tooling API 并行(IDE sync),避免依赖 org.gradle.parallel 的弃用隐式推导 org.gradle.tooling.parallel=true