I have two convention plugins (teams-android-library-java-only.gradle.kts and teams-android-library.gradle.kts) that I apply to Java android library modules with java and Kotlin android library modules. They are applied to ~600 modules in my project.
I need to configure unit tests in those modules. Both of them have code similar to below.
android {
// common android configuration here.
unitTestVariants.all {
// 300 lines of duplication here in both convention plugins.
}
}
How can I avoid the 300 lines of duplication in each of the convention plugins.