Skip to content

Commit

Permalink
Merge f7d2d87 into 5c2996d
Browse files Browse the repository at this point in the history
  • Loading branch information
tcitworld committed Aug 6, 2018
2 parents 5c2996d + f7d2d87 commit 985c344
Show file tree
Hide file tree
Showing 19 changed files with 1,598 additions and 75 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,5 @@ RCS/*

coverage/

js/vendor

js/public
css/public
3 changes: 1 addition & 2 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
filter:
excluded_paths:
- 'js/vendor/*'
- 'js/public/*'
- 'l10n/*'

Expand All @@ -16,4 +15,4 @@ tools:
build:
tests:
override:
- jshint-run --config js/.jshintrc
- jshint-run --config js/.jshintrc
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ before_script:

script:
- make
- phpunit --version
- make composer || true
- make test
- make dist
# Upload nightly
Expand Down
40 changes: 23 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
# build tools and additional package managers should be installed locally in
# your project, since this won't pollute people's global namespace.
#
# The following npm scripts in your package.json install and update the bower
# and npm dependencies and use gulp as build system (notice how everything is
# The following npm scripts in your package.json install and update the npm
# dependencies and use gulp as build system (notice how everything is
# run from the node_modules folder):
#
# "scripts": {
# "test": "node node_modules/gulp-cli/bin/gulp.js karma",
# "prebuild": "npm install && node_modules/bower/bin/bower install && node_modules/bower/bin/bower update",
# "prebuild": "npm install",
# "build": "node node_modules/gulp-cli/bin/gulp.js"
# },

Expand All @@ -51,6 +51,10 @@ appstore_artifact_directory=$(CURDIR)/build/artifacts/appstore
appstore_package_name=$(appstore_artifact_directory)/$(app_name)
yarn=$(shell which yarn 2> /dev/null)
gcp=$(shell which gcp 2> /dev/null)
composer:=$(shell which composer 2> /dev/null)
ifeq (,$(composer))
composer:=php $(build_tools_directory)/composer.phar
endif

ifeq (, $(gcp))
copy_command=cp
Expand Down Expand Up @@ -85,6 +89,18 @@ all: build
build:
make yarn

# Installs and updates the composer dependencies. If composer is not installed
# a copy is fetched from the web
.PHONY: composer
composer:
ifeq (, $(shell which composer 2> /dev/null))
@echo "No composer command available, downloading a copy from the web"
mkdir -p $(build_tools_directory)
curl -sS https://getcomposer.org/installer | php
mv composer.phar $(build_tools_directory)
endif
$(composer) install --prefer-dist

# Installs yarn dependencies
.PHONY: yarn
yarn:
Expand All @@ -97,13 +113,11 @@ clean:
rm -rf css/public
rm -rf js/public

# Same as clean but also removes dependencies installed by composer, bower and
# npm
# Same as clean but also removes dependencies installed by composer and npm
.PHONY: distclean
distclean: clean
rm -rf vendor
rm -rf node_modules
rm -rf js/vendor
rm -rf js/node_modules

# Builds the source and appstore package
Expand Down Expand Up @@ -161,14 +175,6 @@ endif
# from the internet
.PHONY: test
test:
cd js && $(yarn) run test
ifeq (, $(shell which phpunit 2> /dev/null))
@echo "No phpunit command available, downloading a copy from the web"
mkdir -p $(build_tools_directory)
curl -sSL https://phar.phpunit.de/phpunit.phar -o $(build_tools_directory)/phpunit.phar
php $(build_tools_directory)/phpunit.phar -c phpunit.xml --coverage-clover coverage.clover
# php $(build_tools_directory)/phpunit.phar -c phpunit.integration.xml --coverage-clover build/php-integration.clover
else
phpunit -c phpunit.xml --coverage-clover coverage.clover
# phpunit -c phpunit.integration.xml --coverage-clover build/php-unit.clover
endif
make composer
cd js && $(yarn) run test && cd ../
export PATH="$$PWD/vendor/bin:$$PATH" && phpunit -c phpunit.xml --coverage-clover coverage.clover
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require-dev": {
"phpunit/phpunit": "^6.5"
}
}

0 comments on commit 985c344

Please sign in to comment.