@@ -4,6 +4,7 @@ plugins {
44}
55
66import com.vanniktech.maven.publish.SonatypeHost
7+
78android. buildFeatures. buildConfig true
89
910mavenPublishing {
@@ -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,37 +69,36 @@ android {
5269 exclude(" META-INF/*.kotlin_module" )
5370 }
5471
55-
5672 testOptions {
5773 unitTests. all {
58- jacoco {
59- includeNoLocationClasses = true
60- excludes = [' jdk.internal.*' ]
61- }
74+ // jacoco {
75+ // includeNoLocationClasses = true
76+ // }
6277 }
6378 }
6479 signingConfigs {
6580 debug {
66- storeFile file(" /Users/shaileshmishra/keystore /key.keystore" )
81+ storeFile file(" .. /key.keystore" )
6782 storePassword ' android'
6883 keyAlias ' key0'
6984 keyPassword ' android'
7085 }
7186 release {
72- storeFile file(" /Users/shaileshmishra/keystore /key.keystore" )
87+ storeFile file(" .. /key.keystore" )
7388 storePassword ' android'
7489 keyAlias ' key0'
7590 keyPassword ' android'
7691 }
7792 }
7893 compileSdk 30
7994 defaultConfig {
95+ // Required when setting minSdkVersion to 20 or lower
8096 multiDexEnabled true
8197 minSdkVersion 23
8298 versionCode 1
8399 versionName " 1.0"
84100 useLibrary ' org.apache.http.legacy'
85- testInstrumentationRunner " android.support. test.runner.AndroidJUnitRunner"
101+ testInstrumentationRunner ' androidx. test.runner.AndroidJUnitRunner'
86102 signingConfig signingConfigs. release
87103 }
88104
@@ -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,16 +132,18 @@ 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'
127- androidTestImplementation(' com.android.support. test.espresso:espresso-core:3.0.2 ' , {
146+ androidTestImplementation(' androidx. test.espresso:espresso-core:3.1.0 ' , {
128147 exclude group : ' com.android.support' , module : ' support-annotations'
129148 })
130149}
@@ -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