By adding expression support we are moving functionality from the tasks (defined by xml) to the expression engine. Now I am starting to think about how to add support for extensions to the expression engine; just like I think about how to add functionality by creating new tasks. This is the slippery slope that I think we need to be careful about.
It isn't that I don't think this support is cool, and in many cases can simplify instances of use, but I wonder about whether adding expression support (and custom functions) is going to change the over-all feel of the build file, and make it more confusing in general. On the other hand, esp. as programmers, it is nice to allow for expressions instead verbose xml elements :) Really I just want to make sure we get the feedback, user comments, and support we need for adding this feature. Maybe the next step after we discuss this on the dev list is to get together another summary email for the user list. Then we can make a final decision about if we want to add this new feature to a release. BTW. I really appreciate all the work you have done so far. Don't take my interest in this discuss as anything more than a check to make sure we are making the correct decision. ----- Original Message ----- From: "Jaroslaw Kowalski" <[EMAIL PROTECTED]> To: "Scott Hernandez" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Sunday, December 07, 2003 12:05 PM Subject: Re: [nant-dev] SUMMARY: Expression Syntax > Thanks for your opinion Scott. > > > Now for the larger question, Does everyone want expression support in > NAnt? > > > > I think there are some real benefits to adding expression support. It will > > make things much more flexible. But it also means that more complicated > and > > possibly harder to read build files can be built. I don't want to inundate > > our users with features that could make maintenance harder. > > I actually think that when we have EE in place, we could gain some > simplicity and ease maintenance by removing or deprecating some tasks and/or > properties. > > Take a look at: > > <available> > <readregistry> > <sysinfo> > <tstamp> > <xmlpeek> > <script> > <if> > <ifnot> > > Each of these tasks is used to test or retrieve some values (from > filesystem, registry, system configuration, system clock, XML file). > They are all candidates for predicates available in expression evaluator. > > Example 1: > ========= > > Instead of: > > <available type="File" resource="myfile.txt" property="myfile.present" /> > <if propertytrue="myfile.present"> > ... > </if> > > you could simply write: > > <if test="${fileexists('myfile.txt')}"> > </if> > > Example 2: > ========= > > Instead of: > <readregistry property="sdkRoot" > key="SOFTWARE\Microsoft\.NETFramework\sdkInstallRoot" hive="LocalMachine" /> > > you could write: > > <property name="sdkRoot" > value="${registry.readValue('HKLM\Software\Microsoft\.NETFramework\sdkInstal > lRoot')}" /> > > or even use it in an expression: > > <if > test="${registry.keyPresent('HKLM','Software\Microsoft\Windows\CurrentVersio > n\Uninstall\NAnt')}"> > </if> > > Example 3: > ========= > > Instead of: > > <tstamp property="build.date" pattern="yyyyMMdd" verbose="true" /> > > one could write: > > <property name="build.date" value=${dateToString(now(),'yyyyMMdd')}" /> > > Example 4 (taken from today's question to nant-users): > ========= > > <property name="version.build.plus.one" value="${version.build + 1}" /> > > (this eliminates the need for <script> task in some cases) > > Example 5: > ========= > > Instead of: > > <sysinfo /> > <echo message="PATH is: ${sys.env.PATH}" /> > <echo message="temporary folder is: ${sys.os.folder.temp}" /> > > you could write: > > <echo message="PATH is: ${getenv('PATH')}" /> > <echo message="temporary folder is: ${gettemppath()}" /> > > This means that property space is less cluttered with system entries. > > Jarek ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ nant-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-developers