add comandline option excluddir to Prebuild, to make easier to use older xml files that did not excluse folders like obj from the project
This commit is contained in:
@@ -100,6 +100,7 @@ namespace Prebuild.Core
|
||||
bool m_PauseAfterFinish;
|
||||
string[] m_ProjectGroups;
|
||||
|
||||
public HashSet<string> excludeFolders = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
@@ -673,7 +674,7 @@ namespace Prebuild.Core
|
||||
}
|
||||
m_Clean = m_CommandLine["clean"];
|
||||
string removeDirs = m_CommandLine["removedir"];
|
||||
if (removeDirs != null && removeDirs.Length == 0)
|
||||
if (!string.IsNullOrEmpty(removeDirs))
|
||||
{
|
||||
m_RemoveDirectories = removeDirs.Split('|');
|
||||
}
|
||||
@@ -685,6 +686,20 @@ namespace Prebuild.Core
|
||||
}
|
||||
m_PauseAfterFinish = m_CommandLine.WasPassed("pause");
|
||||
|
||||
string excludeDirstr = m_CommandLine["excludedir"];
|
||||
if (!string.IsNullOrEmpty(excludeDirstr))
|
||||
{
|
||||
string[] ex = excludeDirstr.Split(new char[] {'|'}, StringSplitOptions.RemoveEmptyEntries);
|
||||
if(ex.Length > 0)
|
||||
{
|
||||
foreach(string s in ex)
|
||||
{
|
||||
string st = s.Trim();
|
||||
if(st.Length > 0)
|
||||
excludeFolders.Add(st);
|
||||
}
|
||||
}
|
||||
}
|
||||
//LoadSchema();
|
||||
}
|
||||
|
||||
|
||||
@@ -261,6 +261,9 @@ namespace Prebuild.Core.Nodes
|
||||
// a significant performance hit when running on a network drive.
|
||||
if (str.EndsWith(".svn"))
|
||||
continue;
|
||||
string dname = Path.GetFileName(str);
|
||||
if(Kernel.Instance.excludeFolders.Contains(dname))
|
||||
continue;
|
||||
|
||||
RecurseDirectories(Helper.NormalizePath(str), pattern, recurse, useRegex, exclusions);
|
||||
}
|
||||
@@ -345,7 +348,6 @@ namespace Prebuild.Core.Nodes
|
||||
throw new WarningException("Could not compile regex pattern: {0}", ex.Message);
|
||||
}
|
||||
|
||||
|
||||
foreach (XmlNode child in node.ChildNodes)
|
||||
{
|
||||
IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
|
||||
|
||||
Reference in New Issue
Block a user