{
Dictionary <string, bool> excludedItems;
List <ITaskItem> includedItems;
- string[] splitExclude;
if (includes == null)
throw new ArgumentNullException ("Includes");
FileInfo[] fileInfo;
string name = include_item.ItemSpec;
- if (name.IndexOf ('?') == -1 && name.IndexOf ('*') == -1) {
+ if (!HasWildcard (name)) {
if (!excludedItems.ContainsKey (Path.GetFullPath(name)))
includedItems.Add (include_item);
} else {
offset = 1;
}
+ string full_path = Path.GetFullPath (Path.Combine (Environment.CurrentDirectory, include_item.ItemSpec));
fileInfo = ParseIncludeExclude (separatedPath, offset, baseDirectory);
+ int wildcard_offset = full_path.IndexOf ("**");
foreach (FileInfo fi in fileInfo) {
if (!excludedItems.ContainsKey (fi.FullName)) {
TaskItem item = new TaskItem (include_item);
item.ItemSpec = fi.FullName;
+ if (wildcard_offset >= 0) {
+ string rec_dir = Path.GetDirectoryName (fi.FullName.Substring (wildcard_offset));
+ if (rec_dir.Length > 0)
+ rec_dir += Path.DirectorySeparatorChar;
+ item.SetMetadata ("RecursiveDir", rec_dir);
+ }
includedItems.Add (item);
}
}
return fi;
}
}
+
+ public static bool HasWildcard (string expression)
+ {
+ return expression.IndexOf ('?') >= 0 || expression.IndexOf ('*') >= 0;
+ }
public DirectoryInfo BaseDirectory {
get { return baseDirectory; }