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 productionOutputPath: String? = null
|
||||
var testOutputPath: String? = null
|
||||
}
|
||||
|
||||
|
||||
@@ -110,6 +110,9 @@ private fun readV2AndLaterConfig(element: Element): KotlinFacetSettings {
|
||||
XmlSerializer.deserializeInto(compilerArguments!!, it)
|
||||
compilerArguments!!.detectVersionAutoAdvance()
|
||||
}
|
||||
productionOutputPath = element.getChild("productionOutputPath")?.let {
|
||||
PathUtil.toSystemDependentName((it.content.firstOrNull() as? Text)?.textTrim)
|
||||
} ?: (compilerArguments as? K2JSCompilerArguments)?.outputFile
|
||||
testOutputPath = element.getChild("testOutputPath")?.let {
|
||||
PathUtil.toSystemDependentName((it.content.firstOrNull() as? Text)?.textTrim)
|
||||
} ?: (compilerArguments as? K2JSCompilerArguments)?.outputFile
|
||||
@@ -237,6 +240,11 @@ private fun KotlinFacetSettings.writeLatestConfig(element: Element) {
|
||||
implementedModuleName?.let {
|
||||
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 {
|
||||
if (it != (compilerArguments as? K2JSCompilerArguments)?.outputFile) {
|
||||
element.addContent(Element("testOutputPath").apply { addContent(PathUtil.toSystemIndependentName(it)) })
|
||||
|
||||
Reference in New Issue
Block a user