I\'m building a gradle plugin that adds a new task for every application variant. This new task needs the package name of the application variant.
This is my current cod
I use this:
// Return the packageName for the given buildVariant
def getPackageName(variant) {
def suffix = variant.buildType.packageNameSuffix
def packageName = variant.productFlavors.get(0).packageName
if (suffix != null && !suffix.isEmpty() && suffix != "null") {
packageName += suffix
}
return packageName
}