ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Naresh Bhatia" <NBha...@sapient.com>
Subject RE: Deriving new properties based on existing properties
Date Wed, 29 Jan 2003 20:03:45 GMT
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


Mime
View raw message