ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vikas Phonsa <VPho...@suz.com>
Subject Regular Expression Pattern
Date Fri, 05 Sep 2003 21:50:16 GMT
Hi,

Another question. I don't know anything abt regular expressions. I have a
property <property name="project.name" value="SCA_COMMON"/>

I need to set another property named "manifest.file" with value="COMMON.MF".

I need to somehow extract the string "COMMON" from the project.name and add
".MF" to it.

I was trying the propertyregex task after looking at the example given by
ant-contrib but can't get it right. The project name could be SCA_AC, SCA_LM
etc and I have to use the project name to get AC.MF, LM.MF etc.

----------------------------------------------------------------
	<property name="project.name" value="SCA_COMMON"/>
	
	<propertyregex property="manifest.name"
              input="${project.name}"
              regexp="[^\.]*\.[^\.]*\.[^\.]*\."
              replace="\2"
              casesensitive="false" />
                      
   <echo message="Here is the new property=${manifest.name}"/>
--------------------------------------------------------------------

Please guide if anyone knows how to make it work.

Vik





-----Original Message-----
From: Ken Gentle [mailto:j.kenneth.gentle@acm.org] 
Sent: Friday, September 05, 2003 2:15 PM
To: Ant Users List
Subject: Re: No supported regular expression matcher found

Look at the doc for MAPPER, specifically the "regexp" mapper.  I believe 
the same dependencies will apply - either a 1.4 jre, or installation of one 
of the supported regexp libraries into the ant './lib' directory.

         Ken

At 04:31 PM 9/5/2003, you wrote:


