Re: [nant-dev] FW: [Nant-users] How to generate the doc on demand?

2005-05-03 Thread Julien Sobrier
Gary Feldman a écrit :
This looks like a good idea, but could be difficult to do generally 
across all tasks.

In the meantime, a simple approach that works today is to duplicate the 
task invocation with if/unless attributes, and use a property to 
indicate which to do:
 In the setup targets:
   property name=generateDocs value=true / !-- or false --

 In the build targets:
   csc target=exe output=... doc=... if=${generateDocs} /
   csc target=exe output=...   unless=${generateDocs} /
It's annoyingly verbose, but I use this idiom frequently.
Gary

Hello,
can this really work? You have to embed the source files between 
csc/csc:

csc target=exe output=${dir}
sources
include name=AssemblyInfo.cs /
include name=code/*.cs /
/sources
/csc
I don't see how I can use csc target=exe output=... doc=... 
if=${generateDocs} /.

Thank you
Julien

---
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r 
___
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers


Re: [nant-dev] FW: [Nant-users] How to generate the doc on demand?

2005-04-21 Thread Gary Feldman
Troy Laurin wrote:
Just a pie-in-the-sky (whatever that means)...
These kind of issues aren't all that uncommon in builds... how 
feasible is a meta-element attribute that can be nested under any 
element and decorates it with an attribute.  If the attribute 
meta-element supported if/unless and lazy property evaluation, then it 
could be used to do the following:

csc target=exe output=...
attribute name=doc value=${doc} 
if=${property::exists('doc')} /
...
/csc
This looks like a good idea, but could be difficult to do generally 
across all tasks.

In the meantime, a simple approach that works today is to duplicate the 
task invocation with if/unless attributes, and use a property to 
indicate which to do:
 In the setup targets:
   property name=generateDocs value=true / !-- or false --

 In the build targets:
   csc target=exe output=... doc=... if=${generateDocs} /
   csc target=exe output=...   unless=${generateDocs} /
It's annoyingly verbose, but I use this idiom frequently.
Gary

---
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
___
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers


Re: [nant-dev] FW: [Nant-users] How to generate the doc on demand?

2005-04-21 Thread Thibaut Barrère
Hi

I usually leave the doc generation always enabled. I just switch
off/on the ndoc call.

Thibaut

2005/4/21, Gary Feldman [EMAIL PROTECTED]:
 Troy Laurin wrote:
 
  Just a pie-in-the-sky (whatever that means)...
 
  These kind of issues aren't all that uncommon in builds... how
  feasible is a meta-element attribute that can be nested under any
  element and decorates it with an attribute.  If the attribute
  meta-element supported if/unless and lazy property evaluation, then it
  could be used to do the following:
 
  csc target=exe output=...
  attribute name=doc value=${doc}
  if=${property::exists('doc')} /
  ...
  /csc
 
 This looks like a good idea, but could be difficult to do generally
 across all tasks.
 
 In the meantime, a simple approach that works today is to duplicate the
 task invocation with if/unless attributes, and use a property to
 indicate which to do:
  In the setup targets:
property name=generateDocs value=true / !-- or false --
 
  In the build targets:
csc target=exe output=... doc=... if=${generateDocs} /
csc target=exe output=...   unless=${generateDocs} /
 
 It's annoyingly verbose, but I use this idiom frequently.
 
 Gary
 
 ---
 This SF.Net email is sponsored by: New Crystal Reports XI.
 Version 11 adds new functionality designed to reduce time involved in
 creating, integrating, and deploying reporting solutions. Free runtime info,
 new features, or free trial, at: http://www.businessobjects.com/devxi/728
 ___
 nant-developers mailing list
 nant-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/nant-developers



---
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
___
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers


Re: [nant-dev] FW: [Nant-users] How to generate the doc on demand?

2005-04-21 Thread Troy Laurin
On 4/21/05, Gary Feldman [EMAIL PROTECTED] wrote:
This looks like a good idea, but could be difficult to do generallyacross all tasks.
I think there is a way to do it, but it is a little more complicated
than I like... Basically the NAnt.Core.Element class could be
extended with late binding attributes, and an entry point defined to
specify the time that these attributes should be evaluated. This
should work for tasks and targets, because they can bind when Execute
is called... not so sure about data types... or even if this should be
applied to anything but tasks! Dynamic dependencies,
anyone? Wouldn't work, would it? For that matter, some
attributes should never be dynamic even on tasks, like if/unless.
Maybe these properties could be declared static-binding?

Anyway, I might have a play with it over the next few weeks, and if I
don't find any nasty side-effects with targets or other elements, then
I'll submit it as a patch post-0.85.


PS- no offense, but some of the code to initialise the project and process the build file could use some refactoring :-)

In the meantime, a simple approach that works today is to duplicate thetask invocation with if/unless attributes, and use a property to
indicate which to do:In the setup targets:property name=generateDocs value=true / !-- or false --In the build targets:csc target=exe output=... doc=... if=${generateDocs} /
csc
target=exe
output=...
unless=${generateDocs} /It's annoyingly verbose, but I use this idiom frequently.
I think most people use it, because it's currently the only way to do it :-)
It gets exponentially more annoying the larger the element needing
repetition is, though. (IMHO) Allowing dynamic attributes seems
like a much more scalable and maintainable solution for the build
script author.
-- Troy




Re: [nant-dev] FW: [Nant-users] How to generate the doc on demand?

2005-04-21 Thread Ian MacLean
Troy Laurin wrote:
Anyway, I might have a play with it over the next few weeks, and if I 
don't find any nasty side-effects with targets or other elements, then 
I'll submit it as a patch post-0.85.

PS- no offense, but some of the code to initialise the project and 
process the build file could use some refactoring :-)

none taken. That code has been reworked a number of times and is better 
than it was. However any refactoring patches would be more than welcome.

In the meantime, a simple approach that works today is to
duplicate the
task invocation with if/unless attributes, and use a property to
indicate which to do:
  In the setup targets:
property name=generateDocs value=true / !-- or false --
  In the build targets:
csc target=exe output=... doc=... if=${generateDocs} /
csc target=exe output=...  
unless=${generateDocs} /

It's annoyingly verbose, but I use this idiom frequently.
I think most people use it, because it's currently the only way to do 
it :-)
It gets exponentially more annoying the larger the element needing 
repetition is, though. (IMHO)  Allowing dynamic attributes seems like 
a much more scalable and maintainable solution for the build script 
author.

somthing like this could be a good solution. Another possibility is to 
have a way to set an attributes value such that its equivalent to it not 
being set - somthing like null for attributes. For example;
target name=notdoc
   property name=docFile value=${property::null-value()}
/target

csc target=exe output=... doc=${docFile}/
Ian

---
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
___
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers


Re: [nant-dev] FW: [Nant-users] How to generate the doc on demand?

2005-04-21 Thread Troy Laurin
On 4/22/05, Ian MacLean [EMAIL PROTECTED] wrote:
somthing like this could be a good solution. Another possibility is tohave a way to set an attributes value such that its equivalent to it notbeing set - somthing like null for attributes. For example;target name=notdoc
property name=docFile value=${property::null-value()}/target csc target=exe output=... doc=${docFile}/Ian

That certainly looks simpler to implement, and it seems equally
powerful in terms of optional attributes. I think I'm leaning
towards this as a better solution... because it doesn't introduce any
new structures the learning curve should be lower; it also doesn't
require any arbitrary rules like cannot dynamically set
if/unless. Possibly the only issue that I can think of is a
nit-pick... where would you document the null-attribute behaviour so
people can find it?

I guess the _expression_ help page for new users, and the release notes
for old users? I just wonder if the _expression_ page isn't the
obvious place to look for attribute behaviour.
-- Troy