11plugins {
2- id " com.vanniktech.maven.publish" version " 0.28.0"
32 id " com.android.library"
3+ id " com.vanniktech.maven.publish" version " 0.33.0"
44}
5- import com.vanniktech.maven.publish.SonatypeHost
6- android. buildFeatures. buildConfig true
75
8- mavenPublishing {
9- // Use S01 host for Maven Central publishing
10- publishToMavenCentral(SonatypeHost . S01 )
11- signAllPublications()
12- coordinates(" com.contentstack.sdk" , " android" , " 4.1.0-beta" )
13-
14- pom {
15- name = " contentstack-android"
16- description = " The Content Delivery SDK facilitates the retrieval of content from your Contentstack account, enabling seamless delivery to your web or mobile properties.."
17- inceptionYear = " 2018"
18- packaging ' aar'
19- url = " https://github.com/contentstack/contentstack-android"
20- licenses {
21- license {
22- name = " The MIT License"
23- url = " https://github.com/contentstack/contentstack-android/blob/master/LICENSE"
24- distribution = " https://github.com/contentstack/contentstack-android/blob/master/LICENSE"
25- }
26- }
27- developers {
28- developer {
29- id = " ishaileshmishra"
30- name = " contentstack"
31- url = " https://github.com/contentstack/contentstack-android"
32- }
33- }
34- scm {
35- url
= " scm:[email protected] :contentstack/contentstack-android" 36- connection = " scm:git:git://github.com/contentstack/contentstack-android.git"
37- developerConnection
= " scm:[email protected] :contentstack/contentstack-android.git" 38- }
39- }
40- }
41-
42-
43- tasks. register(' jacocoTestReport' , JacocoReport ) {
44- dependsOn[' testDebugUnitTest' , ' createDebugCoverageReport' ]
45- reports {
46- html. enabled = true
47- }
48- afterEvaluate {
49- classDirectories. setFrom(files(classDirectories. files. collect {
50- fileTree(dir : it, exclude : ' **com/contentstack/okhttp**' )
51- fileTree(dir : it, exclude : ' **com/contentstack/okio**' )
52- fileTree(dir : it, exclude : ' **com/contentstack/txtmark**' )
53- }))
54- }
6+ ext {
7+ PUBLISH_GROUP_ID = ' com.contentstack.sdk'
8+ PUBLISH_ARTIFACT_ID = ' android'
9+ PUBLISH_VERSION = ' 4.1.0-beta'
5510}
5611
5712android {
5813 namespace " com.contentstack.sdk"
5914 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" )
@@ -203,4 +161,61 @@ tasks.register('createJar', Jar) {
203161 include ' com/contentstack/'
204162 // include 'META-INF/'
205163}
206- 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:[email protected] :contentstack/contentstack-android" 197+ connection = " scm:git:git://github.com/contentstack/contentstack-android.git"
198+ developerConnection
= " scm:[email protected] :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