KLIB: Fix compilation
This commit is contained in:
+2
-2
@@ -8,10 +8,10 @@ package org.jetbrains.kotlin.ide.konan
|
||||
import com.intellij.openapi.module.Module
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
import org.jetbrains.kotlin.ide.konan.index.KotlinNativeMetaFileIndex
|
||||
import org.jetbrains.kotlin.idea.configuration.LibraryKindSearchScope
|
||||
import org.jetbrains.kotlin.idea.configuration.hasKotlinFilesOnlyInTests
|
||||
import org.jetbrains.kotlin.idea.util.runReadActionInSmartMode
|
||||
import org.jetbrains.kotlin.idea.vfilefinder.KlibMetaFileIndex
|
||||
import org.jetbrains.kotlin.idea.vfilefinder.hasSomethingInPackage
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
|
||||
@@ -23,5 +23,5 @@ fun hasKotlinNativeRuntimeInScope(module: Module): Boolean = module.project.runR
|
||||
private val KOTLIN_NATIVE_FQ_NAME = FqName("kotlin.native")
|
||||
|
||||
fun hasKotlinNativeMetadataFile(project: Project, scope: GlobalSearchScope): Boolean = project.runReadActionInSmartMode {
|
||||
KotlinNativeMetaFileIndex.hasSomethingInPackage(KOTLIN_NATIVE_FQ_NAME, scope)
|
||||
KlibMetaFileIndex.hasSomethingInPackage(KOTLIN_NATIVE_FQ_NAME, scope)
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import com.intellij.openapi.roots.libraries.LibraryType
|
||||
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 javax.swing.Icon
|
||||
import javax.swing.JComponent
|
||||
|
||||
@@ -23,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()?.isKonanLibraryRoot == true)
|
||||
if (classesRoots.firstOrNull()?.isKlibLibraryRootForPlatform(KonanPlatforms.defaultKonanPlatform) == true)
|
||||
DummyLibraryProperties.INSTANCE!!
|
||||
else null
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.ide.konan.index
|
||||
|
||||
import com.intellij.util.indexing.FileBasedIndex
|
||||
import org.jetbrains.kotlin.idea.klib.KlibLoadingMetadataCache
|
||||
import org.jetbrains.kotlin.idea.klib.KlibMetaFileType
|
||||
import org.jetbrains.kotlin.idea.vfilefinder.KotlinFileIndexBase
|
||||
import org.jetbrains.kotlin.library.metadata.KlibMetadataProtoBuf
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
|
||||
Reference in New Issue
Block a user