-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
128 lines (108 loc) · 3.36 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
import java.util.*
plugins {
kotlin("jvm") version "2.1.0"
`java-library`
`maven-publish`
signing
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
id("org.jetbrains.kotlinx.kover") version "0.9.1"
}
group = "dev.aga"
version = "0.0.2"
repositories {
mavenCentral()
}
configurations {
configurations.testImplementation.get().apply {
extendsFrom(configurations.compileOnly.get())
}
}
// this is ugly, but until https://github.com/dependabot/dependabot-core/issues/1164
// is resolved, we need to either duplicate the version strings or use something
// like this
val junitVersion by extra("5.9.2")
val sfmVersion by extra("8.2.3")
val jooqVersion by extra("3.18.2")
val assertJVersion by extra("3.24.2")
dependencies {
implementation(kotlin("reflect"))
compileOnly("org.simpleflatmapper:sfm-jooq:$sfmVersion")
compileOnly("org.jooq:jooq-kotlin:$jooqVersion")
testImplementation(platform("org.junit:junit-bom:$junitVersion"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("org.assertj:assertj-core:$assertJVersion")
}
kotlin {
jvmToolchain(17)
}
kover {
reports {
total {
xml {
onCheck = true
}
}
}
}
tasks {
test {
useJUnitPlatform()
}
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
pom {
name.set("${project.group}:${project.name}")
description.set("Extension library for sfm-jooq to add better kotlin support")
url.set("https://github.com/austinarbor/sfm-jooq-kotlin")
licenses {
license {
name.set("The MIT License")
url.set("http://opensource.org/licenses/MIT")
}
}
developers {
developer {
id.set("austinarbor")
name.set("Austin G. Arbor")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:https://github.com/austinarbor/sfm-jooq-kotlin.git")
developerConnection.set("scm:git:https://github.com/austinarbor/sfm-jooq-kotlin.git")
url.set("https://github.com/austinarbor/sfm-jooq-kotlin/tree/main")
}
}
}
}
}
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(System.getenv("OSSH_USERNAME"))
password.set(System.getenv("OSSH_PASSWORD"))
}
}
}
signing {
isRequired = System.getenv("JITPACK") != "true"
val keyId = System.getenv("OSSH_GPG_KEY_ID")
val signingKey = System.getenv("OSSH_GPG_SIGNING_KEY")
val signingPassword = System.getenv("OSSH_GPG_PASSPHRASE")
useInMemoryPgpKeys(keyId, base64Decode(signingKey), signingPassword)
sign(publishing.publications)
}
fun base64Decode(str: String?): String? {
return str?.let {
String(Base64.getDecoder().decode(str)).trim()
}
}