NAnt is all about portability. That means you don't have to worry where your
C# compiler is installed and whether it's called "csc" or "mcs" or how to
invoke resgen for a particular framework version (mono vs .net). That's also
the reason why you have cvs and zip tasks in NAnt.

Sed and Awk are not as common on Windows as they are on Unix. Maybe Perl is
more popular here, but it is a multi-megabyte download just to have an
interpreter. For most builds you want simple features like pattern matching
and simple replacements. That's why <replace> task is being proposed.

As I build my current project I want it to be portable amongst all CLIs
where possible. Currently it is able to build on Windows and Linux. Whenever
I need some functionality that's not present in NAnt, I generally write
simple 50-line C# programs, compile them using <csc> and execute. This means
100% portability for now. If I had <replace> I could get rid of 50% of my
utility programs.

Jarek
----- Original Message ----- 
From: "Anthony LoveFrancisco" <[EMAIL PROTECTED]>
To: "'Jaroslaw Kowalski'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, August 20, 2003 2:26 AM
Subject: RE: [Nant-users] Replace Task in Nant


> Overall, I like the idea, but I'm wondering the utility/value of a set of
> new tasks versus just invoking sed/awk/perl from an exec task ?
>
> - Ants
>
> |  -----Original Message-----
> |  From: [EMAIL PROTECTED]
> |  [mailto:[EMAIL PROTECTED] On Behalf Of
> |  Jaroslaw Kowalski
> |  Sent: Tuesday, 19 August, 2003 13:48
> |  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> |  Subject: Re: [Nant-users] Replace Task in Nant
> |
> |
> |  Great idea. It would also be useful for updating assembly
> |  versions within daily builds. And because it's very easy to
> |  use regular expressions on .NET I suggest that we supported
> |  regexes in search patterns.
> |
> |  This way you could have:
> |
> |  <replace regex="^[assembly: AssemblyVersion(.*)]$"
> |  replace="[assembly: AssemblyVersion(&quot;${project.version}&quot;)">
> |      <files>
> |          <includes name="**/AssemblyInfo.cs" />
> |      </files>
> |  </replace>
> |
> |  I'm also thinking about using this task to insert / ensure
> |  standard license header (BSD, GPL) into source files, but
> |  perhaps that should be another task.
> |
> |  Jarek
> |
> |  ----- Original Message ----- 
> |  From: "Daya Sharma" <[EMAIL PROTECTED]>
> |  To: <[EMAIL PROTECTED]>
> |  Sent: Tuesday, August 19, 2003 7:30 PM
> |  Subject: [Nant-users] Replace Task in Nant
> |
> |
> |  > Hi All
> |  >
> |  > I think it will be wonderful to have a Replace task in
> |  Nant, much like
> |  > it
> |  is
> |  > in ANT http://ant.apache.org/manual/CoreTasks/replace.html .
> |  >
> |  > This is specially useful for cases like changing the value of the
> |  > project URL when using Solution task. Case in point is the
> |  following
> |  > that I had to write to change "http://localhost/ipm/ipm.csproj";
> |  > project URL to <build.dir>/ipm/ipm.csproj in order for my
> |  .csproj to
> |  > compile using NANT's solution task. (Pardon me for a pathetic
> |  > algorithm of deleting and recreating the ipm.sln file.)
> |  >
> |  > public static void ScriptMain(Project project)
> |  > {
> |  > FileInfo fileInfo = new FileInfo(project.BaseDirectory +
> |  "\\ipm.sln");
> |  > FileStream file = File.Open(fileInfo.ToString(), FileMode.Open,
> |  > FileAccess.ReadWrite); StreamReader reader = new
> |  StreamReader(file);
> |  > string line = null;
> |  > line = reader.ReadToEnd();
> |  > if(line.IndexOf("http://localhost/ipm";) != -1)
> |  > {
> |  > //Console.WriteLine(line);
> |  > StringBuilder sb = new StringBuilder(line);
> |  > sb.Replace("http://localhost/ipm/";, project.BaseDirectory+"\\");
> |  > line = sb.ToString();
> |  > reader.Close();
> |  > fileInfo.Delete();
> |  > Console.WriteLine(line); // output the changed file
> |  contents just for
> |  > verbosity
> |  > file = File.Open(project.BaseDirectory+"\\ipm.sln",
> |  FileMode.CreateNew,
> |  > FileAccess.Write);
> |  > StreamWriter writer = new StreamWriter(file);
> |  > writer.AutoFlush = true;
> |  > writer.WriteLine(line);
> |  > }
> |  > file.Close();
> |  > }
> |  >
> |  > Please provide me with your input.
> |  >
> |  > Thanks in advance.
> |  >
> |  > -daya
> |  >
> |  >
> |  >
> |  > -------------------------------------------------------
> |  > This SF.net email is sponsored by Dice.com.
> |  > Did you know that Dice has over 25,000 tech jobs available
> |  today? From
> |  > careers in IT to Engineering to Tech Sales, Dice has tech
> |  jobs from
> |  > the best hiring companies.
> |  http://www.dice.com/index.epl?rel_code=104
> |  >
> |  _______________________________________________
> |  > Nant-users mailing list
> |  > [EMAIL PROTECTED]
> |  > https://lists.sourceforge.net/lists/listinfo/nant-users
> |  >
> |
> |
> |
> |  -------------------------------------------------------
> |  This SF.net email is sponsored by Dice.com.
> |  Did you know that Dice has over 25,000 tech jobs available
> |  today? From careers in IT to Engineering to Tech Sales, Dice
> |  has tech jobs from the best hiring companies.
> |  http://www.dice.com/index.epl?rel_code=104
> |
> |  _______________________________________________
> |  Nant-users mailing list
> |  [EMAIL PROTECTED]
> |  https://lists.sourceforge.net/lists/listinfo/|  nant-users
> |
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by Dice.com.
> Did you know that Dice has over 25,000 tech jobs available today? From
> careers in IT to Engineering to Tech Sales, Dice has tech jobs from the
> best hiring companies. http://www.dice.com/index.epl?rel_code=104
> _______________________________________________
> Nant-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/nant-users
>



-------------------------------------------------------
This SF.net email is sponsored by Dice.com.
Did you know that Dice has over 25,000 tech jobs available today? From
careers in IT to Engineering to Tech Sales, Dice has tech jobs from the
best hiring companies. http://www.dice.com/index.epl?rel_code=104
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to