Skip to content

Commit

Permalink
Fix ant builds in order to fix owdev jenkins builds
Browse files Browse the repository at this point in the history
- Require PHP 5.4.0
- Adjust settings for test targets in Makefile
- Add some dev requirements used by ant builds
- Remove a now unused config files
- Fix settings in build.xml to work with dependencies under vendor folder
  • Loading branch information
pfrischmuth committed Jun 30, 2016
1 parent 7508ed6 commit e4c9504
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 57 deletions.
25 changes: 14 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,23 @@ endif

# coding standard
# test stuff
test-directories:
rm -rf tests/cache tests/unit/cache tests/integration/cache
mkdir tests/cache
mkdir tests/unit/cache
mkdir tests/integration/cache

test-unit: test-directories
test-unit: directories
$(PHPUNIT) --testsuite "Erfurt Unit Tests"

test-integration-virtuoso: test-directories
EF_STORE_ADAPTER=virtuoso $(PHPUNIT) --testsuite "Erfurt Virtuoso Integration Tests"
test-unit-cc: directories
$(PHPUNIT) --testsuite "Erfurt Unit Tests" --coverage-clover ./build/logs/clover.xml --coverage-html ./build/coverage --log-junit ./build/logs/junit.xml

test-integration-virtuoso: directories
EF_STORE_ADAPTER=virtuoso $(PHPUNIT) --testsuite "Erfurt Integration Tests"

test-integration-virtuoso-cc: directories
EF_STORE_ADAPTER=virtuoso $(PHPUNIT) --testsuite "Erfurt Integration Tests" --coverage-html ./build/coverage-virtuoso

test-integration-mysql: directories
EF_STORE_ADAPTER=zenddb $(PHPUNIT) --testsuite "Erfurt Integration Tests"

test-integration-mysql: test-directories
EF_STORE_ADAPTER=zenddb $(PHPUNIT) --testsuite "Erfurt Virtuoso Integration Tests"
test-integration-mysql-cc: directories
EF_STORE_ADAPTER=zenddb $(PHPUNIT) --testsuite "Erfurt Integration Tests" --coverage-html ./build/coverage-mysql

test:
make test-unit
Expand Down
78 changes: 43 additions & 35 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
<delete dir="${basedir}/build/api"/>
<delete dir="${basedir}/build/code-browser"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/coverage-integration"/>
<delete dir="${basedir}/build/coverage-virtuoso"/>
<delete dir="${basedir}/build/coverage-mysql"/>
<delete dir="${basedir}/build/logs"/>
<delete dir="${basedir}/build/pdepend"/>
</target>
Expand All @@ -21,7 +22,8 @@
<mkdir dir="${basedir}/build/api"/>
<mkdir dir="${basedir}/build/code-browser"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/coverage-integration"/>
<mkdir dir="${basedir}/build/coverage-virtuoso"/>
<mkdir dir="${basedir}/build/coverage-mysql"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/>
</target>
Expand All @@ -38,71 +40,50 @@
</target>

<target name="phploc" description="Measure project size using PHPLOC">
<exec executable="phploc">
<exec executable="./vendor/bin/phploc">
<arg value="--log-csv" />
<arg value="${basedir}/build/logs/phploc.csv" />
<arg path="${basedir}/library/Erfurt" />
</exec>
</target>

<target name="pdepend" description="Calculate software metrics using PHP_Depend">
<exec executable="pdepend">
<exec executable="./vendor/bin/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}/library/Erfurt" />
</exec>
</target>

<target name="phpmd"
description="Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing.">
<exec executable="phpmd">
<arg path="${basedir}/library/Erfurt" />
<arg value="text" />
<arg value="${basedir}/build/phpmd.xml" />
</exec>
</target>

<target name="phpmd-ci"
description="Perform project mess detection using PHPMD creating a log file for the continuous integration server">
<exec executable="phpmd">
<arg path="${basedir}/library/Erfurt" />
<arg value="xml" />
<arg value="${basedir}/build/phpmd.xml" />
<arg value="--reportfile" />
<arg value="${basedir}/build/logs/pmd.xml" />
</exec>
</target>

<target name="phpcs"
description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
<exec executable="phpcs">
<arg value="--standard=${basedir}/build/phpcs.xml" />
<exec executable="./vendor/bin/phpcs">
<arg value="--standard=${basedir}/phpcs.xml" />
<arg path="${basedir}/library/Erfurt" />
</exec>
</target>

