ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Forward" <milkforl...@hotmail.com>
Subject Problems using
Date Mon, 30 Sep 2002 18:12:05 GMT

I am having difficulty using the apply task to 'compile' some php code.  In
essence, I am building small websites for friends and to avoid duplication,
the dev site is in PHP, but the live site is html.  I would like to execute
the php.exe command using the following structure in the command prompt

:   php.exe A.php > A.html

The ant code to do this is shown below:

    <apply executable="php.exe" dest="${dest.dir}"  >
      <srcfile/>
      <arg value=">" />
      <targetfile />
      <fileset dir="${src.dir}" includes="*.php"/>
      <mapper type="regexp" from="^(.*)\.php$$" to="\1.html"/>
    </apply>

Unfortunately  the command prompt ">" argument is not working.  I ran the
task under -v and ant was recognizing the symbols properly but it was not
applying them.

My work around was to wrap the command in a separate batch file.  The ant
code and batch code is shown below:

    phpit.bat = php -q %1  > %2

    <apply executable="phpit.bat" dest="${dest.dir}"  >
      <srcfile/>
      <targetfile />
      <fileset dir="${src.dir}" includes="*.php"/>
      <mapper type="regexp" from="^(.*)\.php$$" to="\1.html"/>
    </apply>


I would prefer the direct approach.  Does anyone have any comments or
suggestions?

andrew f





--
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