Is there a functionality inside android studio to do things like this. Basically my gradle script reads parameter named version based on which it sets dependency version of a certain library. So when I do gradlew -Pversion=‘1.2.3' I get this string inside gradle. But this only works if I invoke gradle from console.
Is there a way to pass parameters to gradle when started using configuration for project inside Android Studio (pressing little play triangle)?
NOTE:I did find Gradle VM options and Script prameters under default configs but adding -Pversion=‘1.2.3' there doesn't seem to have an effect.
In order to provide parameter to run
option of Android Studio you should setup them under AndroidStudios Compile Preferences
AndroidStudio > Preferences...
Under Compiler: ComandLineOptions
Run > Edit Configurations..
Replace "abcdef" in Script parameters by your params.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With