11plugins {
2- id " com.vanniktech.maven.publish" version " 0.27.0"
32 id " com.android.library"
3+ id " com.vanniktech.maven.publish" version " 0.33.0"
44}
55
6- import com.vanniktech.maven.publish.SonatypeHost
7-
8- android. buildFeatures. buildConfig true
9-
10- mavenPublishing {
11- publishToMavenCentral(SonatypeHost . DEFAULT )
12- signAllPublications()
13- coordinates(" com.contentstack.sdk" , " android" , " 4.1.0" )
14-
15- pom {
16- name = " contentstack-android"
17- description = " The Content Delivery SDK facilitates the retrieval of content from your Contentstack account, enabling seamless delivery to your web or mobile properties.."
18- inceptionYear = " 2018"
19- packaging ' aar'
20- url = " https://github.com/contentstack/contentstack-android"
21- licenses {
22- license {
23- name = " The MIT License"
24- url = " https://github.com/contentstack/contentstack-android/blob/master/LICENSE"
25- distribution = " https://github.com/contentstack/contentstack-android/blob/master/LICENSE"
26- }
27- }
28- developers {
29- developer {
30- id = " ishaileshmishra"
31- name = " contentstack"
32- url = " https://github.com/contentstack/contentstack-android"
33- }
34- }
35- scm {
36- url = " scm:git@github.com:contentstack/contentstack-android"
37- connection = " scm:git:git://github.com/contentstack/contentstack-android.git"
38- developerConnection = " scm:git@github.com:contentstack/contentstack-android.git"
39- }
40- }
41- }
42-
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- }
6+ ext {
7+ PUBLISH_GROUP_ID = ' com.contentstack.sdk'
8+ PUBLISH_ARTIFACT_ID = ' android'
9+ PUBLISH_VERSION = ' 4.1.0'
5610}
5711
5812android {
59- // namespace "com.contentstack.sdk"
13+ namespace " com.contentstack.sdk"
14+ compileSdk 34 // Using latest stable Android SDK version
15+ buildFeatures {
16+ buildConfig true
17+ }
6018 packagingOptions {
6119 exclude(" META-INF/DEPENDENCIES" )
6220 exclude(" META-INF/LICENSE" )
@@ -97,7 +55,6 @@ android {
9755 keyPassword ' android'
9856 }
9957 }
100- compileSdk 30
10158 defaultConfig {
10259 // Required when setting minSdkVersion to 20 or lower
10360 multiDexEnabled true
@@ -204,4 +161,61 @@ tasks.register('createJar', Jar) {
204161 include ' com/contentstack/'
205162 // include 'META-INF/'
206163}
207- createJar. dependsOn(clearJar, unzip, build)
164+ createJar. dependsOn(clearJar, unzip, build)
165+
166+ mavenPublishing {
167+ // Configure the Maven Central publishing target
168+ publishToMavenCentral(" CENTRAL_PORTAL" )
169+
170+ // Sign all publications
171+ signAllPublications()
172+
173+ coordinates(PUBLISH_GROUP_ID , PUBLISH_ARTIFACT_ID , PUBLISH_VERSION )
174+
175+ pom {
176+ name = " contentstack-android"
177+ description = " The Content Delivery SDK facilitates the retrieval of content from your Contentstack account, enabling seamless delivery to your web or mobile properties.."
178+ inceptionYear = " 2018"
179+ packaging ' aar'
180+ url = " https://github.com/contentstack/contentstack-android"
181+ licenses {
182+ license {
183+ name = " The MIT License"
184+ url = " https://github.com/contentstack/contentstack-android/blob/master/LICENSE"
185+ distribution = " https://github.com/contentstack/contentstack-android/blob/master/LICENSE"
186+ }
187+ }
188+ developers {
189+ developer {
190+ id = " ishaileshmishra"
191+ name = " contentstack"
192+ url = " https://github.com/contentstack/contentstack-android"
193+ }
194+ }
195+ scm {
196+ url = " scm:git@github.com:contentstack/contentstack-android"
197+ connection = " scm:git:git://github.com/contentstack/contentstack-android.git"
198+ developerConnection = " scm:git@github.com:contentstack/contentstack-android.git"
199+ }
200+ }
201+ }
202+
203+ tasks. register(' jacocoTestReport' , JacocoReport ) {
204+ dependsOn(' testDebugUnitTest' , ' createDebugCoverageReport' )
205+ reports {
206+ html. required = true
207+ }
208+ }
209+
210+ // Configure jacocoTestReport after evaluation when classDirectories is available
211+ project. afterEvaluate {
212+ tasks. named(' jacocoTestReport' , JacocoReport ) {
213+ classDirectories. setFrom(files(classDirectories. files. collect {
214+ fileTree(dir : it, exclude : [
215+ ' **com/contentstack/okhttp**' ,
216+ ' **com/contentstack/okio**' ,
217+ ' **com/contentstack/txtmark**'
218+ ])
219+ }))
220+ }
221+ }
0 commit comments