ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juergen Hermann" ...@web.de>
Subject Re: set property values using my own task
Date Wed, 19 Oct 2005 21:37:56 GMT
On Tue, 18 Oct 2005 12:49:48 +0200, Mikael Petterson (KI/EAB) wrote:

>The purose of my task is to set the values for properties arch, 
product_number and product_revision.

Hmmm, why do you need a custom task for this?

        <loadproperties srcFile="product.attributes">
            <filterchain>
                <tokenfilter>
                    <filetokenizer/>
                    <replaceregex 
                        pattern="^([^:]+):([^:]+):([^\r\n]+)[\n\r]+([^:]+):
([^:]+):([^\r\n]+)[\n\r]+(.*)$"
                        replace="\1=\4&#10;\2=\5&#10;\3=\6"/>
                </tokenfilter>
                <prefixlines prefix="prod."/>
            </filterchain>
        </loadproperties>

		 <!-- Set default here if you need them! -->

        <echoproperties prefix="prod."/>

yields

[echoproperties] prod.PRODUCT_NUMBER=CXC1327714/22
[echoproperties] prod.TARGET=jvm
[echoproperties] prod.PRODUCT_REVISION=R1A01

Ciao, J├╝rgen



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message