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:
UbitUmarov
2022-04-30 14:57:51 +01:00
parent e0a33297dd
commit 4f7b293c5e
7 changed files with 23 additions and 6 deletions

View File

@@ -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();
}

View File

@@ -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);

Binary file not shown.

View File

@@ -1,6 +1,6 @@
@echo OFF
bin\Prebuild.exe /target vs2015
bin\Prebuild.exe /target vs2015 /excludedir = "obj | bin"
setlocal ENABLEEXTENSIONS
set VALUE_NAME=MSBuildToolsPath

View File

@@ -18,7 +18,7 @@ case "$1" in
*)
mono bin/Prebuild.exe /target nant
mono bin/Prebuild.exe /target vs2015
mono bin/Prebuild.exe /target vs2015 /excludedir = "obj | bin"
;;

View File

@@ -1,6 +1,6 @@
@echo OFF
bin\Prebuild.exe /target vs2019 /targetframework v4_8
bin\Prebuild.exe /target vs2019 /targetframework v4_8 /excludedir = "obj | bin"
setlocal ENABLEEXTENSIONS
set VALUE_NAME=MSBuildToolsPath

View File

@@ -19,7 +19,7 @@ case "$1" in
*)
mono bin/Prebuild.exe /target vs2019 /targetframework v4_8
mono bin/Prebuild.exe /target vs2019 /targetframework v4_8 /excludedir = "obj | bin"
;;