|
| 1 | +import me.qoomon.gitversioning.commons.GitRefType |
1 | 2 | import org.apache.tools.ant.filters.EscapeUnicode |
2 | 3 | import java.util.* |
3 | 4 |
|
4 | 5 | plugins { |
5 | 6 | `java-library` |
6 | 7 | `maven-publish` |
7 | 8 | jacoco |
| 9 | + signing |
8 | 10 | id("org.cadixdev.licenser") version "0.6.1" |
9 | 11 | id("org.sonarqube") version "3.3" |
10 | 12 | id("io.freefair.lombok") version "6.1.0" |
@@ -43,6 +45,8 @@ gitVersioning.apply { |
43 | 45 | } |
44 | 46 | } |
45 | 47 |
|
| 48 | +val isSnapshot = gitVersioning.gitVersionDetails.refType != GitRefType.TAG |
| 49 | + |
46 | 50 | val languageToolVersion = "5.4" |
47 | 51 | aspectj.version.set("1.9.7") |
48 | 52 |
|
@@ -228,12 +232,42 @@ artifacts { |
228 | 232 | archives(tasks["javadocJar"]) |
229 | 233 | } |
230 | 234 |
|
| 235 | +signing { |
| 236 | + val signingInMemoryKey: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryKey |
| 237 | + val signingInMemoryPassword: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryPassword |
| 238 | + if (signingInMemoryKey != null) { |
| 239 | + useInMemoryPgpKeys(signingInMemoryKey, signingInMemoryPassword) |
| 240 | + sign(publishing.publications) |
| 241 | + } |
| 242 | +} |
| 243 | + |
231 | 244 | publishing { |
| 245 | + repositories { |
| 246 | + maven { |
| 247 | + name = "sonatype" |
| 248 | + url = if (isSnapshot) |
| 249 | + uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") |
| 250 | + else |
| 251 | + uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") |
| 252 | + |
| 253 | + val sonatypeUsername: String? by project |
| 254 | + val sonatypePassword: String? by project |
| 255 | + |
| 256 | + credentials { |
| 257 | + username = sonatypeUsername // ORG_GRADLE_PROJECT_sonatypeUsername |
| 258 | + password = sonatypePassword // ORG_GRADLE_PROJECT_sonatypePassword |
| 259 | + } |
| 260 | + } |
| 261 | + } |
232 | 262 | publications { |
233 | 263 | create<MavenPublication>("maven") { |
234 | 264 | from(components["java"]) |
235 | 265 | artifact(tasks["bootJar"]) |
236 | 266 |
|
| 267 | + if (isSnapshot && project.hasProperty("simplifyVersion")) { |
| 268 | + version = findProperty("git.ref.slug") as String + "-SNAPSHOT" |
| 269 | + } |
| 270 | + |
237 | 271 | pom { |
238 | 272 | description.set("Language Server Protocol implementation for 1C (BSL) - 1C:Enterprise 8 and OneScript languages.") |
239 | 273 | url.set("https://1c-syntax.github.io/bsl-language-server") |
|
0 commit comments