I have an application with many flavors (A,B,C
) and two build types (debug
,release
)
In the build type debug
I add a suffix to the application ID like so:
debug {
applicationIdSuffix '.debug'
}
This is fine for flavors A
and B
but I can't append .debug
to flavor C
's application ID.
I have looked at overriding on the variant like I have for the versionCode
but no luck.
applicationVariants.all { variant ->
def changedVersionCode = variant.versionCode
variant.
variant.outputs.each { output ->
if (variant.buildType.name != "debug") {
output.setVersionCodeOverride(project.ext.versionCode)
changedVersionCode = project.ext.versionCode
}
}
changeApkFileName(variant,changedVersionCode)
}
Is it possible to override a variants application ID depending on the flavor. For example my plan was to do something like this:
variant.buildType.name.replace('.debug','')