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 ); } }
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); } }
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; } } }
public void actionPerformed(AnActionEvent e) { ExecutionHandler.runBuild( myAntBuildMessageView.getBuildFile(), myAntBuildMessageView.getTargets(), myAntBuildMessageView, e.getDataContext(), Collections.<BuildFileProperty>emptyList(), AntBuildListener.NULL); }
@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); }
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); }
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()); }
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; } } }
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; } } }
public void run(DataContext dataContext, List<BuildFileProperty> additionalProperties, AntBuildListener buildListener) { ExecutionHandler.runBuild(myBuildFile, myTargets, null, dataContext, additionalProperties, buildListener); }