[K/JS] Add file-to-file compilation ^KT-6168 Fixed

This commit is contained in:
Artem Kobzar
2023-06-22 18:23:45 +00:00
committed by Space Team
parent a44b5e4562
commit 64158a8a2f
74 changed files with 947 additions and 608 deletions
@@ -58,7 +58,9 @@ class JsEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfigu
TranslationMode.FULL_DEV to "out",
TranslationMode.FULL_PROD_MINIMIZED_NAMES to "outMin",
TranslationMode.PER_MODULE_DEV to "outPm",
TranslationMode.PER_MODULE_PROD_MINIMIZED_NAMES to "outPmMin"
TranslationMode.PER_MODULE_PROD_MINIMIZED_NAMES to "outPmMin",
TranslationMode.PER_FILE_DEV to "outPf",
TranslationMode.PER_FILE_PROD_MINIMIZED_NAMES to "outPfMin"
)
private const val OUTPUT_KLIB_DIR_NAME = "outputKlibDir"
@@ -86,11 +88,15 @@ class JsEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfigu
}
fun getJsModuleArtifactPath(testServices: TestServices, moduleName: String, translationMode: TranslationMode = TranslationMode.FULL_DEV): String {
return getJsArtifactsOutputDir(testServices, translationMode).absolutePath + File.separator + getJsArtifactSimpleName(testServices, moduleName) + "_v5"
return getJsArtifactsOutputDir(testServices, translationMode).absolutePath + File.separator + getJsModuleArtifactName(testServices, moduleName)
}
fun getRecompiledJsModuleArtifactPath(testServices: TestServices, moduleName: String, translationMode: TranslationMode = TranslationMode.FULL_DEV): String {
return getJsArtifactsRecompiledOutputDir(testServices, translationMode).absolutePath + File.separator + getJsArtifactSimpleName(testServices, moduleName) + "_v5"
return getJsArtifactsRecompiledOutputDir(testServices, translationMode).absolutePath + File.separator + getJsModuleArtifactName(testServices, moduleName)
}
fun getJsModuleArtifactName(testServices: TestServices, moduleName: String): String {
return getJsArtifactSimpleName(testServices, moduleName) + "_v5"
}
fun getJsKlibArtifactPath(testServices: TestServices, moduleName: String): String {
@@ -26,10 +26,9 @@ class TemporaryDirectoryManagerImpl(testServices: TestServices) : TemporaryDirec
// This code will simplify directory name for windows. This is needed because there can occur errors due to long name
val lastDot = className.lastIndexOf('.')
val packageName = className.substring(0, lastDot + 1)
val simplifiedClassName = className.substring(lastDot + 1).getOnlyUpperCaseSymbols()
val simplifiedMethodName = methodName.getOnlyUpperCaseSymbols()
KtTestUtil.tmpDirForTest(packageName + simplifiedClassName, "test$simplifiedMethodName")
KtTestUtil.tmpDirForTest(simplifiedClassName, simplifiedMethodName)
}
override val rootDir: File