From 1ab7ba56d852c6a2c082b92c004444b5fd88bc8c Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Thu, 15 May 2014 04:46:32 +0200 Subject: add makefile to build project --- .gitignore | 5 ++--- .travis.yml | 4 +++- Makefile | 20 ++++++++++++++++++++ js/README.md | 24 ++++++++++++++++++++++++ templates/main.php | 4 +++- 5 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 Makefile create mode 100644 js/README.md diff --git a/.gitignore b/.gitignore index 74778ee29..791d8d289 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ #specific to news app -coffee/build/ node_modules/ *.log /build/ @@ -34,7 +33,7 @@ RCS/* .project .settings -# netbeans +# netbeans nbproject # phpStorm @@ -48,7 +47,7 @@ nbproject # vim ex mode .vimrc - + # Mac OS .DS_Store diff --git a/.travis.yml b/.travis.yml index 5554bc5fc..d64e34ffc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,8 +21,10 @@ script: - wget https://phantomjs.googlecode.com/files/phantomjs-1.9.0-linux-x86_64.tar.bz2 - tar xjf phantomjs-1.9.0-linux-x86_64.tar.bz2 - sudo ln -s $(pwd)/phantomjs-1.9.0-linux-x86_64/bin/phantomjs /usr/bin/phantomjs - - make javascript-tests - phpunit --coverage-clover=coverage.clover tests/unit - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover coverage.clover + - cd js/ + - npm install + - npm test diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..6d3604ce4 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +# Makefile for building the project + +app_name=news +project_dir=$(CURDIR)/../$(app_name) +build_dir=$(CURDIR)/build/artifacts +appstore_dir=$(build_dir)/appstore +package_name=$(app_name) + +all: dist + +clean: + rm -rf $(build_dir) + +dist: appstore + +appstore: clean + mkdir -p $(appstore_dir) + tar cvzf $(appstore_dir)/$(package_name).tar.gz $(project_dir) \ + --exclude-vcs --exclude=$(project_dir)/build/artifacts \ + --exclude=$(project_dir)/js/node_modules diff --git a/js/README.md b/js/README.md new file mode 100644 index 000000000..27c9fbd98 --- /dev/null +++ b/js/README.md @@ -0,0 +1,24 @@ +# JavaScript Development +Before starting, install nodejs 0.10 and run: + + npm install + +## Building +Watch mode: + + grunt watch + +Single run mode: + + grunt + +## Testing +Watch mode: + + grunt watch:phpunit + grunt test + +Single run mode: + + grunt phpunit + grunt ci diff --git a/templates/main.php b/templates/main.php index 213aa4582..d2e1cfc67 100644 --- a/templates/main.php +++ b/templates/main.php @@ -1,9 +1,11 @@