Hi Bill...
Just figured out the multiline stuff. The C# Regex
implementation, like most other regex implementations, equates $ with
\n. But <loadfile> literally sucks in all the bytes of the file, and on
the Windows fs, lines are delineated with \r\n.
If you're looking to use <regex> with MultiLine on a
property loaded with <loadfile>, you have to phrase it something like
"^This is my line.\r$"
Thanks
-Mark
This e-mail message, and any attachments, is intended only for the use of the
individual or entity identified in the alias address of this message and may
contain information that is confidential, privileged and subject to legal
restrictions and penalties regarding its unauthorized disclosure and use. Any
unauthorized review, copying, disclosure, use or distribution is strictly
prohibited. If you have received this e-mail message in error, please notify
the sender immediately by reply e-mail and delete this message, and any
attachments, from your system. Thank you.
________________________________
From: Arnette, Bill [mailto:[EMAIL PROTECTED]
Sent: Monday, January 22, 2007 2:29 PM
To: Mark Modrall; nant-users@lists.sourceforge.net
Subject: RE: [NAnt-users] <exec> and <regex>
I would suggest you use 'svn info' command to get the revision. In
fact, you may not want the current revision of the repository but
actually the last revision that the directory was changed. Svn Info
will give you that information.
How about this:
<?xml version="1.0"?>
<project name="Fred" default=""
xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd">
<exec program="svn.exe" output="svninfo.out">
<arg value="info"/>
</exec>
<loadfile file="svninfo.out" property="svn-info"/>
<regex pattern="Revision:\s+(?'revision'\d+)" input="${svn-info}" />
<regex pattern="Last Changed Rev:\s+(?'lastchangedrevision'\d+)"
input="${svn-info}" />
<echo message="Revision = ${revision}"/>
<echo message="Last Changed Rev = ${lastchangedrevision}"/>
</project>
BTW, I couldn't get options="Multiline" to work either.
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark
Modrall
Sent: Sunday, January 21, 2007 2:54 PM
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] <exec> and <regex>
Hi...
I'm new to nant, and I'm trying to port some java/ant tasks we'd
done to it. Since we use svn as our source control, I'm having to do
the update with exec. To get the revision updated to, I'm sifting
through the svn output. Under ant, I redirected the svn output to a
property using a filterchain and then looked for certain patterns (turns
out to be in the last line).
Just stumbling along here, it seems that I have to direct the
svn output to a file in nant, then use loadfile to get it into a
property then use a <regex> on the whole thing. Is that the best way to
do it?
I was having the damnedest time getting it to deal with the fact
that the property now had multiple lines in it when the regex was
applied. I put options="Multiline" but it still couldn't find anything
if I had $ in the pattern. That seems more of a C# pattern issue, but I
thought I'd ask about the general approach.
Thanks
-Mark
This e-mail message, and any attachments, is intended only for
the use of the individual or entity identified in the alias address of
this message and may contain information that is confidential,
privileged and subject to legal restrictions and penalties regarding its
unauthorized disclosure and use. Any unauthorized review, copying,
disclosure, use or distribution is strictly prohibited. If you have
received this e-mail message in error, please notify the sender
immediately by reply e-mail and delete this message, and any
attachments, from your system. Thank you.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users