Hi guys, I asked in the getting-started channel bu...
# gradle
s
Hi guys, I asked in the getting-started channel but probably the right place is this one. Any one can help me? Thanks!
j
Are you using some android gradle plugin?
Like Android library?
s
no, I never used it because I thought it was only for android app
j
really it is for android apps/libraries, but without it, you can't use buildConfigField. BTW I think you shouldn't use it if it is a web service
s
in a web service app, what is a good approach to load environment variable in gradle and use after that in the app?
n
write the field to a java class
j
you can read enviroment variables from gradle
s
yes, but I didn’t find a way to use these variables in the project
j
There is multiple approach, writing them in gradle.properties files, or in your system.
Copy code
System.getenv("my_env_var")
I am not a backend dev, but maybe this is what you are trying to do https://stackoverflow.com/questions/40659986/maven-profiles-equivalent-of-gradle
s
I think build these variables in the application is better, you have to share these information only during the build pipeline and not in all containers where the app runs @Javier I look at it, thanks