Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the documentation for build.gradle's `android` block?

In a build.gradle, we have the android block. From my limited understanding of Android Gradle Plugin (and Groovy/ Kotlin), this is a method/ (or function?) called android which accepts 1 argument, a closure.

android {
    compileSdkVersion(AppConfig.compileSdkVersion)
    buildToolsVersion(AppConfig.buildToolsVersion)
}

I was not able to find any documentation about android, both on the Google Developer website and Gradle.org. It doesn't help that the function has the same name as the whole operating system. Any documentation about Android Gradle plugin would be helpful, as it seems like information about it is pepperred all over Android docs. So far, I can search what each property means (e.g. applicationId, testInstrumentationRunner), but I want to see all the properties which android has, which is where the documentation comes in handy.

What sparked all these questions was this "Introduction to Groovy and Gradle"

I was able to get the "package name" (maybe) for the android method with autocomplete in Android Studio: com.android.build.gradle.internal.dsl.BaseAppModule, but cannot find source code or documentation...

like image 585
Ben Butterworth Avatar asked Oct 20 '25 03:10

Ben Butterworth


1 Answers

It is described in android gradle plugin documentation under the class name AppExtension. Here's a link //google.github.io/android-gradle-dsl/3.3/com.android.build.gradle.AppExtension.html

like image 173
Tom Rutchik Avatar answered Oct 21 '25 18:10

Tom Rutchik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!