Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion chat-server/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.kotlin
.gradle
.ollama
build
build
system.properties
19 changes: 19 additions & 0 deletions chat-server/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED
import org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED
import org.gradle.api.tasks.testing.logging.TestLogEvent.SKIPPED
import java.util.Properties

plugins {
val kotlinVersion = "2.1.20"
Expand Down Expand Up @@ -73,4 +74,22 @@ tasks.withType<Test> {
testLogging {
events(PASSED, SKIPPED, FAILED)
}
setSystemProperties { systemProperty(it.first, it.second) }
}

tasks.withType<JavaExec> {
setSystemProperties { systemProperty(it.first, it.second) }
}

private fun setSystemProperties(setSystemProperty: (Pair<String, Any>) -> Unit) {
val systemPropertiesFile = project.rootProject.file("system.properties")
if (systemPropertiesFile.exists()) {
systemPropertiesFile.inputStream().use { inputStream ->
Properties().apply {
load(inputStream)
}.forEach {
setSystemProperty(it.key.toString() to it.value)
}
}
}
}