forked from Bastian/bstats-metrics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
83 lines (75 loc) · 2.92 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import org.gradle.api.publish.PublishingExtension
apply(from = "generate-metrics.gradle.kts")
apply(from = "increment-version.gradle.kts")
plugins {
`java-library`
`maven-publish`
signing
}
allprojects {
group = "org.bstats"
}
configure<PublishingExtension> {
subprojects {
val isReleaseVersion = !version.toString().endsWith("SNAPSHOT")
apply(plugin = "java-library")
apply(plugin = "maven-publish")
apply(plugin = "signing")
publishing {
publications {
create<MavenPublication>("mavenJava") {
groupId = "org.bstats"
afterEvaluate {
artifactId = "bstats-${project.name}"
}
from(components["java"])
pom {
name.set("bStats-Metrics")
description.set("The bStats Metrics class")
url.set("https://bStats.org")
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/mit-license.php")
}
}
scm {
connection.set("scm:git:https://github.com/Bastian/bStats-Metrics.git")
developerConnection.set("scm:git:[email protected]:Bastian/bStats-Metrics.git")
url.set("https://github.com/Bastian/bStats-Metrics")
}
developers {
developer {
id.set("Bastian")
name.set("Bastian Oppermann")
email.set("[email protected]")
url.set("https://github.com/Bastian")
timezone.set("Europe/Berlin")
}
}
}
}
}
repositories {
maven {
name = "OSSRH"
url = if (isReleaseVersion) {
uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
} else {
uri("https://oss.sonatype.org/content/repositories/snapshots/")
}
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
signing {
val signingKey = System.getenv("SIGNING_KEY")
val signingPassword = System.getenv("SIGNING_PASSWORD")
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["mavenJava"])
}
}
}