-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
115 lines (97 loc) · 3.2 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
plugins {
kotlin("jvm") version "1.5.21"
id("org.jlleitschuh.gradle.ktlint") version "10.1.0"
id("org.jetbrains.dokka") version "1.5.0"
`java-library`
`maven-publish`
signing
}
group = "com.symbaloo"
version = "1.0.2-SNAPSHOT"
description = "graphql-java instrumentation for micrometer metrics"
val isReleaseVersion = !version.toString().endsWith("SNAPSHOT")
val repoName = name
val repoDescription = description
val repoUrl = "https://github.com/symbaloo/graphql-micrometer"
repositories {
mavenCentral()
}
dependencies {
implementation("com.graphql-java:graphql-java:16.2")
implementation("io.micrometer:micrometer-core:1.5.11")
testImplementation("org.slf4j:slf4j-simple:1.7.+")
testImplementation("org.junit.jupiter:junit-jupiter:5.7.2")
testImplementation("com.willowtreeapps.assertk:assertk-jvm:0.24")
}
tasks {
test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
register<Jar>("sourcesJar") {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
javadoc {
dependsOn("dokkaJavadoc")
}
register<Jar>("javadocJar") {
dependsOn("javadoc")
archiveClassifier.set("javadoc")
from("$buildDir/javadoc")
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["kotlin"])
artifact(tasks["sourcesJar"])
artifact(tasks["javadocJar"])
pom {
name.set(project.name)
description.set(project.description)
url.set(repoUrl)
licenses {
license {
name.set("MIT")
url.set("http://www.opensource.org/licenses/mit-license.php")
distribution.set("repo")
}
}
developers {
developer {
id.set("arian")
name.set("Arian Stolwijk")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com/symbaloo/graphql-micrometer.git")
url.set(repoUrl)
}
}
}
repositories {
maven {
val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2")
val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots")
url = if (isReleaseVersion) releasesRepoUrl else snapshotsRepoUrl
// these can be set through gradle.properties
if (properties.containsKey("mavenRepoUser")) {
credentials {
username = properties["sonatypeRepoUser"] as String?
password = properties["sonatypeRepoPassword"] as String?
}
}
}
}
}
}
signing {
setRequired { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
if (isReleaseVersion) {
sign(publishing.publications)
}
}