Rename: KonanPlatform, KonanPlatforms -> NativePlatform, NativePlatforms
This commit is contained in:
@@ -21,7 +21,7 @@ import org.jetbrains.kotlin.platform.impl.NativeIdePlatformKind
|
||||
import org.jetbrains.kotlin.psi.KtFunction
|
||||
import org.jetbrains.kotlin.psi.KtNamedDeclaration
|
||||
import org.jetbrains.kotlin.platform.TargetPlatform
|
||||
import org.jetbrains.kotlin.platform.konan.KonanPlatforms
|
||||
import org.jetbrains.kotlin.platform.konan.NativePlatforms
|
||||
import javax.swing.Icon
|
||||
|
||||
class NativeIdePlatformKindTooling : IdePlatformKindTooling() {
|
||||
@@ -59,7 +59,7 @@ class NativeIdePlatformKindTooling : IdePlatformKindTooling() {
|
||||
|
||||
object NativeLibraryKind : PersistentLibraryKind<DummyLibraryProperties>("kotlin.native"), KotlinLibraryKind {
|
||||
override val compilerPlatform: TargetPlatform
|
||||
get() = KonanPlatforms.defaultKonanPlatform
|
||||
get() = NativePlatforms.defaultNativePlatform
|
||||
|
||||
override fun createDefaultProperties() = DummyLibraryProperties.INSTANCE!!
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.intellij.openapi.roots.libraries.ui.LibraryEditorComponent
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import org.jetbrains.kotlin.idea.KotlinIcons
|
||||
import org.jetbrains.kotlin.idea.klib.isKlibLibraryRootForPlatform
|
||||
import org.jetbrains.kotlin.platform.konan.KonanPlatforms
|
||||
import org.jetbrains.kotlin.platform.konan.NativePlatforms
|
||||
import javax.swing.Icon
|
||||
import javax.swing.JComponent
|
||||
|
||||
@@ -25,7 +25,7 @@ object NativeLibraryType : LibraryType<DummyLibraryProperties>(NativeLibraryKind
|
||||
// However this does not work for libraries that are to be just created during project build, e.g. C-interop Kotlin/Native KLIBs.
|
||||
// The code below helps to perform postponed detection of Kotlin/Native libraries.
|
||||
override fun detect(classesRoots: List<VirtualFile>): DummyLibraryProperties? =
|
||||
if (classesRoots.firstOrNull()?.isKlibLibraryRootForPlatform(KonanPlatforms.defaultKonanPlatform) == true)
|
||||
if (classesRoots.firstOrNull()?.isKlibLibraryRootForPlatform(NativePlatforms.defaultNativePlatform) == true)
|
||||
DummyLibraryProperties.INSTANCE!!
|
||||
else null
|
||||
|
||||
|
||||
@@ -38,10 +38,10 @@ import org.jetbrains.kotlin.konan.util.KlibMetadataFactories
|
||||
import org.jetbrains.kotlin.library.isInterop
|
||||
import org.jetbrains.kotlin.platform.TargetPlatform
|
||||
import org.jetbrains.kotlin.platform.impl.NativeIdePlatformKind
|
||||
import org.jetbrains.kotlin.platform.konan.KonanPlatforms
|
||||
import org.jetbrains.kotlin.resolve.ImplicitIntegerCoercion
|
||||
import org.jetbrains.kotlin.resolve.TargetEnvironment
|
||||
import org.jetbrains.kotlin.library.metadata.NullFlexibleTypeDeserializer
|
||||
import org.jetbrains.kotlin.platform.konan.NativePlatforms
|
||||
import org.jetbrains.kotlin.serialization.konan.impl.KlibMetadataModuleDescriptorFactoryImpl
|
||||
import org.jetbrains.kotlin.storage.StorageManager
|
||||
|
||||
@@ -64,7 +64,7 @@ class NativePlatformKindResolution : IdePlatformKindResolution {
|
||||
createNativeKlibPackageFragmentProvider(moduleInfo, storageManager, languageVersionSettings, moduleDescriptor)
|
||||
|
||||
override fun isLibraryFileForPlatform(virtualFile: VirtualFile): Boolean =
|
||||
virtualFile.isKlibLibraryRootForPlatform(KonanPlatforms.defaultKonanPlatform)
|
||||
virtualFile.isKlibLibraryRootForPlatform(NativePlatforms.defaultNativePlatform)
|
||||
|
||||
override fun createResolverForModuleFactory(
|
||||
settings: PlatformAnalysisParameters,
|
||||
@@ -168,5 +168,5 @@ class NativeKlibLibraryInfo(project: Project, library: Library, libraryRoot: Str
|
||||
}
|
||||
|
||||
override val platform: TargetPlatform
|
||||
get() = KonanPlatforms.defaultKonanPlatform
|
||||
get() = NativePlatforms.defaultNativePlatform
|
||||
}
|
||||
|
||||
+2
-3
@@ -14,13 +14,12 @@ import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl
|
||||
import org.jetbrains.kotlin.frontend.di.createContainerForLazyResolve
|
||||
import org.jetbrains.kotlin.ide.konan.NativePlatformKindResolution.Companion.createNativeKlibPackageFragmentProvider
|
||||
import org.jetbrains.kotlin.platform.TargetPlatform
|
||||
import org.jetbrains.kotlin.platform.konan.KonanPlatforms
|
||||
import org.jetbrains.kotlin.platform.konan.NativePlatforms
|
||||
import org.jetbrains.kotlin.resolve.CodeAnalyzerInitializer
|
||||
import org.jetbrains.kotlin.resolve.TargetEnvironment
|
||||
import org.jetbrains.kotlin.resolve.konan.platform.NativePlatformAnalyzerServices
|
||||
import org.jetbrains.kotlin.resolve.lazy.ResolveSession
|
||||
import org.jetbrains.kotlin.resolve.lazy.declarations.DeclarationProviderFactoryService.Companion.createDeclarationProviderFactory
|
||||
import org.jetbrains.kotlin.utils.addIfNotNull
|
||||
|
||||
class NativeResolverForModuleFactory(
|
||||
private val platformAnalysisParameters: PlatformAnalysisParameters,
|
||||
@@ -47,7 +46,7 @@ class NativeResolverForModuleFactory(
|
||||
moduleContext,
|
||||
declarationProviderFactory,
|
||||
CodeAnalyzerInitializer.getInstance(moduleContext.project).createTrace(),
|
||||
KonanPlatforms.defaultKonanPlatform,
|
||||
NativePlatforms.defaultNativePlatform,
|
||||
NativePlatformAnalyzerServices,
|
||||
targetEnvironment,
|
||||
languageVersionSettings
|
||||
|
||||
Reference in New Issue
Block a user