|
1 | 1 | plugins { |
2 | 2 | kotlin("multiplatform") version "1.4.31" |
3 | 3 | id("org.jetbrains.dokka") version "1.4.0" |
4 | | - id("com.jfrog.artifactory") version "4.17.2" |
5 | 4 | `maven-publish` |
| 5 | + id("io.github.gradle-nexus.publish-plugin") version "1.1.0" |
| 6 | + signing |
6 | 7 | } |
7 | 8 |
|
8 | 9 | apply("versions.gradle.kts") |
9 | 10 |
|
10 | 11 | group = "io.github.microutils" |
11 | | -version = "2.0.8" + (if (System.getProperty("snapshot")?.toBoolean() == true) "-SNAPSHOT" else "") |
| 12 | +version = "2.0.8" |
12 | 13 |
|
13 | 14 | repositories { |
14 | | - jcenter() |
15 | 15 | mavenCentral() |
16 | 16 | } |
17 | 17 |
|
| 18 | +nexusPublishing { |
| 19 | + repositories { |
| 20 | + sonatype() |
| 21 | + } |
| 22 | +} |
| 23 | + |
| 24 | +apply(plugin = "io.github.gradle-nexus.publish-plugin") |
| 25 | +apply(plugin = "maven-publish") |
| 26 | +apply(plugin = "signing") |
| 27 | + |
18 | 28 | kotlin { |
19 | 29 | explicitApi() |
20 | 30 | jvm { |
@@ -124,77 +134,9 @@ publishing { |
124 | 134 | } |
125 | 135 | } |
126 | 136 |
|
127 | | -publishing { |
128 | | - val bintrayOrg = "microutils" |
129 | | - val bintrayRepo = "kotlin-logging" |
130 | | - val bintrayUser = System.getProperty("bintray.user") |
131 | | - val bintrayApiKey = System.getProperty("bintray.key") |
132 | | - |
133 | | - if (bintrayUser != null && bintrayApiKey != null) { |
134 | | - repositories { |
135 | | - maven { |
136 | | - name = "bintray" |
137 | | - url = uri( |
138 | | - "https://api.bintray.com/maven/$bintrayOrg/$bintrayRepo/${project.name}/;publish=1;override=1" |
139 | | - ) |
140 | | - credentials { |
141 | | - username = bintrayUser |
142 | | - password = bintrayApiKey |
143 | | - } |
144 | | - } |
145 | | - } |
146 | | - } |
147 | | -} |
148 | | - |
149 | | -//bintray { |
150 | | -// user = System.getProperty("bintray.user") |
151 | | -// key = System.getProperty("bintray.key") //https://bintray.com/profile/edit |
152 | | -// setPublications(*publishing.publications.names.toTypedArray()) |
153 | | -// publish = true //[Default: false] Whether version should be auto published after an upload |
154 | | -// pkg.apply { |
155 | | -// repo = "kotlin-logging" |
156 | | -// name = "kotlin-logging" |
157 | | -// userOrg = "microutils" |
158 | | -// setLicenses("Apache-2.0") |
159 | | -// vcsUrl = "https://github.com/MicroUtils/kotlin-logging" |
160 | | -// websiteUrl = "https://github.com/MicroUtils/kotlin-logging" |
161 | | -// issueTrackerUrl = "https://github.com/MicroUtils/kotlin-logging/issues" |
162 | | -// |
163 | | -// githubRepo = "MicroUtils/kotlin-logging" |
164 | | -// githubReleaseNotesFile = "ChangeLog.md" |
165 | | -// version.apply { |
166 | | -// name = "${project.version}" |
167 | | -// desc = "kotlin-logging - Lightweight logging framework for Kotlin" |
168 | | -// released = "${Date()}" |
169 | | -// gpg.sign = true //Determines whether to GPG sign the files. The default is false |
170 | | -// mavenCentralSync.apply { |
171 | | -// sync = true //[Default: true] Determines whether to sync the version to Maven Central. |
172 | | -// user = System.getProperty("maven.user") //OSS user token: mandatory |
173 | | -// password = System.getProperty("maven.password") //OSS user password: mandatory |
174 | | -// close = |
175 | | -// "1" //Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually. |
176 | | -// } |
177 | | -// } |
178 | | -// } |
179 | | -//} |
180 | | - |
181 | | -artifactory { |
182 | | - setContextUrl("http://oss.jfrog.org") |
183 | | - publish(delegateClosureOf<org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig> { |
184 | | - repository(delegateClosureOf<groovy.lang.GroovyObject> { |
185 | | - setProperty("repoKey", "oss-snapshot-local") |
186 | | - setProperty("username", System.getProperty("bintray.user")) |
187 | | - setProperty("password", System.getProperty("bintray.key")) |
188 | | - setProperty("maven", true) |
189 | | - }) |
190 | | - defaults(delegateClosureOf<groovy.lang.GroovyObject> { |
191 | | - invokeMethod("publications", publishing.publications.names.toTypedArray()) |
192 | | - setProperty("publishArtifacts", true) |
193 | | - setProperty("publishPom", true) |
194 | | - }) |
195 | | - }) |
196 | | - resolve(delegateClosureOf<org.jfrog.gradle.plugin.artifactory.dsl.ResolverConfig> { |
197 | | - setProperty("repoKey", "jcenter") |
198 | | - }) |
199 | | - clientConfig.info.buildNumber = System.getProperty("build.number") |
| 137 | +signing { |
| 138 | + val signingKey: String? by project |
| 139 | + val signingPassword: String? by project |
| 140 | + useInMemoryPgpKeys(signingKey, signingPassword) |
| 141 | + sign(publishing.publications) |
200 | 142 | } |
0 commit comments