File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -25,13 +25,30 @@ sourceSets {
25
25
}
26
26
}
27
27
28
+ fun loadEnv (): Map <String , String > {
29
+ val envFile = rootProject.file(" .env" )
30
+ val envMap = mutableMapOf<String , String >()
31
+
32
+ if (envFile.exists()) {
33
+ envFile.forEachLine { line ->
34
+ val trimmedLine = line.trim()
35
+ if (trimmedLine.isNotEmpty() && ! trimmedLine.startsWith(" #" ) && trimmedLine.contains(" =" )) {
36
+ val (key, value) = trimmedLine.split(" =" , limit = 2 )
37
+ envMap[key.trim()] = value.trim()
38
+ }
39
+ }
40
+ }
41
+ return envMap
42
+ }
43
+
28
44
tasks.register<JavaExec >(" runFunctionalTests" ) {
29
45
group = " execute"
30
46
description = " Run the Functional Tests"
31
47
mainClass = " com.fingerprint.example.FunctionalTests"
32
48
classpath = sourceSets[" main" ].runtimeClasspath
49
+ environment(loadEnv())
33
50
}
34
51
35
52
tasks.named(" runFunctionalTests" ) {
36
53
dependsOn(" build" )
37
- }
54
+ }
You can’t perform that action at this time.
0 commit comments