In Gradle for Android, I\'m trying to generate the equivalent of this string-array resource...
Here's the closest I got, with guidance from @schwiz. I still can't find a way to do this with resValue, but it's possible to define a buildConfigField that can accomplish the same goal:
buildConfigField "String[]", "URL_ARRAY",
"{" +
"\"http://www.url1.com\"," +
"\"http://www.url2.com\"," +
"\"http://www.url3.com\"" +
"}"
That gives you access to the array, via BuildConfig:
public static final String[] URL_ARRAY = {
"http://www.url1.com",
"http://www.url2.com",
"http://www.url3.com"}; // whitespace added for clarity
You can then override the buildConfigField value per buildType. So, unless you specifically need this to be in R.array.*, this will meet your needs. Leaving this open for now in case anyone else knows how to do this with resValue.