11apply plugin : ' com.android.application'
22apply plugin : ' com.google.gms.google-services'
33
4+ static def wrapString (aString ) {
5+ return ' "' + aString + ' "'
6+ }
7+
8+ static def wrapBoolean (value ) {
9+ return " Boolean.parseBoolean(" + wrapString(value) + " )"
10+ }
11+
412android {
513 def APP_NAME = " AuthRest"
614 def APP_TITLE = " Firebase Auth REST API"
@@ -26,10 +34,15 @@ android {
2634 versionName rootProject. ext. versionName
2735
2836 def GOOGLE_CLIENT_SECRET = " google.client.secret"
29- if (! properties. containsKey(GOOGLE_CLIENT_SECRET )) {
30- project. logger. log(LogLevel . ERROR , String . format(" Can't find property: \" %s\" in the local.properties file" , GOOGLE_CLIENT_SECRET ))
37+ def googleClientSecret
38+ if (properties. containsKey(GOOGLE_CLIENT_SECRET )) {
39+ googleClientSecret = properties[GOOGLE_CLIENT_SECRET ]
40+ } else {
41+ def errorMsg = String . format(" Can't find property: '%s' in the local.properties file" , GOOGLE_CLIENT_SECRET )
42+ project. logger. log(LogLevel . ERROR , errorMsg)
43+ googleClientSecret = wrapString(errorMsg)
3144 }
32- buildConfigField(" String" , " GOOGLE_CLIENT_SECRET" , properties[ GOOGLE_CLIENT_SECRET ] )
45+ buildConfigField(" String" , " GOOGLE_CLIENT_SECRET" , googleClientSecret )
3346
3447 resValue " string" , " app_name" , APP_NAME
3548 resValue " string" , " app_title" , APP_TITLE
0 commit comments