Java 类com.intellij.lang.ant.config.execution.ExecutionHandler 实例源码

项目:hybris-integration-intellij-idea-plugin    文件:HybrisAntBuildListener.java   
private void triggerCleanAll(final Project project) {
    final HybrisProjectSettings yProjectSettings = HybrisProjectSettingsComponent.getInstance(project).getState();
    final File platformDir = new File(project.getBasePath() + "/" +
                                      yProjectSettings.getHybrisDirectory() + PLATFORM_MODULE_PREFIX);
    final VirtualFile vfPlatformDir = VfsUtil.findFileByIoFile(platformDir, true);
    final VirtualFile vfBuildFile = VfsUtil.findRelativeFile(vfPlatformDir, HybrisConstants.ANT_BUILD_XML);

    if (vfBuildFile == null) {
        return;
    }
    final PsiFile psiBuildFile = PsiManager.getInstance(project).findFile(vfBuildFile);

    if (psiBuildFile == null) {
        return;
    }
    final AntConfigurationBase antConfiguration = AntConfigurationBase.getInstance(project);
    final AntBuildFileBase antBuildFile = antConfiguration.getAntBuildFile(psiBuildFile);

    if (antBuildFile != null) {
        ExecutionHandler.runBuild(
            antBuildFile,
            antCleanAll,
            null,
            getDataContext(project),
            Collections.emptyList(),
            AntBuildListener.NULL
        );
    }
}
项目:intellij-ce-playground    文件:AntExplorer.java   
private void runSelection(final DataContext dataContext) {
  if (!canRunSelection()) {
    return;
  }
  final AntBuildFileBase buildFile = getCurrentBuildFile();
  if (buildFile != null) {
    final TreePath[] paths = myTree.getSelectionPaths();
    final String[] targets = getTargetNamesFromPaths(paths);
    ExecutionHandler.runBuild(buildFile, targets, null, dataContext, Collections.<BuildFileProperty>emptyList(), AntBuildListener.NULL);
  }
}
项目:intellij-ce-playground    文件:TargetAction.java   
public void actionPerformed(AnActionEvent e) {
  DataContext dataContext = e.getDataContext();
  Project project = CommonDataKeys.PROJECT.getData(dataContext);
  if (project == null) return;

  for (final AntBuildFile buildFile : AntConfiguration.getInstance(project).getBuildFiles()) {
    final String name = buildFile.getPresentableName();
    if (name != null && myBuildName.equals(name)) {
      String[] targets = myTargets.length == 1 && DEFAULT_TARGET_NAME.equals(myTargets[0]) ? ArrayUtil.EMPTY_STRING_ARRAY : myTargets;
      ExecutionHandler.runBuild((AntBuildFileBase)buildFile, targets, null, dataContext, Collections.<BuildFileProperty>emptyList(), AntBuildListener.NULL);
      return;
    }
  }
}
项目:intellij-ce-playground    文件:RunAction.java   
public void actionPerformed(AnActionEvent e) {
  ExecutionHandler.runBuild(
    myAntBuildMessageView.getBuildFile(),
    myAntBuildMessageView.getTargets(),
    myAntBuildMessageView,
    e.getDataContext(), Collections.<BuildFileProperty>emptyList(), AntBuildListener.NULL);
}
项目:intellij-ce-playground    文件:RunTargetAction.java   
@Override
public void actionPerformed(AnActionEvent e) {
  Pair<AntBuildFileBase, AntDomTarget> antTarget = findAntTarget(e);
  if (antTarget == null) return;

  ExecutionHandler.runBuild(
    antTarget.first, new String[] {antTarget.second.getName().getValue() },
    null,
    e.getDataContext(),
    Collections.<BuildFileProperty>emptyList(),
    AntBuildListener.NULL);
}
项目:intellij-ce-playground    文件:AntBuildTargetImpl.java   
public void run(DataContext dataContext, List<BuildFileProperty> additionalProperties, AntBuildListener buildListener) {
  AntBuildModel model = getModel();
  if (model == null) {
    buildListener.buildFinished(AntBuildListener.FAILED_TO_RUN, 0);
    throw new IllegalStateException("Target '" + getName() + "' is invalid: model is null");
  }
  AntBuildFile buildFile = model.getBuildFile();
  if (buildFile == null) {
    buildListener.buildFinished(AntBuildListener.FAILED_TO_RUN, 0);
    throw new IllegalStateException("Target '" + getName() + "' is invalid: build file is null");
  }

  String[] targets = isDefault() ? ArrayUtil.EMPTY_STRING_ARRAY : new String[]{getName()};
  ExecutionHandler.runBuild((AntBuildFileBase)buildFile, targets, null, dataContext, additionalProperties, buildListener);
}
项目:Azure-Toolkit-for-IntelliJ    文件:AntHelper.java   
public static void runAntBuild(final DataContext dataContext, final Module module, final AntBuildListener antBuildListener) {
    final VirtualFile packageXmlFile = LocalFileSystem.getInstance().findFileByPath(PluginUtil.getModulePath(module) + File.separator + message("resCLPkgXML"));
    final AntConfiguration antConfiguration = AntConfiguration.getInstance(module.getProject());
    ApplicationManager.getApplication().invokeAndWait(
            new Runnable() {
                @Override
                public void run() {
                    try {
                        final AntBuildFile buildFile;
                        boolean notInAnt = true;
                        AntBuildFile buildFileTemp = null;
                        for (AntBuildFile antBuildFile : antConfiguration.getBuildFiles()) {
                            if (antBuildFile.getPresentableUrl().equals(packageXmlFile.getPresentableUrl())) {
                                buildFileTemp = antBuildFile;
                                notInAnt = false;
                                break;
                            }
                        }
                        buildFile = notInAnt ? antConfiguration.addBuildFile(packageXmlFile) : buildFileTemp;
                        final String[] targets = ArrayUtil.EMPTY_STRING_ARRAY; // default target
                        ExecutionHandler.runBuild((AntBuildFileBase) buildFile, targets, null, dataContext, new ArrayList(), antBuildListener);
                        if (notInAnt) {
                            antConfiguration.removeBuildFile(buildFile);
                        }
                    } catch (AntNoFileException e) {
                        throw new RuntimeException(message("bldErrMsg"), e);
                    }
                }
            }, ModalityState.defaultModalityState());
}
项目:tools-idea    文件:AntExplorer.java   
private void runSelection(final DataContext dataContext) {
  if (!canRunSelection()) {
    return;
  }
  final AntBuildFileBase buildFile = getCurrentBuildFile();
  if (buildFile != null) {
    final TreePath[] paths = myTree.getSelectionPaths();
    final String[] targets = getTargetNamesFromPaths(paths);
    ExecutionHandler.runBuild(buildFile, targets, null, dataContext, Collections.<BuildFileProperty>emptyList(), AntBuildListener.NULL);
  }
}
项目:tools-idea    文件:TargetAction.java   
public void actionPerformed(AnActionEvent e) {
  DataContext dataContext = e.getDataContext();
  Project project = PlatformDataKeys.PROJECT.getData(dataContext);
  if (project == null) return;

  for (final AntBuildFile buildFile : AntConfiguration.getInstance(project).getBuildFiles()) {
    final String name = buildFile.getPresentableName();
    if (name != null && myBuildName.equals(name)) {
      String[] targets = myTargets.length == 1 && DEFAULT_TARGET_NAME.equals(myTargets[0]) ? ArrayUtil.EMPTY_STRING_ARRAY : myTargets;
      ExecutionHandler.runBuild((AntBuildFileBase)buildFile, targets, null, dataContext, Collections.<BuildFileProperty>emptyList(), AntBuildListener.NULL);
      return;
    }
  }
}
项目:tools-idea    文件:RunAction.java   
public void actionPerformed(AnActionEvent e) {
  ExecutionHandler.runBuild(
    myAntBuildMessageView.getBuildFile(),
    myAntBuildMessageView.getTargets(),
    myAntBuildMessageView,
    e.getDataContext(), Collections.<BuildFileProperty>emptyList(), AntBuildListener.NULL);
}
项目:tools-idea    文件:RunTargetAction.java   
@Override
public void actionPerformed(AnActionEvent e) {
  Pair<AntBuildFileBase, AntDomTarget> antTarget = findAntTarget(e);
  if (antTarget == null) return;

  ExecutionHandler.runBuild(
    antTarget.first, new String[] {antTarget.second.getName().getValue() },
    null,
    e.getDataContext(),
    Collections.<BuildFileProperty>emptyList(),
    AntBuildListener.NULL);
}
项目:tools-idea    文件:AntBuildTargetImpl.java   
public void run(DataContext dataContext, List<BuildFileProperty> additionalProperties, AntBuildListener buildListener) {
  AntBuildModel model = getModel();
  if (model == null) {
    buildListener.buildFinished(AntBuildListener.FAILED_TO_RUN, 0);
    throw new IllegalStateException("Target '" + getName() + "' is invalid: model is null");
  }
  AntBuildFile buildFile = model.getBuildFile();
  if (buildFile == null) {
    buildListener.buildFinished(AntBuildListener.FAILED_TO_RUN, 0);
    throw new IllegalStateException("Target '" + getName() + "' is invalid: build file is null");
  }

  String[] targets = isDefault() ? ArrayUtil.EMPTY_STRING_ARRAY : new String[]{getName()};
  ExecutionHandler.runBuild((AntBuildFileBase)buildFile, targets, null, dataContext, additionalProperties, buildListener);
}
项目:consulo-apache-ant    文件:AntExplorer.java   
private void runSelection(final DataContext dataContext) {
  if (!canRunSelection()) {
    return;
  }
  final AntBuildFileBase buildFile = getCurrentBuildFile();
  if (buildFile != null) {
    final TreePath[] paths = myTree.getSelectionPaths();
    final String[] targets = getTargetNamesFromPaths(paths);
    ExecutionHandler.runBuild(buildFile, targets, null, dataContext, Collections.<BuildFileProperty>emptyList(), AntBuildListener.NULL);
  }
}
项目:consulo-apache-ant    文件:TargetAction.java   
public void actionPerformed(AnActionEvent e) {
  DataContext dataContext = e.getDataContext();
  Project project = e.getProject();
  if (project == null) return;

  for (final AntBuildFile buildFile : AntConfiguration.getInstance(project).getBuildFiles()) {
    final String name = buildFile.getPresentableName();
    if (name != null && myBuildName.equals(name)) {
      String[] targets = myTargets.length == 1 && DEFAULT_TARGET_NAME.equals(myTargets[0]) ? ArrayUtil.EMPTY_STRING_ARRAY : myTargets;
      ExecutionHandler.runBuild((AntBuildFileBase)buildFile, targets, null, dataContext, Collections.<BuildFileProperty>emptyList(), AntBuildListener.NULL);
      return;
    }
  }
}
项目:consulo-apache-ant    文件:RunAction.java   
public void actionPerformed(AnActionEvent e) {
  ExecutionHandler.runBuild(
    myAntBuildMessageView.getBuildFile(),
    myAntBuildMessageView.getTargets(),
    myAntBuildMessageView,
    e.getDataContext(), Collections.<BuildFileProperty>emptyList(), AntBuildListener.NULL);
}
项目:consulo-apache-ant    文件:RunTargetAction.java   
@Override
public void actionPerformed(AnActionEvent e) {
  Pair<AntBuildFileBase, AntDomTarget> antTarget = findAntTarget(e);
  if (antTarget == null) return;

  ExecutionHandler.runBuild(
    antTarget.first, new String[] {antTarget.second.getName().getValue() },
    null,
    e.getDataContext(),
    Collections.<BuildFileProperty>emptyList(),
    AntBuildListener.NULL);
}
项目:consulo-apache-ant    文件:AntBuildTargetImpl.java   
public void run(DataContext dataContext, List<BuildFileProperty> additionalProperties, AntBuildListener buildListener) {
  AntBuildModel model = getModel();
  if (model == null) {
    buildListener.buildFinished(AntBuildListener.FAILED_TO_RUN, 0);
    throw new IllegalStateException("Target '" + getName() + "' is invalid: model is null");
  }
  AntBuildFile buildFile = model.getBuildFile();
  if (buildFile == null) {
    buildListener.buildFinished(AntBuildListener.FAILED_TO_RUN, 0);
    throw new IllegalStateException("Target '" + getName() + "' is invalid: build file is null");
  }

  String[] targets = isDefault() ? ArrayUtil.EMPTY_STRING_ARRAY : new String[]{getName()};
  ExecutionHandler.runBuild((AntBuildFileBase)buildFile, targets, null, dataContext, additionalProperties, buildListener);
}
项目:intellij-ce-playground    文件:MetaTarget.java   
public void run(DataContext dataContext, List<BuildFileProperty> additionalProperties, AntBuildListener buildListener) {
  ExecutionHandler.runBuild(myBuildFile, myTargets, null, dataContext, additionalProperties, buildListener);
}
项目:tools-idea    文件:MetaTarget.java   
public void run(DataContext dataContext, List<BuildFileProperty> additionalProperties, AntBuildListener buildListener) {
  ExecutionHandler.runBuild(myBuildFile, myTargets, null, dataContext, additionalProperties, buildListener);
}
项目:consulo-apache-ant    文件:MetaTarget.java   
public void run(DataContext dataContext, List<BuildFileProperty> additionalProperties, AntBuildListener buildListener) {
  ExecutionHandler.runBuild(myBuildFile, myTargets, null, dataContext, additionalProperties, buildListener);
}