mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-06 06:21:16 +07:00
External-system: IDEA-124927 Don't refresh projects on opening when auto-import is disabled
This commit is contained in:
+1
@@ -40,6 +40,7 @@ public class ExternalSystemDataKeys {
|
||||
= DataKey.create("external.system.recent.tasks.list");
|
||||
|
||||
@NotNull public static final Key<Boolean> NEWLY_IMPORTED_PROJECT = new Key<Boolean>("external.system.newly.imported");
|
||||
@NotNull public static final Key<Boolean> NEWLY_CREATED_PROJECT = new Key<Boolean>("external.system.newly.created");
|
||||
|
||||
private ExternalSystemDataKeys() {
|
||||
}
|
||||
|
||||
+10
-3
@@ -52,9 +52,16 @@ public class ExternalSystemStartupActivity implements StartupActivity {
|
||||
}
|
||||
if (project.getUserData(ExternalSystemDataKeys.NEWLY_IMPORTED_PROJECT) != Boolean.TRUE) {
|
||||
for (ExternalSystemManager manager : ExternalSystemManager.EP_NAME.getExtensions()) {
|
||||
ExternalSystemUtil.refreshProjects(
|
||||
new ImportSpecBuilder(project, manager.getSystemId()).whenAutoImportEnabled()
|
||||
);
|
||||
if (project.getUserData(ExternalSystemDataKeys.NEWLY_CREATED_PROJECT) == Boolean.TRUE) {
|
||||
ExternalSystemUtil.refreshProjects(
|
||||
new ImportSpecBuilder(project, manager.getSystemId())
|
||||
);
|
||||
}
|
||||
else {
|
||||
ExternalSystemUtil.refreshProjects(
|
||||
new ImportSpecBuilder(project, manager.getSystemId()).whenAutoImportEnabled()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
ExternalSystemAutoImporter.letTheMagicBegin(project);
|
||||
|
||||
+2
@@ -22,6 +22,7 @@ import com.intellij.ide.util.projectWizard.ModuleWizardStep;
|
||||
import com.intellij.ide.util.projectWizard.WizardContext;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.externalSystem.model.ExternalSystemDataKeys;
|
||||
import com.intellij.openapi.externalSystem.service.project.wizard.AbstractExternalModuleBuilder;
|
||||
import com.intellij.openapi.externalSystem.service.project.wizard.ExternalModuleSettingsStep;
|
||||
import com.intellij.openapi.externalSystem.settings.AbstractExternalSystemSettings;
|
||||
@@ -111,6 +112,7 @@ public class GradleModuleBuilder extends AbstractExternalModuleBuilder<GradlePro
|
||||
String externalProjectPath = FileUtil.toCanonicalPath(project.getBasePath());
|
||||
getExternalProjectSettings().setExternalProjectPath(externalProjectPath);
|
||||
AbstractExternalSystemSettings settings = ExternalSystemApiUtil.getSettings(project, GradleConstants.SYSTEM_ID);
|
||||
project.putUserData(ExternalSystemDataKeys.NEWLY_CREATED_PROJECT, Boolean.TRUE);
|
||||
//noinspection unchecked
|
||||
settings.linkProject(getExternalProjectSettings());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user