-
-
Save dtunctuncer/3ac7a0e9556dd72e6f9ed3da8db29ce6 to your computer and use it in GitHub Desktop.
Set different signing configs with multiple flavors and dimensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
signingConfigs { | |
vanillaPaid { | |
... | |
} | |
vanillaFree { | |
... | |
} | |
chocolatePaid { | |
... | |
} | |
chocolateFree { | |
... | |
} | |
} | |
flavorDimensions "taste", "type" | |
productFlavors { | |
vanilla { | |
dimension "taste" | |
applicationIdSuffix ".vanilla" | |
} | |
chocolate { | |
dimension "taste" | |
applicationIdSuffix ".chocolate" | |
} | |
free { | |
dimension "type" | |
... | |
} | |
paid { | |
dimension "type" | |
... | |
} | |
} | |
applicationVariants.all { variant -> | |
if (variant.name.equals("vanillaPaidRelease")) { | |
variant.mergedFlavor.setSigningConfig(signingConfigs.vanillaPaid) | |
} else if (variant.name.equals("vanillaFreeRelease")) { | |
variant.mergedFlavor.setSigningConfig(signingConfigs.vanillaFree) | |
} else if (variant.name.equals("chocolatePaidRelease")) { | |
variant.mergedFlavor.setSigningConfig(signingConfigs.chocolatePaid) | |
} else if (variant.name.equals("chocolateFreeRelease")) { | |
variant.mergedFlavor.setSigningConfig(signingConfigs.chocolateFree) | |
} | |
} | |
buildTypes { | |
release { | |
... | |
} | |
debug { | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment