在app.gradle中
buildConfigField "String[]", "URL_ARRAY",
"{" +
"\"http:someurl\"," +
"\"http:someurl\"," +
"\"http:someurl\"" +
"}"
如果field想使用def 定义的值,则
def stringArray= "{" +
"\"http:someurl\"," +
"\"http:someurl\"," +
"\"http:someurl\"" +
"}"
buildConfigField "String[]", "URL_ARRAY", "${stringArray}"
网友评论