Search in sources :

Example 16 with BlazeImportSettings

use of com.google.idea.blaze.base.settings.BlazeImportSettings in project intellij by bazelbuild.

the class BlazeSyncManager method requestProjectSync.

/**
 * Requests a project sync with Blaze.
 */
public void requestProjectSync(BlazeSyncParams syncParams) {
    if (syncParams.syncMode == SyncMode.NO_BUILD && !syncParams.backgroundSync && !SyncDirectoriesWarning.warn(project)) {
        return;
    }
    StartupManager.getInstance(project).runWhenProjectIsInitialized(() -> {
        BlazeImportSettings importSettings = BlazeImportSettingsManager.getInstance(project).getImportSettings();
        if (importSettings == null) {
            throw new IllegalStateException(String.format("Attempt to sync non-%s project.", Blaze.buildSystemName(project)));
        }
        if (runInitialDirectoryOnlySync(syncParams)) {
            BlazeSyncParams params = new BlazeSyncParams.Builder("Initial directory update", BlazeSyncParams.SyncMode.NO_BUILD).build();
            submitTask(new BlazeSyncTask(project, importSettings, params));
        }
        submitTask(new BlazeSyncTask(project, importSettings, syncParams));
    });
}
Also used : BlazeImportSettings(com.google.idea.blaze.base.settings.BlazeImportSettings)

Aggregations

BlazeImportSettings (com.google.idea.blaze.base.settings.BlazeImportSettings)16 BlazeImportSettingsManager (com.google.idea.blaze.base.settings.BlazeImportSettingsManager)8 File (java.io.File)6 WorkspaceRoot (com.google.idea.blaze.base.model.primitives.WorkspaceRoot)4 Nullable (javax.annotation.Nullable)4 MockExperimentService (com.google.idea.common.experiments.MockExperimentService)3 VirtualFileManager (com.intellij.openapi.vfs.VirtualFileManager)3 MockBlazeExecutor (com.google.idea.blaze.base.async.executor.MockBlazeExecutor)2 BazelBuildSystemProvider (com.google.idea.blaze.base.bazel.BazelBuildSystemProvider)2 BuildSystemProvider (com.google.idea.blaze.base.bazel.BuildSystemProvider)2 VirtualFileSystemProvider (com.google.idea.blaze.base.io.VirtualFileSystemProvider)2 WorkspacePath (com.google.idea.blaze.base.model.primitives.WorkspacePath)2 MockModule (com.intellij.mock.MockModule)2 MockPsiManager (com.intellij.mock.MockPsiManager)2 MockFileTypeManager (com.intellij.openapi.fileTypes.MockFileTypeManager)2 ProgressManagerImpl (com.intellij.openapi.progress.impl.ProgressManagerImpl)2 LocalFileSystem (com.intellij.openapi.vfs.LocalFileSystem)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 ProjectScopeBuilderImpl (com.intellij.psi.search.ProjectScopeBuilderImpl)2 IOException (java.io.IOException)2