source/targetCompatibility in Gradle
When working with the Android Gradle plugin you are really likely to run into a block of code that looks like this:
compileOptions { sourceCompatibility JavaVersion.VERSION_xx targetCompatibility JavaVersion.VERSION_xx } sourceCompatibility - restricts language features that we can use in our codebase. Usually is set up to a version of the JDK used for compilation. As an example using JavaVersion.VERSION_11 enables us to use var keyword for local variable type definition.