diff --git a/Prebuild/src/Core/Targets/NAntTarget.cs b/Prebuild/src/Core/Targets/NAntTarget.cs index 0ec24708f1..e9870db116 100644 --- a/Prebuild/src/Core/Targets/NAntTarget.cs +++ b/Prebuild/src/Core/Targets/NAntTarget.cs @@ -490,8 +490,45 @@ public class NAntTarget : ITarget ss.WriteLine(" "); ss.WriteLine(); - // sdague - make a zip target - ss.WriteLine(" "); + + + // sdague - ok, this is an ugly hack, but what it lets + // us do is native include of files into the nant + // created files from all .nant/*include files. This + // lets us keep using prebuild, but allows for + // extended nant targets to do build and the like. + + try { + Regex re = new Regex(".include$"); + DirectoryInfo nantdir = new DirectoryInfo(".nant"); + foreach (FileSystemInfo item in nantdir.GetFileSystemInfos()) + { + if (item is DirectoryInfo) {} + else if (item is FileInfo) + { + if (re.Match(((FileInfo)item).FullName) != + System.Text.RegularExpressions.Match.Empty) { + Console.WriteLine("Including file: " + ((FileInfo)item).FullName); + + using (FileStream fs = new FileStream(((FileInfo)item).FullName, + FileMode.Open, + FileAccess.Read, + FileShare.None)) + { + using (StreamReader sr = new StreamReader(fs)) + { + ss.WriteLine("", ((FileInfo)item).FullName); + while (sr.Peek() != -1) { + ss.WriteLine(sr.ReadLine()); + } + ss.WriteLine(); + } + } + } + } + } + } catch {} + // ss.WriteLine(" "); // ss.WriteLine(" "); // ss.WriteLine(" ", solution.Name, solution.Version); // ss.WriteLine(" ");