Speakers: Malvin Sutanto
Sources: droidcon APAC 2020
Lately, more and more android projects are adopting multi-module setup. The number of modules for a project can vary and some projects can even have more than a hundred modules. Managing these modules can then be very cumbersome as it involves a lot of copying and pasting common settings and codes between build.gradle files. Some teams utilize buildscript.ext and apply from: statements to try to remedy this issue. However, these methods are very limited in terms of functionalities.
In this talk, I will discuss how the Gradle plugin works, and how we can write a custom plugin in Kotlin to help us manage an Android multi-module project. I will also present techniques to provide custom configurations in our Gradle plugin so that we can modify our build depending on the module, and further, extend the plugin's capabilities by integrating it with other Gradle plugins; e.g., Jacoco plugin. Lastly, I will share our experience of building a Gradle plugin and explore the benefits and limitations that I've encountered.