aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSean Dague2007-09-17 10:58:06 +0000
committerSean Dague2007-09-17 10:58:06 +0000
commitb25b0b2662f40db9c4a8e832e41cda6d899027ee (patch)
tree14d39bcd570f2d2a8829481fc53493daffa87970
parentattempt to add extra set of nant local rules (diff)
downloadopensim-SC_OLD-b25b0b2662f40db9c4a8e832e41cda6d899027ee.zip
opensim-SC_OLD-b25b0b2662f40db9c4a8e832e41cda6d899027ee.tar.gz
opensim-SC_OLD-b25b0b2662f40db9c4a8e832e41cda6d899027ee.tar.bz2
opensim-SC_OLD-b25b0b2662f40db9c4a8e832e41cda6d899027ee.tar.xz
allow for raw inject of nant files to aid in building
things like build targets
-rw-r--r--Prebuild/src/Core/Targets/NAntTarget.cs41
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()}\">");