Mike,
One common problem when including one NAnt file in another is that they are in
two different namespaces. If your included file is in a different namespace
than your calling file, then you aren't calling what you think you are calling.
Merrill
---
Tony,
>>> individual clauses in a boolean expression are evaluated in the order they
>>> are written.
Clauses in an _expression_, yes. Arguments in a subroutine call, no. The
languages I am familiar with evaluate ALL arugments before making the
subroutine call. The order of evaluation may d
Gary,
>>> What are the arguments in favor of not changing it?
I can't think of any language that does not evaluate all arguments to a
subroutine call because invoking that subroutine. NAnt is using XML elements
much like subroutine calls where all attributes are evaluated before the
element p
Matt,
A simple version could parse tasks with literal pathnames and quietly
skip tasks that reference properties. Not perfect, but it would work
in many cases.
Merrill
---
SF.Net email is Sponsored by the Better Software Conference & EXPO
Matt,
>>> -projecthelp should parse any include tags
I think the problem is with the camel getting his nose in the tent. :-)
If you parse tasks, then you would also (I think) have to parse
properties since the include pathname could be defined by property expansion.
However, properties can b
Celio,
You need to have matching xmlns declarations in both build files _or_ you need
to qualify the include parameter.
Merrill
---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA *
Matt,
I don't believe you can do what you would like to do. As I remember from some
previous question, --projecthelp doesn't actually cause the NAnt file to be
processed so tasks and ${propertyname} substitutions aren't executed.
Instead, --projecthelp merely reads the NAnt file serially loo
If you script B in script A, then after the statement,
script A will see all of the properties in script B.
Merrill
---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straight
Sachin,
If your root build file does an of the other build files, then after
the point where the include occurs in the root build file, the root build file
will have access to any properties defined in the included files.
Merrill
---
This S
Kevin,
Everything inside the ${ ... } will be evaluated UNLESS it is quoted. Since I
assume BLOCK is the name of an environment variable rather than of a property
to be evaluated, try single quotes around it.
Merrill
---
This SF.Net email i
Evan,
>>> there might be a need to attach one file on success, and another on failure,
>>> but I'm not sure what that would be.
One common usage would be to attach files on failure to help diagnois the
failure, but not attach anything on success.
Merrill
--
Tony,
You might also try ${environment::get_variable('SRCROOT')} to see if you can
just extract that one environment variable.
As for PATH, there was some discussion about that one before. Be sure you are
capitalizing it as it appears in a SET statement in a DOS console window. For
some Wind
Tony,
Try adding just "SRCROOT" (no "sys.end" prefix) to your environment, then check
the value of the "sys.SRCROOT" property in your script. In general, if you
have specified a prefix of "xxx", the environment variable "ABC" will show up
as property "xxx.ABC".
Merrill
-
Sandeep,
When you launch NAnt, you can provide property values on the command line with
the
NAnt -buildfile:nantFilename -D:propertyName=propertyValue targetName
You can include as many -DpropertyName=propertyValue declarations as you want
on the command line that launches NAnt.
Or...
Shelly,
You use ${ ... } in a NAnt statement to cause whatever is between the curly
braces to be "evaluated". The simplest evaluation is to just write a property
name. You can also use it to evaluate function calls and so on.
Since everything inside a ${ ... } is evaluated, there is no need t
I have been running NAnt 0.84. I needed to so some upgrades to a NAnt script,
so I decided to upgrade to the current NAnt 0.85 rc3, which involves weeding
out some deprecated and obsolete code.
One of the things I had been using was the task with "cvsroot" and
"password" attributes, but "pass
Brian,
You can create a NAnt script that contains only statements rather
than targets. Then you can use an task in another NAnt script to
call the properties-only script. All of the properties in the properties-only
script will then be defined in the calling script.
The effect is about the
David,
Since NAnt is freely available to anyone in the world with Internet access,
there isn't _any_ control of it. There's nothing to export since everyone who
wants it already has it.
Merrill
---
SF email is sponsored by - The IT Product
Jason,
Have you tried defining the Success and Failure targets WITHOUT the depends
attribute? Just a thought.
Merrill
---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users
Evan,
If I read this right, your two files are in different namespaces, so the
property names are actually different.
Merrill
---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from rea
Kevin,
Properties set on the command line are always read-only. So, you can't use
command line -D values to "override" script properties. Instead, the script
will have to check for the command line properties. If they do NOT exist, only
then can the script safely set the properties to a defa
Bill,
I haven't done it recently, but I've prviously been able to call targets (did
you really mean "tasks") defined in an included NAnt script from the calling
Nant script. Of course, the include must come before the call to the included
target.
Merrill
Robert,
I think there's another solution that's a little prettier.
XML allows either single _or_ double quotes to be used to delimit attributes.
So, if you use single quotes to delimit that particular arg attribute, then you
are free to use double quotes within that single quoted string.
Merr
Joe,
Put quotes around the argument to exists() if you are specifying a literal file
name. Leave off the quotes of the argument is a property name that needs to be
evaluated to get the file name.
Merrill
---
SF email is sponsored by - The I
---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op
Clive,
I'm not sure I understand you comment/concern about NAnt being too .NET centric.
At the pragmatic level, NAnt offers an task which would allow you (as
far as I know) to implement any build script that could have been implemented
in a DOS batch file.
The most obviously NAnt feature to s
Someone in our group is trying to decide whether it would be worthwhile for him
to convert a number of build batch files into NAnt 0.85. He' grumbling about
how much NAnt he has to write to dulicate the work now done by the batch files.
He's right, of course. Since NAnt is XML based, almost a
Kevin,
Do you have an xmlns declaration for the xsi namespace?
Merrill
---
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish repor
Payton,
>>> When is the nant.rollback.onfailure.chain property set?
Either I missed something in the earlier thread or I misled you. Either the
nant.onfailure or nant.onsuccess target is called 1) assuming you have defined
them (since by default they are undefined), and 2) only after the execu
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 long as you can get by
Craig,
I'm pretty sure that "link" means _link_. If you go to the FSF site, in their
explanation of the GPL (at least at one time), they gave the example of the
GPL'ed Bash application being used to call proprietary programs (which is much
like NAnt calling external programs). Since the Bash
Christopher,
>>> TreatWarningsAsErrors = "true". in the csproj files.
OK, what does TreatWarningsAsErrors = "true" actually _do_? At what level does
it work? Does it possibly simply say the solution build stops on warnings,
which it wouldn't normally do.
If the program that uses the TreatWar
Dustin,
In your , is the pathname with the space put in double quotes?
Merrill
---
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almo
Christopher,
I believe the default failonerror attribute of the task is true,
which is what you want. Could it somehow have been set to false, thereby
letting ignore the failure?
Merrill
---
The SF.Net email is sponsored by: Beat the post
Mark,
Charlie will have to answer you on that one. All I've used is the mail logger
for things I've echo'ed.
Merrill
---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Mark,
Check the NAnt documentation under doc/help/funcamentals for Loggers and
Listeners.
Merrill
---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which prod
Payton,
Check to see if the dynamic attribute of will do what you want.
Merrill
---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up
Eric,
Properties are immutable ONLY if their readonly attribute has been set to true.
Properties which are created by virtue of being -D: command line arguments are
automatically readonly. However, properties that YOU create are readonly ONLY
if you override the default of read/write and set
Eric,
Someone may have a clever/devious answer, but you may find that you can NOT set
environment variables from within NAnt--because .NET won't let you set
environment variables, just read them. It's a security thing.
Merrill
---
SF email
Felice,
>>> Public Const TEST_VERSION As String = "Test Program 1.0.0.1"
Assuming you can have more than one digit in each of the four positions:
\d+\.\d+\.\d+\.\d+
because "\d" says "any digit" and the following "+" says "one or more."
Periods are regex characters representing any character,
>>> XML is a standard and IMHO is specified to be followed.
True, but not relevant to this case.
If advertises that it processes Visual Studio solution files, then
it should process Visual Studio soution files whatever their format. If
does NOT process Vusual Studio solution files, then it
Mike,
>>> property::get-value(sql.init)
Should be property::get-value('sql.init') -- note the quotes. Without the
quotes, NAnt tried to resolve sql.init into a value and then get ITS value.
Actually, you can simplify your if-test to ${sql.init} since any non-quoted
property name inside ${ ...
Chis,
NAnt currently doesn't have an IF-THEN-ELSE construct. Instead, you have to
say IF x THEN ... followed by IF not x THEN
If you IF test is complex, you might try defining a property named something
like "is_x" then have an IF testing for is_x followed by one testing for not
is_x.
M
Brian,
Sometimes system error messages are generic to the point of being useless. The
"file already exists" may be actually indicating something else.
Can you do the move manually from the command line?
Does the destination directory aleady exist? (It probably needs to be there.)
Is the
Edwin,
>>> I can't see it if I use explorer or dir. It's just strange.
No, it's hidden. :-)
In Explorer, look under Tools | Folder Options... | View | Files and Folders
and click on Hide protected operating system files. That should let you see
the System Volume.
I don't know how this "hidi
Payton,
Check out the task.
Merrill
---
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=1
Roman,
Your
should be
(notice the quotes). Inside the ${ ... }, ALL strings are treated as a property names
to be expanded UNLESS the string is quoted. So., in your case, the property::exists()
function was evaluting "test" to be "ABC", then checking to see if property ABC
exist
Payton,
Charlie can give you the definitive answer, but I'm pretty sure I know what it will
be: You can't.
You could call your scripts from inside trivial NAnt targets by those names, if that's
what you want to do, but you can't access command line arguments other than
-D:name=value arguments
Gert,
>>>the "resultproperty" attribute will be set the the string value "-1000".
Thanks,
Merrill
---
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best
As part of our NAnt script to run tests, we have an task that power cycles the
hardware under test so we always start from a pristine state. We originally assumed
that the would always succeed, but we now know it can hang indefinitely.
The task's timeout attribute looks like exactly what we
John,
I don't know if this is a typo, but 'sys.env.;PATH' has an illegal character in it:
the semi-colon. Also, from the DOS prompt, issue a "set" to see _exactly_ what
capitalization of "PATH" is on your machine. For example, on my Windows XP Pro, it's
"Path" and sys.env will work _only_ wi
Charles,
>>> in the verbose setting for the sysinfo task. It doesn't display the environment
>>> variable properties that were set.
Actually, the verbose attribute has nothing to be with the information _collected_ by
sysinfo or the environment variables. All NAnt tasks have a verbose attribu
Charles,
Despite the fact that sys.env.PATH is the example given in the NAnt
documentation, and despite the fact that I thought that's what I used before; when I
checked, on my machine the environment variable is "Path" (i.e., initial caps only).
So, when I tried ${sys.env.Path}, it worked.
Felice,
>>> ${property::exists(rootdir)}
Everything inside a ${ ... } is evaluated UNLESS it is quoted. So, it's trying to
evalute rootdir so it can test the existence of that value. What you want is
${property::exists('rootdir')}
Merrill
-
Charles,
>>>I will try to figure out why it is not working then.
If you use the default task without a prefix attribute, then the environment
variables will have a "sys.env." prefix. For example, the PATH environment variable
would be recorded in the sys.env.PATH property. (Actually, I'm not
If one of your steps fails, does that cause the build to fail? If so, then you can
use the nant.onfailure property to specify a "cleanup" task, which will only be run
after the main build if finished. In your case, that cleanup task would write the
fail record to the SQL database.
Merrill
-
Felice,
I didn't see any funny characters, but I did notice that the block you identified
occurs twice. The second time it is over 1800 lines into the file. Does the mailer
you are using have a limit?
One way of checking for a length limit would be to temporarily comment out a couple of
the
Felice,
Gert beat me to it. If part, but not all, of the log is sent, and it's the same part
each time, then there is probably a control character or a character with the high
order bit set in the file somewhere. The log file you attached is quite long. Can
you give us an idea of where in th
Felice,
I believe that the debug level will give you everything.
For the MailLogger, you would not use the nant.onsuccess and nant.onfailure
properties. Instead, the MailLogger defines its own set of properties that you can
initialize with your mail subject line, address list , and so on.
If
When I saw earlier posts about typed properties, I didn't pay much attention. Since
typed languages are a Generally Good Thing, adding typed properties to NAnt sounded
like a good thing too. Now, after my run in with the assembly/assemblyname beast, I'm
not so sure.
The typing mechanism in ty
Felice,
There are two built-in NAnt properties: nant.onsuccess and nant.onfailure. Normally,
they are not defined. However, you can set either or both to a target(s) in your
script. If the overall NAnt build finishes successfully, then whatever task you have
named in the nant.onsuccess prop
Now I've got
This is--I thought--what Gert said to do. However, NAnt is now objecting to the
argument to assembly::get-name() as "Object must implement IConvertible."
Maybe there's elegance in here somewhere, but I fail to see it.
Merrill
--
You need to use the logger functionality. You can start and stop the logger from
inside the NAnt script. So, you start the logger at the start of the script. You
then use a build-success and build-fail target to stop the logger and mail its result.
Check out NAnt/doc/help/fundamentals/listen
Gert,
I just tried this:
where the assembly.path property had existed before, but the assemblyname.obj property
is new and the expression in the is new.
I got another "Invalid case from System.String to System.Reflection.Assembly." I
assume that means that the Ass
Gert,
Thanks for your prompt help, but I still think this change is as clear as mud. :-)
The function called assemblyname::get-assembly-name() does NOT return an assembly
name, despite the function's name. Instead, it returns and "AssemblyName object,"
which I can't find documented as a typ
Gert,
Actually, I _did_ read the nightly build doc/help before I sent the message. They may
be in there somewhere, but I didn't see any specific changes listed.
Now that I know there is a change, if I compare the documentation for
assembly::get-name() with the previous version, I see that the
The first time I ran my build script (which has been working for months) with NAnt
0.85, 10/6/2004, I got the following error:
Cannot convert argument 1 (assembly) of assembly::get-name() to
'System.Reflection.Assembly' (actual type was 'string').
Expression: Assembly= ${assembly::get-name(
Clayton,
>>> What should happen if both of these fail is the cvs task should pass in the
>>> password that was specified in the password attribute.
That sound like the .cvspass file in the filesystem takes precedence over the password
attribute of the NAnt task. Is that true? If so, then to
>>> (or alternatively, you could use \\)
The blackslash is not an escape character in XML, so that wouldn't do what you're
expecting.
Merrill
---
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your
Edwin,
In general, compilers (XML or otherwise) expand/evaluate all terms of an expression
before doing the final evaluating the expression. This means that the if= attribute
of an XML element can never "protect" the evaluation of the rest of the element.
Merrill
Felice,
Something tells me (but I can't find a reference off hand) that needs to
be a file name rather than a full pathname. The directory is in the higher-level
(basedir, perhaps).
Merrill
---
This SF.net email is sponsored by: IT Produc
Brandon,
I don't know if it applies in your case, but the the "Build" check box checked for
that project in your solution configuration?
Merrill
---
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in y
Gert,
Considering the wide range of new functionality in upcoming release, perhaps it should
be call 0.90 rather than 0.84, since it's a _lot_ more than 1% better than what it
will be replacing. :-)
Merrill
---
This SF.Net email is sponsore
XML disallows "--" inside an XML comment.
Merrill
---
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Spons
Frank,
Yes, I had that problem too. It's a problem with the 9/4/2004 nightly build. Upgrade
to a newer one and it should go away.
Merrill
---
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Ap
We are running NAnt 0.85 (Build 0.85.1712.0; net-1.0.win32; nightly; 9/8/2004). In
this particular case, NAnt was being run by Cruise Control. We are not using the CVS
built-in to NAnt, but rather CVSNT that comes with WinCVS 1.3.
The task failed. From the info messages below (extracted from
Felice,
I'll have to admit that I've never understood what a filterchain is or what it is used
for.
Merrill
---
This SF.Net email is sponsored by: thawte's Crypto Challenge Vl
Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam
Camc
We have a need to create a NAnt script whose job it is to take certain information and
write a second NAnt script with some of that information from the first script
embedded into the second one.
We can use elements and have them append to a file. That can create the NAnt
file, but
* all of
Kevin,
First
you need only one enclosing ${ ... }.
Next, because you have only one enclosing ${ ... }, EVERYTHING inside it will be
evaluated as either a function or a property name unless quotes. But,
'/ConsumerWeb/bin' is a literal string. So you need
so that "build.dir" ins
I would vote for a simple change log to be included in the nightly builds also.
Merrill
---
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports you
Bryan,
You could temporarily rename the task to something else--add a "-disabled" suffix to
its name, perhaps.
Merrill
---
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE fo
Errors on top of errors [sigh...]
We've now found that the immediate reason the example I sent you is failing is that
exec's commandline attribute string was broken across lines. (OK, I'm a neat freak,
even if I'm not too bright sometimes.) That worker script formatting detail caused
the new
For what it's worth, here is the trivial NAnt script:
This is created on the fly to carry variables to the CC.NET test box
for use by QATest.build
---
This SF
We have a big worker NAnt build script that has been, and still is, working just fine
when called from the command line directly. (I'm running the 9/8/2004 nightly build.)
For various reasons, we have a second trivial, dynamically generated NAnt script that
calls the big worker script. And unt
Gary,
>>> why can't they both be good?
They might be, in one situation or another. I would like a Best Practices document to
give me a hint as to what those situations are.
Merrill
---
This SF.Net email is sponsored by: YOU BE THE JUDGE. B
Gary,
>>> and "best" implies everything else is worse,
I've used a number of large, commercial, and apparently well-documented software
packages--only to find that what I really needed _was_ a "best practices" document.
There is a great tendency of documenters to fall into the rut of writing,
Felice,
>>>
I would guess the problem is that NAnt is expanding the value of ${temp.lib.dir} at
the time it compiles the task rather than at the time the fileset is
references. Try declaring the 'temp.lib.dir' property to be dynamic. Maybe that will
do what you want it to.
Merrill
---
Vladimir,
You would have to ask Charlie Poole, but I believe the idea of the SetUp and TearDown
methods is to provide support code that is outside of the test. Nevertheless, you can
still put Assert calls inside the SetUp and TearDown methods to do your own checks.
If one of those Assert fail
Vladimir,
>>> Tests run: 0, Failures: 0, Not run: 35
NUnit doesn't consider that to be an error, so it's not going to report an error to
NAnt.
Why is it that none of your tests are running?
Merrill
---
This SF.Net email is sponsored by BEA
Gert,
>>> That RemotingException should be fixed in the next nightly build.
That's good to know.
>>> It does not have anything to do with any XML errors
OK, but should those syntax error be getting past the parser?
Merrill
---
This SF.Net
Something strange just started happening to my NAnt executions. (I'm running NAnt
0.85 (Build 0.85.1708.0; net-1.0.win32; nightly; 9/4/2004).) The exception is shown
below. It appears that the exception is thrown AFTER the target has completed all of
its work. If it weren't for the unhandled
John,
NAnt properties can be readonly (if you specifically set the readonly attribute) or
read-write (the default). If they are read-write, then you can set the same property
as many times has you want, much like any programming variable.
The thing that catches a lot of people is that command
Jim,
>>> How would this differ from using XML comments in the build files?
Clumsiness, or lack thereof.
or
versus
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
Gert,
>>> [property descriptions] has never been supported by NAnt ... NAnt now reports
>>> unknown elements and attributes.
Perhaps NAnt could allow, but ignore, a "comment" attribute on all tasks.
Merrill
---
SF.Net email is sponsored by
Gert,
All of these immediate problems seem to have arisen not because the readonly
attribute was added to properties, but because command line parameters were
made readonly. What is the particular advantage of making command line
parameters internally readonly?
Merrill
Mark,
The usage of draco in your example shouldn't fail because of any readonly condition.
Are you sure the error message is coming from those particular lines of code?
Merrill
---
SF.Net email is sponsored by Shop4tech.com-Lowest price on B
Unfortunately, the property task's overwrite attribute can't overwrite a readonly
property--according to the documentation.
So, if you are passing a command line argument into the NAnt 0.85 script and you want
to munge that value internally, then you will have to create a second property
initi
Mark,
Beginning in NAnt 0.85, properties now have an optional readonly attribute which
defaults to false. Once the readonly attribute is set, it (apparently) can't be reset
and can't be overwritten.
Command line parameters specified by -D:propname become readonly properties in NAnt
0.85 scrip
Madhan,
Have you checked the file system to be sure you have the file
"C:\Development\VisualStudioNet\Projects\sysCFocus\slnCFocus\CFocus\Activities\TakeC"?
Merrill
---
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
1
>>>I would suggest examining your user's PATH variable
Troy,
Thanks. I'll check that when I get to work tomorrow.
Merrill
---
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DV
1 - 100 of 162 matches
Mail list logo