make PKGS classes open

GitOrigin-RevId: f8183b237261fe4f77d6f66ba2e83405c5574ce1
This commit is contained in:
Alexander Bubenchikov
2021-04-11 18:55:31 +00:00
committed by intellij-monorepo-bot
parent e393297c0a
commit 8174dece93
16 changed files with 40 additions and 37 deletions
@@ -11,7 +11,7 @@ import com.intellij.openapi.module.ModuleUtilCore
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
internal abstract class AbstractProjectModuleOperationProvider : ProjectModuleOperationProvider {
abstract class AbstractProjectModuleOperationProvider : ProjectModuleOperationProvider {
override fun addDependencyToProject(
operationMetadata: DependencyOperationMetadata,
@@ -1,7 +1,17 @@
package com.jetbrains.packagesearch.intellij.plugin.extensibility
internal enum class BuildSystemType(val statisticsKey: String) {
MAVEN(statisticsKey = "maven"),
GRADLE_GROOVY(statisticsKey = "gradle-groovy"),
GRADLE_KOTLIN(statisticsKey = "gradle-kts")
class BuildSystemType(val name: String, val statisticsKey: String) {
companion object {
@JvmStatic
val MAVEN = BuildSystemType(name = "MAVEN", statisticsKey = "maven")
@JvmStatic
val GRADLE_GROOVY = BuildSystemType(name = "GRADLE_GROOVY", statisticsKey = "gradle-groovy")
@JvmStatic
val GRADLE_KOTLIN = BuildSystemType(name = "GRADLE_KOTLIN", statisticsKey = "gradle-kts")
}
}
class Build
@@ -1,6 +1,6 @@
package com.jetbrains.packagesearch.intellij.plugin.extensibility
internal data class DependencyOperationMetadata(
data class DependencyOperationMetadata(
val module: ProjectModule,
val groupId: String,
val artifactId: String,
@@ -11,7 +11,7 @@ import com.jetbrains.rd.util.reactive.Signal
import com.jetbrains.rd.util.reactive.flowInto
import kotlin.streams.asSequence
internal interface ModuleChangesSignalProvider {
interface ModuleChangesSignalProvider {
companion object {
@@ -34,4 +34,4 @@ internal interface ModuleChangesSignalProvider {
fun listenToModuleChanges(project: Project, lifetime: Lifetime): IVoidSource
}
internal fun MessageBus.connect(lifetime: Lifetime): MessageBusConnection = connect(lifetime.createNestedDisposable())
fun MessageBus.connect(lifetime: Lifetime): MessageBusConnection = connect(lifetime.createNestedDisposable())
@@ -5,8 +5,9 @@ import com.intellij.openapi.util.NlsSafe
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.pom.Navigatable
import com.jetbrains.packagesearch.intellij.plugin.ui.toolwindow.models.PackageVersion
import org.jetbrains.annotations.ApiStatus
internal data class ProjectModule(
data class ProjectModule(
val name: String,
val nativeModule: Module,
val parent: ProjectModule?,
@@ -1,15 +1,15 @@
package com.jetbrains.packagesearch.intellij.plugin.extensibility
import com.intellij.openapi.extensions.ExtensionPointName
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.psi.PsiFile
import com.intellij.buildsystem.model.OperationFailure
import com.intellij.buildsystem.model.OperationItem
import com.intellij.buildsystem.model.unified.UnifiedDependency
import com.intellij.buildsystem.model.unified.UnifiedDependencyRepository
import com.intellij.openapi.extensions.ExtensionPointName
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.psi.PsiFile
internal interface ProjectModuleOperationProvider {
interface ProjectModuleOperationProvider {
companion object {
@@ -4,7 +4,7 @@ import com.intellij.openapi.extensions.ExtensionPointName
import com.intellij.openapi.project.Project
import kotlin.streams.asSequence
internal interface ProjectModuleProvider {
interface ProjectModuleProvider {
companion object {
@@ -1,14 +1,13 @@
package com.jetbrains.packagesearch.intellij.plugin.extensibility
import com.intellij.openapi.project.Project
import com.jetbrains.packagesearch.intellij.plugin.api.model.StandardV2Package
import javax.swing.Icon
enum class ProjectModuleTypeTerm {
SCOPE
}
internal interface ProjectModuleType {
interface ProjectModuleType {
val icon: Icon?
val packageIcon: Icon?
@@ -16,6 +15,4 @@ internal interface ProjectModuleType {
fun scopes(project: Project): List<String>
fun defaultScope(project: Project): String
fun providesSupportFor(dependency: StandardV2Package): Boolean
}
@@ -1,6 +1,6 @@
package com.jetbrains.packagesearch.intellij.plugin.extensibility
internal data class RepositoryDeclaration(
data class RepositoryDeclaration(
val id: String?,
val name: String?,
val url: String?,
@@ -1,6 +1,6 @@
package com.jetbrains.packagesearch.intellij.plugin.extensibility
internal data class RepositoryOperationMetadata(
data class RepositoryOperationMetadata(
val module: ProjectModule,
val groupId: String,
val artifactId: String,
@@ -0,0 +1,4 @@
@ApiStatus.Experimental
package com.jetbrains.packagesearch.intellij.plugin.extensibility;
import org.jetbrains.annotations.ApiStatus;
@@ -13,7 +13,7 @@ import com.intellij.psi.PsiElement
import com.intellij.psi.PsiFile
import com.intellij.psi.PsiManager
import com.intellij.psi.util.PsiUtil
import com.jetbrains.packagesearch.intellij.plugin.extensibility.BuildSystemType.GRADLE_GROOVY
import com.jetbrains.packagesearch.intellij.plugin.extensibility.BuildSystemType
import com.jetbrains.packagesearch.intellij.plugin.extensibility.ProjectModule
import com.jetbrains.packagesearch.intellij.plugin.extensibility.ProjectModuleProvider
import com.jetbrains.packagesearch.intellij.plugin.ui.toolwindow.models.PackageVersion
@@ -65,7 +65,7 @@ internal open class GradleProjectModuleProvider : ProjectModuleProvider {
nativeModule = nativeModule,
parent = null,
buildFile = buildVirtualFile,
buildSystemType = GRADLE_GROOVY,
buildSystemType = BuildSystemType.GRADLE_GROOVY,
moduleType = GradleProjectModuleType
).apply {
getNavigatableDependency = createNavigatableDependencyCallback(project, buildVirtualFile)
@@ -119,7 +119,7 @@ internal open class GradleProjectModuleProvider : ProjectModuleProvider {
nativeModule = nativeModule,
parent = currentModule,
buildFile = projectBuildFile,
buildSystemType = GRADLE_GROOVY,
buildSystemType = BuildSystemType.GRADLE_GROOVY,
moduleType = GradleProjectModuleType
)
@@ -26,8 +26,4 @@ internal object GradleProjectModuleType : ProjectModuleType {
override fun scopes(project: Project): List<String> = packageSearchGradleConfigurationForProject(project).getGradleScopes()
override fun providesSupportFor(dependency: StandardV2Package): Boolean {
// For Gradle modules, allow working with any dependency that is not an MPP root
return dependency.mpp?.moduleType == null || dependency.mpp.moduleType != MppModuleType.ROOT
}
}
@@ -3,7 +3,7 @@ package com.jetbrains.packagesearch.intellij.plugin.extensions.maven
import com.intellij.openapi.module.Module
import com.intellij.openapi.module.ModuleManager
import com.intellij.openapi.project.Project
import com.jetbrains.packagesearch.intellij.plugin.extensibility.BuildSystemType.MAVEN
import com.jetbrains.packagesearch.intellij.plugin.extensibility.BuildSystemType
import com.jetbrains.packagesearch.intellij.plugin.extensibility.ProjectModule
import com.jetbrains.packagesearch.intellij.plugin.extensibility.ProjectModuleProvider
import com.jetbrains.packagesearch.intellij.plugin.ui.toolwindow.models.PackageVersion
@@ -33,7 +33,7 @@ internal class MavenProjectModuleProvider : ProjectModuleProvider {
nativeModule = module,
parent = null,
buildFile = mavenProject.file,
buildSystemType = MAVEN,
buildSystemType = BuildSystemType.MAVEN,
moduleType = MavenProjectModuleType
).apply {
getNavigatableDependency = createNavigatableDependencyCallback(project, mavenProject)
@@ -26,9 +26,4 @@ internal object MavenProjectModuleType : ProjectModuleType {
override fun scopes(project: Project): List<String> =
packageSearchMavenConfigurationForProject(project).getMavenScopes()
override fun providesSupportFor(dependency: StandardV2Package): Boolean {
// For Maven modules, allow working with any dependency that is not an MPP root
return dependency.mpp?.moduleType == null || dependency.mpp.moduleType != MppModuleType.ROOT
}
}
@@ -7,7 +7,7 @@ import com.jetbrains.packagesearch.intellij.plugin.version.looksLikeStableVersio
import org.jetbrains.annotations.Nls
import org.jetbrains.annotations.NonNls
internal sealed class PackageVersion(
sealed class PackageVersion(
open val versionName: String,
open val isStable: Boolean
) : Comparable<PackageVersion> {
@@ -43,7 +43,7 @@ internal sealed class PackageVersion(
companion object {
fun from(rawVersion: StandardV2Version): PackageVersion {
internal fun from(rawVersion: StandardV2Version): PackageVersion {
if (rawVersion.version.isBlank()) return Missing
return Named(rawVersion.version.trim(), rawVersion.stable)
}