Permalink
Browse files

Added Ant build toolchain.

  • Loading branch information...
gsomoza committed Jul 7, 2015
1 parent e3e33bf commit f6c2b3cd1685a0c9b0fcb92fba397d5713db9bb5
Showing with 384 additions and 95 deletions.
  1. +1 −0 .coveralls.yml
  2. +3 −0 .gitignore
  3. +3 −0 .scrutinizer.yml
  4. +192 −0 build.xml
  5. +10 −0 build/phpcs.xml
  6. +26 −0 build/phpmd.xml
  7. +6 −2 composer.json
  8. +1 −1 lib/Exception/BaleenException.php
  9. +1 −1 lib/Exception/InvalidArgumentException.php
  10. +1 −1 lib/Exception/MigrationException.php
  11. +1 −1 lib/Exception/MigrationExceptionInterface.php
  12. +1 −1 lib/Exception/MigrationMissingException.php
  13. +4 −4 lib/Migration/Capabilities/OptionsAwareInterface.php
  14. +3 −1 lib/Migration/Capabilities/TransactionAwareInterface.php
  15. +2 −1 lib/Migration/Command/Middleware/SetOptionsMiddleware.php
  16. +1 −0 lib/Migration/Command/Middleware/TransactionMiddleware.php
  17. +5 −4 lib/Migration/Command/MigrateCommand.php
  18. +3 −3 lib/Migration/Command/MigrateHandler.php
  19. +2 −2 lib/Migration/Command/MigrationBusFactory.php
  20. +12 −11 lib/Migration/MigrateOptions.php
  21. +2 −3 lib/Migration/MigrationInterface.php
  22. +3 −3 lib/Migration/SimpleMigration.php
  23. +7 −4 lib/Repository/DirectoryRepository.php
  24. +3 −3 lib/Repository/RepositoryInterface.php
  25. +10 −2 lib/Storage/FileStorage.php
  26. +4 −1 lib/Storage/StorageInterface.php
  27. +28 −12 lib/Timeline.php
  28. +10 −5 lib/Timeline/TimelineFactory.php
  29. +9 −12 lib/Timeline/TimelineInterface.php
  30. +5 −4 lib/Version.php
  31. +16 −6 lib/Version/Collection.php
  32. +2 −2 lib/Version/Comparator/ComparatorInterface.php
  33. +2 −3 lib/Version/Comparator/DefaultComparator.php
  34. +5 −2 lib/Version/VersionInterface.php
