JS: use metadata in jps build process
This commit is contained in:
@@ -120,14 +120,8 @@ public class LibrarySourcesConfig extends Config {
|
||||
VirtualFileSystem fileSystem = VirtualFileManager.getInstance().getFileSystem(StandardFileSystems.FILE_PROTOCOL);
|
||||
VirtualFileSystem jarFileSystem = VirtualFileManager.getInstance().getFileSystem(StandardFileSystems.JAR_PROTOCOL);
|
||||
|
||||
String moduleName = null;
|
||||
|
||||
for (String path : files) {
|
||||
VirtualFile file;
|
||||
if (path.charAt(0) == '@') {
|
||||
moduleName = path.substring(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
File filePath = new File(path);
|
||||
if (!filePath.exists()) {
|
||||
@@ -149,10 +143,7 @@ public class LibrarySourcesConfig extends Config {
|
||||
else {
|
||||
String actualModuleName;
|
||||
|
||||
if (moduleName != null) {
|
||||
actualModuleName = moduleName;
|
||||
}
|
||||
else if (isOldKotlinJavascriptLibrary(filePath)) {
|
||||
if (isOldKotlinJavascriptLibrary(filePath)) {
|
||||
actualModuleName = LibraryUtils.getKotlinJsModuleName(filePath);
|
||||
}
|
||||
else if (isKotlinJavascriptLibraryWithMetadata(filePath)) {
|
||||
@@ -167,7 +158,6 @@ public class LibrarySourcesConfig extends Config {
|
||||
action.invoke(actualModuleName, file);
|
||||
}
|
||||
}
|
||||
moduleName = null;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.js.test
|
||||
|
||||
import org.jetbrains.kotlin.js.JavaScript
|
||||
import org.jetbrains.kotlin.js.config.EcmaVersion
|
||||
import org.jetbrains.kotlin.js.facade.MainCallParameters
|
||||
import org.jetbrains.kotlin.js.test.rhino.RhinoFunctionResultChecker
|
||||
@@ -52,12 +53,15 @@ public abstract class MultipleModulesTranslationTest(main: String) : BasicTest(m
|
||||
val fullFilePaths = getAllFilesInDir(pathToDir + File.separator + moduleName)
|
||||
val libraries = ArrayList<String>()
|
||||
for (dependencyName in dependencies) {
|
||||
libraries.add("@" + dependencyName)
|
||||
libraries.add(pathToDir + File.separator + dependencyName)
|
||||
libraries.add(getMetaInfo(getModuleDirectoryName(dirName, dependencyName)))
|
||||
}
|
||||
generateJavaScriptFiles(fullFilePaths, moduleDirectoryName, MainCallParameters.noCall(), BasicTest.DEFAULT_ECMA_VERSIONS, moduleName, libraries)
|
||||
}
|
||||
|
||||
override fun getMetaInfo(moduleId: String): String? {
|
||||
return getOutputPath() + moduleId + ".meta" + JavaScript.DOT_EXTENSION
|
||||
}
|
||||
|
||||
override fun additionalJsFiles(ecmaVersion: EcmaVersion): List<String> {
|
||||
val result = super.additionalJsFiles(ecmaVersion)
|
||||
val dirName = getTestName(true)
|
||||
|
||||
Reference in New Issue
Block a user