forked from ClickHouse/flink-connector-clickhouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
88 lines (72 loc) · 2.23 KB
/
build.gradle.kts
File metadata and controls
88 lines (72 loc) · 2.23 KB
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
plugins {
`maven-publish`
java
signing
id("com.gradleup.nmcp") version "0.0.8"
id("com.gradleup.shadow") version "9.0.2"
}
val versionFile by extra("version.txt")
val sinkVersion by extra(getProjectVersion())
val flinkVersion by extra("1.18.0")
val clickhouseVersion by extra("0.9.5")
val junitVersion by extra("5.8.2")
fun isVersionFileExists(): Boolean = file(versionFile).exists()
fun getVersionFromFile(): String = file(versionFile).readText().trim()
fun getProjectVersion(): String {
if (!isVersionFileExists())
throw IllegalStateException("Cannot find %s".format(versionFile))
return getVersionFromFile()
}
allprojects {
group = "org.apache.flink"
version = sinkVersion
repositories {
mavenCentral()
}
}
subprojects {
apply(plugin = "java-library")
apply(plugin = "maven-publish")
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
dependencies {
// Use JUnit Jupiter for testing.
// testImplementation(libs.junit.jupiter)
testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
}
tasks.test {
useJUnitPlatform()
include("**/*Test.class", "**/*Tests.class", "**/*Spec.class")
testLogging {
events("passed", "failed", "skipped")
//showStandardStreams = true - , "standardOut", "standardError"
}
}
tasks.compileJava {
options.encoding = "UTF-8"
}
tasks.compileTestJava {
options.encoding = "UTF-8"
}
tasks.withType<ScalaCompile> {
scalaCompileOptions.apply {
encoding = "UTF-8"
isDeprecation = true
additionalParameters = listOf("-feature", "-unchecked")
}
}
tasks.register<JavaExec>("runScalaTests") {
group = "verification"
mainClass.set("org.scalatest.tools.Runner")
classpath = sourceSets["test"].runtimeClasspath
args = listOf(
"-R", "build/classes/scala/test",
"-oD", // show durations
"-s", "org.apache.flink.connector.clickhouse.test.scala.ClickHouseSinkTests"
)
}
}