File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 22.kotlin
33.gradle
44.ollama
5- build
5+ build
6+ system.properties
Original file line number Diff line number Diff line change 11import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED
22import org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED
33import org.gradle.api.tasks.testing.logging.TestLogEvent.SKIPPED
4+ import java.util.Properties
45
56plugins {
67 val kotlinVersion = " 2.1.20"
@@ -73,4 +74,22 @@ tasks.withType<Test> {
7374 testLogging {
7475 events(PASSED , SKIPPED , FAILED )
7576 }
77+ setSystemProperties { systemProperty(it.first, it.second) }
78+ }
79+
80+ tasks.withType<JavaExec > {
81+ setSystemProperties { systemProperty(it.first, it.second) }
82+ }
83+
84+ private fun setSystemProperties (setSystemProperty : (Pair <String , Any >) -> Unit ) {
85+ val systemPropertiesFile = project.rootProject.file(" system.properties" )
86+ if (systemPropertiesFile.exists()) {
87+ systemPropertiesFile.inputStream().use { inputStream ->
88+ Properties ().apply {
89+ load(inputStream)
90+ }.forEach {
91+ setSystemProperty(it.key.toString() to it.value)
92+ }
93+ }
94+ }
7695}
You can’t perform that action at this time.
0 commit comments