@@ -10,7 +10,7 @@ android.buildFeatures.buildConfig true
1010mavenPublishing {
1111 publishToMavenCentral(SonatypeHost . DEFAULT )
1212 signAllPublications()
13- coordinates(" com.contentstack.sdk" , " android" , " 3.16.1 " )
13+ coordinates(" com.contentstack.sdk" , " android" , " 4.0.0 " )
1414
1515 pom {
1616 name = " contentstack-android"
@@ -112,18 +112,27 @@ android {
112112
113113 def localProperties = new Properties ()
114114 localProperties. load(new FileInputStream (rootProject. file(" local.properties" )))
115+ def getPropertyOrEmpty = { key ->
116+ def value = localProperties. getProperty(key)
117+ return value != null ? " $value " : " \"\" "
118+ }
119+ def variantsArray = localProperties. getProperty(' variantsUID' )?. split(" ," )?. collect { it. trim() }
120+ def variantsAsArrayString = variantsArray ? ' new String[] {' + variantsArray. collect { " \" $it \" " }. join(" , " ) + ' }' : " new String[0]"
115121 buildTypes {
116122 debug {
117123 debuggable true
118124 testCoverageEnabled true
119125 proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
120126
121- buildConfigField " String" , " host" , localProperties[' host' ]
122- buildConfigField " String" , " APIKey" , localProperties[' APIKey' ]
123- buildConfigField " String" , " deliveryToken" , localProperties[' deliveryToken' ]
124- buildConfigField " String" , " environment" , localProperties[' environment' ]
125- buildConfigField " String" , " contentTypeUID" , localProperties[' contentType' ]
126- buildConfigField " String" , " assetUID" , localProperties[' assetUid' ]
127+ buildConfigField " String" , " host" , getPropertyOrEmpty(' host' )
128+ buildConfigField " String" , " APIKey" , getPropertyOrEmpty(' APIKey' )
129+ buildConfigField " String" , " deliveryToken" , getPropertyOrEmpty(' deliveryToken' )
130+ buildConfigField " String" , " environment" , getPropertyOrEmpty(' environment' )
131+ buildConfigField " String" , " contentTypeUID" , getPropertyOrEmpty(' contentType' )
132+ buildConfigField " String" , " assetUID" , getPropertyOrEmpty(' assetUid' )
133+ buildConfigField " String" , " variantUID" , getPropertyOrEmpty(' variantUID' )
134+ buildConfigField " String" , " variantEntryUID" , getPropertyOrEmpty(' variantEntryUID' )
135+ buildConfigField " String[]" , " variantsUID" , variantsAsArrayString
127136 }
128137 release {
129138 minifyEnabled false
0 commit comments