From e87bcb835d6918dc2dd8798f1245fc1877460631 Mon Sep 17 00:00:00 2001 From: Joshua Estes Date: Tue, 15 Jul 2014 12:36:02 -0400 Subject: [PATCH 1/2] Updated build script to be more standardized --- .gitattributes | 9 +- .gitignore | 14 +- .scrutinizer.yml | 29 --- .travis.yml | 8 +- build.properties | 29 --- build.xml | 198 ++++++++++++------ build/build.properties | 153 ++++++++++++++ phpunit.xml.dist => build/phpunit.xml.dist | 7 +- .../rulesets/phpmd.xml | 29 ++- build/travis.properties | 152 ++++++++++++++ composer.json | 17 +- tests/bootstrap.php | 28 --- travis.properties | 28 --- 13 files changed, 490 insertions(+), 211 deletions(-) delete mode 100644 .scrutinizer.yml delete mode 100644 build.properties create mode 100644 build/build.properties rename phpunit.xml.dist => build/phpunit.xml.dist (88%) rename tests/app/code/community/Bitpay/Bitcoins/Block/IframeTest.php => build/rulesets/phpmd.xml (59%) create mode 100644 build/travis.properties delete mode 100644 tests/bootstrap.php delete mode 100644 travis.properties diff --git a/.gitattributes b/.gitattributes index 6bc4780..d88b370 100644 --- a/.gitattributes +++ b/.gitattributes @@ -19,16 +19,15 @@ # 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. -# These files are not included when making + +# These files/directories are not included when making # an archive of this repository. +/build export-ignore /tests export-ignore .gitattributes export-ignore .gitignore export-ignore -.scrutinizer.yml export-ignore .travis.yml export-ignore -build.properties export-ignore build.xml export-ignore composer.json export-ignore +/tests export-ignore modman export-ignore -phpunit.xml.dist export-ignore -travis.properties export-ignore diff --git a/.gitignore b/.gitignore index 1cc9443..0b34963 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # The MIT License (MIT) # -# Copyright (c) 2011-2014 BitPay LLC +# Copyright (c) 2011-2014 BitPay # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -22,10 +22,10 @@ *.swp lib/bitpay/bp_config.php -bin/ -vendor/ +/bin/ +/build/cache/ +/build/docs/ +/build/logs/ +/vendor/ composer.lock -build/logs/ -build/ -build.xml -ocular.phar +composer.phar diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index e7c33bb..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,29 +0,0 @@ -# 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. -inherit: true -tools: - # @see https://scrutinizer-ci.com/docs/tools/php/security-advisory-checker/ - sensiolabs_security_checker: true - # @see https://scrutinizer-ci.com/docs/tools/php/php-analyzer/ - php_analyzer: true - # @see https://scrutinizer-ci.com/docs/tools/php/pdepend/ - php_pdepend: true diff --git a/.travis.yml b/.travis.yml index ee04321..e714753 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ # The MIT License (MIT) # -# Copyright (c) 2011-2014 BitPay LLC +# Copyright (c) 2011-2014 BitPay # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -26,8 +26,8 @@ php: - 5.3 install: - composer install -script: php bin/phing -propertyfile travis.properties build-travis +script: ./bin/phing -propertyfile build/travis.properties build-travis cache: directories: - - vendor - - build/magento + - build/cache/ + - vendor/ diff --git a/build.properties b/build.properties deleted file mode 100644 index 583f05a..0000000 --- a/build.properties +++ /dev/null @@ -1,29 +0,0 @@ -# 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. - -# Running a build locally, this also is used -# to define all the default properties. -DB_USER=root -DB_PASS=root -DB_NAME=magento -DB_HOST=127.0.0.1 -MAGENTO_VERSION=1.9.0.1 diff --git a/build.xml b/build.xml index 9718778..44e9680 100644 --- a/build.xml +++ b/build.xml @@ -3,7 +3,7 @@ /** * The MIT License (MIT) * - * Copyright (c) 2011-2014 BitPay LLC + * Copyright (c) 2011-2014 BitPay * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -28,95 +28,173 @@ - + - + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/build.properties b/build/build.properties new file mode 100644 index 0000000..248d96f --- /dev/null +++ b/build/build.properties @@ -0,0 +1,153 @@ +# 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. + +# Running a build locally, this also is used +# to define all the default properties. +DB_USER=root +DB_PASS=root +DB_NAME=magento +DB_HOST=127.0.0.1 +MAGENTO_VERSION=1.9.0.1 + +#### +# +# This properties file is used to configure the entire build. The purpose of +# this file is so that it is easy to drop it into a project and change a few +# of these settings and have a build run successfully. +# +# NOTE: You may still need to take a look at and edit `phpunit.xml.dist`. +# + +#### +# +# Directory Configuration +# + +# The main location of all the projects source code, this should be the only +# property that you need to change. Code can live in the root directory or it +# can live inside of it's own directory. +project.source=${project.basedir} +#project.source=${project.basedir}/src + +# --- You shouldn't need to edit any of the below value --- + +# Location of all executables, this is the location on the `bin-dir` that you +# have configured in `composer.json`. If you have not configured this in +# 1composer.json` the default is to put it in the `vendor` directory. +project.bindir=${project.basedir}/bin +#project.bindir=${project.basedir}/vendor/bin + +# Where to put the build artifacts, cache, logs, docs, etc. +project.builddir=${project.basedir}/build + +# Location of vendor directory created by composer. +project.vendordir=${project.basedir}/vendor + +# build artifacts for code analysis +project.logsdir=${project.builddir}/logs + +# Build artifacts that can be reused or updated, they do not need to be deleted +# every build. These would include charts and images. +project.cachedir=${project.builddir}/cache + +# Location of generated documentation such as API and code coverage +project.docsdir=${project.builddir}/docs +#### directory #### + +#### +# +# phpunit configuration +# + +# Directory that contains phpunit.xml or the phpunit.xml file itself +phpunit.configuration=${project.builddir}/phpunit.xml.dist +#### phpunit #### + +#### +# +# phpmd configuration +# + +# php source code filename or directory. Can be a comma-separated string +phpmd.source=${project.source} + +# report format, text, xml, or html +phpmd.report.format=xml + +# ruleset filename or a comma-separated string of rulesetfilenames +phpmd.ruleset=${project.builddir}/rulesets/phpmd.xml + +# send report output to this file +phpmd.report.file=${project.logsdir}/phpmd.xml + +# comma-separated string of patterns that are used to ignore directories +phpmd.exclude=${project.bindir},${project.builddir},${project.vendordir} +#### phpmd #### + +#### +# +# phploc Configuration +# + +# Source directory of project +phploc.source=${project.source}/ + +# Where to put the csv log +phploc.log.csv=${project.logsdir}/phploc.csv + +# Location of xml log +phploc.log.xml=${project.logsdir}/phploc.xml + +# Small hack to exclude multiple directories +phploc.exclude=vendor --exclude=build --exclude=bin +#### phploc #### + +#### +# +# pdepend configuration +# +pdepend.source=${project.source} +pdepend.jdepend.chart=${project.cachedir}/jdepend_chart.svg +pdepend.jdepend.xml=${project.logsdir}/jdepend.xml +pdepend.overview.pyramid=${project.cachedir}/pyramid.svg +pdepend.summary.xml=${project.logsdir}/jdepend_summary.xml +pdepend.ignore=bin,build,vendor +#### pdepend #### + +#### +# +# phpcs configuration +# +phpcs.source=${project.source} +phpcs.report.xml=${project.logsdir}/phpcs.xml +phpcs.standard=PSR1 --standard=PSR2 +phpcs.ignore=vendor --ignore=bin --ignore=build --ignore=tests/ +#### phpcs #### + +#### +# +# phpdoc configuration +# +phpdoc.directory=${project.source}/ +phpdoc.target=${project.docsdir}/api +phpdoc.ignore=vendor/,bin/,tests/ +#### phpdoc #### diff --git a/phpunit.xml.dist b/build/phpunit.xml.dist similarity index 88% rename from phpunit.xml.dist rename to build/phpunit.xml.dist index 00a8aea..38d2db5 100644 --- a/phpunit.xml.dist +++ b/build/phpunit.xml.dist @@ -3,7 +3,7 @@ /** * The MIT License (MIT) * - * Copyright (c) 2011-2014 BitPay LLC + * Copyright (c) 2011-2014 BitPay * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -27,7 +27,7 @@ - + + diff --git a/tests/app/code/community/Bitpay/Bitcoins/Block/IframeTest.php b/build/rulesets/phpmd.xml similarity index 59% rename from tests/app/code/community/Bitpay/Bitcoins/Block/IframeTest.php rename to build/rulesets/phpmd.xml index 1b572f4..acf46e2 100644 --- a/tests/app/code/community/Bitpay/Bitcoins/Block/IframeTest.php +++ b/build/rulesets/phpmd.xml @@ -1,5 +1,5 @@ - + + + + Custom phpmd ruleset to be used with BitPay projects. + -class Bitpay_Bitcoins_Block_IframeTest extends PHPUnit_Framework_TestCase -{ - - public function testSomething() - { - $this->assertTrue(true); - } -} + + + + + + + + diff --git a/build/travis.properties b/build/travis.properties new file mode 100644 index 0000000..796edbc --- /dev/null +++ b/build/travis.properties @@ -0,0 +1,152 @@ +# 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. + +# Properties file for running a build on Travis CI +DB_USER=travis +DB_PASS= +DB_NAME=magento +DB_HOST=127.0.0.1 +MAGENTO_VERSION=1.9.0.1 + +#### +# +# This properties file is used to configure the entire build. The purpose of +# this file is so that it is easy to drop it into a project and change a few +# of these settings and have a build run successfully. +# +# NOTE: You may still need to take a look at and edit `phpunit.xml.dist`. +# + +#### +# +# Directory Configuration +# + +# The main location of all the projects source code, this should be the only +# property that you need to change. Code can live in the root directory or it +# can live inside of it's own directory. +project.source=${project.basedir} +#project.source=${project.basedir}/src + +# --- You shouldn't need to edit any of the below value --- + +# Location of all executables, this is the location on the `bin-dir` that you +# have configured in `composer.json`. If you have not configured this in +# 1composer.json` the default is to put it in the `vendor` directory. +project.bindir=${project.basedir}/bin +#project.bindir=${project.basedir}/vendor/bin + +# Where to put the build artifacts, cache, logs, docs, etc. +project.builddir=${project.basedir}/build + +# Location of vendor directory created by composer. +project.vendordir=${project.basedir}/vendor + +# build artifacts for code analysis +project.logsdir=${project.builddir}/logs + +# Build artifacts that can be reused or updated, they do not need to be deleted +# every build. These would include charts and images. +project.cachedir=${project.builddir}/cache + +# Location of generated documentation such as API and code coverage +project.docsdir=${project.builddir}/docs +#### directory #### + +#### +# +# phpunit configuration +# + +# Directory that contains phpunit.xml or the phpunit.xml file itself +phpunit.configuration=${project.builddir}/phpunit.xml.dist +#### phpunit #### + +#### +# +# phpmd configuration +# + +# php source code filename or directory. Can be a comma-separated string +phpmd.source=${project.source} + +# report format, text, xml, or html +phpmd.report.format=xml + +# ruleset filename or a comma-separated string of rulesetfilenames +phpmd.ruleset=${project.builddir}/rulesets/phpmd.xml + +# send report output to this file +phpmd.report.file=${project.logsdir}/phpmd.xml + +# comma-separated string of patterns that are used to ignore directories +phpmd.exclude=${project.bindir},${project.builddir},${project.vendordir} +#### phpmd #### + +#### +# +# phploc Configuration +# + +# Source directory of project +phploc.source=${project.source}/ + +# Where to put the csv log +phploc.log.csv=${project.logsdir}/phploc.csv + +# Location of xml log +phploc.log.xml=${project.logsdir}/phploc.xml + +# Small hack to exclude multiple directories +phploc.exclude=vendor --exclude=build --exclude=bin +#### phploc #### + +#### +# +# pdepend configuration +# +pdepend.source=${project.source} +pdepend.jdepend.chart=${project.cachedir}/jdepend_chart.svg +pdepend.jdepend.xml=${project.logsdir}/jdepend.xml +pdepend.overview.pyramid=${project.cachedir}/pyramid.svg +pdepend.summary.xml=${project.logsdir}/jdepend_summary.xml +pdepend.ignore=bin,build,vendor +#### pdepend #### + +#### +# +# phpcs configuration +# +phpcs.source=${project.source} +phpcs.report.xml=${project.logsdir}/phpcs.xml +phpcs.standard=PSR1 --standard=PSR2 +phpcs.ignore=vendor --ignore=bin --ignore=build +#### phpcs #### + +#### +# +# phpdoc configuration +# +phpdoc.directory=${project.source}/ +phpdoc.target=${project.docsdir}/api +phpdoc.ignore=vendor/,bin/ +#### phpdoc #### diff --git a/composer.json b/composer.json index b614c13..374d64a 100644 --- a/composer.json +++ b/composer.json @@ -15,10 +15,15 @@ "composer/installers": "~1.0" }, "require-dev": { + "n98/magerun": "*", + "phpmd/phpmd": "*", + "phpdocumentor/phpdocumentor": "*", "phing/phing": "*", + "pdepend/pdepend" : "1.1.0", + "squizlabs/php_codesniffer": "*", "phpunit/phpunit": "*", - "satooshi/php-coveralls": "*", - "n98/magerun": "*" + "phploc/phploc": "*", + "phpunit/phpunit-skeleton-generator": "*" }, "config": { "bin-dir": "bin" @@ -31,15 +36,11 @@ "archive": { "exclude": [ "tests/", - ".coveralls.yml", ".gitattributes", ".gitignore", - ".scrutinizer.yml", ".travis.yml", - "build.properties", - "build.xml", - "phpunit.xml.dist", - "travis.properties" + "build/", + "build.xml" ] } } diff --git a/tests/bootstrap.php b/tests/bootstrap.php deleted file mode 100644 index cde7f32..0000000 --- a/tests/bootstrap.php +++ /dev/null @@ -1,28 +0,0 @@ - Date: Tue, 15 Jul 2014 12:44:38 -0400 Subject: [PATCH 2/2] Updated readme file --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 037103a..b444d95 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,6 @@ BitPay Inc Magento Plugin [![Build Status](https://travis-ci.org/bitpay/magento-plugin.svg?branch=master)](https://travis-ci.org/bitpay/magento-plugin) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/bitpay/magento-plugin/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/bitpay/magento-plugin/?branch=master) - -[![Code Coverage](https://scrutinizer-ci.com/g/bitpay/magento-plugin/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/bitpay/magento-plugin/?branch=master) - # Installation ## Download