ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 33253] a wrapper for the java.lang. String class to modify properties
Date Wed, 14 May 2008 00:54:26 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=33253





--- Comment #8 from Colm Smyth <lateralcoder@gmail.com>  2008-05-13 17:54:26 PST ---
The feature proposal in principle seems sound. I would suggest changing the
parameter names to "argN" to be compatible with the existing Ant equals
feature, and the "src" attribute to "value".

However when you introduce substring() and length(), you also introduce the
requirement to do integer arithmetic on properties, using (say) an "evaluate"
task as follows:

<string property="fileNameLength" method="length" src="${fileName}" />
<evaluate property="fileNameLengthMinusExtension"
expression="${fileNameLength}-3" />
<string property="fileExtension" method="substring" src="{$fileName}"
param1="${fileNameLengthMinusExtension}" />

But when you consider the effort required to deliver these features, and the
effort to code and maintain the tasks in Ant XML, I wonder if
http://ant.apache.org/manual/OptionalTasks/script.html isn't a better answer?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message