Skip to content

Commit 2690663

Browse files
committed
fix release workflow
1 parent 99273ec commit 2690663

File tree

5 files changed

+75
-57
lines changed

5 files changed

+75
-57
lines changed

build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ buildscript {
1212
}
1313

1414
dependencies {
15-
//classpath "com.android.tools.build:gradle:8.2.1" //8.2.1
16-
classpath 'com.android.tools.build:gradle:7.4.2'
15+
classpath "com.android.tools.build:gradle:8.2.1"
1716
classpath 'io.github.gradle-nexus:publish-plugin:2.0.0-rc-1'
1817
classpath "org.jacoco:org.jacoco.core:$jacoco_version"
1918
}

contentstack/build.gradle

Lines changed: 66 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,20 @@
11
plugins {
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

5712
android {
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+
}

gradle.properties

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m
55
android.suppressUnsupportedCompileSdk=34
66

77
# Maven Central Publishing Configuration
8-
SONATYPE_HOST=S01
9-
RELEASE_SIGNING_ENABLED=true
10-
118
# These values should be provided by environment variables in CI
9+
# For new Central Portal, use Portal Token instead of username/password
1210
mavenCentralUsername=
1311
mavenCentralPassword=
1412
signing.keyId=

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
#distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
44
#distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
66
networkTimeout=10000
77
validateDistributionUrl=true
88
zipStoreBase=GRADLE_USER_HOME

settings.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,9 @@ dependencyResolutionManagement {
1717
}
1818
rootProject.name = "contentstack-android"
1919
include ':contentstack'
20+
21+
gradle.beforeProject { project ->
22+
if (project.name == "contentstack") {
23+
project.ext.ANDROID_VARIANT_TO_PUBLISH = "release"
24+
}
25+
}

0 commit comments

Comments
 (0)