[JS] Migrate tests onto IR compiler with outputDir API instead of outputFile
^KT-61117 fixed
This commit is contained in:
committed by
Space Team
parent
e50f6e6bca
commit
08e3cb300a
@@ -181,10 +181,12 @@ private fun readV2AndLaterConfig(
|
||||
}
|
||||
productionOutputPath = element.getChild("productionOutputPath")?.let {
|
||||
(it.content.firstOrNull() as? Text)?.textTrim?.let(FileUtilRt::toSystemDependentName)
|
||||
} ?: (compilerArguments as? K2JSCompilerArguments)?.outputFile
|
||||
} ?: (compilerArguments as? K2JSCompilerArguments)?.outputDir
|
||||
?: (compilerArguments as? K2JSCompilerArguments)?.outputFile
|
||||
testOutputPath = element.getChild("testOutputPath")?.let {
|
||||
(it.content.firstOrNull() as? Text)?.textTrim?.let(FileUtilRt::toSystemDependentName)
|
||||
} ?: (compilerArguments as? K2JSCompilerArguments)?.outputFile
|
||||
} ?: (compilerArguments as? K2JSCompilerArguments)?.outputDir
|
||||
?: (compilerArguments as? K2JSCompilerArguments)?.outputFile
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,7 +241,7 @@ fun CommonCompilerArguments.convertPathsToSystemIndependent() {
|
||||
}
|
||||
|
||||
is K2JSCompilerArguments -> {
|
||||
outputFile = outputFile?.let(FileUtilRt::toSystemIndependentName)
|
||||
outputDir = (outputDir ?: outputFile)?.let(FileUtilRt::toSystemIndependentName)
|
||||
libraries = libraries?.let(FileUtilRt::toSystemIndependentName)
|
||||
}
|
||||
|
||||
@@ -354,14 +356,16 @@ private fun KotlinFacetSettings.writeConfig(element: Element) {
|
||||
if (pureKotlinSourceFolders.isNotEmpty()) {
|
||||
element.setAttribute("pureKotlinSourceFolders", pureKotlinSourceFolders.joinToString(";"))
|
||||
}
|
||||
productionOutputPath?.let {
|
||||
if (it != (compilerArguments as? K2JSCompilerArguments)?.outputFile) {
|
||||
element.addContent(Element("productionOutputPath").apply { addContent(FileUtilRt.toSystemIndependentName(it)) })
|
||||
(compilerArguments as? K2JSCompilerArguments)?.let { compilerArguments ->
|
||||
productionOutputPath?.let {
|
||||
if (it != compilerArguments.outputDir && it != compilerArguments.outputFile) {
|
||||
element.addContent(Element("productionOutputPath").apply { addContent(FileUtilRt.toSystemIndependentName(it)) })
|
||||
}
|
||||
}
|
||||
}
|
||||
testOutputPath?.let {
|
||||
if (it != (compilerArguments as? K2JSCompilerArguments)?.outputFile) {
|
||||
element.addContent(Element("testOutputPath").apply { addContent(FileUtilRt.toSystemIndependentName(it)) })
|
||||
testOutputPath?.let {
|
||||
if (it != compilerArguments.outputDir && it != compilerArguments.outputFile) {
|
||||
element.addContent(Element("testOutputPath").apply { addContent(FileUtilRt.toSystemIndependentName(it)) })
|
||||
}
|
||||
}
|
||||
}
|
||||
compilerSettings?.copyOf()?.let {
|
||||
|
||||
@@ -237,7 +237,8 @@ class CompilerArgumentsContentProspectorTest {
|
||||
K2JSCompilerArguments::wasm
|
||||
)
|
||||
private val k2JSCompilerArgumentsStringProperties = commonCompilerArgumentsStringProperties + listOf(
|
||||
K2JSCompilerArguments::outputFile,
|
||||
K2JSCompilerArguments::outputDir,
|
||||
K2JSCompilerArguments::moduleName,
|
||||
K2JSCompilerArguments::libraries,
|
||||
K2JSCompilerArguments::sourceMapPrefix,
|
||||
K2JSCompilerArguments::sourceMapBaseDirs,
|
||||
|
||||
Reference in New Issue
Block a user