11import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
2- import com.jfrog.bintray.gradle.BintrayExtension
3- import com.jfrog.bintray.gradle.tasks.BintrayUploadTask
2+
3+ val ossrhUsername: String? by ext
4+ val ossrhPassword: String? by ext
45
56description = " A logger facilitating lazily-evaluated log calls via Kotlin's inline classes & functions."
67
78plugins {
89 `maven- publish`
10+ signing
911 kotlin(" multiplatform" ) version " 1.3.61"
1012 id(" com.github.ben-manes.versions" ) version " 0.27.0"
11- id(" com.jfrog.bintray" ) version " 1.8.4"
1213 id(" net.researchgate.release" ) version " 2.8.1"
1314}
1415
@@ -22,7 +23,6 @@ tasks.withType<DependencyUpdatesTask> {
2223
2324repositories {
2425 mavenCentral()
25- jcenter()
2626}
2727
2828kotlin {
@@ -69,40 +69,74 @@ kotlin {
6969 }
7070}
7171
72- fun BintrayExtension.pkg (configure : BintrayExtension .PackageConfig .() -> Unit ) {
73- pkg(delegateClosureOf(configure))
72+ signing {
73+ useGpgCmd()
74+ sign(publishing.publications)
7475}
7576
76- val bintrayUser: String? by project
77- val bintrayKey: String? by project
78-
79- bintray {
80- user = bintrayUser
81- key = bintrayKey
82- setPublications(" jvm" , " metadata" )
83-
84- pkg {
85- repo = " maven"
86- name = project.name
87- desc = project.description
88- websiteUrl = " https://github.com/michaelbull/kotlin-inline-logger"
89- issueTrackerUrl = " https://github.com/michaelbull/kotlin-inline-logger/issues"
90- vcsUrl
= " [email protected] :michaelbull/kotlin-inline-logger.git" 91- githubRepo = " michaelbull/kotlin-inline-logger"
92- setLicenses(" ISC" )
77+ publishing {
78+ repositories {
79+ maven {
80+ if (project.version.toString().endsWith(" SNAPSHOT" )) {
81+ setUrl(" https://oss.sonatype.org/content/repositories/snapshots" )
82+ } else {
83+ setUrl(" https://oss.sonatype.org/service/local/staging/deploy/maven2" )
84+ }
85+
86+ credentials {
87+ username = ossrhUsername
88+ password = ossrhPassword
89+ }
90+ }
9391 }
94- }
9592
96- val bintrayUpload by tasks.existing(BintrayUploadTask ::class ) {
97- dependsOn(" build" )
98- dependsOn(" generatePomFileForJvmPublication" )
99- dependsOn(" generatePomFileForMetadataPublication" )
100- dependsOn(" jvmJar" )
101- dependsOn(" jvmSourcesJar" )
102- dependsOn(" metadataJar" )
103- dependsOn(" metadataSourcesJar" )
93+ publications.withType<MavenPublication > {
94+ pom {
95+ name.set(project.name)
96+ description.set(project.description)
97+ url.set(" https://github.com/michaelbull/kotlin-inline-logger" )
98+ inceptionYear.set(" 2019" )
99+
100+ licenses {
101+ license {
102+ name.set(" ISC License" )
103+ url.set(" https://opensource.org/licenses/isc-license.txt" )
104+ }
105+ }
106+
107+ developers {
108+ developer {
109+ name.set(" Michael Bull" )
110+ url.set(" https://www.michael-bull.com" )
111+ }
112+ }
113+
114+ scm {
115+ connection.set(" scm:git:https://github.com/michaelbull/kotlin-inline-logger" )
116+ developerConnection.set(
" scm:git:[email protected] :michaelbull/kotlin-inline-logger.git" )
117+ url.set(" https://github.com/michaelbull/kotlin-inline-logger" )
118+ }
119+
120+ issueManagement {
121+ system.set(" GitHub" )
122+ url.set(" https://github.com/michaelbull/kotlin-inline-logger/issues" )
123+ }
124+
125+ ciManagement {
126+ system.set(" GitHub" )
127+ url.set(" https://github.com/michaelbull/kotlin-inline-logger/actions?query=workflow%3Aci" )
128+ }
129+
130+ contributors {
131+ contributor {
132+ name.set(" Toby-S" )
133+ url.set(" https://github.com/Toby-S" )
134+ }
135+ }
136+ }
137+ }
104138}
105139
106- tasks.named( " afterReleaseBuild" ) {
107- dependsOn(bintrayUpload )
140+ tasks.afterReleaseBuild {
141+ dependsOn(tasks.publish )
108142}
0 commit comments