diff options
Diffstat (limited to 'Prebuild/src')
-rw-r--r-- | Prebuild/src/Core/Targets/NAntTarget.cs | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/Prebuild/src/Core/Targets/NAntTarget.cs b/Prebuild/src/Core/Targets/NAntTarget.cs index 0ec2470..e9870db 100644 --- a/Prebuild/src/Core/Targets/NAntTarget.cs +++ b/Prebuild/src/Core/Targets/NAntTarget.cs | |||
@@ -490,8 +490,45 @@ public class NAntTarget : ITarget | |||
490 | ss.WriteLine(" </target>"); | 490 | ss.WriteLine(" </target>"); |
491 | ss.WriteLine(); | 491 | ss.WriteLine(); |
492 | 492 | ||
493 | // sdague - make a zip target | 493 | |
494 | ss.WriteLine(" <include buildfile=\".nant/local.include\" />"); | 494 | |
495 | // sdague - ok, this is an ugly hack, but what it lets | ||
496 | // us do is native include of files into the nant | ||
497 | // created files from all .nant/*include files. This | ||
498 | // lets us keep using prebuild, but allows for | ||
499 | // extended nant targets to do build and the like. | ||
500 | |||
501 | try { | ||
502 | Regex re = new Regex(".include$"); | ||
503 | DirectoryInfo nantdir = new DirectoryInfo(".nant"); | ||
504 | foreach (FileSystemInfo item in nantdir.GetFileSystemInfos()) | ||
505 | { | ||
506 | if (item is DirectoryInfo) {} | ||
507 | else if (item is FileInfo) | ||
508 | { | ||
509 | if (re.Match(((FileInfo)item).FullName) != | ||
510 | System.Text.RegularExpressions.Match.Empty) { | ||
511 | Console.WriteLine("Including file: " + ((FileInfo)item).FullName); | ||
512 | |||
513 | using (FileStream fs = new FileStream(((FileInfo)item).FullName, | ||
514 | FileMode.Open, | ||
515 | FileAccess.Read, | ||
516 | FileShare.None)) | ||
517 | { | ||
518 | using (StreamReader sr = new StreamReader(fs)) | ||
519 | { | ||
520 | ss.WriteLine("<!-- included from {0} -->", ((FileInfo)item).FullName); | ||
521 | while (sr.Peek() != -1) { | ||
522 | ss.WriteLine(sr.ReadLine()); | ||
523 | } | ||
524 | ss.WriteLine(); | ||
525 | } | ||
526 | } | ||
527 | } | ||
528 | } | ||
529 | } | ||
530 | } catch {} | ||
531 | // ss.WriteLine(" <include buildfile=\".nant/local.include\" />"); | ||
495 | // ss.WriteLine(" <target name=\"zip\" description=\"\">"); | 532 | // ss.WriteLine(" <target name=\"zip\" description=\"\">"); |
496 | // ss.WriteLine(" <zip zipfile=\"{0}-{1}.zip\">", solution.Name, solution.Version); | 533 | // ss.WriteLine(" <zip zipfile=\"{0}-{1}.zip\">", solution.Name, solution.Version); |
497 | // ss.WriteLine(" <fileset basedir=\"${project::get-base-directory()}\">"); | 534 | // ss.WriteLine(" <fileset basedir=\"${project::get-base-directory()}\">"); |