1
1
plugins {
2
- id(" org.jetbrains.kotlin.jvm" ) version " 1.7.20"
3
- }
4
-
5
- repositories {
6
- mavenCentral()
2
+ @Suppress(" DSL_SCOPE_VIOLATION" )
3
+ alias(libs.plugins.kotlin)
7
4
}
8
5
9
6
dependencies {
10
- implementation(" org.jetbrains.kotlin:kotlin-stdlib" )
11
- implementation(" org.jetbrains.kotlin:kotlin-stdlib-jdk8" )
12
- implementation(" org.jetbrains.kotlin:kotlin-reflect" )
13
- implementation(" org.seleniumhq.selenium:selenium-java:4.5.0" )
14
- implementation(" io.github.bonigarcia:webdrivermanager:5.3.0" )
15
- // TODEL when upgrading webdrivermanager Listed because they have vulnerabilities.
16
- implementation(" com.fasterxml.jackson.core:jackson-databind:2.13.4" )
17
- implementation(" commons-io:commons-io:2.11.0" )
18
- implementation(" org.bouncycastle:bcprov-jdk15on:1.70" )
7
+ implementation(libs.kotlin.stdlib8)
8
+ implementation(libs.kotlin.reflect)
19
9
20
- val log4jVersion = " 2.19.0"
21
- implementation(" org.apache.logging.log4j:log4j-iostreams:$log4jVersion " )
22
- implementation(" org.assertj:assertj-core:3.23.1" )
10
+ implementation(libs.selenium)
11
+ implementation(libs.webdrivermanager)
23
12
24
- val junitVersion = " 5.9.1"
25
- testImplementation(" org.junit.jupiter:junit-jupiter-api:$junitVersion " )
26
- testImplementation(" org.junit.jupiter:junit-jupiter-params:$junitVersion " )
27
-
28
- testRuntimeOnly(" org.junit.jupiter:junit-jupiter-engine:$junitVersion " )
29
- testRuntimeOnly(" org.junit.platform:junit-platform-console:1.9.1" )
30
- testRuntimeOnly(" org.slf4j:jul-to-slf4j:2.0.3" )
31
- testRuntimeOnly(" org.apache.logging.log4j:log4j-slf4j2-impl:$log4jVersion " )
32
- testRuntimeOnly(" org.apache.logging.log4j:log4j-core:$log4jVersion " )
33
- }
13
+ implementation(libs.log4j.iostreams)
14
+ implementation(libs.assertj)
34
15
35
- val javaVersion = JavaVersion .VERSION_1_8
16
+ testImplementation(libs.junit.api)
17
+ testImplementation(libs.junit.params)
18
+ testRuntimeOnly(libs.junit.engine)
36
19
37
- java {
38
- sourceCompatibility = javaVersion
39
- targetCompatibility = javaVersion
20
+ testRuntimeOnly(libs.log4j)
21
+ testRuntimeOnly(libs.log4j.slf4j)
22
+ testRuntimeOnly(libs.slf4j.jul)
40
23
}
41
24
42
- tasks.withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > {
25
+ tasks.withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > ().configureEach {
43
26
kotlinOptions {
44
27
verbose = true
45
- jvmTarget = javaVersion.toString ()
28
+ jvmTarget = libs.versions.java.get ()
46
29
allWarningsAsErrors = true
47
30
}
48
31
}
49
32
50
33
// Configure JUnit 5
51
- tasks.withType<Test > {
34
+ tasks.withType<Test >().configureEach {
52
35
useJUnitPlatform {
53
36
}
54
37
}
55
38
56
39
// Configure Console logging
57
- tasks.withType<Test > {
40
+ tasks.withType<Test >().configureEach {
58
41
testLogging {
59
42
events(" passed" , " skipped" , " failed" )
60
43
}
61
44
}
62
45
63
46
// Configure logging
64
- tasks.withType<Test > {
47
+ tasks.withType<Test >().configureEach {
65
48
jvmArgs(
66
- " -Djava.util.logging.config.file=${rootProject.file(" config/logging .properties" )} "
49
+ " -Djava.util.logging.config.file=${rootProject.file(" config/jul .properties" )} "
67
50
)
68
51
}
69
52
project.tasks {
@@ -78,13 +61,13 @@ project.tasks {
78
61
from(rootProject.file(" config/log4j2.xml" ))
79
62
into(java.sourceSets[" test" ].resources.srcDirs.first())
80
63
}
81
- " processTestResources" {
64
+ " processTestResources" {
82
65
dependsOn(copyLoggingTestResources)
83
66
}
84
67
}
85
68
86
69
// Configure global test parameters.
87
- tasks.withType<Test > {
70
+ tasks.withType<Test >().configureEach {
88
71
val propertyNamesToExposeToJUnitTests = listOf (
89
72
" net.twisterrob.test.selenium.headless"
90
73
)
0 commit comments