Get current build variant in kotlin

by AVEbrahimi   Last Updated August 14, 2019 04:26 AM

I have a couple of build variants in my Android project.

How can I check what variant is compiling in Kotlin code? I want to make a condition like this : If it's local variant then do this else if it's remote variant do that...

For example something like this :

if (build.variant=="local") {
...
}
else
{
...
}


Related Questions


Updated January 18, 2019 00:26 AM

Updated February 26, 2017 23:26 PM

Updated December 06, 2017 03:26 AM

Updated June 27, 2018 09:26 AM