11plugins {
22 id ' groovy'
33 id ' java-gradle-plugin'
4- id ' maven-publish'
5- id ' signing'
4+ id ' com.vanniktech.maven.publish' version ' 0.34.0'
65}
76
87group = ' io.middleware'
9- // Read version from ORG_GRADLE_PROJECT_VERSION_NAME env var injected by CI
108version = project. findProperty(' VERSION_NAME' ) ?: ' 1.0.0'
119
12- java {
13- withSourcesJar()
14- withJavadocJar()
15- }
16-
1710dependencies {
1811 compileOnly ' com.android.tools.build:gradle:8.3.0'
1912 implementation localGroovy()
@@ -28,66 +21,41 @@ gradlePlugin {
2821 }
2922}
3023
31- publishing {
32- publications {
33- maven(MavenPublication ) {
34- from components. java
35- artifactId = ' middleware-sourcemap-gradle-plugin'
24+ mavenPublishing {
25+ // Publishes to Maven Central via the new portal
26+ publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost . CENTRAL_PORTAL )
27+
28+ // Signs with in-memory key from CI env
29+ signAllPublications()
3630
37- pom {
38- name = ' Middleware Sourcemap Gradle Plugin'
39- description = ' Gradle plugin for uploading R8/ProGuard mapping files to Middleware'
40- url = ' https://github.com/middleware-labs/middleware-android'
31+ coordinates(' io.middleware' , ' middleware-sourcemap-gradle-plugin' , version. toString())
4132
42- licenses {
43- license {
44- name = ' The Apache License, Version 2.0'
45- url = ' http://www.apache.org/licenses/LICENSE-2.0.txt'
46- }
47- }
48- developers {
49- developer {
50- id = ' middleware-labs'
51- name = ' Middleware Team'
52- email = ' support@middleware.io'
53- }
54- }
55- scm {
56- connection = ' scm:git:git://github.com/middleware-labs/middleware-android.git'
57- developerConnection = ' scm:git:ssh://github.com/middleware-labs/middleware-android.git'
58- url = ' https://github.com/middleware-labs/middleware-android'
59- }
33+ pom {
34+ name = ' Middleware Sourcemap Gradle Plugin'
35+ description = ' Gradle plugin for uploading R8/ProGuard mapping files to Middleware'
36+ url = ' https://github.com/middleware-labs/middleware-android'
37+
38+ licenses {
39+ license {
40+ name = ' The Apache License, Version 2.0'
41+ url = ' http://www.apache.org/licenses/LICENSE-2.0.txt'
6042 }
6143 }
62- }
63-
64- repositories {
65- maven {
66- name = " OSSRH"
67- url = " https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
68- credentials {
69- // These now map correctly to ORG_GRADLE_PROJECT_mavenCentralUsername / Password
70- username = project. findProperty(' mavenCentralUsername' ) ?: ' '
71- password = project. findProperty(' mavenCentralPassword' ) ?: ' '
44+ developers {
45+ developer {
46+ id = ' middleware-labs'
47+ name = ' Middleware Team'
48+ email = ' support@middleware.io'
7249 }
7350 }
51+ scm {
52+ connection = ' scm:git:git://github.com/middleware-labs/middleware-android.git'
53+ developerConnection = ' scm:git:ssh://github.com/middleware-labs/middleware-android.git'
54+ url = ' https://github.com/middleware-labs/middleware-android'
55+ }
7456 }
7557}
7658
77- signing {
78- def signingKey = project. findProperty(' signingInMemoryKey' )
79- def signingKeyId = project. findProperty(' signingInMemoryKeyId' )
80- def signingPassword = project. findProperty(' signingInMemoryKeyPassword' )
81-
82- // Use in-memory ASCII-armored key (no gpg keyring needed on CI)
83- if (signingKey) {
84- useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
85- }
86-
87- required { signingKey != null && gradle. taskGraph. hasTask(" publish" ) }
88- sign publishing. publications. maven
89- }
90-
9159tasks. named(' processResources' ) {
9260 duplicatesStrategy = DuplicatesStrategy . INCLUDE
9361}
0 commit comments