magento-plugin/build.xml

123 lines
4.2 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* The MIT License (MIT)
*
* Copyright (c) 2011-2014 BitPay LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-->
<project name="bitpay/magento-plugin" default="build">
<!--
Default properties
-->
<property file="build.properties" />
<!--
Default build for running a build locally
-->
<target name="build" depends="lint,phpunit">
</target>
<!--
Used to run a build on Travis CI
-->
<target name="build-travis" depends="prepare">
<parallel threadCount="3">
<phingcall target="lint" />
<phingcall target="database:create" />
<phingcall target="magento:install" />
</parallel>
<phingcall target="phpunit" />
<phingcall target="ocular:code-coverage:upload" />
</target>
<target name="clean" hidden="true">
<delete dir="build/logs" verbose="true" />
<delete file="build/magento/app/etc/local.xml" verbose="true" />
</target>
<target name="prepare" depends="clean" hidden="true">
<mkdir dir="build/logs" />
</target>
<target name="lint">
<phplint>
<fileset dir="app/code/community/Bitpay/Bitcoins">
<include name="**/*.php"/>
</fileset>
<fileset dir="lib/bitpay">
<include name="**/*.php"/>
</fileset>
</phplint>
</target>
<target name="phpunit">
<exec executable="bin/phpunit" passthru="true" />
</target>
<target name="scrutinizer:ocular:download">
<if>
<not>
<available file="ocular.phar" />
</not>
<then>
<exec executable="wget" passthru="true">
<arg value="https://scrutinizer-ci.com/ocular.phar" />
</exec>
</then>
</if>
</target>
<target name="ocular:code-coverage:upload" depends="scrutinizer:ocular:download">
<exec executable="ocular.phar">
<arg value="code-coverage:upload" />
<arg value="--format=php-clover" />
<arg value="build/logs/clover.xml" />
</exec>
</target>
<target name="database:create">
<exec executable="mysql" passthru="true">
<arg value="--user=${DB_USER}" />
<arg value="--password=${DB_PASS}" />
<arg value="-e" />
<arg value="create database ${DB_NAME};" />
</exec>
</target>
<target name="magento:install">
<exec executable="bin/n98-magerun" passthru="true">
<arg value="install" />
<arg value="-n" />
<arg value="--forceUseDb=${DB_NAME}" />
<arg value="--magentoVersion=${MAGENTO_VERSION}" />
<arg value="--installationFolder=build/magento" />
<arg value="--dbHost=${DB_HOST}" />
<arg value="--dbUser=${DB_USER}" />
<arg value="--dbPass=${DB_PASS}" />
<arg value="--dbName=${DB_NAME}" />
<arg value="--installSampleData=no" />
<arg value="--useDefaultConfigParams=yes" />
<arg value="--baseUrl=http://www.localhost.com" />
</exec>
</target>
</project>