Search in sources :

Example 6 with BuckBuildManager

use of com.facebook.buck.intellij.ideabuck.build.BuckBuildManager in project buck by facebook.

the class BuckTestAction method executeOnPooledThread.

@Override
public void executeOnPooledThread(final AnActionEvent e) {
    Project project = e.getProject();
    BuckBuildManager buildManager = BuckBuildManager.getInstance(project);
    String target = buildManager.getCurrentSavedTarget(project);
    BuckModule buckModule = project.getComponent(BuckModule.class);
    buckModule.attach(target);
    if (target == null) {
        buildManager.showNoTargetMessage(project);
        return;
    }
    // Initiate a buck test
    BuckBuildCommandHandler handler = new BuckBuildCommandHandler(project, project.getBaseDir(), BuckCommand.TEST);
    handler.command().addParameter(target);
    buildManager.runBuckCommandWhileConnectedToBuck(handler, ACTION_TITLE, buckModule);
}
Also used : Project(com.intellij.openapi.project.Project) BuckModule(com.facebook.buck.intellij.ideabuck.config.BuckModule) BuckBuildManager(com.facebook.buck.intellij.ideabuck.build.BuckBuildManager) BuckBuildCommandHandler(com.facebook.buck.intellij.ideabuck.build.BuckBuildCommandHandler)

Example 7 with BuckBuildManager

use of com.facebook.buck.intellij.ideabuck.build.BuckBuildManager in project buck by facebook.

the class BuckUninstallAction method executeOnPooledThread.

@Override
public void executeOnPooledThread(final AnActionEvent e) {
    Project project = e.getProject();
    BuckBuildManager buildManager = BuckBuildManager.getInstance(project);
    String target = buildManager.getCurrentSavedTarget(project);
    BuckModule buckModule = project.getComponent(BuckModule.class);
    buckModule.attach(target);
    if (target == null) {
        buildManager.showNoTargetMessage(project);
        return;
    }
    // Initiate a buck uninstall
    BuckBuildCommandHandler handler = new BuckBuildCommandHandler(project, project.getBaseDir(), BuckCommand.UNINSTALL);
    handler.command().addParameter(target);
    buildManager.runBuckCommandWhileConnectedToBuck(handler, ACTION_TITLE, buckModule);
}
Also used : Project(com.intellij.openapi.project.Project) BuckModule(com.facebook.buck.intellij.ideabuck.config.BuckModule) BuckBuildManager(com.facebook.buck.intellij.ideabuck.build.BuckBuildManager) BuckBuildCommandHandler(com.facebook.buck.intellij.ideabuck.build.BuckBuildCommandHandler)

Example 8 with BuckBuildManager

use of com.facebook.buck.intellij.ideabuck.build.BuckBuildManager in project buck by facebook.

the class TestConfiguration method getState.

@Nullable
@Override
public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment environment) throws ExecutionException {
    final BuckBuildManager buildManager = BuckBuildManager.getInstance(getProject());
    if (buildManager.isBuilding()) {
        final Notification notification = new Notification("", "Can't run test. Buck is already running!", "", NotificationType.ERROR);
        Notifications.Bus.notify(notification);
        return null;
    }
    return new TestExecutionState(this, getProject());
}
Also used : BuckBuildManager(com.facebook.buck.intellij.ideabuck.build.BuckBuildManager) Notification(com.intellij.notification.Notification) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

BuckBuildManager (com.facebook.buck.intellij.ideabuck.build.BuckBuildManager)8 Project (com.intellij.openapi.project.Project)6 BuckBuildCommandHandler (com.facebook.buck.intellij.ideabuck.build.BuckBuildCommandHandler)5 BuckModule (com.facebook.buck.intellij.ideabuck.config.BuckModule)5 BuckCommandHandler (com.facebook.buck.intellij.ideabuck.build.BuckCommandHandler)1 BuckQueryCommandHandler (com.facebook.buck.intellij.ideabuck.build.BuckQueryCommandHandler)1 BuckSettingsProvider (com.facebook.buck.intellij.ideabuck.config.BuckSettingsProvider)1 Function (com.google.common.base.Function)1 Notification (com.intellij.notification.Notification)1 List (java.util.List)1 Matcher (java.util.regex.Matcher)1 Nullable (javax.annotation.Nullable)1 Nullable (org.jetbrains.annotations.Nullable)1