forked from f0xdx/kafka-connect-wrap-smt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
113 lines (94 loc) · 2.52 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
import java.time.LocalDate
group = "com.github.f0xdx"
version = "0.2.0"
val junitVersion by extra("5.6.2")
val kafkaVersion by extra("2.3.1")
val lombokVersion by extra("1.18.12")
plugins {
java
jacoco
id("com.diffplug.spotless") version "5.1.0"
id("org.sonarqube") version "3.0"
}
repositories {
mavenCentral()
}
dependencies {
// bom
implementation(platform("org.junit:junit-bom:${junitVersion}"))
// annotation processors
annotationProcessor("org.projectlombok:lombok:$lombokVersion")
// implementation
compileOnly("org.projectlombok:lombok:$lombokVersion")
compileOnly("org.apache.kafka:connect-api:${kafkaVersion}")
implementation("org.apache.kafka:connect-transforms:${kafkaVersion}")
// test
testAnnotationProcessor("org.projectlombok:lombok:$lombokVersion")
testCompileOnly("org.projectlombok:lombok:$lombokVersion")
testImplementation("org.apache.kafka:connect-api:${kafkaVersion}")
testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("org.junit.jupiter:junit-jupiter-params")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
}
tasks.test {
useJUnitPlatform()
}
tasks.jacocoTestReport {
reports {
xml.isEnabled = true
csv.isEnabled = false
}
}
tasks.sonarqube {
dependsOn(tasks.jacocoTestReport)
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
withJavadocJar()
}
spotless {
java {
googleJavaFormat()
licenseHeaderFile(file("$rootDir/spotless/apache-license-2.0.java.comment"))
trimTrailingWhitespace()
endWithNewline()
}
encoding("UTF-8")
}
sonarqube {
properties {
property("sonar.projectKey", "f0xdx_kafka-connect-wrap-smt")
property("sonar.organization", "f0xdx")
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.login", System.getenv("SONAR_TOKEN"))
}
}
tasks.register<Zip>("confluent_hub_archive") {
destinationDirectory.set(file("${buildDir}/dist"))
archiveFileName.set("f0xdx-${rootProject.name}-${rootProject.version}.zip")
from("manifest.json") {
expand(
"name" to rootProject.name,
"version" to rootProject.version,
"build_date" to LocalDate.now()
)
}
from("README.md") {
into("doc")
}
from("LICENSE") {
into("doc")
}
from(tasks.javadoc) {
into("doc/javadoc")
}
from(tasks.jar) {
into("lib")
}
into("f0xdx-${rootProject.name}-${rootProject.version}")
}