diff --git a/docs/plugin-graph/plugin-graph.json b/docs/plugin-graph/plugin-graph.json
index 07bb3ca64864..a547168f56f0 100644
--- a/docs/plugin-graph/plugin-graph.json
+++ b/docs/plugin-graph/plugin-graph.json
@@ -2100,18 +2100,6 @@
"parent": "cT41",
"type": 0
}
-}, {
- "group": "nodes",
- "data": {
- "id": "kP",
- "name": "intellij.performanceTesting.gradle",
- "n": "i.performanceTesting.gradle",
- "package": "com.jetbrains.performancePlugin.gradle",
- "sourceModule": "intellij.performanceTesting.gradle",
- "descriptor": "plugins/performanceTesting/gradle/resources/META-INF/plugin.xml",
- "pluginId": "com.jetbrains.performancePlugin.gradle",
- "type": 1
- }
}, {
"group": "nodes",
"data": {
diff --git a/native/XPlatLauncher/resources/product_info_linux.json b/native/XPlatLauncher/resources/product_info_linux.json
index f4fe3e1a0c2c..3ef41bf9b273 100644
--- a/native/XPlatLauncher/resources/product_info_linux.json
+++ b/native/XPlatLauncher/resources/product_info_linux.json
@@ -160,7 +160,6 @@
"com.jetbrains.packagesearch.intellij-plugin",
"com.jetbrains.performancePlugin",
"com.jetbrains.performancePlugin.dynamicPlugins",
- "com.jetbrains.performancePlugin.gradle",
"com.jetbrains.performancePlugin.java",
"com.jetbrains.performancePlugin.kotlin",
"com.jetbrains.performancePlugin.workspaceModel",
diff --git a/native/XPlatLauncher/resources/product_info_macos.json b/native/XPlatLauncher/resources/product_info_macos.json
index e0114979173b..811680cc6ea2 100644
--- a/native/XPlatLauncher/resources/product_info_macos.json
+++ b/native/XPlatLauncher/resources/product_info_macos.json
@@ -162,7 +162,6 @@
"com.jetbrains.packagesearch.intellij-plugin",
"com.jetbrains.performancePlugin",
"com.jetbrains.performancePlugin.dynamicPlugins",
- "com.jetbrains.performancePlugin.gradle",
"com.jetbrains.performancePlugin.java",
"com.jetbrains.performancePlugin.kotlin",
"com.jetbrains.performancePlugin.workspaceModel",
diff --git a/native/XPlatLauncher/resources/product_info_windows.json b/native/XPlatLauncher/resources/product_info_windows.json
index 10691b4db44a..e61335654443 100644
--- a/native/XPlatLauncher/resources/product_info_windows.json
+++ b/native/XPlatLauncher/resources/product_info_windows.json
@@ -159,7 +159,6 @@
"com.jetbrains.packagesearch.intellij-plugin",
"com.jetbrains.performancePlugin",
"com.jetbrains.performancePlugin.dynamicPlugins",
- "com.jetbrains.performancePlugin.gradle",
"com.jetbrains.performancePlugin.java",
"com.jetbrains.performancePlugin.kotlin",
"com.jetbrains.performancePlugin.workspaceModel",
diff --git a/plugins/gradle/java/intellij.gradle.java.iml b/plugins/gradle/java/intellij.gradle.java.iml
index c2739d65546a..e3e200b0bda2 100644
--- a/plugins/gradle/java/intellij.gradle.java.iml
+++ b/plugins/gradle/java/intellij.gradle.java.iml
@@ -45,5 +45,6 @@
+
\ No newline at end of file
diff --git a/plugins/gradle/java/resources/META-INF/gradle-performance-plugin-support.xml b/plugins/gradle/java/resources/META-INF/gradle-performance-plugin-support.xml
new file mode 100644
index 000000000000..a76521eddf7e
--- /dev/null
+++ b/plugins/gradle/java/resources/META-INF/gradle-performance-plugin-support.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/plugins/gradle/java/resources/META-INF/plugin.xml b/plugins/gradle/java/resources/META-INF/plugin.xml
index 4abb66902ce2..90020c85e002 100644
--- a/plugins/gradle/java/resources/META-INF/plugin.xml
+++ b/plugins/gradle/java/resources/META-INF/plugin.xml
@@ -18,6 +18,7 @@
org.intellij.groovy
com.intellij.properties
org.toml.lang
+ com.jetbrains.performancePlugin
messages.GradleInspectionBundle
diff --git a/plugins/gradle/java/resources/commandDescriptions/importGradleProjectCommand.html b/plugins/gradle/java/resources/commandDescriptions/importGradleProjectCommand.html
new file mode 100644
index 000000000000..f299434e93ae
--- /dev/null
+++ b/plugins/gradle/java/resources/commandDescriptions/importGradleProjectCommand.html
@@ -0,0 +1,14 @@
+
+
Command imports gradle project
+
+
+ Simulate invocation of reimport of gradle project.
+
+
+ Syntax: %importGradleProject
+
+
+ Example: %importGradleProject
+
+
+
\ No newline at end of file
diff --git a/plugins/gradle/java/src/performanceTesting/GradleCommandProvider.java b/plugins/gradle/java/src/performanceTesting/GradleCommandProvider.java
new file mode 100644
index 000000000000..d4059d8f0d30
--- /dev/null
+++ b/plugins/gradle/java/src/performanceTesting/GradleCommandProvider.java
@@ -0,0 +1,15 @@
+// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
+package org.jetbrains.plugins.gradle.performanceTesting;
+
+import com.jetbrains.performancePlugin.CommandProvider;
+import com.jetbrains.performancePlugin.CreateCommand;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Map;
+
+final class GradleCommandProvider implements CommandProvider {
+ @Override
+ public @NotNull Map getCommands() {
+ return Map.of(ImportGradleProjectCommand.PREFIX, ImportGradleProjectCommand::new);
+ }
+}
diff --git a/plugins/gradle/java/src/performanceTesting/ImportGradleProjectCommand.java b/plugins/gradle/java/src/performanceTesting/ImportGradleProjectCommand.java
new file mode 100644
index 000000000000..5c0d632af042
--- /dev/null
+++ b/plugins/gradle/java/src/performanceTesting/ImportGradleProjectCommand.java
@@ -0,0 +1,217 @@
+// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
+package org.jetbrains.plugins.gradle.performanceTesting;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.externalSystem.autoimport.ExternalSystemProjectTrackerSettings;
+import com.intellij.openapi.externalSystem.importing.ImportSpecBuilder;
+import com.intellij.openapi.externalSystem.model.DataNode;
+import com.intellij.openapi.externalSystem.model.project.ProjectData;
+import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskType;
+import com.intellij.openapi.externalSystem.service.internal.ExternalSystemProcessingManager;
+import com.intellij.openapi.externalSystem.service.project.ExternalProjectRefreshCallback;
+import com.intellij.openapi.externalSystem.service.project.manage.ExternalProjectsManagerImpl;
+import com.intellij.openapi.externalSystem.service.project.manage.ProjectDataImportListener;
+import com.intellij.openapi.externalSystem.settings.ExternalProjectSettings;
+import com.intellij.openapi.externalSystem.util.ExternalSystemUtil;
+import com.intellij.openapi.project.DumbService;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.project.ProjectUtil;
+import com.intellij.openapi.ui.playback.PlaybackContext;
+import com.intellij.openapi.ui.playback.commands.AbstractCommand;
+import com.intellij.openapi.util.ActionCallback;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.util.DisposeAwareRunnable;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.messages.SimpleMessageBusConnection;
+import com.jetbrains.performancePlugin.utils.ActionCallbackProfilerStopper;
+import org.gradle.util.GradleVersion;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.concurrency.AsyncPromise;
+import org.jetbrains.concurrency.Promise;
+import org.jetbrains.concurrency.Promises;
+import org.jetbrains.plugins.gradle.service.project.open.GradleProjectImportUtil;
+import org.jetbrains.plugins.gradle.settings.GradleDefaultProjectSettings;
+import org.jetbrains.plugins.gradle.settings.GradleProjectSettings;
+import org.jetbrains.plugins.gradle.settings.GradleSettings;
+import org.jetbrains.plugins.gradle.util.GradleConstants;
+import org.jetbrains.plugins.gradle.util.GradleJvmResolutionUtil;
+import org.jetbrains.plugins.gradle.util.GradleJvmValidationUtil;
+import org.jetbrains.plugins.gradle.util.SuggestGradleVersionOptions;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import static org.jetbrains.plugins.gradle.util.GradleJvmSupportMatrices.suggestGradleVersion;
+
+public final class ImportGradleProjectCommand extends AbstractCommand {
+ public static final String PREFIX = "%importGradleProject";
+
+ public ImportGradleProjectCommand(@NotNull String text, int line) {
+ super(text, line);
+ }
+
+ @NotNull
+ @Override
+ protected Promise