I am using Android Studio and I have the following modules in my project:
- Android application named "app"
- Java library named "communication"
In my "app" module's build.gradle
file, I can declare variables for the BuildConfig.java
file, as follows:
buildTypes {
release {
...
buildConfigField "String", "SERVER_URL", '"my_url"'
}
debug {
buildConfigField "String", "SERVER_URL", '"my_url"'
}
}
I can then access these variables using BuildConfig.SERVER_URL
.
How do I achieve this in my "communication" module's build.gradle
file?