From e0989caf465f703fa8a6c4d61d20ba7755c6b623 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Mon, 17 Oct 2016 18:11:38 +0300 Subject: [PATCH] Load built-ins from module dependencies in JVM compiler Introduce a new method KotlinClassFinder#findBuiltInsData, which is only implemented correctly in the JvmCliVirtualFileFinder because it's only used in the compiler code at the moment. Introduce JvmBuiltInsPackageFragmentProvider, the purpose of which is to look for .kotlin_builtins files in the classpath and provide definitions of built-ins from those files. Also exclude script.runtime from compilation because, as other excluded modules, it has no dependency on the stdlib and is no longer compilable from the IDE now, because it cannot resolve built-ins from anywhere --- .idea/compiler.xml | 8 +- build.xml | 16 +++- .../jvm/compiler/JvmCliVirtualFileFinder.kt | 22 +++++- .../kotlin/frontend/java/di/injection.kt | 10 ++- .../kotlin/resolve/jvm/JvmAnalyzerFacade.kt | 1 + .../jvm/TopDownAnalyzerFacadeForJVM.kt | 10 ++- compiler/testData/cli/jvm/noStdlib.out | 6 +- .../JvmBuiltInsPackageFragmentProvider.kt | 73 +++++++++++++++++++ .../kotlin/load/kotlin/JavaClassDataFinder.kt | 2 +- .../kotlin/load/kotlin/KotlinClassFinder.kt | 3 + .../reflect/ReflectKotlinClassFinder.kt | 5 ++ .../builtins/BuiltInSerializerProtocol.kt | 5 +- .../DeserializerForClassfileDecompiler.kt | 4 + .../kotlin/idea/vfilefinder/fileFinders.kt | 5 +- 14 files changed, 145 insertions(+), 25 deletions(-) create mode 100644 core/descriptor.loader.java/src/org/jetbrains/kotlin/builtins/JvmBuiltInsPackageFragmentProvider.kt diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 626bc0be539..3d8f44e5abf 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,14 +1,13 @@ -