[nant-dev] Re: Wild targets/Current target

2004-03-03 Thread Giuseppe Greco

Currently, targets in master build files look like this:



  ...
  
 


  
  ...



Then, if the NAnt group decides to accept this my
proposal, targets in master build files will look
like this:



  ...
  

  
  ...



... and gateway build files like this:



  

  

  
  

  
  

  

  



j3d.

> Giuseppe Greco wrote:
>
>>>As a curiousity, wouldn't you be able to use a regular target and
>>>properties to define what to call?  For instance, your gateway project
>>>can just do this:
>
>> Yes, but this is exactly what I'm trying to avoid...
>>
>> When a master build file contains more than 3 or 4 targets
>> to forward, you have to define lots of properties just to handle that.
>>
>> I think a wild target would be much more elegant. Furthermore,
>> be able to define a wild target that is executed when the user
>> specifies a target that does not exist in the current build file,
>> would be handy...
>>
>> Of course, that's nothing vital, but...
>
> Sorry.  :)  I just noticed your first post, describing exactly what I
> put in my message here.
>
> I suppose it's good for allowing you to specify targets for your
> subprojects without having to know about them in your master build file.
> Would you be rewriting your master to use wildcards as well?
>
> Matt.
>



Giuseppe Greco

::agamura::

phone:  +41 (0)91 604 67 65
mobile: +41 (0)76 390 60 32
email:  [EMAIL PROTECTED]
web:www.agamura.com



---
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
___
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers


[nant-dev] Re: Wild targets/Current target

2004-03-03 Thread Matthew Mastracci
Giuseppe Greco wrote:

As a curiousity, wouldn't you be able to use a regular target and
properties to define what to call?  For instance, your gateway project
can just do this:

Yes, but this is exactly what I'm trying to avoid...

When a master build file contains more than 3 or 4 targets
to forward, you have to define lots of properties just to handle that.
I think a wild target would be much more elegant. Furthermore,
be able to define a wild target that is executed when the user
specifies a target that does not exist in the current build file,
would be handy...
Of course, that's nothing vital, but...
Sorry.  :)  I just noticed your first post, describing exactly what I 
put in my message here.

I suppose it's good for allowing you to specify targets for your 
subprojects without having to know about them in your master build file. 
   Would you be rewriting your master to use wildcards as well?

Matt.

---
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
___
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers


[nant-dev] Re: Wild targets/Current target

2004-03-03 Thread Giuseppe Greco
> As a curiousity, wouldn't you be able to use a regular target and
> properties to define what to call?  For instance, your gateway project
> can just do this:
>
>name="process"
>   description="Builds recursively all subprojects">
>item="Folder"
> property="foldername">
> 
>   
> 
> 
>   
> 
> 
>buildfile="${foldername}/default.build"
> target="${project.config} ${operation}"/>
> 
>   
> 
>
> The master just needs to set the "operation" property before calling.
> I'm not certain these wildcard targets are necessary in this case.
>
> 
> 
>
> etc...

Yes, but this is exactly what I'm trying to avoid...

When a master build file contains more than 3 or 4 targets
to forward, you have to define lots of properties just to handle that.

I think a wild target would be much more elegant. Furthermore,
be able to define a wild target that is executed when the user
specifies a target that does not exist in the current build file,
would be handy...

Of course, that's nothing vital, but...

j3d.

