[JS] [tests] Look for properties in local.properties
This commit is contained in:
committed by
Space Team
parent
1417c8961b
commit
d16bbb1145
@@ -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.gradle.targets.js.d8.D8RootPlugin
|
||||||
import org.jetbrains.kotlin.ideaExt.idea
|
import org.jetbrains.kotlin.ideaExt.idea
|
||||||
import org.apache.tools.ant.filters.FixCrLfFilter
|
import org.apache.tools.ant.filters.FixCrLfFilter
|
||||||
|
import java.util.Properties
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm")
|
kotlin("jvm")
|
||||||
@@ -327,10 +328,18 @@ fun Test.setUpBoxTests() {
|
|||||||
systemProperty("overwrite.output", project.providers.gradleProperty("overwrite.output")
|
systemProperty("overwrite.output", project.providers.gradleProperty("overwrite.output")
|
||||||
.forUseAtConfigurationTime().orNull ?: "false")
|
.forUseAtConfigurationTime().orNull ?: "false")
|
||||||
|
|
||||||
val prefixForPpropertiesToForward = "fd."
|
val localProperties = Properties().apply {
|
||||||
for ((key, value) in properties) {
|
project.file("local.properties").takeIf { it.isFile }?.inputStream()?.use {
|
||||||
if (key.startsWith(prefixForPpropertiesToForward)) {
|
load(it)
|
||||||
systemProperty(key.substring(prefixForPpropertiesToForward.length), value!!)
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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!!)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user