Can anyone suggest, how can we add a dependency at build time in android gradle based on some condition like:
dependencies{ if(someCondition){ // add dependency } }
Thanks in advance!!
1 Answers
Answers 1
I found a solution for this:
Step1: Declare a boolean variable
in gradle at root level.
like: def someDependencyEnabled = true //This could be dynamically set.
Step2: Using this boolean
variable we can apply a check like:
if(someDependencyEnabled){ //Add some dependency } else { //Add some other dependency }
0 comments:
Post a Comment