> Giuseppe Greco wrote:
>
>> Hi all,
>>
>> I've just completed the implementation of the
>> stuff we discussed yesterday.
>>
>> Right now I'm out of office and I don't have
>> CVS access due to proxy restrictions, so
>> attached to this email you will find the
>> modified files. I'll send you a patch tomorrow.
>>
>> The modified files are:
>>
>> NAnt.Core/Project.cs
>> line81   added WildTarget const
>> line   132   added _currentTarget field
>> lines  410 -  416added CurrentTarget property
>> lines  784 -  796replaced do-while statement
>> lines 1415 - 1419added wild targets handling
>>
>> NAnt.Core/Functions/NAntFunctions.cs
>> lines   83 - 98  added GetCurrentTarget functioin
>>
>> These modifications allow you to specify a wild target
>> that is executed when the user specifies a target that
>> does not exist in the current build file. Here's an
>> example:
>>
>> >   name="myProject"
>>   default="build">
>>
>>   
>> 
>>   
>>
>>   
>> 
>>   
>> 
>>
>> if you type
>>
>>   nant hello
>>
>> from the command, you get the message "This is the hello target".
>>
>> Furthermore, using the master-gateway-slave build file pattern is
>> much easier (see my previous emails). Here below is another
>> example.
>>
>> Let's start with the usual project:
>>
>> /myProject
>>  + default.build
>>  + /src
>>  + default.build
>>  + /Subproject
>> + default.build
>> + HelloWorld.cs
>>
>> the master build file (/myProject/default.build) looks
>> like this:
>>
>> 
>>
>> >   name="myProject"
>>   default="build">
>>
>>  > name="build"
>> description="Builds the current configuration">
>> >   buildfile="src/default.build"
>>   target="${target::get-current-target()}"/>
>>   
>>
>>   > name="test"
>> description="Tests the current configuration">
>> >   buildfile="src/default.build"
>>   target="${target::get-current-target()}"/>
>>   
>>
>>   > name="clean"
>> description="Deletes the current configuration">
>> >   buildfile="src/default.build"
>>   target="${target::get-current-target()}"/>
>>   
>>
>> 
>>
>>
>> ... and the gateway build file (/myProject/src/default.build)
>> like this:
>>
>> 
>>
>> >   name="myProject"
>>   default="*">
>>
>>   > name="*"
>> description="Builds recursively all subprojects">
>> >   item="Folder"
>>   property="foldername">
>>   
>> 
>>   
>>   
>> 
>>   
>>   
>> >   buildfile="${foldername}/default.build"
>>   target="${project.config} ${target::get-current-target()}"/>
>>   
>> 
>>   
>>
>> 
>>
>> I don't report the slave build file
>> (/myProject/src/Subproject/default.build)
>> since it is like any other build file written till now.
>>
>> Wild targets allow you to write more compact build files and
>> provide a standard way to handle unexpected targets.
>>
>> What do you think about that?
>>
>> j3d.
>>
>> 
>> Giuseppe Greco
>>
>> ::agamura::
>>
>> phone:  +41 (0)91 604 67 65
>> mobile: +41 (0)76 390 60 32
>> email:  [EMAIL PROTECTED]
>> web:www.agamura.com
>> 
>



Giuseppe Greco

::agamura::

phone:  +41 (0)91 604 67 65
mobile: +41 (0)76 390 60 32
email:  [EMAIL PROTECTED]
web:www.agamura.com



---
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
___
nant-develope

[nant-dev] Re: Wild targets/Current target

2004-03-03 Thread Matthew Mastracci
As a curiousity, wouldn't you be able to use a regular target and 
properties to define what to call?  For instance, your gateway project 
can just do this:

   
 
   
 
   
   
 
   
   
 
   
 
   
The master just needs to set the "operation" property before calling. 
I'm not certain these wildcard targets are necessary in this case.



etc...

Giuseppe Greco wrote:

Hi all,

I've just completed the implementation of the
stuff we discussed yesterday.
Right now I'm out of office and I don't have
CVS access due to proxy restrictions, so
attached to this email you will find the
modified files. I'll send you a patch tomorrow.
The modified files are:

NAnt.Core/Project.cs
line81   added WildTarget const
line   132   added _currentTarget field
lines  410 -  416added CurrentTarget property
lines  784 -  796replaced do-while statement
lines 1415 - 1419added wild targets handling
NAnt.Core/Functions/NAntFunctions.cs
lines   83 - 98  added GetCurrentTarget functioin
These modifications allow you to specify a wild target
that is executed when the user specifies a target that
does not exist in the current build file. Here's an
example:

  

  
  

  

if you type

  nant hello

from the command, you get the message "This is the hello target".

Furthermore, using the master-gateway-slave build file pattern is
much easier (see my previous emails). Here below is another
example.
Let's start with the usual project:

/myProject
 + default.build
 + /src
 + default.build
 + /Subproject
+ default.build
+ HelloWorld.cs
the master build file (/myProject/default.build) looks
like this:



 

  
  

  
  

  


... and the gateway build file (/myProject/src/default.build)
like this:



  

  

  
  

  
  

  

  


I don't report the slave build file (/myProject/src/Subproject/default.build)
since it is like any other build file written till now.
Wild targets allow you to write more compact build files and
provide a standard way to handle unexpected targets.
What do you think about that?

j3d.


Giuseppe Greco
::agamura::

phone:  +41 (0)91 604 67 65
mobile: +41 (0)76 390 60 32
email:  [EMAIL PROTECTED]
web:www.agamura.com



---
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
___
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers