Gradle: Import test output path for JavaScript modules

Original commit: 3319fdba6d
This commit is contained in:
Alexey Sedunov
2017-10-26 14:59:30 +03:00
parent 5ec73d6fbd
commit c8f8e6829e
2 changed files with 10 additions and 0 deletions
@@ -151,6 +151,8 @@ class KotlinFacetSettings {
}
var implementedModuleName: String? = null
var testOutputPath: String? = null
}
fun TargetPlatformKind<*>.createCompilerArguments(init: CommonCompilerArguments.() -> Unit = {}): CommonCompilerArguments {
@@ -108,6 +108,9 @@ private fun readV2AndLaterConfig(element: Element): KotlinFacetSettings {
compilerArguments = platformKind.createCompilerArguments()
XmlSerializer.deserializeInto(compilerArguments!!, it)
}
testOutputPath = element.getChild("testOutputPath")?.let {
PathUtil.toSystemDependentName((it.content.firstOrNull() as? Text)?.textTrim)
} ?: (compilerArguments as? K2JSCompilerArguments)?.outputFile
}
}
@@ -232,6 +235,11 @@ private fun KotlinFacetSettings.writeLatestConfig(element: Element) {
implementedModuleName?.let {
element.addContent(Element("implements").apply { addContent(it) })
}
testOutputPath?.let {
if (it != (compilerArguments as? K2JSCompilerArguments)?.outputFile) {
element.addContent(Element("testOutputPath").apply { addContent(PathUtil.toSystemIndependentName(it)) })
}
}
compilerSettings?.let { copyBean(it) }?.let {
it.convertPathsToSystemIndependent()
buildChildElement(element, "compilerSettings", it, filter)