So, thats sorta the problem...replaceregex works on a file...not on a
property... Ant Contrib's version works on a property itself...
I wrote the macrodef as I did...as I can reuse it over and over...
On Sat, 17 Jan 2009, Georg-Johann Lay wrote:
Georg-Johann Lay schrieb:
Ant proper really is not capable to perform things that look in C like
>> char * prefix;
>> char * path;
>> char * suffix = path + strlen (prefix);
or like
>> String prefix;
>> String path;
>> String suffix = path.substring (prefix.length());
in Java?
Hi, I found this solution:
<!-- remove prefix from path -->
<tempfile property="prefix.file" />
<echo message="${path}" file="${prefix.file}" />
<length property="prefix.length" string="${prefix}" />
<replaceregexp file="${prefix.file}" match="^.{${prefix.length}}(.*)"
replace="path.suffix=\1" />
<property file="${prefix.file}" />
<delete file="${prefix.file}" deleteonexit="true" />
<echo message="path.suffix=${path.suffix} via ${prefix.file}" />
What I don't like are the accesses to the file system.
Can they be avoided?
You ant experts certanly know smarter ways to do this :-)
Regards, Georg-Johann
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org
Scot P. Floess
27 Lake Royale
Louisburg, NC 27549
252-478-8087 (Home)
919-754-4592 (Work)
Chief Architect JPlate http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim
Architect Keros http://sourceforge.net/projects/keros
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org