Files
libsignal/java/settings.gradle
Jordan Rose f98b7394ec Gradle: Conditionally throw an error when building without JDK 11
Previously the project would error out during the configuration stage,
since the Android Gradle plugin requires JDK 11 to even load. Now it
throws an error if you try to build a top-level task or a task in the
Android subproject, but allows you to build, e.g. 'client:test' with
no problems.
2022-03-22 10:19:47 -07:00

19 lines
714 B
Groovy

pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
include ':client', ':server'
if (JavaVersion.current().isJava11Compatible()) {
include ':android'
} else if (gradle.startParameter.getTaskNames().any { name -> name.contains('android:') }) {
throw new GradleException("building for Android requires JDK 11 or newer")
} else if (gradle.startParameter.getTaskNames().any { name -> name.lastIndexOf(':') <= 0 }) {
// If there are any top-level tasks ("build" or ":build" but not ":client:build")...
throw new GradleException("building for Android requires JDK 11 or newer; use 'client:' or 'server:' to only build certain products")
}