Search in sources :

Example 1 with BuiltInFictitiousFunctionClassFactory

use of org.jetbrains.kotlin.builtins.functions.BuiltInFictitiousFunctionClassFactory in project kotlin by JetBrains.

the class LoadBuiltinsTest method createBuiltInsPackageFragmentProvider.

@NotNull
private static PackageFragmentProvider createBuiltInsPackageFragmentProvider() {
    LockBasedStorageManager storageManager = new LockBasedStorageManager();
    ModuleDescriptorImpl builtInsModule = new ModuleDescriptorImpl(KotlinBuiltIns.BUILTINS_MODULE_NAME, storageManager, DefaultBuiltIns.getInstance());
    PackageFragmentProvider packageFragmentProvider = createBuiltInPackageFragmentProvider(storageManager, builtInsModule, BUILT_INS_PACKAGE_FQ_NAMES, Collections.singletonList(new BuiltInFictitiousFunctionClassFactory(storageManager, builtInsModule)), PlatformDependentDeclarationFilter.All.INSTANCE, AdditionalClassPartsProvider.None.INSTANCE, new Function1<String, InputStream>() {

        @Override
        public InputStream invoke(String path) {
            return ForTestCompileRuntime.runtimeJarClassLoader().getResourceAsStream(path);
        }
    });
    builtInsModule.initialize(packageFragmentProvider);
    builtInsModule.setDependencies(builtInsModule);
    return packageFragmentProvider;
}
Also used : BuiltInFictitiousFunctionClassFactory(org.jetbrains.kotlin.builtins.functions.BuiltInFictitiousFunctionClassFactory) PackageFragmentProvider(org.jetbrains.kotlin.descriptors.PackageFragmentProvider) BuiltInsPackageFragmentProviderKt.createBuiltInPackageFragmentProvider(org.jetbrains.kotlin.builtins.BuiltInsPackageFragmentProviderKt.createBuiltInPackageFragmentProvider) InputStream(java.io.InputStream) LockBasedStorageManager(org.jetbrains.kotlin.storage.LockBasedStorageManager) ModuleDescriptorImpl(org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

InputStream (java.io.InputStream)1 NotNull (org.jetbrains.annotations.NotNull)1 BuiltInsPackageFragmentProviderKt.createBuiltInPackageFragmentProvider (org.jetbrains.kotlin.builtins.BuiltInsPackageFragmentProviderKt.createBuiltInPackageFragmentProvider)1 BuiltInFictitiousFunctionClassFactory (org.jetbrains.kotlin.builtins.functions.BuiltInFictitiousFunctionClassFactory)1 PackageFragmentProvider (org.jetbrains.kotlin.descriptors.PackageFragmentProvider)1 ModuleDescriptorImpl (org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl)1 LockBasedStorageManager (org.jetbrains.kotlin.storage.LockBasedStorageManager)1