Skip to content

Instantly share code, notes, and snippets.

View jrvansuita's full-sized avatar
🎖️
Prize Time

jrvansuita jrvansuita

🎖️
Prize Time
View GitHub Profile

Privacy Policy

Last updated: August 8, 2025

This Privacy Policy describes Our policies and procedures on the collection, use, and disclosure of Your information when You use the Service, and informs You about Your privacy rights and how the law protects You.

By using the Service, You agree to the collection and use of information in accordance with this Privacy Policy.

@jrvansuita
jrvansuita / gist:c154488ace77b63af9367b74a42256d1
Created July 11, 2023 01:29
Getting the current buildtype and Flavor by assemble task using gradle scripts
gradle.allprojects {
ext.getCurrentProductVariant = {
def taskName = project.gradle.startParameter.taskNames.find { it.contains("assemble") }
if (taskName != null) {
def variantParts = taskName.split(/(?<!^)(?=[A-Z])/)[-2..-1].collect { it.toLowerCase() }
return new ProductVariant(buildType: variantParts[1], productFlavor: variantParts[0])
}
return null
}
}