@@ -10,7 +10,7 @@ android.buildFeatures.buildConfig true
10
10
mavenPublishing {
11
11
publishToMavenCentral(SonatypeHost . DEFAULT )
12
12
signAllPublications()
13
- coordinates(" com.contentstack.sdk" , " android" , " 3.16.1 " )
13
+ coordinates(" com.contentstack.sdk" , " android" , " 4.0.0 " )
14
14
15
15
pom {
16
16
name = " contentstack-android"
@@ -112,18 +112,27 @@ android {
112
112
113
113
def localProperties = new Properties ()
114
114
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]"
115
121
buildTypes {
116
122
debug {
117
123
debuggable true
118
124
testCoverageEnabled true
119
125
proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
120
126
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
127
136
}
128
137
release {
129
138
minifyEnabled false
0 commit comments