From 4e3dfb7d679afe0c99e22f866e3eecce2dae1dc4 Mon Sep 17 00:00:00 2001 From: "Nikita.Skvortsov" Date: Wed, 17 Jul 2024 12:11:30 +0200 Subject: [PATCH] [es] IJPL-797 `external.system.api.impl` review internal API Hide APIs. Common issues: action calls instead of API calls, unfortunate internal interfaces naming. GitOrigin-RevId: d6eca755594ad495fc43dad737dbbdfff7854a48 --- .../api-dump-unreviewed.txt | 195 ------------------ .../action/DetachExternalProjectAction.java | 4 +- .../RefreshAllExternalProjectsAction.java | 4 +- .../autoimport/HideProjectRefreshAction.kt | 4 +- .../ProjectBatchFileChangeListener.kt | 4 +- .../autoimport/ProjectRefreshAction.kt | 3 +- .../autoimport/ProjectStatus.kt | 4 +- .../changes/vfs/VirtualFileChangesListener.kt | 4 +- .../analyzer/DependencyAnalyzerManager.kt | 4 +- .../DummyDependencyAnalyzerContributor.kt | 164 --------------- .../importing/GAVStateComponent.java | 4 +- .../importing/JpsDependencyContributor.java | 4 +- 12 files changed, 27 insertions(+), 371 deletions(-) delete mode 100644 platform/external-system-impl/src/com/intellij/openapi/externalSystem/dependency/analyzer/DummyDependencyAnalyzerContributor.kt diff --git a/platform/external-system-impl/api-dump-unreviewed.txt b/platform/external-system-impl/api-dump-unreviewed.txt index 1a0bf80ad723..58e913a4c167 100644 --- a/platform/external-system-impl/api-dump-unreviewed.txt +++ b/platform/external-system-impl/api-dump-unreviewed.txt @@ -1,10 +1,3 @@ -c:com.intellij.openapi.externalSystem.action.DetachExternalProjectAction -- com.intellij.openapi.externalSystem.action.ExternalSystemNodeAction -- ():V -- s:detachProject(com.intellij.openapi.project.Project,com.intellij.openapi.externalSystem.model.ProjectSystemId,com.intellij.openapi.externalSystem.model.project.ProjectData,com.intellij.openapi.externalSystem.view.ProjectNode):V -- p:isEnabled(com.intellij.openapi.actionSystem.AnActionEvent):Z -- perform(com.intellij.openapi.project.Project,com.intellij.openapi.externalSystem.model.ProjectSystemId,com.intellij.openapi.externalSystem.model.project.ProjectData,com.intellij.openapi.actionSystem.AnActionEvent):V -- update(com.intellij.openapi.actionSystem.AnActionEvent):V a:com.intellij.openapi.externalSystem.action.ExternalSystemAction - com.intellij.openapi.actionSystem.AnAction - com.intellij.openapi.project.DumbAware @@ -53,12 +46,6 @@ a:com.intellij.openapi.externalSystem.action.ExternalSystemToggleAction - p:setText(com.intellij.openapi.actionSystem.AnActionEvent,java.lang.String):V - p:setText(java.lang.String):V - update(com.intellij.openapi.actionSystem.AnActionEvent):V -c:com.intellij.openapi.externalSystem.action.RefreshAllExternalProjectsAction -- com.intellij.openapi.project.DumbAwareAction -- ():V -- actionPerformed(com.intellij.openapi.actionSystem.AnActionEvent):V -- getActionUpdateThread():com.intellij.openapi.actionSystem.ActionUpdateThread -- update(com.intellij.openapi.actionSystem.AnActionEvent):V f:com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTrackerSettings - com.intellij.openapi.components.PersistentStateComponent - com.intellij.openapi.externalSystem.autoimport.ExternalSystemProjectTrackerSettings @@ -80,165 +67,6 @@ f:com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTrackerSetting - f:getAutoReloadType():com.intellij.openapi.externalSystem.autoimport.ExternalSystemProjectTrackerSettings$AutoReloadType - hashCode():I - f:setAutoReloadType(com.intellij.openapi.externalSystem.autoimport.ExternalSystemProjectTrackerSettings$AutoReloadType):V -f:com.intellij.openapi.externalSystem.autoimport.HideProjectRefreshAction -- com.intellij.openapi.project.DumbAwareAction -- ():V -- actionPerformed(com.intellij.openapi.actionSystem.AnActionEvent):V -- getActionUpdateThread():com.intellij.openapi.actionSystem.ActionUpdateThread -- update(com.intellij.openapi.actionSystem.AnActionEvent):V -a:com.intellij.openapi.externalSystem.autoimport.ProjectBatchFileChangeListener -- com.intellij.ide.file.BatchFileChangeListener -- (com.intellij.openapi.project.Project):V -- batchChangeCompleted():V -- f:batchChangeCompleted(com.intellij.openapi.project.Project):V -- f:batchChangeStarted(com.intellij.openapi.project.Project,java.lang.String):V -- batchChangeStarted(java.lang.String):V -f:com.intellij.openapi.externalSystem.autoimport.ProjectRefreshAction -- com.intellij.openapi.project.DumbAwareAction -- sf:Companion:com.intellij.openapi.externalSystem.autoimport.ProjectRefreshAction$Companion -- ():V -- actionPerformed(com.intellij.openapi.actionSystem.AnActionEvent):V -- getActionUpdateThread():com.intellij.openapi.actionSystem.ActionUpdateThread -- update(com.intellij.openapi.actionSystem.AnActionEvent):V -f:com.intellij.openapi.externalSystem.autoimport.ProjectRefreshAction$Companion -- f:refreshProject(com.intellij.openapi.project.Project):V -f:com.intellij.openapi.externalSystem.autoimport.ProjectRefreshAction$Manager -- sf:INSTANCE:com.intellij.openapi.externalSystem.autoimport.ProjectRefreshAction$Manager -- f:refreshProject(com.intellij.openapi.project.Project):V -f:com.intellij.openapi.externalSystem.autoimport.ProjectStatus -- sf:Companion:com.intellij.openapi.externalSystem.autoimport.ProjectStatus$Companion -- ():V -- (java.lang.String):V -- b:(java.lang.String,I,kotlin.jvm.internal.DefaultConstructorMarker):V -- f:getModificationType():com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType -- f:isDirty():Z -- f:isUpToDate():Z -- f:markBroken(J):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState -- f:markDirty(J,com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState -- bs:markDirty$default(com.intellij.openapi.externalSystem.autoimport.ProjectStatus,J,com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType,I,java.lang.Object):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState -- f:markModified(J,com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState -- bs:markModified$default(com.intellij.openapi.externalSystem.autoimport.ProjectStatus,J,com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType,I,java.lang.Object):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState -- f:markReverted(J):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState -- f:markSynchronized(J):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState -- f:update(com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState -f:com.intellij.openapi.externalSystem.autoimport.ProjectStatus$Companion -- f:merge(com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType,com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType):com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType -a:com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent -- sf:Companion:com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Companion -- a:getStamp():J -f:com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Break -- com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent -- (J):V -- f:component1():J -- f:copy(J):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Break -- bs:copy$default(com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Break,J,I,java.lang.Object):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Break -- equals(java.lang.Object):Z -- getStamp():J -- hashCode():I -f:com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Companion -- f:externalInvalidate(J):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Invalidate -- f:externalModify(J):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Modify -f:com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Invalidate -- com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent -- (J,com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType):V -- f:component1():J -- f:component2():com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType -- f:copy(J,com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Invalidate -- bs:copy$default(com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Invalidate,J,com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType,I,java.lang.Object):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Invalidate -- equals(java.lang.Object):Z -- getStamp():J -- f:getType():com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType -- hashCode():I -f:com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Modify -- com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent -- (J,com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType):V -- f:component1():J -- f:component2():com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType -- f:copy(J,com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Modify -- bs:copy$default(com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Modify,J,com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType,I,java.lang.Object):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Modify -- equals(java.lang.Object):Z -- getStamp():J -- f:getType():com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType -- hashCode():I -f:com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Revert -- com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent -- (J):V -- f:component1():J -- f:copy(J):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Revert -- bs:copy$default(com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Revert,J,I,java.lang.Object):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Revert -- equals(java.lang.Object):Z -- getStamp():J -- hashCode():I -f:com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Synchronize -- com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent -- (J):V -- f:component1():J -- f:copy(J):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Synchronize -- bs:copy$default(com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Synchronize,J,I,java.lang.Object):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectEvent$Synchronize -- equals(java.lang.Object):Z -- getStamp():J -- hashCode():I -a:com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState -- a:getStamp():J -f:com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Broken -- com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState -- (J):V -- f:component1():J -- f:copy(J):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Broken -- bs:copy$default(com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Broken,J,I,java.lang.Object):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Broken -- equals(java.lang.Object):Z -- getStamp():J -- hashCode():I -f:com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Dirty -- com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState -- (J,com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType):V -- f:component1():J -- f:component2():com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType -- f:copy(J,com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Dirty -- bs:copy$default(com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Dirty,J,com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType,I,java.lang.Object):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Dirty -- equals(java.lang.Object):Z -- getStamp():J -- f:getType():com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType -- hashCode():I -f:com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Modified -- com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState -- (J,com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType):V -- f:component1():J -- f:component2():com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType -- f:copy(J,com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Modified -- bs:copy$default(com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Modified,J,com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType,I,java.lang.Object):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Modified -- equals(java.lang.Object):Z -- getStamp():J -- f:getType():com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType -- hashCode():I -f:com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Reverted -- com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState -- (J):V -- f:component1():J -- f:copy(J):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Reverted -- bs:copy$default(com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Reverted,J,I,java.lang.Object):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Reverted -- equals(java.lang.Object):Z -- getStamp():J -- hashCode():I -f:com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Synchronized -- com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState -- (J):V -- f:component1():J -- f:copy(J):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Synchronized -- bs:copy$default(com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Synchronized,J,I,java.lang.Object):com.intellij.openapi.externalSystem.autoimport.ProjectStatus$ProjectState$Synchronized -- equals(java.lang.Object):Z -- getStamp():J -- hashCode():I -com.intellij.openapi.externalSystem.autoimport.changes.vfs.VirtualFileChangesListener -- sf:Companion:com.intellij.openapi.externalSystem.autoimport.changes.vfs.VirtualFileChangesListener$Companion -- apply():V -- init():V -- isProcessRecursively():Z -- isRelevant(com.intellij.openapi.vfs.VirtualFile,com.intellij.openapi.vfs.newvfs.events.VFileEvent):Z -- updateFile(com.intellij.openapi.vfs.VirtualFile,com.intellij.openapi.vfs.newvfs.events.VFileEvent):V -f:com.intellij.openapi.externalSystem.autoimport.changes.vfs.VirtualFileChangesListener$Companion -- f:installAsyncVirtualFileListener(com.intellij.openapi.externalSystem.autoimport.changes.vfs.VirtualFileChangesListener,com.intellij.openapi.Disposable):V -- f:installBulkVirtualFileListener(com.intellij.openapi.externalSystem.autoimport.changes.vfs.VirtualFileChangesListener,com.intellij.openapi.Disposable):V a:com.intellij.openapi.externalSystem.dependency.analyzer.AbstractDependencyAnalyzerAction - com.intellij.openapi.externalSystem.dependency.analyzer.DependencyAnalyzerAction - ():V @@ -265,13 +93,6 @@ a:com.intellij.openapi.externalSystem.dependency.analyzer.DependencyAnalyzerGoTo - a:getNavigatable(com.intellij.openapi.actionSystem.AnActionEvent):com.intellij.pom.Navigatable - f:getSystemId():com.intellij.openapi.externalSystem.model.ProjectSystemId - update(com.intellij.openapi.actionSystem.AnActionEvent):V -f:com.intellij.openapi.externalSystem.dependency.analyzer.DependencyAnalyzerManager -- sf:Companion:com.intellij.openapi.externalSystem.dependency.analyzer.DependencyAnalyzerManager$Companion -- (com.intellij.openapi.project.Project):V -- sf:getInstance(com.intellij.openapi.project.Project):com.intellij.openapi.externalSystem.dependency.analyzer.DependencyAnalyzerManager -- f:getOrCreate(com.intellij.openapi.externalSystem.model.ProjectSystemId):com.intellij.openapi.externalSystem.dependency.analyzer.DependencyAnalyzerView -f:com.intellij.openapi.externalSystem.dependency.analyzer.DependencyAnalyzerManager$Companion -- f:getInstance(com.intellij.openapi.project.Project):com.intellij.openapi.externalSystem.dependency.analyzer.DependencyAnalyzerManager a:com.intellij.openapi.externalSystem.dependency.analyzer.DependencyAnalyzerOpenConfigAction - com.intellij.openapi.project.DumbAwareAction - (com.intellij.openapi.externalSystem.model.ProjectSystemId):V @@ -280,12 +101,6 @@ a:com.intellij.openapi.externalSystem.dependency.analyzer.DependencyAnalyzerOpen - a:getConfigFile(com.intellij.openapi.actionSystem.AnActionEvent):com.intellij.openapi.vfs.VirtualFile - f:getSystemId():com.intellij.openapi.externalSystem.model.ProjectSystemId - update(com.intellij.openapi.actionSystem.AnActionEvent):V -a:com.intellij.openapi.externalSystem.dependency.analyzer.DummyDependencyAnalyzerContributor -- com.intellij.openapi.externalSystem.dependency.analyzer.DependencyAnalyzerContributor -- (com.intellij.openapi.project.Project):V -- getDependencies(com.intellij.openapi.externalSystem.dependency.analyzer.DependencyAnalyzerProject):java.util.List -- getDependencyScopes(com.intellij.openapi.externalSystem.dependency.analyzer.DependencyAnalyzerProject):java.util.List -- getProjects():java.util.List a:com.intellij.openapi.externalSystem.dependency.analyzer.ExternalSystemDependencyAnalyzerOpenConfigAction - com.intellij.openapi.externalSystem.dependency.analyzer.DependencyAnalyzerOpenConfigAction - (com.intellij.openapi.externalSystem.model.ProjectSystemId):V @@ -316,16 +131,6 @@ a:com.intellij.openapi.externalSystem.importing.ExternalProjectStructureCustomiz - getPublicDataKeys():java.util.Set - getRepresentationName(com.intellij.openapi.externalSystem.model.DataNode):com.intellij.openapi.util.Couple - a:suggestIcon(com.intellij.openapi.externalSystem.model.DataNode,com.intellij.openapi.externalSystem.ExternalSystemUiAware):javax.swing.Icon -*f:com.intellij.openapi.externalSystem.importing.GAVStateComponent -- com.intellij.openapi.components.PersistentStateComponent -- ():V -- addMapping(java.lang.String,java.lang.String,java.lang.String,java.lang.String):V -- getMapping():java.util.Map -- getState():com.intellij.openapi.externalSystem.importing.GAVStateComponent$State -- loadState(com.intellij.openapi.externalSystem.importing.GAVStateComponent$State):V -*f:com.intellij.openapi.externalSystem.importing.GAVStateComponent$State -- f:moduleMapping:java.util.Set -- ():V *c:com.intellij.openapi.externalSystem.issue.BuildIssueException - com.intellij.openapi.externalSystem.model.ExternalSystemException - com.intellij.build.issue.BuildIssueProvider diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/DetachExternalProjectAction.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/DetachExternalProjectAction.java index 1fd0b60d6a8a..db3a70b2789f 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/DetachExternalProjectAction.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/DetachExternalProjectAction.java @@ -1,4 +1,4 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.externalSystem.action; import com.intellij.icons.AllIcons; @@ -20,6 +20,7 @@ import com.intellij.openapi.externalSystem.view.ProjectNode; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleManager; import com.intellij.openapi.project.Project; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -27,6 +28,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +@ApiStatus.Internal public class DetachExternalProjectAction extends ExternalSystemNodeAction { public DetachExternalProjectAction() { diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/RefreshAllExternalProjectsAction.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/RefreshAllExternalProjectsAction.java index 14a8afd8c3b9..0f4c37e7776c 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/RefreshAllExternalProjectsAction.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/RefreshAllExternalProjectsAction.java @@ -1,4 +1,4 @@ -// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.externalSystem.action; import com.intellij.openapi.actionSystem.ActionUpdateThread; @@ -17,6 +17,7 @@ import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.project.DumbAwareAction; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.text.StringUtil; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; @@ -26,6 +27,7 @@ import java.util.List; * Forces the ide to retrieve the most up-to-date info about the linked external projects and updates project state if necessary * (e.g. imports missing libraries). */ +@ApiStatus.Internal public class RefreshAllExternalProjectsAction extends DumbAwareAction { public RefreshAllExternalProjectsAction() { getTemplatePresentation().setText(ExternalSystemBundle.messagePointer("action.refresh.all.projects.text", "External")); diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/HideProjectRefreshAction.kt b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/HideProjectRefreshAction.kt index d58659847189..631b4ad3937b 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/HideProjectRefreshAction.kt +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/HideProjectRefreshAction.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.externalSystem.autoimport import com.intellij.icons.AllIcons @@ -6,7 +6,9 @@ import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.externalSystem.util.ExternalSystemBundle import com.intellij.openapi.project.DumbAwareAction +import org.jetbrains.annotations.ApiStatus +@ApiStatus.Internal class HideProjectRefreshAction : DumbAwareAction() { override fun actionPerformed(e: AnActionEvent) { val project = e.project ?: return diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/ProjectBatchFileChangeListener.kt b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/ProjectBatchFileChangeListener.kt index 067365b76271..5f3717a661b3 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/ProjectBatchFileChangeListener.kt +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/ProjectBatchFileChangeListener.kt @@ -1,9 +1,11 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.externalSystem.autoimport import com.intellij.ide.file.BatchFileChangeListener import com.intellij.openapi.project.Project +import org.jetbrains.annotations.ApiStatus +@ApiStatus.Internal abstract class ProjectBatchFileChangeListener(private val project: Project) : BatchFileChangeListener { open fun batchChangeStarted(activityName: String?) {} diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/ProjectRefreshAction.kt b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/ProjectRefreshAction.kt index 1a7dc1fd2982..7605afaf4b26 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/ProjectRefreshAction.kt +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/ProjectRefreshAction.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.externalSystem.autoimport import com.intellij.icons.AllIcons @@ -15,6 +15,7 @@ import com.intellij.openapi.util.NlsActions import org.jetbrains.annotations.ApiStatus import javax.swing.Icon +@ApiStatus.Internal class ProjectRefreshAction : DumbAwareAction() { override fun actionPerformed(e: AnActionEvent) { val project = e.project ?: return diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/ProjectStatus.kt b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/ProjectStatus.kt index 735711997207..16787e2a5ba9 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/ProjectStatus.kt +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/ProjectStatus.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.externalSystem.autoimport @@ -6,9 +6,11 @@ import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.externalSystem.autoimport.ExternalSystemModificationType.* import com.intellij.openapi.externalSystem.autoimport.ProjectStatus.ProjectEvent.* import com.intellij.openapi.externalSystem.autoimport.ProjectStatus.ProjectState.* +import org.jetbrains.annotations.ApiStatus import java.util.concurrent.atomic.AtomicReference import kotlin.math.max +@ApiStatus.Internal class ProjectStatus(private val debugName: String? = null) { private var state = AtomicReference(Synchronized(-1) as ProjectState) diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/changes/vfs/VirtualFileChangesListener.kt b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/changes/vfs/VirtualFileChangesListener.kt index fcce98171098..15c934c7a7b7 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/changes/vfs/VirtualFileChangesListener.kt +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/autoimport/changes/vfs/VirtualFileChangesListener.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.externalSystem.autoimport.changes.vfs import com.intellij.openapi.Disposable @@ -8,7 +8,9 @@ import com.intellij.openapi.vfs.VirtualFile import com.intellij.openapi.vfs.VirtualFileManager import com.intellij.openapi.vfs.newvfs.BulkFileListener import com.intellij.openapi.vfs.newvfs.events.VFileEvent +import org.jetbrains.annotations.ApiStatus +@ApiStatus.Internal interface VirtualFileChangesListener { fun isProcessRecursively(): Boolean = false diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/dependency/analyzer/DependencyAnalyzerManager.kt b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/dependency/analyzer/DependencyAnalyzerManager.kt index 4070a7fdb437..4a6eac27278e 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/dependency/analyzer/DependencyAnalyzerManager.kt +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/dependency/analyzer/DependencyAnalyzerManager.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.externalSystem.dependency.analyzer import com.intellij.openapi.components.Service @@ -7,8 +7,10 @@ import com.intellij.openapi.externalSystem.model.ProjectSystemId import com.intellij.openapi.fileEditor.FileEditorManager import com.intellij.openapi.observable.util.whenDisposed import com.intellij.openapi.project.Project +import org.jetbrains.annotations.ApiStatus @Service(Service.Level.PROJECT) +@ApiStatus.Internal class DependencyAnalyzerManager(private val project: Project) { private val files = HashMap() diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/dependency/analyzer/DummyDependencyAnalyzerContributor.kt b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/dependency/analyzer/DummyDependencyAnalyzerContributor.kt deleted file mode 100644 index d2b8d39f2657..000000000000 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/dependency/analyzer/DummyDependencyAnalyzerContributor.kt +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -package com.intellij.openapi.externalSystem.dependency.analyzer - -import com.intellij.openapi.externalSystem.dependency.analyzer.DependencyAnalyzerDependency as Dependency -import com.intellij.openapi.externalSystem.util.ExternalSystemBundle -import com.intellij.openapi.project.Project -import com.intellij.openapi.project.modules -import com.intellij.openapi.util.NlsSafe -import com.intellij.openapi.util.text.StringUtil -import com.intellij.util.LocalTimeCounter - -@Suppress("HardCodedStringLiteral", "unused") -abstract class DummyDependencyAnalyzerContributor(private val project: Project) : DependencyAnalyzerContributor { - - private fun scope(name: @NlsSafe String) = - DAScope(name, StringUtil.toTitleCase(name)) - - override fun getProjects() = - project.modules.map { DAProject(it, it.name) } - - override fun getDependencyScopes(externalProject: DependencyAnalyzerProject) = listOf( - scope("compile"), - scope("runtime"), - scope("provided"), - scope("test"), - scope("system"), - scope("import"), - scope("scope" + LocalTimeCounter.currentTime()) - ) - - private fun getRoot(externalProject: DependencyAnalyzerProject): Dependency { - return createDependency(DAModule(externalProject.module.name), scope("compile"), null) - } - - private fun getDependencies(dependency: Dependency): List { - return when (dependency.data.id) { - "parent1" -> listOf( - createDependency(DAArtifact("org.hamcrest", "hamcrest", "2.2"), scope("compile"), dependency), - createDependency(DAArtifact("org.hamcrest", "hamcrest-core", "2.2"), scope("runtime"), dependency), - createDependency(DAArtifact("org.junit.jupiter", "junit-jupiter-api", "5.8.0"), scope("provided"), dependency), - createDependency(DAArtifact("org.junit.jupiter", "junit-jupiter-engine", "5.8.0"), scope("test"), dependency), - createDependency(DAArtifact("org.junit.platform", "junit-platform-commons", "1.8.0"), scope("system"), dependency), - createDependency(DAArtifact("org.junit.platform", "junit-platform-engine", "1.8.0"), scope("import"), dependency) - ) - "parent2" -> listOf( - createDependency(DAArtifact("org.hamcrest", "hamcrest-core", "1.3"), scope("compile"), dependency) - ) - "module" -> listOf( - createDependency(DAModule("parent1"), scope("compile"), dependency), - createDependency(DAModule("parent2"), scope("compile"), dependency) - ) - "org.hamcrest:hamcrest-core:2.2" -> listOf( - createDependency(DAArtifact("org.hamcrest", "hamcrest", "2.2"), scope("compile"), dependency) - ) - "org.hamcrest:hamcrest-core:1.3" -> listOf( - createDependency(DAArtifact("org.hamcrest", "hamcrest", "1.3"), scope("compile"), dependency) - ) - "org.junit.jupiter:junit-jupiter-api:5.8.0" -> listOf( - createDependency(DAArtifact("org.opentest4j", "opentest4j", "1.2.0"), scope("compile"), dependency), - createDependency(DAArtifact("org.junit.platform", "junit-platform-commons", "1.8.0"), scope("compile"), dependency), - createDependency(DAArtifact("org.apiguardian", "apiguardian-api", "1.1.2"), scope("compile"), dependency) - ) - "org.junit.jupiter:junit-jupiter-engine:5.8.0" -> listOf( - createDependency(DAArtifact("org.junit.platform", "junit-platform-engine", "1.8.0"), scope("compile"), dependency), - createDependency(DAArtifact("org.junit.jupiter", "junit-jupiter-api", "5.8.0"), scope("compile"), dependency), - createDependency(DAArtifact("org.apiguardian", "apiguardian-api", "1.1.2"), scope("compile"), dependency) - ) - "org.junit.platform:junit-platform-commons:1.8.0" -> listOf( - createDependency(DAArtifact("org.apiguardian", "apiguardian-api", "1.1.2"), scope("compile"), dependency) - ) - "org.junit.platform:junit-platform-engine:1.8.0" -> listOf( - createDependency(DAArtifact("org.opentest4j", "opentest4j", "1.2.0"), scope("compile"), dependency), - createDependency(DAArtifact("org.junit.platform", "junit-platform-commons", "1.8.0"), scope("compile"), dependency), - createDependency(DAArtifact("org.apiguardian", "apiguardian-api", "1.1.2"), scope("compile"), dependency) - ) - else -> emptyList() - } - } - - override fun getDependencies(externalProject: DependencyAnalyzerProject): List { - val dependencies = ArrayList() - val queue = ArrayDeque() - queue.add(getRoot(externalProject)) - while (queue.isNotEmpty()) { - val dependency = queue.removeFirst() - dependencies.add(dependency) - getDependencies(dependency) - .forEach(queue::addLast) - } - return dependencies - } - - private fun getStatus(data: Dependency.Data, usage: Dependency?): List { - when (data.id) { - "org.hamcrest:hamcrest-core:1.3" -> - if (matchesUsagePathPrefix(usage, "parent2", "module")) { - return listOf(createVersionConflict("2.2"), DAOmitted) - } - "org.hamcrest:hamcrest:1.3" -> - if (matchesUsagePathPrefix(usage, "org.hamcrest:hamcrest-core:1.3", "parent2", "module")) { - return listOf(createVersionConflict("2.2"), DAOmitted) - } - "org.hamcrest:hamcrest-core:2.2" -> { - if (matchesUsagePathPrefix(usage, "parent1", "module")) { - return listOf(createVersionConflict("1.3")) - } - if (!matchesUsagePathPrefix(usage, "parent1")) { - return listOf(DAOmitted) - } - } - "org.hamcrest:hamcrest:2.2" -> { - if (matchesUsagePathPrefix(usage, "org.hamcrest:hamcrest-core:2.2", "parent1", "module")) { - return listOf(createVersionConflict("1.3")) - } - if (!matchesUsagePathPrefix(usage, "parent1")) { - return listOf(DAOmitted) - } - } - "org.junit.jupiter:junit-jupiter-api:5.8.0" -> - if (!matchesUsagePathPrefix(usage, "parent1")) { - return listOf(DAOmitted) - } - "org.junit.jupiter:junit-jupiter-engine:5.8.0" -> - if (!matchesUsagePathPrefix(usage, "parent1")) { - return listOf(DAOmitted) - } - "org.junit.platform:junit-platform-commons:1.8.0" -> - if (!matchesUsagePathPrefix(usage, "parent1")) { - return listOf(DAOmitted) - } - "org.junit.platform:junit-platform-engine:1.8.0" -> - if (!matchesUsagePathPrefix(usage, "parent1")) { - return listOf(DAOmitted) - } - "org.opentest4j:opentest4j:1.2.0" -> - if (!matchesUsagePathPrefix(usage, "org.junit.jupiter:junit-jupiter-api:5.8.0", "parent1")) { - return listOf(DAOmitted) - } - "org.apiguardian:apiguardian-api:1.1.2" -> - if (!matchesUsagePathPrefix(usage, "org.junit.jupiter:junit-jupiter-api:5.8.0", "parent1")) { - return listOf(DAOmitted) - } - } - return emptyList() - } - - private fun createDependency(data: Dependency.Data, scope: Dependency.Scope, usage: Dependency?) = - DADependency(data, scope, usage, getStatus(data, usage)) - - private fun createVersionConflict(conflictedVersion: String) = - DAWarning(ExternalSystemBundle.message("external.system.dependency.analyzer.warning.version.conflict", conflictedVersion)) - - private fun matchesUsagePathPrefix(dependency: Dependency?, vararg ids: String): Boolean { - if (ids.isEmpty()) return true - return dependency?.data?.id == ids.first() && - matchesUsagePathPrefix(dependency.parent, *ids.drop(1).toTypedArray()) - } - - private val Dependency.Data.id - get() = when (this) { - is Dependency.Data.Module -> name - is Dependency.Data.Artifact -> "$groupId:$artifactId:$version" - } -} \ No newline at end of file diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/importing/GAVStateComponent.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/importing/GAVStateComponent.java index 7d1e91681109..79a845afc28f 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/importing/GAVStateComponent.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/importing/GAVStateComponent.java @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.externalSystem.importing; import com.intellij.openapi.components.PersistentStateComponent; @@ -13,7 +13,7 @@ import org.jetbrains.annotations.Nullable; import java.util.*; @Service(Service.Level.PROJECT) -@ApiStatus.Experimental +@ApiStatus.Internal @State(name = "ExternalSystem.GAVStateComponent", storages = @Storage("jps2ext.xml")) public final class GAVStateComponent implements PersistentStateComponent { public static final class State { diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/importing/JpsDependencyContributor.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/importing/JpsDependencyContributor.java index afc39d31a94e..1deedc6e7256 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/importing/JpsDependencyContributor.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/importing/JpsDependencyContributor.java @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.externalSystem.importing; import com.intellij.openapi.externalSystem.model.project.ProjectCoordinate; @@ -8,7 +8,7 @@ import com.intellij.openapi.util.registry.Registry; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; -@ApiStatus.Experimental +@ApiStatus.Internal final class JpsDependencyContributor implements ExternalSystemWorkspaceContributor { @Override public @Nullable ProjectCoordinate findProjectId(Module module) {