-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.gradle.kts
158 lines (146 loc) · 5.26 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
val kotlinVersion = "2.1.10"
id("org.jetbrains.kotlin.jvm") version kotlinVersion
id("org.jetbrains.dokka") version "2.0.0"
id("org.jlleitschuh.gradle.ktlint") version "12.2.0"
kotlin("plugin.serialization") version kotlinVersion
`maven-publish`
jacoco
signing
}
group = "com.personio"
version = System.getenv("VERSION")
jacoco {
toolVersion = "0.8.12"
}
repositories {
mavenCentral()
}
val e2eTest =
tasks.register<Test>("e2eTest") {
description = "Runs end to end test"
group = "verification"
filter {
includeTestsMatching("*.e2e.*")
}
useJUnitPlatform()
}
dependencies {
val awsSdkVersion = "2.30.31"
val jacksonVersion = "2.18.3"
val junitVersion = "5.12.0"
implementation("org.jetbrains.kotlin:kotlin-stdlib:2.1.10")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$jacksonVersion")
implementation("org.apache.commons:commons-text:1.13.0")
api("software.amazon.awssdk:secretsmanager:$awsSdkVersion")
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.0")
api("javax.activation:activation:1.1.1")
api("com.datadoghq:datadog-api-client:2.32.0")
testRuntimeOnly("software.amazon.awssdk:sso:$awsSdkVersion")
testRuntimeOnly("software.amazon.awssdk:sts:$awsSdkVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")
testImplementation("org.mockito:mockito-inline:5.2.0")
testImplementation("org.mockito.kotlin:mockito-kotlin:5.4.0")
testImplementation("io.kotest:kotest-runner-junit5-jvm:5.9.1")
}
tasks {
test {
useJUnitPlatform()
filter {
excludeTestsMatching("*.e2e.*")
}
}
jacocoTestReport {
reports {
xml.required.convention(true)
html.required.convention(false)
xml.outputLocation.convention(layout.buildDirectory.file("test-results/test/xml/jacocoReport.xml"))
}
}
withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.fromTarget("17"))
}
}
}
val javadocJar by tasks.register("javadocJar", Jar::class) {
dependsOn(tasks.named("dokkaJavadoc"))
archiveClassifier.convention("javadoc")
from(layout.buildDirectory.dir("javadoc"))
}
val sourcesJar =
tasks.register("sourcesJar", Jar::class) {
archiveClassifier.convention("sources")
from(sourceSets.main.get().allSource)
}
java {
withJavadocJar()
withSourcesJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
publishing {
repositories {
maven {
name = "OSSRH"
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("maven", MavenPublication::class) {
from(components["java"])
pom {
groupId = "com.personio"
name.set("Datadog Synthetic test Support")
description.set("Kotlin library for managing Datadog Synthetic test as code")
url.set("https://github.com/personio/datadog-synthetic-test-support")
packaging = "jar"
licenses {
license {
name.set("MIT License")
url.set("https://github.com/personio/datadog-synthetic-test-support/blob/master/LICENSE")
}
}
organization {
name.set("Personio SE & Co. KG")
url.set("https://personio.com")
}
developers {
developer {
id.set("personio")
name.set("Test Solutions Squad")
}
}
scm {
url.set("https://github.com/personio/datadog-synthetic-test-support")
connection.set("scm:git:https://github.com/personio/datadog-synthetic-test-support.git")
developerConnection.set("scm:git:ssh://github.com:personio/datadog-synthetic-test-support.git")
}
issueManagement {
system.set("GitHub Issues")
url.set("https://github.com/personio/datadog-synthetic-test-support/issues")
}
ciManagement {
system.set("GitHub Actions")
url.set("https://github.com/personio/datadog-synthetic-test-support/actions")
}
}
}
}
}
signing {
val signingKey = System.getenv("GPG_PRIVATE_KEY")
val signingPassword = System.getenv("GPG_PASSPHRASE")
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["maven"])
}