-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
107 lines (95 loc) · 2.87 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.net.URI
plugins {
kotlin("jvm") version "1.4.32"
`maven-publish`
signing
}
group = "org.araqnid.hamkrest"
version = "1.1.2"
description = "JSON matchers for Hamkrest"
repositories {
mavenCentral()
}
dependencies {
api("com.natpryce:hamkrest:1.7.0.0")
api("com.fasterxml.jackson.core:jackson-databind")
api(platform("com.fasterxml.jackson:jackson-bom:2.10.5"))
implementation(kotlin("reflect"))
testImplementation(kotlin("test-junit"))
}
java(Action {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
withJavadocJar()
})
tasks {
withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.compilerArgs.add("-parameters")
options.isIncremental = true
options.isDeprecation = true
}
withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "1.8"
}
}
withType<Jar>().configureEach {
manifest {
attributes["Implementation-Title"] = project.description ?: project.name
attributes["Implementation-Version"] = project.version
}
}
}
publishing(Action {
publications {
register<MavenPublication>("mavenJava") {
from(components["java"])
pom {
name.set(project.name)
description.set(project.description)
licenses {
license {
name.set("Apache")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
url.set("https://github.com/araqnid/hamkrest-json")
issueManagement {
system.set("Github")
url.set("https://github.com/araqnid/hamkrest-json/issues")
}
scm {
connection.set("https://github.com/araqnid/hamkrest-json.git")
url.set("https://github.com/araqnid/hamkrest-json")
}
developers {
developer {
name.set("Steven Haslam")
email.set("araqnid@gmail.com")
}
}
}
}
}
repositories {
val sonatypeUser: String? by project
if (sonatypeUser != null) {
maven {
name = "OSSRH"
url = URI("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
val sonatypePassword: String by project
credentials {
username = sonatypeUser
password = sonatypePassword
}
}
}
}
})
signing(Action {
useGpgCmd()
sign(publishing.publications)
})