Fixed deprecated IDEA API

#KT-24907 Fixed
This commit is contained in:
Alexander Podkhalyuzin
2018-09-06 10:16:39 +03:00
parent 720587abf3
commit 8e9945bc9e
2 changed files with 6 additions and 6 deletions
@@ -23,8 +23,8 @@ import com.intellij.openapi.roots.OrderRootType
import com.intellij.openapi.roots.impl.libraries.ProjectLibraryTable
import com.intellij.openapi.roots.libraries.Library
import com.intellij.openapi.roots.libraries.PersistentLibraryKind
import com.intellij.openapi.vfs.JarFileSystem
import com.intellij.openapi.vfs.LocalFileSystem
import com.intellij.openapi.vfs.StandardFileSystems
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.testFramework.PlatformTestCase
import org.jetbrains.kotlin.test.testFramework.runWriteAction
@@ -52,10 +52,10 @@ fun PlatformTestCase.projectLibrary(
}
}
val File.jarRoot get() = StandardFileSystems.getJarRootForLocalFile(LocalFileSystem.getInstance().findFileByIoFile(this)!!)!!
val File.jarRoot get() = JarFileSystem.getInstance().getRootByLocal(LocalFileSystem.getInstance().findFileByIoFile(this)!!)!!
fun Module.addDependency(
library: Library,
dependencyScope: DependencyScope = DependencyScope.COMPILE,
exported: Boolean = false
) = ModuleRootModificationUtil.addDependency(this, library, dependencyScope, exported)
) = ModuleRootModificationUtil.addDependency(this, library, dependencyScope, exported)