0

I was looking through and open source application here and saw this line of code in this file:

buildConfigField "String", "DRIBBBLE_CLIENT_ID", "\"${dribbble_client_id}\""

How does something like this work, mainly where or what is ${dribble_client_id} stored or defined?

Thanks

rycirese
  • 179
  • 1
  • 14
  • Answered in this [link](http://stackoverflow.com/questions/30796533/how-to-generate-buildconfigfield-with-string-type) – Fady Saad Apr 15 '17 at 23:25
  • @user7790438: That question and answers cover the syntax of `buildConfigField`, not where `dribble_client_id` comes from. – CommonsWare Apr 15 '17 at 23:26

2 Answers2

1

you can see:http://qiita.com/shts/items/d94834437b22712415c5

buildConfigField "String", "PARSE_API_ID", "\"${project.property("parseApiId")}\""
HONG.LI
  • 11
  • 1
0

That could be defined in any of the gradle.properties files:

  • In the module root
  • In the project root
  • In the Gradle home (e.g., ~/.gradle on Linux and macOS)

There's also a syntax for using environment variables to inject values like that, but that approach didn't use to work with Android Studio, and I am not aware that it now does. It would work for command-line builds (e.g., CI servers).

I think that there is a command-line switch approach as well for defining properties like these.

Personally, I use gradle.properties.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491