-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
103 lines (84 loc) · 2.6 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
plugins {
id("java")
`maven-publish`
signing
}
group = "br.com.guiabolso"
version = System.getenv("RELEASE_VERSION") ?: "local"
apply(plugin = "maven-publish")
apply(plugin = "signing")
repositories {
mavenCentral()
}
dependencies {
implementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:1.28.0")
testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("org.mockito:mockito-core:5.4.0")
}
tasks.withType<Test> {
useJUnitPlatform()
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.getByName("main").allSource)
}
val javadoc = tasks.named("javadoc")
val javadocsJar by tasks.creating(Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Assembles java doc to jar"
archiveClassifier.set("javadoc")
from(javadoc)
}
publishing {
repositories {
maven {
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_PASSWORD")
}
}
}
publications.register("mavenJava", MavenPublication::class) {
from(components["java"])
artifact(javadocsJar)
artifact(sourcesJar.get())
artifactId = project.name
pom {
name.set("Dynatel")
description.set("Dynatel - OpenTelemetry Javaagent Extension")
url.set("https://github.com/GuiaBolso/dynatel-javaagent-extension")
scm {
url.set("https://github.com/GuiaBolso/dynatel-javaagent-extension")
connection.set("scm:git:https://github.com/GuiaBolso/dynatel-javaagent-extension")
}
licenses {
license {
name.set("Apache-2.0")
url.set("https://opensource.org/licenses/Apache-2.0")
}
}
developers {
developer {
id.set("Picpay")
name.set("Picpay")
}
}
}
}
}
signing {
val signingKey: String? by project
val signingPassword: String? by project
useGpgCmd()
if (signingKey != null && signingPassword != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
}
sign((extensions.getByName("publishing") as PublishingExtension).publications)
}