[ant-contrib - Help] unable to get Propertyselector example workin
"SourceForge.net" <[email protected]>
| Newsgroups | gmane.comp.java.ant-contrib.devel |
|---|---|
| Message-ID | <[email protected]> |
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=4301405
By: darth_punk
I am trying to get the example of the propertyselector task working, described
in the ant-crontrib manual. Its about this example:
The following code
<property name="package.ABC.name" value="abc pack name" />
<property name="package.DEF.name" value="def pack name" />
<property name="package.GHI.name" value="ghi pack name" />
<property name="package.JKL.name" value="jkl pack name" />
<propertyselector property="pack.list"
delimiter=","
match="package\.([^\.]*)\.name"
select="\1"
casesensitive="false" />
would yield the results
ABC,DEF,GHI,JKL
You could then iterate through this list using the ForEach Task as follows:
<foreach list="${pack.list}"
delimiter=","
target="print.name"
param="pack.id" />
<target name="print.name" >
<propertycopy name="pack.name" value="package.${pack.id}.name" />
<echo message="${pack.name}" />
</target>
Would print
[echo] abc pack name
[echo] def pack name
[echo] ghi pack name
[echo] jkl pack name
however when i try tris on my dev box, i'm getting this error:
C:\projecten\Testproject\build.xml:186: The following error occurred while executing
this line:
C:\projecten\Testproject\build.xml:194: Property 'package.GHI.name' is
not defined.
I'm using Eclipse 3.2 as IDE, JDK 1.6 and Ant 1.7.0. I only changed the propertycopy
task into
<propertycopy property="pack.name" from="package.${pack.id}.name" override="true"
/> because, the name ATTRIBUTE does not accept the value attribute.
Does someone know what is wrong in the example?
______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=113701
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/