Skip to content

Commit

Permalink
Makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Jan 24, 2018
1 parent 7aefbc9 commit 57a0387
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ nbproject

# WebPack
/node_modules
/js/merged.js*
/js

# Tests - auto-generated files
/tests/Unit/coverage*
Expand All @@ -62,3 +62,7 @@ nbproject
/tests/Integration/composer.lock
/tests/Integration/output
/tests/Integration/vendor

# Build related files
/npm-debug.log
/build
43 changes: 43 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
app_name=notifications

project_dir=$(CURDIR)/../$(app_name)
build_dir=$(CURDIR)/build
source_dir=$(build_dir)/$(app_name)
sign_dir=$(build_dir)/sign

all: package

dev-setup: clean npm-update build-js

npm-update:
rm -rf node_modules
npm update

build-js:
npm run build

clean:
rm -rf $(build_dir)

package: clean build-js
mkdir -p $(source_dir)
rsync -a \
--exclude=/build \
--exclude=/docs \
--exclude=/js-src \
--exclude=/l10n/.tx \
--exclude=/tests \
--exclude=/.git \
--exclude=/.github \
--exclude=/CONTRIBUTING.md \
--exclude=/issue_template.md \
--exclude=/README.md \
--exclude=/.gitignore \
--exclude=/.scrutinizer.yml \
--exclude=/.travis.yml \
--exclude=/.drone.yml \
--exclude=/node_modules \
--exclude=/npm-debug.log \
--exclude=/package.json \
--exclude=/Makefile \
$(project_dir)/ $(source_dir)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions js/webpack.config.js → js-src/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ var path = require('path');
var webpack = require('webpack');

module.exports = {
entry: './js/init.js',
entry: './js-src/init.js',
output: {
path: path.resolve(__dirname, '.'),
path: path.resolve(__dirname, '../js'),
publicPath: '/',
filename: 'merged.js'
},
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"name": "notifications",
"version": "2.2.0",
"description": "This app provides a backend and frontend for the notification API available in Nextcloud.",
"main": "index.js",
"main": "init.js",
"directories": {
"lib": "lib",
"test": "tests"
},
"scripts": {
"dev": "cross-env NODE_ENV=development webpack --progress --hot --config js/webpack.config.js --watch",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules --config js/webpack.config.js",
"dev": "cross-env NODE_ENV=development webpack --progress --hot --config js-src/webpack.config.js --watch",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules --config js-src/webpack.config.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand Down

0 comments on commit 57a0387

Please sign in to comment.