aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-12-22 16:22:19 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2021-07-29 12:30:07 +0530
commit29bb93cdf753ce3eb5791c641580325926f01900 (patch)
tree16b5f41d0d490a2351b3b7315d88bcb02c01fe29
parentbuild: fix CMake warning (diff)
downloadwireguard-android-29bb93cdf753ce3eb5791c641580325926f01900.tar.xz
wireguard-android-29bb93cdf753ce3eb5791c641580325926f01900.zip
gradle: update property set with AGP 7 experimental flags
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
-rw-r--r--gradle.properties68
-rw-r--r--tunnel/build.gradle3
-rw-r--r--ui/build.gradle7
3 files changed, 57 insertions, 21 deletions
diff --git a/gradle.properties b/gradle.properties
index 670f7d0..b91f540 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,11 +1,12 @@
-# Project-wide Gradle settings.
-
-# IDE (e.g. Android Studio) users:
-# Gradle settings configured through the IDE *will override*
-# any settings specified in this file.
+# 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.configureondemand=true
+org.gradle.caching=true
-# For more details on how to configure your build environment visit
-# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Enable Kotlin incremental compilation
+kotlin.incremental=true
# Enable AndroidX support
android.useAndroidX=true
@@ -14,21 +15,56 @@ android.useAndroidX=true
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
-# 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
+# Turn off AP discovery in compile path to enable compile avoidance
+kapt.include.compile.classpath=false
-# https://jakewharton.com/increased-accuracy-of-aapt2-keep-rules/
-android.useMinimalKeepRules=true
+# Enable AndroidX
+android.useAndroidX=true
-# Enable rudimentary R class namespacing where each library only contains
+# Enable non-transitive R class namespacing where each library only contains
# references to the resources it declares instead of declarations plus all
# transitive dependency references.
-android.namespacedRClass=true
+android.nonTransitiveRClass=true
+
+# Experimental AGP flags
+# Generate compile-time only R class for app modules.
+android.enableAppCompileTimeRClass=true
+# Keep AAPT2 daemons alive between incremental builds.
+android.keepWorkerActionServicesBetweenBuilds=true
+# Make R fields non-final to improve build speeds.
+# http://tools.android.com/tips/non-constant-fields
+android.nonFinalResIds=true
+# Enable the newly refactored resource shrinker.
+android.experimental.enableNewResourceShrinker=true
+# Enable precise shrinking in the new resource shrinker.
+android.experimental.enableNewResourceShrinker.preciseShrinking=true
+# Generate manifest class as a .class directly rather than a Java source file.
+android.generateManifestClass=true
+# Generate the text map of source sets and absolute paths to allow
+# generating relative paths from absolute paths later in the build.
+android.experimental.enableSourceSetPathsMap=true
+# Use relative paths for better Gradle caching of library build tasks
+android.experimental.cacheCompileLibResources=true
+
+# Default Android build features
+# Disable BuildConfig generation by default
+android.defaults.buildfeatures.buildconfig=false
+# Disable AIDL stub generation by default
+android.defaults.buildfeatures.aidl=false
+# Disable RenderScript compilation by default
+android.defaults.buildfeatures.renderscript=false
+# Disable resource values generation by default in libraries
+android.defaults.buildfeatures.resvalues=false
+# Disable shader compilation by default
+android.defaults.buildfeatures.shaders=false
+# Disable Android resource processing by default
+android.library.defaults.buildfeatures.androidresources=false
# Suppress warnings for some features that aren't yet stabilized
-android.suppressUnsupportedOptionWarnings=android.enableR8.fullMode,android.useMinimalKeepRules,android.namespacedRClass,android.suppressUnsupportedOptionWarnings
+android.suppressUnsupportedOptionWarnings=android.keepWorkerActionServicesBetweenBuilds,\
+ android.experimental.enableNewResourceShrinker,android.experimental.enableNewResourceShrinker.preciseShrinking,\
+ android.enableAppCompileTimeRClass,android.experimental.enableSourceSetPathsMap,android.experimental.cacheCompileLibResources,\
+ android.suppressUnsupportedOptionWarnings
# OSSRH sometimes struggles with slow deployments, so this makes Gradle
# more tolerant to those delays.
diff --git a/tunnel/build.gradle b/tunnel/build.gradle
index 7268a4d..b6183ea 100644
--- a/tunnel/build.gradle
+++ b/tunnel/build.gradle
@@ -22,9 +22,6 @@ android {
path 'tools/CMakeLists.txt'
}
}
- libraryVariants.all {
- it.generateBuildConfigProvider.configure { enabled = false }
- }
testOptions.unitTests.all {
testLogging {
events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
diff --git a/ui/build.gradle b/ui/build.gradle
index 53f2416..b0b92ba 100644
--- a/ui/build.gradle
+++ b/ui/build.gradle
@@ -13,8 +13,11 @@ final def keystorePropertiesFile = rootProject.file("keystore.properties")
android {
compileSdkVersion 30
- buildFeatures.dataBinding = true
- buildFeatures.viewBinding = true
+ buildFeatures {
+ buildConfig = true
+ dataBinding = true
+ viewBinding = true
+ }
defaultConfig {
applicationId 'com.wireguard.android'
minSdkVersion 21