-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
110 lines (98 loc) · 3.23 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
import java.util.Base64
import org.gradle.api.JavaVersion.VERSION_1_8
version = "0.1.2"
group = "com.bisnode.opa"
plugins {
checkstyle
codenarc
groovy
java
`java-library`
`maven-publish`
maven
signing
}
dependencies {
implementation("com.fasterxml.jackson.core:jackson-databind:2.11.0")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.11.0")
implementation("org.jetbrains:annotations:19.0.0")
testImplementation("org.codehaus.groovy:groovy-all:2.5.7")
testImplementation("org.spockframework:spock-core:1.3-groovy-2.5")
}
repositories {
mavenCentral()
}
java {
sourceCompatibility = VERSION_1_8
targetCompatibility = VERSION_1_8
withJavadocJar()
withSourcesJar()
}
tasks.test {
useJUnitPlatform()
}
configure<CodeNarcExtension> {
reportFormat = "console"
}
tasks.javadoc {
source = sourceSets["main"].allJava
}
tasks.wrapper {
version = "6.4.1"
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = "opa-test-result-formatter"
from(components["java"])
pom {
name.set("OPA test result formatter")
description.set("Open Policy Agent test result converter to JUnit XML")
url.set("https://github.com/Bisnode/opa-test-result-formatter")
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-test-result-formatter.git")
developerConnection.set("scm:git:ssh://github.com:Bisnode/opa-test-result-formatter.git")
url.set("https://github.com/Bisnode/opa-test-result-formatter.git")
}
developers {
developer {
name.set("Team Night's Watch")
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"])
}