Skip to content

Instantly share code, notes, and snippets.

@nhoxbypass
Created August 3, 2019 09:11
Show Gist options
  • Select an option

  • Save nhoxbypass/482290d243bfac0d5ac60ac5c135ca78 to your computer and use it in GitHub Desktop.

Select an option

Save nhoxbypass/482290d243bfac0d5ac60ac5c135ca78 to your computer and use it in GitHub Desktop.
def build_param = "${build}"
if (build_param == "devCI") {
// Exclude all except mockDebug flavor
android.variantFilter { variant ->
if (variant.getFlavors().get(0).name != 'mock' || variant.buildType.name != 'debug') {
variant.setIgnore(true)
}
}
} else if (build_param == "releaseCI") {
// Exclude all except prodRelease flavor
android.variantFilter { variant ->
if (variant.getFlavors().get(0).name != 'prod' || variant.buildType.name != 'release') {
variant.setIgnore(true)
}
}
} else {
// Normal local machine dev
// Exclude mockRelease as it's not needed.
android.variantFilter { variant ->
if(variant.buildType.name == 'release' && variant.getFlavors().get(0).name == 'mock') {
variant.setIgnore(true)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment