[JS] [tests] Look for properties in local.properties

This commit is contained in:
Sergej Jaskiewicz
2022-10-10 12:18:28 +02:00
committed by Space Team
parent 1417c8961b
commit d16bbb1145
+13 -4
View File
@@ -6,6 +6,7 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinUsages
import org.jetbrains.kotlin.gradle.targets.js.d8.D8RootPlugin
import org.jetbrains.kotlin.ideaExt.idea
import org.apache.tools.ant.filters.FixCrLfFilter
import java.util.Properties
plugins {
kotlin("jvm")
@@ -327,10 +328,18 @@ fun Test.setUpBoxTests() {
systemProperty("overwrite.output", project.providers.gradleProperty("overwrite.output")
.forUseAtConfigurationTime().orNull ?: "false")
val prefixForPpropertiesToForward = "fd."
for ((key, value) in properties) {
if (key.startsWith(prefixForPpropertiesToForward)) {
systemProperty(key.substring(prefixForPpropertiesToForward.length), value!!)
val localProperties = Properties().apply {
project.file("local.properties").takeIf { it.isFile }?.inputStream()?.use {
load(it)
}
}
val allProperties = localProperties + properties
val prefixForPropertiesToForward = "fd."
for ((key, value) in allProperties) {
if (key is String && key.startsWith(prefixForPropertiesToForward)) {
systemProperty(key.substring(prefixForPropertiesToForward.length), value!!)
}
}
}