Gradle: Import production output path for JavaScript modules
Original commit: 1f7fab837f
This commit is contained in:
@@ -194,6 +194,7 @@ class KotlinFacetSettings {
|
|||||||
|
|
||||||
var implementedModuleName: String? = null
|
var implementedModuleName: String? = null
|
||||||
|
|
||||||
|
var productionOutputPath: String? = null
|
||||||
var testOutputPath: String? = null
|
var testOutputPath: String? = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,6 +110,9 @@ private fun readV2AndLaterConfig(element: Element): KotlinFacetSettings {
|
|||||||
XmlSerializer.deserializeInto(compilerArguments!!, it)
|
XmlSerializer.deserializeInto(compilerArguments!!, it)
|
||||||
compilerArguments!!.detectVersionAutoAdvance()
|
compilerArguments!!.detectVersionAutoAdvance()
|
||||||
}
|
}
|
||||||
|
productionOutputPath = element.getChild("productionOutputPath")?.let {
|
||||||
|
PathUtil.toSystemDependentName((it.content.firstOrNull() as? Text)?.textTrim)
|
||||||
|
} ?: (compilerArguments as? K2JSCompilerArguments)?.outputFile
|
||||||
testOutputPath = element.getChild("testOutputPath")?.let {
|
testOutputPath = element.getChild("testOutputPath")?.let {
|
||||||
PathUtil.toSystemDependentName((it.content.firstOrNull() as? Text)?.textTrim)
|
PathUtil.toSystemDependentName((it.content.firstOrNull() as? Text)?.textTrim)
|
||||||
} ?: (compilerArguments as? K2JSCompilerArguments)?.outputFile
|
} ?: (compilerArguments as? K2JSCompilerArguments)?.outputFile
|
||||||
@@ -237,6 +240,11 @@ private fun KotlinFacetSettings.writeLatestConfig(element: Element) {
|
|||||||
implementedModuleName?.let {
|
implementedModuleName?.let {
|
||||||
element.addContent(Element("implements").apply { addContent(it) })
|
element.addContent(Element("implements").apply { addContent(it) })
|
||||||
}
|
}
|
||||||
|
productionOutputPath?.let {
|
||||||
|
if (it != (compilerArguments as? K2JSCompilerArguments)?.outputFile) {
|
||||||
|
element.addContent(Element("productionOutputPath").apply { addContent(PathUtil.toSystemIndependentName(it)) })
|
||||||
|
}
|
||||||
|
}
|
||||||
testOutputPath?.let {
|
testOutputPath?.let {
|
||||||
if (it != (compilerArguments as? K2JSCompilerArguments)?.outputFile) {
|
if (it != (compilerArguments as? K2JSCompilerArguments)?.outputFile) {
|
||||||
element.addContent(Element("testOutputPath").apply { addContent(PathUtil.toSystemIndependentName(it)) })
|
element.addContent(Element("testOutputPath").apply { addContent(PathUtil.toSystemIndependentName(it)) })
|
||||||
|
|||||||
Reference in New Issue
Block a user