>Guys,
>Please shed some light on this one. I am getting the error : "No supported
>regular expression matcher found" when I try to use the propertyregex task
>or ant-contrib.
>
>I'm using java 1.3.1 and Ant 1.5.3
>
>What is a regular expression match anyways ? And how do I get it.
>
>Vik
>
>
>
>
>-----Original Message-----
>From: Vikas Phonsa [mailto:VPhonsa@suz.com]
>Sent: Friday, September 05, 2003 11:30 AM
>To: 'Ant Users List'
>Subject: RE: propertyregex task
>
>In the mailing list archive I found a similar issue. From what I could make
>out of those archive messages, either some more ant related jars need to
>added to classpath or maybe java1.4 needs to be used.
>
>I am using Java 1.3.1 and ant 1.5.3 and everything else including the other
>ant-contrib tasks are working fine.
>
>Any thoughts ??
>
>Vik
>
>-----Original Message-----
>From: Vikas Phonsa [mailto:VPhonsa@suz.com]
>Sent: Friday, September 05, 2003 10:44 AM
>To: 'Ant Users List'
>Subject: propertyregex task
>
>Hi,
>
>I am trying to use the <propertyregex> task of ant-contrib in the following
>ant script but am getting the errors listed below the script. Any ideas ??
>
>
>--------------------------Ant Script-------------------------------
><project name="test" default="siebel" basedir=".">
>         <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
>         <target name="siebel">
>                 <propertyregex property="pack.name"
>               input="package.ABC.name"
>               regexp="(package)\.[^\.]*\.(name)"
>               replace="\1.DEF.\2"
>               casesensitive="false" />
>    <echo message="${pack.name}"/>
>   </target>
></project>
>--------------------End of Ant Script----------------------------------
>
>-------------------Errors-----------------------------
>Build exception: file:c:/wsad_workspaces/br/test1/META-INF/build.xml:28: No
>supported regular expression matcher found
>Build exception: file:c:/wsad_workspaces/br/test1/META-INF/build.xml:28: No
>supported regular expression matcher found
>file:c:/wsad_workspaces/br/test1/META-INF/build.xml:28: No supported
regular
>expression matcher found
>-----------------------End of Errors--------------------------------
>
>
>Vik
>
>-----Original Message-----
>From: peter reilly [mailto:peter.reilly@corvil.com]
>Sent: Friday, September 05, 2003 8:56 AM
>To: Ant Users List
>Subject: Re: environment variable
>
>Another solution would be to use the experimental task
><presetdef/> in the nightly build.
>
>(Note: I do not have windows so I do not know if
>    <exec  executable="test.bat" .../> works, I assumed
>    that one needs to do
>        <exec executable="cmd.exe" ..>
>           <arg value="/c"/>
>           <arg value="call"/>
>           <arg value="test.bat"/>
>           <...>
>       </exec>
>)
>
><presetdef name="my.env.exec">
>   <exec executable="test.bat" newenvironment="false">
>      <env key="PNG_HOME" value="${PNG_HOME}"/>
>      <env key="ORACLE_HOME" value="${ORACLE_HOME}"/>
>      <env key="ORACLE_SID" value="${ORACLE_SID}"/>
>      <env key="SCHEMA" value="${SCHEMA}"/>
>      <env key="PASSWD" value="${PASSWD}"/>
>      <env key="NLS_LANG" value="${NLS_LANG}"/>
>      <env key="NG_PORT" value="${NG_PORT}"/>
>      <env key="MAX_USERS" value="${MAX_USERS}"/>
>      <env key="TRACE" value="${TRACE}"/>
>      <env key="COBOLREP" value="${COBOLREP}"/>
>      <env key="COBOLREPBIS" value="${COBOLREPBIS}"/>
>      <env key="JAVA_HOME" value="${JAVA_HOME}"/>
>      <env key="ANT_HOME" value="${ANT_HOME}"/>
>   </exec>
></presetdef>
>
>Then one could do:
>
><my.env.exec executable="test.bat"/>
><my.env.exec executable="test2.bat"/>
>
>Peter
>
>On Friday 05 September 2003 16:31, Jan.Materne@rzf.fin-nrw.de wrote:
> > 1) copy that <env>-part  :-)
> > 2) define that part outside in a file and include that on both places
with
> > xml-includes
> > 3) I donĀ“t know whether <include> can help here ...
> >
> >
> > Mmm, <java> supports <syspropertyset>s. I think a <envpropertyset>
would
>be
> > useful
> > for <exec> and <java> also ...
> >
> >
> > Jan
> >
> > > -----Original Message-----
> > > From: Blanchet Samuel [mailto:sblanchet@sopragroup.com]
> > > Sent: Friday, September 05, 2003 4:10 PM
> > > To: user@ant.apache.org
> > > Subject: environment variable
> > >
> > >
> > > Hi,
> > >
> > > I've a prob with the environment variables.
> > >
> > > I would like to set a lot of environment variables to use
> > > them in different process.
> > >
> > > My script is below.
> > >
> > > the pb is that I'm not able to use the differents environment
> > > variables (PNG_HOME, ORACLE_HOME,...) in the second  prog : TEST2.BAT.
> > >
> > >
> > > <exec executable="test.bat" newenvironment="false">
> > >  <env key="PNG_HOME" value="${PNG_HOME}"/>
> > >  <env key="ORACLE_HOME" value="${ORACLE_HOME}"/>
> > >  <env key="ORACLE_SID" value="${ORACLE_SID}"/>
> > >  <env key="SCHEMA" value="${SCHEMA}"/>
> > >  <env key="PASSWD" value="${PASSWD}"/>
> > >  <env key="NLS_LANG" value="${NLS_LANG}"/>
> > >  <env key="NG_PORT" value="${NG_PORT}"/>
> > >  <env key="MAX_USERS" value="${MAX_USERS}"/>
> > >  <env key="TRACE" value="${TRACE}"/>
> > >  <env key="COBOLREP" value="${COBOLREP}"/>
> > >  <env key="COBOLREPBIS" value="${COBOLREPBIS}"/>
> > >  <env key="JAVA_HOME" value="${JAVA_HOME}"/>
> > >  <env key="ANT_HOME" value="${ANT_HOME}"/>
> > > </exec>
> > >
> > > <exec executable="test2.bat"/>
> > >
> > > Could you help me ?
> > >
> > > thx
> > >
> > >  Sam
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org


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

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


Mime
View raw message