diff --git a/gradle.properties b/gradle.properties index 5bac8ac50..68d245fef 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,4 @@ android.useAndroidX=true +# Set to false in $HOME/.gradle/gradle.properties (or pass -Pconscrypt.includeAndroid=false) +# to exclude Android sub-projects, e.g. when iterating on common/ code. +conscrypt.includeAndroid=true diff --git a/settings.gradle b/settings.gradle index 830dc8e7a..94c46951c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -14,7 +14,8 @@ dependencyResolutionManagement { } rootProject.name = "conscrypt" -if (System.env.ANDROID_HOME && file(System.env.ANDROID_HOME).exists()) { +if (providers.gradleProperty('conscrypt.includeAndroid').getOrElse('true').toBoolean() + && System.env.ANDROID_HOME && file(System.env.ANDROID_HOME).exists()) { include ":conscrypt-android" include ":conscrypt-android-platform" include ":conscrypt-android-stub" @@ -27,7 +28,9 @@ if (System.env.ANDROID_HOME && file(System.env.ANDROID_HOME).exists()) { project(':conscrypt-benchmark-android').projectDir = "$rootDir/benchmark-android" as File project(':conscrypt-libcore-stub').projectDir = "$rootDir/libcore-stub" as File } else { - logger.warn('Android SDK has not been detected. Skipping Android projects.') + logger.warn('Android projects not included. ' + + 'Ensure ANDROID_HOME is set and set conscrypt.includeAndroid=true ' + + 'in gradle.properties to include them.') } include ":conscrypt-api-doclet"