/
build.gradle.kts
129 lines (108 loc) · 3.46 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.util.*
plugins {
`java-library`
`maven-publish`
signing
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
id("org.springframework.boot") version "3.2.4" apply (false)
id("io.spring.dependency-management") version "1.1.4"
id("com.palantir.git-version") version "3.0.0"
kotlin("jvm") version "1.9.23"
}
group = "io.github.raphiz"
description = "Start instantly with readable and reliable feature specs for spring projects"
version = run {
val gitVersion: groovy.lang.Closure<String> by extra
val version = gitVersion()
if (version.startsWith("v")) version.substring(1)
else version
}
repositories {
mavenCentral()
}
dependencyManagement {
imports {
mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
}
}
dependencies {
api("com.microsoft.playwright:playwright:1.43.0")
implementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.boot:spring-boot-starter-web")
}
val javaVersion = JavaLanguageVersion.of("17")
java {
toolchain {
languageVersion.set(javaVersion)
}
}
kotlin {
jvmToolchain {
languageVersion.set(javaVersion)
}
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = javaVersion.toString()
freeCompilerArgs = listOf("-Xjsr305=strict")
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username.set(project.findProperty("ossrhUsername") as String?)
password.set(project.findProperty("ossrhPassword") as String?)
}
}
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
register("mavenJava", MavenPublication::class) {
from(components["java"])
pom {
name.set("${project.group}:${project.name}")
description.set(project.description)
url.set("https://www.github.com/raphiz/spring-playwright-feature-specs")
scm {
connection.set("scm:git:git://github.com/raphiz/spring-playwright-feature-specs.git")
developerConnection.set("scm:git:ssh://github.com:raphiz/spring-playwright-feature-specs.git")
url.set("https://www.github.com/raphiz/spring-playwright-feature-specs")
}
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/mit-license")
}
}
developers {
developer {
id.set("raphiz")
name.set("Raphael Zimmermann")
email.set("oss@raphael.li")
}
}
}
}
}
}
signing {
if (project.hasProperty("signingKey")) {
val signingKey: String by project
val signingPassword: String by project
useInMemoryPgpKeys(signingKey.base64Decode(), signingPassword)
} else {
useGpgCmd()
}
sign(publishing.publications)
}
fun String.base64Decode() = String(Base64.getDecoder().decode(this)).trim()