@@ -4,12 +4,13 @@ plugins {
44}
55
66import com.vanniktech.maven.publish.SonatypeHost
7+
78android. buildFeatures. buildConfig true
89
910mavenPublishing {
1011 publishToMavenCentral(SonatypeHost . DEFAULT )
1112 signAllPublications()
12- coordinates(" com.contentstack.sdk" , " android" , " 3.14 .0" )
13+ coordinates(" com.contentstack.sdk" , " android" , " 3.13 .0" )
1314
1415 pom {
1516 name = " contentstack-android"
@@ -39,7 +40,23 @@ mavenPublishing {
3940 }
4041}
4142
43+
44+ tasks. register(' jacocoTestReport' , JacocoReport ) {
45+ dependsOn[' testDebugUnitTest' , ' createDebugCoverageReport' ]
46+ reports {
47+ html. enabled = true
48+ }
49+ afterEvaluate {
50+ classDirectories. setFrom(files(classDirectories. files. collect {
51+ fileTree(dir : it, exclude : ' **com/contentstack/okhttp**' )
52+ fileTree(dir : it, exclude : ' **com/contentstack/okio**' )
53+ fileTree(dir : it, exclude : ' **com/contentstack/txtmark**' )
54+ }))
55+ }
56+ }
57+
4258android {
59+ // namespace "com.contentstack.sdk"
4360 packagingOptions {
4461 exclude(" META-INF/DEPENDENCIES" )
4562 exclude(" META-INF/LICENSE" )
@@ -52,12 +69,10 @@ android {
5269 exclude(" META-INF/*.kotlin_module" )
5370 }
5471
55-
5672 testOptions {
5773 unitTests. all {
5874 jacoco {
5975 includeNoLocationClasses = true
60- excludes = [' jdk.internal.*' ]
6176 }
6277 }
6378 }
@@ -77,6 +92,7 @@ android {
7792 }
7893 compileSdk 30
7994 defaultConfig {
95+ // Required when setting minSdkVersion to 20 or lower
8096 multiDexEnabled true
8197 minSdkVersion 23
8298 versionCode 1
@@ -94,6 +110,7 @@ android {
94110 debuggable true
95111 testCoverageEnabled true
96112 proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
113+
97114 buildConfigField " String" , " host" , localProperties[' host' ]
98115 buildConfigField " String" , " APIKey" , localProperties[' APIKey' ]
99116 buildConfigField " String" , " deliveryToken" , localProperties[' deliveryToken' ]
@@ -115,12 +132,14 @@ android {
115132}
116133configurations { archives }
117134dependencies {
135+ def multidex = " 2.0.1"
118136 def volley = " 1.2.1"
119137 def junit = " 4.13.2"
120138 configurations. configureEach { resolutionStrategy. force ' com.android.support:support-annotations:23.1.0' }
121139 implementation fileTree(include : [' *.jar' ], dir : ' libs' )
122140 implementation " com.android.volley:volley:$volley "
123141 implementation " junit:junit:$junit "
142+ // For AGP 7.4+
124143 coreLibraryDesugaring ' com.android.tools:desugar_jdk_libs:2.0.4'
125144 testImplementation ' junit:junit:4.13.2'
126145 androidTestImplementation ' androidx.test:core:1.5.0'
@@ -139,5 +158,6 @@ tasks.register('createJar', Jar) {
139158 archivesBaseName = " contentstack.jar"
140159 from(' build/contentstack-jar/' )
141160 include ' com/contentstack/'
161+ // include 'META-INF/'
142162}
143163createJar. dependsOn(clearJar, unzip, build)
0 commit comments