diff --git a/Prebuild/src/Core/Kernel.cs b/Prebuild/src/Core/Kernel.cs index 52087c002d..53d01889fe 100755 --- a/Prebuild/src/Core/Kernel.cs +++ b/Prebuild/src/Core/Kernel.cs @@ -100,6 +100,7 @@ namespace Prebuild.Core bool m_PauseAfterFinish; string[] m_ProjectGroups; + public HashSet excludeFolders = new HashSet(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(); } diff --git a/Prebuild/src/Core/Nodes/MatchNode.cs b/Prebuild/src/Core/Nodes/MatchNode.cs index cc66767260..69e89c3e60 100644 --- a/Prebuild/src/Core/Nodes/MatchNode.cs +++ b/Prebuild/src/Core/Nodes/MatchNode.cs @@ -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); diff --git a/bin/Prebuild.exe b/bin/Prebuild.exe index 253d3064b5..03837d5ebd 100755 Binary files a/bin/Prebuild.exe and b/bin/Prebuild.exe differ diff --git a/runprebuild.bat b/runprebuild.bat index e5ec6e0287..bdd77a1502 100755 --- a/runprebuild.bat +++ b/runprebuild.bat @@ -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 diff --git a/runprebuild.sh b/runprebuild.sh index 6848188ff9..3f81df390c 100755 --- a/runprebuild.sh +++ b/runprebuild.sh @@ -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" ;; diff --git a/runprebuild48.bat b/runprebuild48.bat index 6c75220d12..151dd90f80 100644 --- a/runprebuild48.bat +++ b/runprebuild48.bat @@ -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 diff --git a/runprebuild48.sh b/runprebuild48.sh index cca98f2ca1..bb87334d8c 100755 --- a/runprebuild48.sh +++ b/runprebuild48.sh @@ -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" ;;