@@ -37,7 +37,7 @@ val gitBranch: String? by lazy {
3737}
3838
3939if (" release" !in gradle.startParameter.taskNames) {
40- val hash = this . gitDescribe
40+ val hash = gitDescribe
4141
4242 if (hash == null ) {
4343 gitRevision = " dirty"
@@ -56,8 +56,7 @@ if ("release" !in gradle.startParameter.taskNames) {
5656
5757plugins {
5858 `java- library`
59- `maven- publish`
60- signing
59+ id(" com.vanniktech.maven.publish" ) version " 0.30.0"
6160}
6261
6362allprojects {
@@ -90,75 +89,48 @@ subprojects {
9089 )
9190
9291 if (project.name in mavenProjects) {
93- apply (plugin = " maven-publish" )
94- apply (plugin = " signing" )
92+ apply (plugin = " com.vanniktech.maven.publish" )
9593
96- java {
97- withJavadocJar()
98- withSourcesJar()
99- }
94+ mavenPublishing {
95+ publishToMavenCentral()
96+ signAllPublications()
10097
101- publishing {
102- repositories {
103- maven {
104- url = if (suffix.contains( " SNAPSHOT " )) {
105- uri( " https://s01.oss.sonatype.org/content/repositories/snapshots/ " )
106- } else {
107- uri( " https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/ " )
108- }
109- credentials {
110- username = (project.properties[ " ossrhUsername " ] ? : " " ).toString( )
111- password = (project.properties[ " ossrhPassword " ] ? : " " ).toString( )
98+ coordinates( " org.apktool " , project.name, apktoolVersion)
99+
100+ pom {
101+ name.set( " Apktool " )
102+ description.set( " A tool for reverse engineering Android apk files. " )
103+ url.set( " https://apktool.org " )
104+
105+ licenses {
106+ license {
107+ name.set( " The Apache License 2.0 " )
108+ url.set( " https://opensource.org/licenses/Apache-2.0 " )
112109 }
113110 }
114- }
115- publications {
116- register(" mavenJava" , MavenPublication ::class ) {
117- from(components[" java" ])
118- groupId = " org.apktool"
119- artifactId = project.name
120- version = apktoolVersion
121-
122- pom {
123- name = " Apktool"
124- description = " A tool for reverse engineering Android apk files."
125- url = " https://apktool.org"
126-
127- licenses {
128- license {
129- name = " The Apache License 2.0"
130- url = " https://opensource.org/licenses/Apache-2.0"
131- }
132- }
133- developers {
134- developer {
135- id = " iBotPeaches"
136- name = " Connor Tumbleson"
137- 138- }
139- developer {
140- id = " brutall"
141- name = " Ryszard Wiśniewski"
142- 143- }
144- }
145- scm {
146- connection = " scm:git:git://github.com/iBotPeaches/Apktool.git"
147- developerConnection
= " scm:git:[email protected] :iBotPeaches/Apktool.git" 148- url = " https://github.com/iBotPeaches/Apktool"
149- }
111+ developers {
112+ developer {
113+ id.set(" iBotPeaches" )
114+ name.set(" Connor Tumbleson" )
115+ 150116 }
117+ developer {
118+ id.set(" brutall" )
119+ name.set(" Ryszard Wiśniewski" )
120+ 121+ }
122+ }
123+ scm {
124+ connection.set(" scm:git:git://github.com/iBotPeaches/Apktool.git" )
125+ developerConnection.set(
" scm:git:[email protected] :iBotPeaches/Apktool.git" )
126+ url.set(" https://github.com/iBotPeaches/Apktool" )
151127 }
152128 }
153129 }
154130
155131 tasks.withType<Javadoc >() {
156132 (options as StandardJavadocDocletOptions ).addStringOption(" Xdoclint:none" , " -quiet" )
157133 }
158-
159- signing {
160- sign(publishing.publications[" mavenJava" ])
161- }
162134 }
163135}
164136
0 commit comments