-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.gradle.kts
189 lines (160 loc) · 5.8 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
group = "cz.smarteon"
plugins {
`java-library`
signing
`maven-publish`
jacoco
id("net.researchgate.release") version "2.6.0"
id("ru.vyarus.quality") version "4.8.0"
kotlin("jvm") version "1.7.10"
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.java-websocket:Java-WebSocket:1.5.2")
val jacksonVersion = "2.13.3"
implementation("com.fasterxml.jackson.core:jackson-core:$jacksonVersion")
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
implementation("com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion")
implementation("com.sun.xml.bind:jaxb-impl:3.0.2")
val slf4jVersion = "1.7.32"
implementation("org.slf4j:slf4j-api:$slf4jVersion")
compileOnly("org.jetbrains:annotations:22.0.0")
val lombokVersion = "1.18.24"
compileOnly("org.projectlombok:lombok:$lombokVersion")
annotationProcessor("org.projectlombok:lombok:$lombokVersion")
testCompileOnly("org.projectlombok:lombok:$lombokVersion")
testAnnotationProcessor("org.projectlombok:lombok:$lombokVersion")
testImplementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
val junitVersion = "5.8.2"
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")
val striktVersion = "0.34.1"
testImplementation("io.strikt:strikt-core:$striktVersion")
testImplementation("io.strikt:strikt-jvm:$striktVersion")
testImplementation("io.mockk:mockk:1.12.2")
val jsonUnitVersion = "2.28.0"
testImplementation("net.javacrumbs.json-unit:json-unit:$jsonUnitVersion")
testImplementation("net.javacrumbs.json-unit:json-unit-core:$jsonUnitVersion")
testImplementation("nl.jqno.equalsverifier:equalsverifier:3.7.2")
testRuntimeOnly("org.slf4j:slf4j-simple:$slf4jVersion")
testImplementation("org.bouncycastle:bcprov-jdk15on:1.69")
val jadlerVersion = "1.3.1"
testImplementation("net.jadler:jadler-core:$jadlerVersion")
testImplementation("net.jadler:jadler-jdk:$jadlerVersion")
val ktorVersion = "2.0.3"
testImplementation("io.ktor:ktor-server-core:$ktorVersion")
testImplementation("io.ktor:ktor-server-netty:$ktorVersion")
testImplementation("io.ktor:ktor-server-websockets:$ktorVersion")
testImplementation("io.ktor:ktor-network:$ktorVersion")
testImplementation("io.ktor:ktor-server-content-negotiation:$ktorVersion")
testImplementation("io.ktor:ktor-serialization-jackson:$ktorVersion")
testImplementation("org.awaitility:awaitility-kotlin:4.1.1")
}
val ossUser: String? by project
val ossPass: String? by project
publishing {
publications {
create<MavenPublication>("library") {
from(components["java"])
pom {
name.set(project.name)
url.set("https://github.com/Smarteon/loxone-java")
description.set("Java implementation of the Loxone™ communication protocol (Web Socket)")
organization {
name.set("Smarteon Systems s.r.o")
url.set("https://smarteon.cz")
}
licenses {
license {
name.set("3-Clause BSD License")
url.set("https://opensource.org/licenses/BSD-3-Clause")
distribution.set("repo")
}
}
developers {
developer {
name.set("Jiří Mikulášek")
email.set("[email protected]")
}
developer {
name.set("Vojtěch Zavřel")
email.set("[email protected]")
}
developer {
name.set("Tomáš Knotek")
email.set("[email protected]")
}
}
contributors {
contributor {
name.set("Petr Žufan")
}
}
scm {
url.set("[email protected]:Smarteon/loxone-java.git")
connection.set("scm:git:[email protected]:Smarteon/loxone-java.git")
tag.set(project.version.toString())
}
}
}
}
repositories {
maven {
name = "oss"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
authentication {
credentials {
username = ossUser
password = ossPass
}
}
}
}
}
if (hasProperty("signing.keyId")) {
signing {
setRequired({
!project.version.toString().endsWith("-SNAPSHOT")
})
sign(publishing.publications["library"])
}
}
quality {
strict = false
}
tasks {
withType<JacocoReport> {
reports {
xml.required.set(true)
html.required.set(true)
}
}
withType<Test> {
useJUnitPlatform()
jvmArgs(
"--add-opens",
"java.base/jdk.internal.misc=ALL-UNNAMED",
"-Dio.netty.tryReflectionSetAccessible=true"
)
}
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "11"
}
}
check {
dependsOn(jacocoTestReport)
}
afterReleaseBuild {
dependsOn(getByName("publishLibraryPublicationToOssRepository"))
}
}