use of com.intellij.lang.ant.config.AntBuildFile in project intellij-community by JetBrains.
the class AntWorkspaceConfiguration method writeExternal.
public void writeExternal(Element parentNode) throws WriteExternalException {
DefaultJDOMExternalizer.writeExternal(this, parentNode);
for (final AntBuildFile buildFile : AntConfiguration.getInstance(myProject).getBuildFileList()) {
Element element = new Element(BUILD_FILE);
element.setAttribute(URL, buildFile.getVirtualFile().getUrl());
((AntBuildFileBase) buildFile).writeWorkspaceProperties(element);
parentNode.addContent(element);
}
}
use of com.intellij.lang.ant.config.AntBuildFile in project intellij-community by JetBrains.
the class GlobalAntConfiguration method findTarget.
public AntBuildTarget findTarget(Project project, String fileUrl, String targetName) {
if (fileUrl == null || targetName == null || project == null) {
return null;
}
final VirtualFile vFile = VirtualFileManager.getInstance().findFileByUrl(fileUrl);
if (vFile == null) {
return null;
}
final AntConfigurationImpl antConfiguration = (AntConfigurationImpl) AntConfiguration.getInstance(project);
for (AntBuildFile buildFile : antConfiguration.getBuildFileList()) {
if (vFile.equals(buildFile.getVirtualFile())) {
final AntBuildTarget target = buildFile.getModel().findTarget(targetName);
if (target != null) {
return target;
}
for (AntBuildTarget metaTarget : antConfiguration.getMetaTargets(buildFile)) {
if (targetName.equals(metaTarget.getName())) {
return metaTarget;
}
}
return null;
}
}
return null;
}
use of com.intellij.lang.ant.config.AntBuildFile in project intellij-community by JetBrains.
the class TargetAction method actionPerformed.
public void actionPerformed(AnActionEvent e) {
Project project = e.getProject();
if (project == null)
return;
for (final AntBuildFile buildFile : AntConfiguration.getInstance(project).getBuildFileList()) {
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, e.getDataContext(), Collections.emptyList(), AntBuildListener.NULL);
return;
}
}
}
Aggregations