ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
Subject Re: transform (regexp ?) question
Date Tue, 30 Oct 2001 02:22:04 GMT
You could use JavaScript to do this using the <script> tag.  Here's a
segment I snagged from OpenJMS's build.xml that does something similar:

<script language="javascript">
<![CDATA[
       var label = openjms.getProperty("version.label");
       label = label.replace(".", "_");
       openjms.setProperty("version.label", label);

  ]]>

Note: "openjms" is the <project> name attribute value and that is how
<script> provides access to the Project.

    Erik


----- Original Message -----
From: "Johannes Zellner" <johannes@zellner.org>
To: <ant-user@jakarta.apache.org>
Sent: Monday, October 29, 2001 5:45 AM
Subject: transform (regexp ?) question


> Hi,
>
> I'd like to set a property according to the path of the current dir.
>
> Example:
>     ${user.dir} == /home/joze/jsrc/org/zellner/Fred
> then I'd like to have a property
>     ${myproperty} == org.zellner.Fred
>
> Is this possible with an ant task ?
>
> --
>    Johannes
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
>



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


Mime
View raw message