1
1
@file:Suppress(" UnstableApiUsage" )
2
2
3
3
import com.google.protobuf.gradle.id
4
- import org.gradle.internal.impldep.org.bouncycastle.cms.RecipientId.password
4
+ import com.vanniktech.maven.publish.SonatypeHost
5
5
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
6
6
7
7
// define the gav coordinates of this project
@@ -17,7 +17,7 @@ plugins {
17
17
alias(libs.plugins.kotlin)
18
18
alias(libs.plugins.dokka)
19
19
alias(libs.plugins.kover)
20
- alias(libs.plugins.nexusPublish)
20
+ id( " com.vanniktech.maven.publish " ) version " 0.28.0 "
21
21
alias(libs.plugins.protobuf)
22
22
alias(libs.plugins.sonarqube)
23
23
alias(libs.plugins.ktlint)
@@ -51,12 +51,6 @@ dependencies {
51
51
dokkaHtmlPlugin(libs.dokka.html)
52
52
}
53
53
54
- // configure the java extension
55
- java {
56
- // also generate javadoc and sources
57
- withSourcesJar()
58
- }
59
-
60
54
// configure the kotlin extension
61
55
kotlin {
62
56
// set the toolchain version that is required to build this project
@@ -114,33 +108,40 @@ testing {
114
108
}
115
109
}
116
110
117
- // configure dokka task for html output
118
- val dokkaHtmlJar = tasks.register<Jar >(" dokkaHtmlJar" ) {
119
- description = " Generates the HTML documentation for this project."
120
- group = JavaBasePlugin .DOCUMENTATION_GROUP
121
- dependsOn(tasks.dokkaHtml)
122
- from(tasks.dokkaHtml.flatMap { it.outputDirectory })
123
- archiveClassifier.set(" html-docs" )
124
- }
125
-
126
- // configure dokka task for javadoc output
127
- val dokkaJavadocJar = tasks.register<Jar >(" dokkaJavadocJar" ) {
128
- description = " Generates the Javadoc documentation for this project."
129
- group = JavaBasePlugin .DOCUMENTATION_GROUP
130
- dependsOn(tasks.dokkaJavadoc)
131
- from(tasks.dokkaJavadoc.flatMap { it.outputDirectory })
132
- archiveClassifier.set(" javadoc" )
133
- }
134
-
135
- nexusPublishing {
136
- repositories {
137
- sonatype {
138
- nexusUrl.set(uri(" https://s01.oss.sonatype.org/service/local/" ))
139
- snapshotRepositoryUrl.set(uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" ))
140
- username = System .getenv(" OSSRH_USERNAME" )
141
- password = System .getenv(" OSSRH_PASSWORD" )
111
+ // configure publishing for the sonatype portal
112
+ mavenPublishing {
113
+ // add the central portal of Sonatype
114
+ publishToMavenCentral(SonatypeHost .CENTRAL_PORTAL , automaticRelease = true )
115
+
116
+ // configure mandatory metadata for Maven Central
117
+ pom {
118
+ name.set(" xenos-client (Kotlin)" )
119
+ description.set(" A gRPC client/binding for the communication with xenos." )
120
+ inceptionYear.set(" 2024" )
121
+ url.set(" https://github.com/scrayosnet/xenos-client-kotlin/" )
122
+ licenses {
123
+ license {
124
+ name.set(" MIT License" )
125
+ url.set(" https://opensource.org/license/mit" )
126
+ distribution.set(" repo" )
127
+ }
128
+ }
129
+ developers {
130
+ developer {
131
+ id.set(" scrayos" )
132
+ name.set(" Joshua Dean Küpper" )
133
+ url.set(" https://github.com/scrayos/" )
134
+ }
135
+ }
136
+ scm {
137
+ url.set(" https://github.com/scrayosnet/xenos-client-kotlin/" )
138
+ connection.set(" scm:git:git://github.com/scrayosnet/xenos-client-kotlin.git" )
139
+ developerConnection.set(
" scm:git:ssh://[email protected] /scrayosnet/xenos-client-kotlin.git" )
142
140
}
143
141
}
142
+
143
+ // sign all exported publications
144
+ signAllPublications()
144
145
}
145
146
146
147
// configure the publishing in the maven repository
@@ -156,15 +157,6 @@ publishing {
156
157
}
157
158
}
158
159
}
159
-
160
- // define the java components as publications for the repository
161
- publications {
162
- create<MavenPublication >(" maven" ) {
163
- from(components[" java" ])
164
- artifact(dokkaJavadocJar)
165
- artifact(dokkaHtmlJar)
166
- }
167
- }
168
160
}
169
161
170
162
// configure ktlint
0 commit comments