summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-05-15 04:46:32 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-05-15 04:46:32 +0200
commit1ab7ba56d852c6a2c082b92c004444b5fd88bc8c (patch)
tree3f9dcd48adf2a32180bdcbffe2bbd3aef2c8b3e5
parent04e421cf2f4f801d7e5e6b1fbdb8221855ad4613 (diff)
add makefile to build project
-rw-r--r--.gitignore5
-rw-r--r--.travis.yml4
-rw-r--r--Makefile20
-rw-r--r--js/README.md24
-rw-r--r--templates/main.php4
5 files changed, 52 insertions, 5 deletions
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 @@
<?php
\OCP\Util::addScript('news', 'vendor/angular/angular');
+\OCP\Util::addScript('news', 'vendor/angular-route/angular-route');
+\OCP\Util::addScript('news', 'vendor/angular-sanitize/angular-sanitize');
\OCP\Util::addScript('news', 'vendor/momentjs/moment');
\OCP\Util::addScript('news', 'vendor/momentjs/min/langs');
\OCP\Util::addScript('news', 'vendor/bootstrap/tooltip');
-\OCP\Util::addScript('news', 'public/app');
+\OCP\Util::addScript('news', 'build/app');
\OCP\Util::addStyle('news', 'bootstrap/tooltip');
\OCP\Util::addStyle('news', 'addnew');