

In short, the Android Gradle plugin contains all the actions that are executed to build an Android app. All of the useful features, like the ability to compile Java code, are added by plugins. Gradle at its core intentionally provides very little for real world automation. Gradle explains it very well in their site: Photo by Jo Szczepanska on Unsplash Why is it a Plugin? They are installed in a local machine and you create builds manually. Build automation utilities - This is the group to which Gradle belongs.

For example, builds can run at night and in the morning you have a new version of all the merged changes.

You can commonly see these tools when working on big projects. Build automation servers - As the name states, they are online tools that make builds on their own in a scheduled way or through manual triggering.There are two types of build automation tools. Some of the processes that happen in it are compiling your code into binary, packaging, and running automated tests. It is the complete process of building software, done by a program without our interaction. Read about Gradle features to learn what is possible with Gradle.įrom the above, it is important to understand what build automation is. Gradle build scripts are written using a Groovy or Kotlin DSL. Gradle is an open-source build automation tool focused on flexibility and performance. Let’s review the definition in Gradle’s official page: The first thing we need to define and understand how Gradle works. All we need is for your plugin to be aware of the AGP, so we can use the APIs it provides.Photo by Bia Andrade on Unsplash What is Gradle? We’re using compileOnly, since, at runtime, this dependency will be provided by the build.script of the Android application that applies your plugin, in its build script. So, in your plugin’s adle script, you’ll need: dependencies So, the first thing you need to do, is add a dependency in your Gradle plugin’s adle file on the Android Gradle Plugin. But with Kotlin, you can’t get away with that. For groovy, this is all pretty easy and straightforward, because groovy doesn’t require you to explicitly import anything.

And if you’re creating your own plugin, you might want to know some of the stuff in that closure, or other stuff the AGP is doing.
