Redirected to the NAnt-users list...
Daniel,
Remove the in="" attribute in the foreach element... this is
overriding the nested in element, so your include is not being used.
The *.sql is the (semantically) correct format, by the way. ** usually
denotes a recursive path.
Regards,
--
Troy
On
On 11/2/05, Robert Schneider <[EMAIL PROTECTED]> wrote:
> Is this the regular approach?:
>
> >
> > //TODO: Stuff
> >
> >
> > Kind of hoaky, but it works :)
>
> Why not:
>
>
>//TODO: Stuff
>
Typo aside, putting the actual positive test in the test attribute is
much more expressive (at leas
On 10/21/05, Anderson, Kelly <[EMAIL PROTECTED]> wrote:
> Ok. So here's a middle ground question. Say that you have a code
> generation scheme that generates source files from say an Excel
> spreadsheet using templates (like CodeSmith), then those files are
> compiled. If the generated source files
On 10/20/05, Evan Levy <[EMAIL PROTECTED]> wrote:
> Exactly. I'm also experiencing output going to output file AND to
> log. My question (feature request?) is how do I turn off (or at least turn
> down) logging, but not affect output. Not sure how this can be
> accomplished.
I've got a patch
On 10/20/05, Evan Levy <[EMAIL PROTECTED]> wrote:
> This is what we do. Developers develop with Visual Studio, and the
> build automation happens with Nant on the server pulling code from
> source control. In fact, our developers don't really need to build
> locally at all (but they do anyway).
On 10/20/05, Anderson, Kelly <[EMAIL PROTECTED]> wrote:
> As a follow up question though... about the "clean" target, does the
> clean target typically delete the source files so that they have to be
> retrieved from revision control by scratch, or just the obj, lib, exe
> and other intermediate fi
On 10/18/05, Anderson, Kelly <[EMAIL PROTECTED]> wrote:
> If you just expect the tools to be installed, then you have a job
> setting up a new machine, virtual machine or whatever. If you do this
> often, it might be worth automating, and it might be as easy to write a
> NAnt script to do this as t
> Thank you for a pleasant discussion of NAnt. I'm quite excited to be
> using it and learning about it. I hope that someday soon, I'll be able
> to answer questions here rather than just asking. I've really enjoyed
> the separation of concerns thread too. Nice thinking!
>
> -Kelly
Nothing wrong
On 9/15/05, Bill Arnette <[EMAIL PROTECTED]> wrote:
> With my suggestion, 'nant -only:projectC' would only do the body of the
> projectC target and not execute the dependencies without cluttering the
> build file with dependency-only targets, or with if statements and unless
> attributes that short
On 9/13/05, Anderson, Kelly <[EMAIL PROTECTED]> wrote:
> Does anyone have any idea about how to unit test Nant scripts? Is it
> even possible?
>
> -Kelly
Kelly,
There is unit testing in place for many (most?) NAnt tasks, which can
be found in the source distribution of NAnt.
There isn't really
On 9/13/05, Ashley Moran <[EMAIL PROTECTED]> wrote:
> Paul Cowan wrote:
> > Is FTP in anyway possible through Nant?
>
> You have to use an external program.
There is also an FTP task available for NAnt, unfortunately it is not
distributed as part of NAnt or NAnt-Contrib. You can get it from
here
On 9/6/05, Andy Johnstone <[EMAIL PROTECTED]> wrote:
> HI all,
>
> I have a folder structure which stores releases in a known location.
>
> The pattern is:
> c:\releases\\ - This level will always contain the latest
> version of the DLL
> c:\releases\\\ - This level stores archived versions
On 9/1/05, Kevin Kirkpatrick <[EMAIL PROTECTED]> wrote:
> I'm trying to use the nant if condition to act on the value of a property.
>
> http://nant.sourceforge.net/release/latest/help/fundamentals/expressions.html#expression-syntax
The syntax you are after looks like:
...
--
Troy
On 8/19/05, Sandeep <[EMAIL PROTECTED]> wrote:
> I would like to ignore the error in task (generated by test condition)
> if the file is locked. I tried adding failonerror="false" but it still
> breaks the build.
>
> Can you please tell me how to make build successful even if some files being
>
> no - you can't do this right now. However it would be fairly easy to
> write a custom task ( or
> Hello Friends,
>
> In my NAnt script, I am calling one child Nant script which generate one
> dll(lets say abc.dll) now I don't want to create/recompile it every time.
>
> Shall i go with
> 1. file::get-last-access-time
> 2. file::up-to-date
>
> or is there any otherway to solve th
On 7/14/05, Shelly Midha <[EMAIL PROTECTED]> wrote:
>
>
> I'm compiling a set of java files using the following command in NAnt file
>
> failonerror = "false">
>
Shelly,
The %CLASSPATH% environment variable is probably not being expanded -
this is usually done by the command processor
On 7/8/05, Curtis Zarger <[EMAIL PROTECTED]> wrote:
> I tried two forms of the property reference, with the
> same result. Does NAnt support this type of
> referencing?
Curt,
If you are using one of the 0.85 releases (or nightlies), then you can
evaluate the value of a property using expressions
On 7/4/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I have a problem where a target defined in an d build file
> isn't being found when I make it a dependency of a target in my main
> build file, although the file appears to have been d
> successfully. The included build file is valid and run
On 7/2/05, Stephen Touset <[EMAIL PROTECTED]> wrote:
> Is it possible to have a depends clause in a target that uses a
> property? In other words,
>
>
>
>
>
>
> Whenever I do this, any attempt to build results in an error saying the
> property ${target} had not been set. However, it's set to
On 6/29/05, Wilson, Glenn <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Is IBM's ClearCase supported by NAnt (or NantContrib)? There doesn't appear
> to be any specific Tasks such as the PVCS, CVS and Surrond SCM tasks.
>
> Regards
>
> Glenn
>
> Glenn Wilson
> Corporate Systems Development
Clea
On 6/25/05, Bert Robbins (Documentum) <[EMAIL PROTECTED]> wrote:
>
>
> All,
>
> I need to peek a value out of an XML file, add 1 to it, and then poke that
> new value into the XML file. I have the peeking and poking working. However,
> I am confused about how to take a property's value and add
On 6/23/05, Stephen Smyth <[EMAIL PROTECTED]> wrote:
> I have a few external programs that have several possible return codes
> each, only 1 of which in each case means failure. However, NAnt itself
> fails if any return code from an exec task is not 0, even if
> failonerror=false for that task (Wh
On 6/24/05, Gary Feldman <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
>
> >...I call the exec task:
> >
> >
> >
> >
> >
> >
> This isn't the right way to call it. It's equivalent to typing
>
> osql "-E -S $... < ..."
> i.e., putting everything into quotes and passing it as the fi
On 6/22/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> I need to include quotation marks (" ") in a command line parameter
> being passed to an exec command. How should I escape the character in
> the command line?
>
> Cheers,
> James.
James,
You can insert quotes into argumen
>
Oops... the less-than operator will need to be escaped:
On 6/10/05, Sam Gardiner <[EMAIL PROTECTED]> wrote:
>
> Is there a way to create a fileset of files by date? I want to delete files
> older than a certain date and I have no good ways of doing it.
>
> cheers,
>
> sam
Sam,
It sounds like you're asking for a way to create a fileset by ap
On 6/9/05, Paul Cowan <[EMAIL PROTECTED]> wrote:
>
>
>
> Hi all,
>
>
>
> The following copy tag is copying the Source folder as well, can anyone tell
> me why:
Paul,
The Source folder is being copied because the path of the files being
copied is being calculated on the fileset, not on
On 6/3/05, Sandeep <[EMAIL PROTECTED]> wrote:
> Please let me know if you have any idea to handle this problem more
> elegantly.
In Ant, this would be handled using a custom mapper[1] on the copy
task. Personally, I think that's a little heavy-handed, and
ultimately hard to maintain, just becaus
On 6/3/05, Malcolm Anderson <[EMAIL PROTECTED]> wrote:
> is there a way to set up environment variables programatically? I'm working
> with a bunch of people who are not used to using NAnt, and I'd like to be able
> to just hit them with an install script that will set their path and
> environment
> The question has already been answered, but I'm curious. Is this the
> entire script? Everything you do here can be done within pure NAnt.
> Personally, I prefer to avoid dropping into scripts, because one never
> knows who will be maintaining the build file in the future.
>
> Gary
I would gu
Malcolm,
I don't have NAnt installed here so can't verify, but perhaps it is
having a problem with the '..' in the path? Try using
${path::combine(nant::get-base-directory(),
'..\..\nantcontrib-0.85-rc3\bin')}, this is the recommended (if more
verbose) method for creating a path relative to anoth
Paul,
This is indeed possible, but is likely to be dependent on the database
server that you are using.
I don't know of any NAnt tasks to do this for any database server, but
if the database server provides a command-line interface for exporting
a database into a sql script, then you could use th
On 5/27/05, Sandeep <[EMAIL PROTECTED]> wrote:
> Does anyone have idea on how I can achieve that? I don't think I can use
> for adding the directive in the xml log file. Another issue is
> that if I try to modify the file from NAnt itself, the file may be locked.
One way I can think of is to cre
> Unfortunately, while this works well when files in SourceFolder1 and
> SourceFolder2 which exist in "lib" are updated, if the file does not already
> exist in the "lib" folder dependencies.uptodate is still set to True.
>
> Is this a bug, or am I misusing ? If I'm misusing it, is there any
> wa
Shelly,
See if copying your scripts with a filterchain (replacestring filter)
will help you...
http://nant.sourceforge.net/release/latest/help/types/filterchain.html
http://nant.sourceforge.net/release/latest/help/filters/index.html
Note that using filterchains you cannot modify your scripts in p
Christian,
I believe this (or something similar) has been suggested before, but
there are some questions in the design of such a feature...
Should the nant task require the called build file to be the exact
version specified? Or should backwards compatibility be allowed and
we specify the maximu
On 5/16/05, Shelly Midha <[EMAIL PROTECTED]> wrote:
>
> I 'm geeting the an error while running the following target:
>
> [snip]
>
> System.UnauthorizedAccessException: Access to the path
> "\\delminfraapp\release"
> is denied.
>
> [snip]
>
> Any pointers to workaround the same will be
On 5/13/05, Ian MacLean <[EMAIL PROTECTED]> wrote:
Gary Feldman wrote:> Check out the cascade attribute of the task,> http://nant.sourceforge.net/nightly/latest/help/tasks/call.html
.>Thats exactly right - maybe another doc fix is required. cascade="true"means execute dependencies and is the defa
Sandeep,
You can use the task to rename files, as in original.name" tofile="new.name" />
http://nant.sourceforge.net/release/latest/help/tasks/move.html
Unfortunately to use this renaming behaviour you can only specify a
single file, not a fileset (see the documentation for details).
You can st
Malcolm,
You have fallen victim to the most common error when using functions... never nest your _expression_ evaluation brackets ${}
${directory::exists('${build.dir}')} becomes ${directory::exists(build.dir)}, and similar for your other expressions.
This is demonstrated in the fourth example o
On 4/22/05, Julien Sobrier <[EMAIL PROTECTED]> wrote:
Hello,can this really work? You have to embed the source files between:I don't see how I can use if="${generateDocs}" />.
Thank youJulien---SF em
What may be cleaner than directly writing the child build scripts using
the task is to use XML/XSLT to template your build
scripts...
http://nant.sourceforge.net/release/latest/help/tasks/style.html
It would probably yield a more maintainable script in the long run,
since XSLT should be much simp
On 4/19/05, Rainey, Mark (Cleveland) <[EMAIL PROTECTED]> wrote:
So I am guessing the PATH environment variable isn't being set. I runsysinfo and then check the variable with environment::get-variable('PATH').That returns the path but when I echo the ${sys.env.PATH} variable it says
nothing is set.
Curtis,
NAntContrib offers a task
(http://nantcontrib.sourceforge.net/release/latest/help/tasks/record.html),
you could use this in conjunction with the standard task
to capture and send the output of a segment of your build output.
--
Troy
Chris,
I can think of one way, but it's not the cleanest. Basically it
reverses the normal kind of looping logic:
Code might need tweaking, it's not tested, but the basic idea is that
the loop will be executed t
Jonathan,
You could use the task instead of target dependencies to
achieve what you are trying... something like...
If you use that in multiple places, you can put it through the
evolution cycle and replace the strings with properties and create a
utility target that you
The if property requires a boolean value (true or false)... you need
to perform the comparison as part of an expression:
if="${build.type == ''}"
Hope that helps,
--
Troy
---
SF email is sponsored by - The IT Product Guide
Read honest &
Chris,
Try the task in recent releases of nant-contrib (it is in RC2).
http://nantcontrib.sourceforge.net/release/latest/help/tasks/trycatch.html
Note that nant-contrib and nant should be at the same version for
maximum compatibility.
Regards,
--
Troy
---
> The point is that you can't nest ${...} properties but you CAN still
> concatonate strings in expressions, so '.\${src.dir}' becomes '.\$' +
> src.dir
Actually, '.\${src.dir}' becomes '.\' + src.dir... the backslash here
is a directory separator, not an escape character.
-T
-
Paul,
you're checking out your code to C:\Inetpub\wwwroot\NAnt, I assume
this is not the same place you are running your build from?
If not, try adding a "basedir" attribute to your sources and resources
elements...
You could then pull the path out into a property to redu
Xavier,
> But it doesn't expand the ${property::get-value(buildfile.id)} in the
> count_buildfile function.
Here, you're actually expanding the "buildfile.id" property twice.
The simplest way to get the value of the property is ${buildfile.id}.
In a more general comment, your target to count t
Does the setting the "includeemptydirs" attribute on the task
prevent the directories being created in the target location?
I'm not sure if NAnt should copy directories if all of the files they
contain are excluded.
Hope this helps,
--
Troy
--
Evan,
NAnt has been modified to fail the build if it encounters any invalid
attributes (previously it just displayed a warning message). There is
no "value" attribute in the task, so NAnt is erroring.
Is it a problem to remove the "value" attribute from your script?
--
Troy
---
Once a fileset has been created, I don't think there's any way to
change the contents, as far as I know.
With this in mind, you should be able to do something like what you're
after by creating the fileset as late as possible:
--
Troy
Owen Rogers wrote:
i would recommend treating the task of accelerating your build in the
same way that you would treat any performance improvement task: start
by profiling your build. determine which targets/tasks take the most
time and start by optimising them. the recent patch that i submitted
Claudio Pacciarini wrote:
Hi guys!
I wonder: how could I accelerate my NAnt builds? Any trick will be
appreciated.
Currently, I'm building 28 projects. If I do "nant clean build", it
takes 99.7 seconds to finish, which is ok (it takes time to compile,
it's not NAnt's fault). No problem here.
B
> Original Message
>From: [EMAIL PROTECTED]
>
>Check out this code fragment:
>
>
>
>
>The echo statement shouldn't happen if property2 doesn't exist;
>however, the following error happens:
>
>Property evaluation failed.
>Expression: property2 is ${property2}
>
> Original Message
>From: [EMAIL PROTECTED]
>
> [snip]
>
>OK - I've whipped up a couple of custom functions using the script
>task to inspect the contents of a fileset. Heres the script :
>
> [snip]
>
>[Function("to-string")]
>public string Contains( string fsetID ) {
>
>
[EMAIL PROTECTED] wrote:
Griffin,
Try
Once you've entered an expression context ${}, you don't need to further
escape your properties... you do however need to quote your literal strings.
Hope that helps,
-- Troy
---
SF email is sponsored
Chris Fewtrell wrote:
Hi
In build scripts, often I want to carry on executing the script even
though the last task has failed (ie. use failonerror="false") but I
would like to know that the preceeding step has failed so I can do some
different processing to normal.
What do you think of the
Byrd, Payton wrote:
I'm current invoking nant by creating a new Process and starting it. I
would like finer-grained control, plus the ability to initiate a debug,
by starting the build directly in my code in a new thread. Has anyone
already done this? If so, would you mind sharing the code?
Risler, Dave wrote:
Hi,
I’ve got a conditional that if a pipe (|) is in the path of a changeset,
I want to do a of the version number that follows it. For some
reason, it’s not able to eval the pipe, even when I used an escape (\|).
Thanks,
Dave
> [snip]
Dave,
You need
Byrd, Payton wrote:
I cannot find any documentation for how to do Boolean tests such as if a
&& b. How do I do this without nesting if tasks?
The boolean operators are documented at
http://nant.sourceforge.net/release/latest/help/fundamentals/expressions.html#operators
Well, they're at least ment
Byrd, Payton wrote:
I'm afraid this isn't working for me.
Our system is structured like this:
default.build is our bootstrapper. It sets up shared properties for all
of the builds and loops through a CSV file calling the specified targets
against ProjectTemplate.build for each line in the CSV fil
Merrill Cornish wrote:
Bevan,
every task needs to have built in "smarts" to support rollback.
Perhaps you have suggested an elegant way of providing
> transaction-like operation while not putting undue stress
> on Charlie.
What if each definition could include an OPTIONAL
> error recovery . As
Eric Deslauriers wrote:
What I need to do with the above snippet is change test’s failonerror to
TRUE when not doing code coverage, but to FALSE when doing codecoverage,
then pass the fail back to codecov to propogate out. Basically like
catching and rethrowing an exception.
Thanks!,
Eric
Eric
John Hardin wrote:
On Tue, 2004-12-14 at 04:40, Troy Laurin wrote:
The cleanest solution (IMHO) was to create a custom try/catch/finally
task... your codecov target becomes:
GACK!
Where is this documented? Is this part of the standard syntax for all
targets
J. Christopher Six wrote:
The "if" attribute definitely seems to be malfunctioning. Here is my test build:
The results of running this on Gentoo:
$nant test.build
<...snipped irrelevant messages...>
Target(s) specif
Chris Hetlinger wrote:
I need to perform a task such as compiling a VS.net solution and then do
different tasks depending on whether the original task succeeded or
not. I do not just want to quit if the task fails. How can I implement
this if-then-else construct in a NAnt build?
Chris Hetling
Gert Driesen wrote:
Rutger Dijkstra wrote:
[snip]
One can, of course, distribute the relevant documentation by making
it available online; this is a respectable thing to do. However,
that would mean that you have to ensure the continued availability
of the documentation of older versions of NAnt: p
Bill,
The problem is that the name attribute of the include element is being
evaluated regardless of whether the if attribute evaluates to true or false.
The only workaround I know of is to protect the entire task containing
the if-protected element inside a dual if/unless block... in the if
bl
[EMAIL PROTECTED] wrote:
Couldn't you just make properties from -D not read-only and just have a
higher precedence than ? I know in Ant -D has higher
precedence. if(property set via -D) { don't throw } ?
Just to clarify...
In Ant, all properties are read-only... that is, they always keep the
fi
Edwin,
Another alternative is to unify build/rebuild and decide between them
with properties...
Regards,
-- Troy
-Original Message-
*From:* [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
*Castro, Edwin Gabriel (Firing Systems Engr.)
*Sent:* Thursday, Septem
Kevin Williams wrote:
Troy Laurin wrote:
There are cons, one being it's harder to insert data into an xml file
than it is to create a new one
I have found the xmlpoke task to be quite simple to use.
My issue with xmlpoke is that it is great for changing nodes and
attributes in-place,
Should this be on nant-dev rather than nant-users?
Anyway, comments below...
Gert Driesen wrote:
Hi Clayton,
It would be great if we would not have to reply on some local file to
determine the last successful daily build. Perhaps we could use a file on
our sf project site to store the date of the l
McCullough, Gary wrote:
Can anyone explain this to me? Is it a bug or a feature? This code:
It's in the documentation, so I'd go feature.
http://nant.sourceforge.net/help/tasks/foreach.html
"The property is returned to its normal value once it is used."
Bonus question:
Anyone know an easier way to
Merrill Cornish wrote:
Jim,
How would this differ from using XML comments in the build
files?
Clumsiness, or lack thereof.
XML comments are verbose and stand on a level with the elements they
are supposed to be commenting on. Therefore, it's not always clear
who they apply to.
Personally, there's
Felice Vittoria wrote:
Gary,
Thanks. I kinda knew this was going to be the answer to my question :~(
Felice
> [...]
I was wondering ... is it possible to do something like:
McCullough, Gary wrote:
How do you get VS.Net to recognize a .build file as an xml file?
Personally, I always use an extension of .xml, and specify the build
file using -f
YMMV :-)
I don't have VS.Net handy (just started a new job, back in the Java
world), so I can't check for myself... is there
Gert Driesen wrote:
Ian MacLean wrote:
This seems to be causing a lot of grief. I'm really leaning towards
having a list of elements at the project level and
allowing those and only those values to be passed on the
commandline. I'm not sure how feasible that would be with the way
we pass properti
Merrill,
One user got the internal error shown below. Following the internal
> error listing is the part of the NAnt make-cvs-tree target that was
> being executed when the problem occurred.
My script starts by echoing its command line arguments and various
> other important pieces of information.
Merrill Cornish wrote:
Thanks. However, NAnt needs a bit more graceful "type mismatch" syntax
message than triggering a stack tract starting in the temporary
directory of Gert's workstation. :-)
That's a valid comment :-)
Gert Driesen wrote:
> Implicit conversion has not yet been removed from NA
Merrill Cornish wrote:
It all started out innocently enough with me trying to conditionalize an
message depending on whether the size of a certain file was greater or less than a certain
limit. Things when down hill from there. Below is a simplified NAnt script and the output
it produced.
To
Johnson, Russell D. wrote:
Does nant contain any functionality for creating a share and assigning
permissions on it? I've looked through the nant and nantcontrib tasks,
but don't see a (for example) task.
Thanks in advance.
One way to do this would be to use the task and execute 'net use'
Eg:
The is currently not support on Mono. The reason for this is
that the