Re: [nant-dev] Current target again...
- Original Message - From: Giuseppe Greco [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 02, 2004 7:49 AM Subject: [nant-dev] Current target again... Hi all, In my previous email there was a copy-and-paste problem, and my explanation was incomplete! I'll try again... I use to structure projects like this: /myProject + default.build + /src + default.build + /subproject1 | + default.build | + mySource.cs + /subproject2 + default.build + mySource.cs This structure let me build subprojects from any level. The build file located in the /src directory is just a gateway build file, and looks like this: ?xml version=1.0? project name=myProject default=recurse target name=recurse description=Builds recursively all subprojects foreach item=Folder property=foldername in items includes name=*/ excludes name=CVS/ /items /in do nant buildfile=${foldername}/default.build target=${project.config} ${target}/ /do /foreach /target /project The 'target' property of the nant task specifies two targets: ${project.config} and ${target}. Both are inherited from the calling build file (the one located in the project's root directory). ${project.config} contains 'release' or 'debug', while ${target} contains the target that should be executed in each subproject. My proposal is to introduce the concept of generic target. Let's go back to our gateway build file described above, and rewrite the recurse target as a generic target: ?xml version=1.0? project name=myProject default=* target name=* description=Builds recursively all subprojects foreach item=Folder property=foldername in items includes name=*/ excludes name=CVS/ /items /in do nant buildfile=${foldername}/default.build target=${project.config} ${nant.current.target}/ /do /foreach /target /project Generic targets would specify * as their name, and NAnt would always execute them. I don't immediately see a need for this. At that point we also need a way to get the target name specified by the calling build file, and the answer is a built-in property named ${nant.current.target}. I'm not sure we should implement this, but if we should we'd definitely implement it as a function, not a built-in property. I guess we could add the following functions : target::get-target-name or target::get-current-target() this function returns the name of the current target this would throw an exception when there's no current target target::get-description(string targetname) this functions returns the description of the specified target this would throw an exception when the targetname is null or the given target does not exist But I'd like to get feedback of other committers first ... Gert --- 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=1356alloc_id=3438op=click ___ nant-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-developers
Re: [nant-dev] Current target again...
- Original Message - From: Giuseppe Greco [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 02, 2004 7:49 AM Subject: [nant-dev] Current target again... ... My proposal is to introduce the concept of generic target. Let's go back to our gateway build file described above, and rewrite the recurse target as a generic target: ?xml version=1.0? project name=myProject default=* target name=* description=Builds recursively all subprojects foreach item=Folder property=foldername in items includes name=*/ excludes name=CVS/ /items /in do nant buildfile=${foldername}/default.build target=${project.config} ${nant.current.target}/ /do /foreach /target /project Generic targets would specify * as their name, and NAnt would always execute them. I don't immediately see a need for this. Let me show you a more detailed example. Here is a fragment of the caller build file (the one in the project's top directory): ... target name=test depends=init description=Tests the current configuration property name=target value=test/ nant buildfile=src/default.build/ /target ... In this example, the target property is set to test, and then the nant task calls the gateway build file described in my previous email. If NAnt would support generic targets, we could reduce the target above like this: ... target name=test depends=init description=Tests the current configuration nant buildfile=src/default.build target=${target::get-current-target()}/ /target ... and then let gateway build files forward targets automatically: ?xml version=1.0? project name=myProject default=* target name=* description=Builds recursively all subprojects foreach item=Folder property=foldername in items includes name=*/ excludes name=CVS/ /items /in do nant buildfile=${foldername}/default.build target=${project.config} ${target::get-current-target()}/ /do /foreach /target /project I think this would be a nice feature... but, of course, that's just my opinion. j3d. At that point we also need a way to get the target name specified by the calling build file, and the answer is a built-in property named ${nant.current.target}. I'm not sure we should implement this, but if we should we'd definitely implement it as a function, not a built-in property. I guess we could add the following functions : target::get-target-name or target::get-current-target() this function returns the name of the current target this would throw an exception when there's no current target target::get-description(string targetname) this functions returns the description of the specified target this would throw an exception when the targetname is null or the given target does not exist But I'd like to get feedback of other committers first ... Gert 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=1356alloc_id=3438op=click ___ nant-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-developers
Re: [nant-dev] Current target again...
OK guys, I'm going to implement it... I'll let you know when is done. j3d. Guis, Why don't you just implement it as a nant extension function and then see if there is enough interest to include it in either nantcontrib or nant core. Ian Giuseppe Greco wrote: - Original Message - From: Giuseppe Greco [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 02, 2004 7:49 AM Subject: [nant-dev] Current target again... ... My proposal is to introduce the concept of generic target. Let's go back to our gateway build file described above, and rewrite the recurse target as a generic target: ?xml version=1.0? project name=myProject default=* target name=* description=Builds recursively all subprojects foreach item=Folder property=foldername in items includes name=*/ excludes name=CVS/ /items /in do nant buildfile=${foldername}/default.build target=${project.config} ${nant.current.target}/ /do /foreach /target /project Generic targets would specify * as their name, and NAnt would always execute them. I don't immediately see a need for this. Let me show you a more detailed example. Here is a fragment of the caller build file (the one in the project's top directory): ... target name=test depends=init description=Tests the current configuration property name=target value=test/ nant buildfile=src/default.build/ /target ... In this example, the target property is set to test, and then the nant task calls the gateway build file described in my previous email. If NAnt would support generic targets, we could reduce the target above like this: ... target name=test depends=init description=Tests the current configuration nant buildfile=src/default.build target=${target::get-current-target()}/ /target ... and then let gateway build files forward targets automatically: ?xml version=1.0? project name=myProject default=* target name=* description=Builds recursively all subprojects foreach item=Folder property=foldername in items includes name=*/ excludes name=CVS/ /items /in do nant buildfile=${foldername}/default.build target=${project.config} ${target::get-current-target()}/ /do /foreach /target /project I think this would be a nice feature... but, of course, that's just my opinion. j3d. At that point we also need a way to get the target name specified by the calling build file, and the answer is a built-in property named ${nant.current.target}. I'm not sure we should implement this, but if we should we'd definitely implement it as a function, not a built-in property. I guess we could add the following functions : target::get-target-name or target::get-current-target() this function returns the name of the current target this would throw an exception when there's no current target target::get-description(string targetname) this functions returns the description of the specified target this would throw an exception when the targetname is null or the given target does not exist But I'd like to get feedback of other committers first ... Gert 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=1356alloc_id=3438op=click ___ nant-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-developers -- Ian MacLean, Developer, ActiveState, a division of Sophos http://www.ActiveState.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=1356alloc_id=3438op=click ___ nant-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-developers 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
[nant-dev] Current target again...
Hi all, In my previous email there was a copy-and-paste problem, and my explanation was incomplete! I'll try again... I use to structure projects like this: /myProject + default.build + /src + default.build + /subproject1 | + default.build | + mySource.cs + /subproject2 + default.build + mySource.cs This structure let me build subprojects from any level. The build file located in the /src directory is just a gateway build file, and looks like this: ?xml version=1.0? project name=myProject default=recurse target name=recurse description=Builds recursively all subprojects foreach item=Folder property=foldername in items includes name=*/ excludes name=CVS/ /items /in do nant buildfile=${foldername}/default.build target=${project.config} ${target}/ /do /foreach /target /project The 'target' property of the nant task specifies two targets: ${project.config} and ${target}. Both are inherited from the calling build file (the one located in the project's root directory). ${project.config} contains 'release' or 'debug', while ${target} contains the target that should be executed in each subproject. My proposal is to introduce the concept of generic target. Let's go back to our gateway build file described above, and rewrite the recurse target as a generic target: ?xml version=1.0? project name=myProject default=* target name=* description=Builds recursively all subprojects foreach item=Folder property=foldername in items includes name=*/ excludes name=CVS/ /items /in do nant buildfile=${foldername}/default.build target=${project.config} ${nant.current.target}/ /do /foreach /target /project Generic targets would specify * as their name, and NAnt would always execute them. At that point we also need a way to get the target name specified by the calling build file, and the answer is a built-in property named ${nant.current.target}. What's your opinion? 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=1356alloc_id=3438op=click ___ nant-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-developers