Extracted 'kotlin_module' constant
This commit is contained in:
@@ -33,6 +33,7 @@ import org.jetbrains.kotlin.descriptors.*;
|
||||
import org.jetbrains.kotlin.load.java.descriptors.JavaClassDescriptor;
|
||||
import org.jetbrains.kotlin.load.java.lazy.descriptors.LazyJavaPackageFragment;
|
||||
import org.jetbrains.kotlin.load.kotlin.KotlinJvmBinaryClass;
|
||||
import org.jetbrains.kotlin.load.kotlin.ModuleMapping;
|
||||
import org.jetbrains.kotlin.load.kotlin.VirtualFileKotlinClass;
|
||||
import org.jetbrains.kotlin.load.kotlin.incremental.IncrementalPackageFragmentProvider;
|
||||
import org.jetbrains.kotlin.psi.JetFile;
|
||||
@@ -253,6 +254,6 @@ public class JvmCodegenUtil {
|
||||
|
||||
@NotNull
|
||||
public static String getMappingFileName(@NotNull String moduleName) {
|
||||
return "META-INF/" + moduleName + ".kotlin_module";
|
||||
return "META-INF/" + moduleName + "." + ModuleMapping.MAPPING_FILE_EXT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class KotlinModuleFileType implements FileType {
|
||||
@Override
|
||||
@NotNull
|
||||
public String getDescription() {
|
||||
return getName();
|
||||
return "Kotlin module info: contains package part mappings";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ class RuntimePackagePartProvider(val classLoader : ClassLoader) : PackagePartPro
|
||||
if (moduleName == null) return
|
||||
|
||||
module2Mapping.putIfAbsent(moduleName, lazy {
|
||||
val resourceAsStream: InputStream = classLoader.getResourceAsStream("META-INF/$moduleName.kotlin_module") ?: return@lazy ModuleMapping()
|
||||
val resourceAsStream: InputStream = classLoader.getResourceAsStream("META-INF/$moduleName.${ModuleMapping.MAPPING_FILE_EXT}") ?: return@lazy ModuleMapping()
|
||||
|
||||
try {
|
||||
return@lazy ModuleMapping(resourceAsStream.readBytes())
|
||||
|
||||
@@ -24,6 +24,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
public class KotlinModuleFileFactory extends FileTypeFactory {
|
||||
@Override
|
||||
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
|
||||
consumer.consume(KotlinModuleFileType.INSTANCE, "kotlin_module");
|
||||
consumer.consume(KotlinModuleFileType.INSTANCE, KotlinModuleFileType.EXTENSION);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user