use of org.jetbrains.kotlin.storage.LockBasedStorageManager 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;
}
Aggregations