Saturday, 15 May 2010

php file from command line using ant - windows -



php file from command line using ant - windows -

i'm trying run ant script set execute various php modules e.g.

<target name="phploc" description="measure project size using phploc"> <exec executable="${basedir}/build/tools/phploc.phar"> <arg value="--count-tests" /> <arg path="${basedir}/src" /> <arg path="${basedir}/tests" /> </exec> </target>

however it's failing error "%1 not valid win32 application"

i've performed registry tweaks described here... http://php.net/manual/en/install.windows.commandline.php

and repeated them phar. if open command window can execute php or phar file typing it's name e.g. phploc.phar rather total php.exe phploc.phar it's not working via ant.

if alter ant file to:

<target name="phploc" description="measure project size using phploc"> <exec executable="php"> <arg line="${basedir}/build/tools/phploc.phar --count-tests" /> <arg path="${basedir}/src" /> <arg path="${basedir}/tests" /> </exec> </target>

everything works fine guess that's translated php.exe /build/tools/phploc.phar (or that).

the build file else's project i've cloned via git ideally don't want have alter it.

so guess don't understand why it's working via commandline (i.e. recognising .php .phar executable) not via ant. what's difference?

thanks!

nb: have php installed standalone (no apache) on windows machine beingness using build server (jenkins). path has been changed include php dir.

windows *.bat files have run thorugh cmd. alter illustration to:

<target name="phploc" description="measure project size using phploc"> <exec executable="cmd"> <arg value="/c"/> <arg value="${basedir}/build/tools/phploc"/> <arg value="--count-tests" /> <arg path="${basedir}/src" /> <arg path="${basedir}/tests" /> </exec> </target>

php ant

No comments:

Post a Comment