<target name="phpcs-ci"
description="Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server">
<exec executable="phpcs" output="/dev/null">
<exec executable="./vendor/bin/phpcs" output="/dev/null">
<arg value="--report=checkstyle" />
<arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
<arg value="--standard=${basedir}/build/phpcs.xml" />
<arg value="--standard=${basedir}/phpcs.xml" />
<arg path="${basedir}/library/Erfurt" />
</exec>
</target>

<target name="phpcpd" description="Find duplicate code using PHPCPD">
<exec executable="phpcpd">
<exec executable="./vendor/bin/phpcpd">
<arg value="--log-pmd" />
<arg value="${basedir}/build/logs/pmd-cpd.xml" />
<arg path="${basedir}/library/Erfurt" />
</exec>
</target>

<target name="phpdoc" description="Create API doc using DocCreator">
<exec dir="/opt/DocCreator/" executable="php">
<arg value="/opt/DocCreator/create.php5" />
<exec executable="php vendor/bin/doc-creator.php">
<arg value="--config-file=${basedir}/build/doc.erfurt.xml" />
<arg value="--source-folder=${basedir}/library/Erfurt/" />
<arg value="--target-folder=${basedir}/build/api/" />
Expand All @@ -111,20 +92,27 @@

<target name="directories">
<exec executable="make">
<arg value="test-directories" />
<arg value="directories" />
</exec>
</target>

<target name="phpunit" depends="directories" description="Run unit tests with PHPUnit">
<exec dir="${basedir}/tests/unit/" executable="phpunit" failonerror="true" />
<exec executable="make" failonerror="true">
<arg value="test-unit-cc" />
</exec>
</target>

<target name="phpunit-integration" depends="phpunit" description="Run unit tests with PHPUnit">
<exec dir="${basedir}/tests/integration/" executable="phpunit" failonerror="true" />
<exec executable="make" failonerror="true">
<arg value="test-integration-virtuoso-cc" />
</exec>
<exec executable="make" failonerror="true">
<arg value="test-integration-mysql-cc" />
</exec>
</target>

<target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
<exec executable="phpcb">
<exec executable="./vendor/bin/phpcb">
<arg value="--log" />
<arg path="${basedir}/build/logs" />
<arg value="--source" />
Expand All @@ -133,4 +121,24 @@
<arg path="${basedir}/build/code-browser" />
</exec>
</target>

<target name="phpmd"
description="Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing.">
<exec executable="./vendor/bin/phpmd">
<arg path="${basedir}/library/Erfurt" />
<arg value="text" />
<arg value="${basedir}/build/phpmd.xml" />
</exec>
</target>

<target name="phpmd-ci"
description="Perform project mess detection using PHPMD creating a log file for the continuous integration server">
<exec executable="./vendor/bin/phpmd">
<arg path="${basedir}/library/Erfurt" />
<arg value="xml" />
<arg value="${basedir}/build/phpmd.xml" />
<arg value="--reportfile" />
<arg value="${basedir}/build/logs/pmd.xml" />
</exec>
</target>
</project>
6 changes: 0 additions & 6 deletions build/phpcs.xml

This file was deleted.

6 changes: 3 additions & 3 deletions build/phpmd.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0"?>

<ruleset name="OntoWiki RuleSet"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<ruleset name="OntoWiki 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">
Expand Down
11 changes: 9 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,20 @@
}
],
"require": {
"php": ">=5.3.3",
"php": ">=5.4.0",
"semsol/arc2": "*",
"zendframework/zendframework1": "1.*"
},
"require-dev": {
"phpunit/phpunit": "4.5.*",
"squizlabs/php_codesniffer": "dev-master"
"squizlabs/php_codesniffer": "dev-master",
"ceus-media/common": "dev-master",
"ceus-media/doc-creator": "dev-master",
"zerkalica/php-code-browser": "dev-master",
"sebastian/phpcpd": "2.0.*",
"pdepend/pdepend": "2.2.*",
"phploc/phploc": "2.1.*",
"phpmd/phpmd": "2.4.*"
},
"autoload": {
"classmap": [
Expand Down

0 comments on commit e4c9504

Please sign in to comment.