Created
March 11, 2021 16:10
-
-
Save dudego/2001bbc6c292803ee3e1116a41150653 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def taskFlavorTypes = ["flavor1", "flavor2"] //flavors defined for apk | |
def taskVariant = ["debug", "release"] //variant defined for apk | |
// generates gradle task dynamically which can be mapped for each build flavor and variant combination defined in above variables | |
// for eg. tasks will be declared as "encryptFlavor1DebugConfig", "encryptFlavor1ReleaseConfig", "encryptFlavor2DebugConfig", "encryptFlavor2ReleaseConfig" | |
taskFlavorTypes.each { buildFlavor -> | |
taskVariant.each { buildVariant -> | |
task "encrypt${buildFlavor.capitalize()}${buildVariant.capitalize()}Config" { | |
outputs.upToDateWhen { false } | |
description = "Encrypt ${buildFlavor} ${buildVariant} Config" | |
doLast { | |
encryptfile(buildFlavor, buildVariant) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment