phing

How to fail Phing without triggering backtrace

我只是一个虾纸丫 提交于 2019-12-11 03:23:55
问题 Before my main phing task runs, it first checks that all required properties have been set. If a property is missing or invalid, it calls a FailTask to end execution - which works. <if> <equals arg1="${build.db.host}" arg2="" /> <then> <fail msg="build.db.host is empty." /> </then> </if> Alas, the FailTask throws a BuildException (with the msg), which throws an 'error in IfTask' - both of which are displayed twice, with their backtraces, giving me a 60-line screen dump for a one line message!

Return value when internally calling target with phing/phingcall

风格不统一 提交于 2019-12-11 03:08:50
问题 I am calling a target by means of phingcall command. I want to pass back a status variable from the called target or at least change the existing value from the calling target. Goal: I want to branch in my main target controlling logic if the sub target fails which I indicate with a property. The code below does not work. Any idea how to make it work or an altertive approach for my goal? Thanks, Juergen <target name="main"> <echo>target a</echo> <echo>${bOk}</echo> <exec command="echo 1"

does phing support arrays with keys and values?

做~自己de王妃 提交于 2019-12-11 02:56:12
问题 In phing i can set this: <property name="build.myArray" value="something1, something2, something3" /> And then retrieve each value like this: <foreach list="${build.myArray}" param="replace.me" target="build:create-vhost" /> <target name="build:create-vhost"> <filterchain> <replacetokens begintoken="@" endtoken="@"> <token key="REPLACE_ME" value="${replace.me}" /> </replacetokens> </filterchain> </target> My question is can i do the same this but using array with keys and values? Something

Stop phing deployment if code coverage is below 85%

假如想象 提交于 2019-12-11 02:46:20
问题 Am using a phing to deploy my php code but we need to add a condition to stop the deployment if any of the PHP Unit test cases fails or code coverage is less than 85% We were able to add the PHP Unit test case condition by adding following code in built.xml <phpunit haltonerror="true" haltonfailure="true" printsummary="true"> </phpunit> Now i need to test for the code coverage percentage, Please let me know how can i do that? 回答1: With Phing's own PHPunit task being used, you could

How do I tell Phing where PHPUnit is installed?

心已入冬 提交于 2019-12-10 19:39:35
问题 Both Phing and PHPUnit were installed from pear on ubuntu 12.04. PHPUnit is located at /usr/bin/phpunit and /usr/bin is on the unix path and also on the include_path in PHP.INI How do I tell Phing where PHPUnit is installed? webroot@gm3:~/med1/pub$ phing utest Buildfile: /home/webroot/med1/pub/build.xml myproject > utest: [echo] Unittests PHPUnit... Execution of target "utest" failed for the following reason: /home/webroot/med1/pub/build.xml:8:40: /home/webroot/med1/pub/build.xml:8:40:

How can I conditionally replace tokens in a config file with Capistrano or Phing?

倖福魔咒の 提交于 2019-12-10 11:42:06
问题 I would like to try out Capistrano to deploy a PHP application but can't see an option for replacing tokens in config files for different environments. I'm using the Slim microframework which just uses an array in index.php for config variables like database username etc. I would like to put tokens such as %dbuser% in there which would be replaced at deploy time based on whether I am deploying to staging or production. Is this possible in Capistrano? Or would I use something like Phing to do

build.xml to set date and time as file name

三世轮回 提交于 2019-12-10 04:26:49
问题 I want to set file name with date and time attached to it so I want to create file named as behat-20140913-195915.html however the example below sets the name as behat-yyyymmdd-hhiiss.html . Anyone know the solution to problem? I followed this example Note : These two don't work too: ${DSTAMP} ${TSTAMP} <?xml version="1.0" encoding="UTF-8"?> <project name="Sport" default="build-default" basedir="."> <tstamp> <format property="TODAY_MY" pattern="yyyymmdd-hhiiss" locale="en,UK" /> </tstamp>

Echo linebreak to file using Phing on Windows

拟墨画扇 提交于 2019-12-10 02:11:40
问题 In my build script I'm trying to output the date and SVN revision number to a file in the build directory. I would like the date and revision number on separate line, but can't get a linebreak to output to the file. I've tried all sorts of methods: <echo file="${build.dir}\build.txt">DATE = ${DATE} \r\n \\\r\\\n PHP_EOL</echo> <echo msg="DATE: ${DATE} \r\n \\\r\\\n PHP_EOL 0x0D0A SVN revision: ${svn.lastrevision} . PHP_EOL" file="${build.dir}\build.txt" append="true" /> Has anyone else

what can Phing do that Ant can't?

大城市里の小女人 提交于 2019-12-10 01:10:01
问题 I'm doing PHP development and I'm thinking of using one of these. I have both PHP and Java installed on my machine. In theory I could use any of the two. What are the compelling arguments to pick Phing over Ant? 回答1: The greatest argument I have in favor of Phing is that it's fully developed in PHP ; which means, at least : You can debug it / submit patches if you want You can develop tasks in PHP including tasks which are specific to your project that can use stuff from your project (I've

svn checkout not working via phing

巧了我就是萌 提交于 2019-12-08 05:47:52
问题 I'm currently trying to write an internal application to be able to deploy our projects to acceptance and production servers with a single click. We are using phing to accomplish this. At the moment I'm having difficulty checking out (or doing an svn export) the project. I use the following command: <exec command="svn checkout ${svn.host} ${svn.exportdir} --force --username server --password <password>" /> on a normal command line this works perfectly, however i get prompted to accept a