-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuild.gradle.kts
102 lines (92 loc) · 3.18 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
import org.gradle.api.JavaVersion.VERSION_11
import java.util.*
version = "0.4.5"
group = "com.bisnode.opa"
plugins {
groovy
java
`java-library`
`maven-publish`
signing
}
java {
sourceCompatibility = VERSION_11
targetCompatibility = VERSION_11
withJavadocJar()
withSourcesJar()
}
dependencies {
implementation("com.fasterxml.jackson.core:jackson-databind:2.16.1")
implementation("org.slf4j:slf4j-api:2.0.13")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.2")
testImplementation("org.junit.vintage:junit-vintage-engine:5.10.2")
testImplementation("org.apache.groovy:groovy:4.0.21")
testImplementation("org.spockframework:spock-core:2.3-groovy-4.0")
testImplementation("com.github.tomakehurst:wiremock-jre8:3.0.1")
testImplementation("net.bytebuddy:byte-buddy:1.14.14")
}
repositories {
mavenCentral()
}
tasks.test {
useJUnitPlatform()
}
tasks.javadoc {
source = sourceSets["main"].allJava
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = "opa-java-client"
from(components["java"])
pom {
name.set("OPA Java Client")
description.set("Lightweight Java library for Open Policy Agent")
url.set("https://github.com/Bisnode/opa-java-client")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
scm {
connection.set("scm:git:git://github.com/Bisnode/opa-java-client.git")
developerConnection.set("scm:git:ssh://github.com:Bisnode/opa-java-client.git")
url.set("https://github.com/Bisnode/opa-java-client.git")
}
developers {
developer {
name.set("Igor Rodzik")
email.set("[email protected]")
organization.set("Bisnode")
organizationUrl.set("https://www.bisnode.com")
}
}
}
}
}
repositories {
maven {
val ossrhUsername: String? by project
val ossrhPassword: String? by project
name = "OSSRH"
credentials {
username = ossrhUsername
password = ossrhPassword
}
val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
}
}
}
signing {
val signingKey: String? by project
val signingPassword: String? by project
val decodedKey = signingKey
?.let { Base64.getDecoder().decode(signingKey) }
?.let { String(it) }
useInMemoryPgpKeys(decodedKey, signingPassword)
sign(publishing.publications["mavenJava"])
}