ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sascha Freitag" <frei...@objtec.com>
Subject RE: Deriving new properties based on existing properties
Date Thu, 30 Jan 2003 08:08:06 GMT
Hi Dominique,

Dominique, you're right. That is not a good example. But that is only a
snipped out of a longer script which we use to build a component. It was the
fastest and easiest way for me to show the general usage.

Sascha

P. S. Naresh I'm glad to here that all works.
-----Original Message-----
From: Dominique Devienne [mailto:DDevienne@lgc.com]
Sent: Mittwoch, 29. Januar 2003 21:17
To: 'Ant Users List'
Subject: RE: Deriving new properties based on existing properties


The particular example given could have been achieve with <condition> and
<equals>. Granted would have required two <condition>s since the latter can
only set two properties at a time, but still...

Capitalizing first work letters is another story of course. --DD

-----Original Message-----
From: Naresh Bhatia [mailto:NBhatia@sapient.com]
Sent: Wednesday, January 29, 2003 2:04 PM
To: Ant Users List
Subject: RE: Deriving new properties based on existing properties

Thanks sascha. That will work for me!
Naresh

-----Original Message-----
From: Sascha Freitag [mailto:freitag@objtec.com]
Sent: Wednesday, January 29, 2003 2:26 AM
To: Ant Users List
Subject: RE: Deriving new properties based on existing properties


So fare as I know you have to do this with a script or your own task.
Use <script> and any of the supported script languages see
http://jakarta.apache.org/bsf/ for further information.

Here an javascript snipped:
<project basedir="../" name="projectname">
	.
	.
	.
        <script language="javascript"> <![CDATA[
            var prj = projectname;
            var entityclasses =
prj.getProperty("component.entityclasses");
            // generate entities
            if ( (entityclasses != null) && (!entityclasses.equals(""))
) {
                generate = true;
                prj.setProperty("component.generate", "true");
                prj.setProperty("component.generate.entity", "true");
            }
        ]]></script>

Sascha
-----Original Message-----
From: Naresh Bhatia [mailto:NBhatia@sapient.com]
Sent: Dienstag, 28. Januar 2003 23:46
To: ant-user@jakarta.apache.org
Subject: Deriving new properties based on existing properties


Is there any way to derive new properties based on existing properties?
For example, given a property with value="user", I want to derive
another property with the first letter capitalized, i.e. "User". I would
like to use this approach to derive different filenames based on a base
name that is supplied as a parameter.

Thanks
Naresh


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


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

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



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


Mime
View raw message