I definitely think that defining what a legal property name is would be a big benefit.
As it stands, "" is a legal property name, I can write <property name="" value="I'm a
nameless property!"/><echo message="${}"/> and it's legal. This has a practical
consequence, in that I think it's currently impossible to correctly parse the -D
argument if you don't know what the legal range for property names is. I could think
of a couple other good candidates for names (underscore springs to mind), but any
definition is better than none.
It seems like Ant is pretty extensive prior art here and I've been thinking that NAnt
should try to follow their lead, not for compatibility but because it's a proven
system. I'm not very experienced with Ant, but I did some checking in Hatcher &
Loughran's new book and it looks like the Ant approach is the <condition> task.
Essentially, you define a task that has condition children that can be combined with
<and>, <or> and <not>. The documentation is at
http://jakarta.apache.org/ant/manual/CoreTasks/condition.html, documentation for
supported condition child elements is at
http://jakarta.apache.org/ant/manual/CoreTasks/condition.html.
-----Original Message-----
What do people think of restricting property names to the following
regular expression:
^([\w-\.]+)$
This would mean that only:
A-Z a-z 0-9 and '-' '.' would be allowed. If someone wants to restrict
it further to prevent leading numerics and - or . characters that would
be fine.
I'm starting work on adding functions to nant and the syntax I was
thinking of using is this:
<echo message="The current time is ${Time.ToString()}"/>
I want to detect a function by looking for
function-name(parameter1,param2, ...)
I see functions being added in much the same way as tasks are being
added now. There will be a core set of functions but people can create
new functions and nant will auto load them.
The set of functions I see going into NAnt is something like this:
String manipulation
Contains(string, substring) => boolean
NormalizeSpace(string) => string
Format(format, ...) => string
StartsWith(value, substring) => boolean
StringLength(string) => number
Substring(value, start) => string
Substring(value, start, length) => string
SubstringAfter(value, substring) => string
SubstringBefore(value, substring) => string
Translate(value, from, to) => string
Probing
FunctionExsists(name) => boolean
PropertyExsits(name) => boolean
FileExsists(name) => boolean
DirectoryExsists(name) => boolean
Conditionals
Equal(value1, value2) => boolean
EqualIgnoreCase(value1, value2) => boolean
Conversions
Boolean(value) => boolean
Number(value) => number
String(value) => string
Others
TempFileName() => string
TempDirectoryName() => string
Guid() => string
-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing
real-time communications platform! Don't just IM. Build it in!
http://www.jabber.com/osdn/xim
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers