What does formString(System.getenv("...")) mean?

2.3k Views Asked by At

In build.gradle, the following is under a product flavor:

buildConfigField 'String', 'API_URL', formString(System.getenv("DEV_API_URL"))

What does formString(System.getenv("DEV_API_URL")) mean?

I am used to seeing the formString as a static value (and I can reference it in code as BuildConfig.API_URL") but am having a hard time figuring out what this code means as well as where "DEV_API_URL" is defined. Guidance and links are appreciated!

1

There are 1 best solutions below

4
On

1) formString must be a custom function defined somewhere in your build.gradle as there is no such function in Groovy or Java. If you cant figure out where it is, use a text search tool like ag (https://github.com/ggreer/the_silver_searcher)

2) System.getenv is a call that retrieves an environment variable defined on your machine, more here: https://docs.oracle.com/javase/7/docs/api/java/lang/System.html#getenv(java.lang.String).