View
@@ -0,0 +1 @@
src_dir: lib
View
@@ -30,3 +30,6 @@ data/tmp/
## Plugin-specific files:
# mpeltonen/sbt-idea plugin
.idea_modules/
build/pdepend
build/logs
View
@@ -0,0 +1,3 @@
tools:
external_code_coverage:
timeout: 600 # Timeout in seconds.
View
192 build.xml
@@ -0,0 +1,192 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="BEF-Api" default="build">
<!-- Uncomment the following when the tools are in ${basedir}/vendor/bin -->
<property name="toolsdir" value="${basedir}/vendor/bin/"/>
<fileset id="src" dir="${basedir}/lib">
<include name="**/*.php"/>
</fileset>
<fileset id="src-modified" dir="${basedir}/lib">
<include name="**/*.php"/>
</fileset>
<target name="build"
depends="prepare,lint,phploc-ci,pdepend,phpmd-ci,phpcs-ci,phpcpd-ci,phpunit"
description=""/>
<target name="build-parallel"
depends="prepare,lint,tools-parallel,phpunit"
description=""/>
<target name="tools-parallel" description="Run tools in parallel">
<parallel threadCount="2">
<sequential>
<antcall target="pdepend"/>
<antcall target="phpmd-ci"/>
</sequential>
<antcall target="phpcpd-ci"/>
<antcall target="phpcs-ci"/>
<antcall target="phploc-ci"/>
</parallel>
</target>
<target name="clean"
unless="clean.done"
description="Cleanup build artifacts">
<delete dir="${basedir}/build/logs"/>
<delete dir="${basedir}/build/pdepend"/>
<property name="clean.done" value="true"/>
</target>
<target name="prepare"
unless="prepare.done"
depends="clean"
description="Prepare for build">
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/>
<property name="prepare.done" value="true"/>
</target>
<target name="lint"
unless="lint.done"
description="Perform syntax check of sourcecode files">
<apply executable="php" failonerror="true" taskname="lint">
<arg value="-l" />
<fileset refid="src-modified"/>
</apply>
<property name="lint.done" value="true"/>
</target>
<target name="phploc"
unless="phploc.done"
description="Measure project size using PHPLOC and print human readable output. Intended for usage on the command line.">
<exec executable="${toolsdir}phploc" taskname="phploc">
<arg value="--count-tests" />
<arg path="${basedir}/lib" />
</exec>
<property name="phploc.done" value="true"/>
</target>
<target name="phploc-ci"
unless="phploc.done"
depends="prepare"
description="Measure project size using PHPLOC and log result in CSV and XML format. Intended for usage within a continuous integration environment.">
<exec executable="${toolsdir}phploc" taskname="phploc">
<arg value="--count-tests" />
<arg value="--log-csv" />
<arg path="${basedir}/build/logs/phploc.csv" />
<arg value="--log-xml" />
<arg path="${basedir}/build/logs/phploc.xml" />
<arg path="${basedir}/lib" />
</exec>
<property name="phploc.done" value="true"/>
</target>
<target name="pdepend"
unless="pdepend.done"
depends="prepare"
description="Calculate software metrics using PHP_Depend and log result in XML format. Intended for usage within a continuous integration environment.">
<exec executable="${toolsdir}pdepend" taskname="pdepend">
<arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
<arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
<arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
<arg path="${basedir}/lib" />
</exec>
<property name="pdepend.done" value="true"/>
</target>
<target name="phpmd" depends="prepare" description="PHP Mess Detector">
<exec executable="${toolsdir}phpmd" taskname="phpmd" failonerror="true">
<arg path="${basedir}/lib" />
<arg value="text" />
<arg value="${basedir}/build/phpmd.xml" />
</exec>
<property name="phpmd.done" value="true"/>
</target>
<target name="phpmd-ci"
unless="phpmd.done"
depends="prepare"
description="Perform project mess detection using PHPMD and log result in XML format. Intended for usage within a continuous integration environment.">
<exec executable="${toolsdir}phpmd" taskname="phpmd" failonerror="true">
<arg path="${basedir}/lib" />
<arg value="xml" />
<arg value="${basedir}/build/phpmd.xml" />
<arg value="--reportfile" />
<arg value="${basedir}/build/logs/pmd.xml" />
</exec>
<property name="phpmd.done" value="true"/>
</target>
<target name="phpcs"
unless="phpcs.done"
description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
<exec executable="${toolsdir}phpcs" taskname="phpcs" failonerror="true">
<arg value="--standard=${basedir}/build/phpcs.xml" />
</exec>
<property name="phpcs.done" value="true"/>
</target>
<target name="phpcs-ci"
unless="phpcs.done"
depends="prepare"
description="Find coding standard violations using PHP_CodeSniffer and log result in XML format. Intended for usage within a continuous integration environment.">
<exec executable="${toolsdir}phpcs" output="/dev/null" taskname="phpcs" failonerror="true">
<arg value="--report=checkstyle" />
<arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
<arg value="--standard=${basedir}/build/phpcs.xml" />
</exec>
<property name="phpcs.done" value="true"/>
</target>
<target name="phpcpd"
unless="phpcpd.done"
description="Find duplicate code using PHPCPD and print human readable output. Intended for usage on the command line before committing.">
<exec executable="${toolsdir}phpcpd" taskname="phpcpd" failonerror="true">
<arg path="${basedir}/lib" />
</exec>
<property name="phpcpd.done" value="true"/>
</target>
<target name="phpcpd-ci"
unless="phpcpd.done"
depends="prepare"
description="Find duplicate code using PHPCPD and log result in XML format. Intended for usage within a continuous integration environment.">
<exec executable="${toolsdir}phpcpd" taskname="phpcpd" failonerror="true">
<arg value="--log-pmd" />
<arg path="${basedir}/build/logs/pmd-cpd.xml" />
<arg path="${basedir}/lib" />
</exec>
<property name="phpcpd.done" value="true"/>
</target>
<target name="phpunit"
unless="phpunit.done"
depends="prepare"
description="Run unit tests with PHPUnit">
<exec executable="${toolsdir}phpunit" failonerror="true" taskname="phpunit">
</exec>
<property name="phpunit.done" value="true"/>
</target>
<!--<target name="phpdox"
unless="phpdox.done"
depends="phploc-ci,phpcs-ci,phpmd-ci"
description="Generate project documentation using phpDox">
<exec executable="${toolsdir}phpdox" dir="${basedir}/build" taskname="phpdox"/>
<property name="phpdox.done" value="true"/>
</target>-->
</project>
View
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<ruleset name="PHP_CodeSniffer">
<description>PHP_CodeSniffer coding standard for this project.</description>
<file>./lib</file>
<arg value="sp"/>
<rule ref="PSR2"/>
</ruleset>
View
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="pcsg-generated-ruleset"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>Created with the PHP Coding Standard Generator. http://edorian.github.com/php-coding-standard-generator/
</description>
<rule ref="rulesets/codesize.xml"/>
<rule ref="rulesets/controversial.xml"/>
<rule ref="rulesets/design.xml"/>
<rule ref="rulesets/naming.xml/LongVariable">
<properties>
<property name="maximum" value="30"/>
</properties>
</rule>
<rule ref="rulesets/naming.xml/ShortMethodName">
<properties>
<property name="minimum" value="2" />
</properties>
</rule>
<rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass"/>
<rule ref="rulesets/naming.xml/ConstantNamingConventions"/>
<rule ref="rulesets/naming.xml/BooleanGetMethodName"/>
<rule ref="rulesets/unusedcode.xml"/>
</ruleset>
View
@@ -24,7 +24,11 @@
}
},
"require-dev": {
"phpunit/phpunit": "^4.7",
"mockery/mockery": "^0.9.4"
"phpunit/phpunit": "*",
"mockery/mockery": "^0.9.4",
"squizlabs/php_codesniffer": "2.*",
"phploc/phploc": "^2.1",
"phpmd/phpmd": "^2.2",
"sebastian/phpcpd": "^2.0"
}
}
@@ -1,4 +1,5 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -24,5 +25,4 @@
*/
class BaleenException extends \Exception
{
}
@@ -1,4 +1,5 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -24,5 +25,4 @@
*/
class InvalidArgumentException extends BaleenException
{
}
@@ -1,4 +1,5 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -24,5 +25,4 @@
*/
class MigrationException extends BaleenException
{
}
@@ -1,4 +1,5 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -24,5 +25,4 @@
*/
class MigrationExceptionInterface extends BaleenException
{
}
@@ -1,7 +1,7 @@
<?php
namespace Baleen\Migrations\Exception;
class MigrationMissingException extends MigrationException
{
}
@@ -1,4 +1,5 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -22,12 +23,11 @@
use Baleen\Migrations\Migration\MigrateOptions;
/**
* Interface OptionsAwareInterface
* Interface OptionsAwareInterface.
*
* @author Gabriel Somoza <gabriel@strategery.io>
*/
interface OptionsAwareInterface {
interface OptionsAwareInterface
{
public function setOptions(MigrateOptions $options);
}
@@ -1,4 +1,5 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -20,7 +21,7 @@
namespace Baleen\Migrations\Migration\Capabilities;
/**
* Interface TransactionAwareInterface
* Interface TransactionAwareInterface.
*
* @author Gabriel Somoza <gabriel@strategery.io>
*/
@@ -32,6 +33,7 @@ public function finish();
/**
* @param \Exception $e
*
* @return mixed
*/
public function abort(\Exception $e);
@@ -1,4 +1,5 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -37,7 +38,7 @@ public function execute($command, callable $next)
{
$migration = $command->getMigration();
if ($migration instanceof OptionsAwareInterface) {
$migration->setRunOptions($command->getOptions());
$migration->setOptions($command->getOptions());
}
$next($command);
}
@@ -1,4 +1,5 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Oops, something went wrong.

0 comments on commit f6c2b3c

Please sign in to comment.