forked from flyeralarm/kafka-merge-purge
/
build.gradle.kts
92 lines (74 loc) · 2.3 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.gradle.ext.ProjectSettings
import org.jetbrains.gradle.ext.TaskTriggersConfig
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
repositories {
mavenCentral()
}
}
group = "com.flyeralarm"
version = project.properties["projVersion"] ?: "0.0.0"
plugins {
application
kotlin("jvm") version "1.6.10"
id("com.github.johnrengelman.shadow") version "5.2.0"
id("org.jlleitschuh.gradle.ktlint") version "10.2.1"
id("org.jetbrains.gradle.plugin.idea-ext") version "0.5"
jacoco
}
repositories {
jcenter()
maven { url = uri("https://packages.confluent.io/maven/") }
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1")
implementation("info.picocli:picocli:4.6.3")
implementation("org.apache.logging.log4j:log4j-core:2.18.0")
implementation("org.apache.logging.log4j:log4j-slf4j-impl:2.17.2")
implementation("org.apache.avro:avro:1.11.0")
implementation("io.confluent:kafka-avro-serializer:6.0.1")
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
testImplementation("io.mockk:mockk:1.12.7")
}
application {
mainClassName = "com.flyeralarm.kafkamp.KafkaMergePurge"
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks {
val versionTxt = register("versionTxt") {
doLast {
val outputDir = File("${sourceSets.main.get().output.resourcesDir}/version.txt")
if (outputDir.exists()) outputDir.writeText("${project.version}")
}
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}
withType<ShadowJar> {
dependsOn(versionTxt)
archiveFileName.set("kafka-merge-purge.jar")
manifest {
attributes("Multi-Release" to true)
}
}
jacocoTestReport {
dependsOn(test)
}
}
idea {
project {
this as ExtensionAware
configure<ProjectSettings> {
this as ExtensionAware
configure<TaskTriggersConfig> {
afterSync(tasks.findByName("ktlintApplyToIdea"))
}
}
}
}