-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
71 lines (58 loc) · 1.7 KB
/
build.gradle
File metadata and controls
71 lines (58 loc) · 1.7 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
plugins {
id 'application'
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.kapt)
alias(libs.plugins.th2.component)
}
group = 'com.exactpro.th2'
version = release_version
repositories {
mavenCentral()
}
dependencies {
implementation(libs.th2.common) {
exclude group: 'com.exactpro.th2', module: 'task-utils'
}
implementation(libs.th2.common.utils)
implementation(libs.kotlin.logging)
implementation(libs.rawhttp.core)
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
compileOnly(libs.auto.service)
kapt(libs.auto.service)
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testImplementation(libs.junit.jupiter.integration)
testImplementation(libs.strikt.core)
testImplementation(libs.strikt.jackson)
}
application {
mainClass = 'com.exactpro.th2.http.client.Main'
}
test {
useJUnitPlatform {
excludeTags('integration-test')
}
}
tasks.register('integrationTest', Test) {
group = 'verification'
useJUnitPlatform {
includeTags('integration-test')
}
if (isPodmanInstalled()) {
environment("DOCKER_HOST", "unix:///run/user/${getUid()}/podman/podman.sock")
environment("TESTCONTAINERS_RYUK_DISABLED", "true")
}
}
static def isPodmanInstalled() {
try {
def process = new ProcessBuilder("podman", "--version").start()
process.waitFor()
return process.exitValue() == 0
} catch (IOException ignored) {
println("podman isn't installed")
return false
}
}
static def getUid() {
new ProcessBuilder("id", "-u").start().inputStream.text.trim()
}