Skip to content

Commit

Permalink
Merge pull request #32 from SlavaRa/develop
Browse files Browse the repository at this point in the history
Stable release
  • Loading branch information
SlavaRa committed Apr 13, 2016
2 parents fa4a65e + 7643a66 commit bd35c44
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion AntPanel/PluginMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void RemoveBuildFile(string file)
public void RunTarget(string file, string target)
{
var antPath = ((Settings)Settings).AntPath;
var command = PluginBase.MainForm.CommandPromptExecutable ?? Path.Combine(Environment.SystemDirectory, "cmd.exe");
var command = /*PluginBase.MainForm.CommandPromptExecutable ??*/ Path.Combine(Environment.SystemDirectory, "cmd.exe");
var arguments = "/c ";
if (string.IsNullOrEmpty(antPath)) arguments += "ant";
else arguments += Path.Combine(Path.Combine(antPath, "bin"), "ant");
Expand Down
26 changes: 9 additions & 17 deletions AntPanel/PluginUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,9 @@ AntTreeNode GetBuildFileNode(string file)
xml.Load(file);
var documentElement = xml.DocumentElement;
Debug.Assert(documentElement != null, "documentElement != null");
var defTargetAttr = documentElement.Attributes["default"];
var defaultTarget = defTargetAttr?.InnerText ?? "";
var nameAttr = documentElement.Attributes["name"];
var projectName = nameAttr?.InnerText ?? file;
var descrAttr = documentElement.Attributes["description"];
var description = descrAttr?.InnerText ?? "";
var defaultTarget = documentElement.Attributes["default"]?.InnerText ?? "";
var projectName = documentElement.Attributes["name"]?.InnerText ?? file;
var description = documentElement.Attributes["description"]?.InnerText ?? "";
if (string.IsNullOrEmpty(projectName)) projectName = file;
var rootNode = new AntTreeNode(projectName, IconFile)
{
Expand All @@ -200,11 +197,9 @@ AntTreeNode GetBuildFileNode(string file)
if (node.Name != "target") continue;
var attributes = node.Attributes;
Debug.Assert(attributes != null, "attributes != null");
if (!string.IsNullOrEmpty(attributes["description"]?.InnerText))
{
skipHiddenTargets = true;
break;
}
if (string.IsNullOrEmpty(attributes["description"]?.InnerText)) continue;
skipHiddenTargets = true;
break;
}
}
foreach (XmlNode node in documentElement.ChildNodes)
Expand All @@ -213,8 +208,7 @@ AntTreeNode GetBuildFileNode(string file)
// skip private and optionally hidden targets
var attributes = node.Attributes;
Debug.Assert(attributes != null, "attributes != null");
var targetNameAttr = attributes["name"];
var targetName = targetNameAttr?.InnerText;
var targetName = attributes["name"]?.InnerText;
if (!string.IsNullOrEmpty(targetName) && (targetName[0] == '-'))
continue;
if (skipHiddenTargets && string.IsNullOrEmpty(attributes["description"]?.InnerText))
Expand All @@ -231,10 +225,8 @@ AntTreeNode GetBuildTargetNode(XmlNode node, string defaultTarget)
{
var attributes = node.Attributes;
Debug.Assert(attributes != null, "attributes != null");
var nameAttr = attributes["name"];
var targetName = nameAttr?.InnerText ?? string.Empty;
var descrAttr = attributes["description"];
var description = descrAttr?.InnerText ?? string.Empty;
var targetName = attributes["name"]?.InnerText ?? string.Empty;
var description = attributes["description"]?.InnerText ?? string.Empty;
AntTreeNode result;
if (targetName == defaultTarget)
{
Expand Down

0 comments on commit bd35c44

Please sign in to comment.