Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Build environment #105

Merged
merged 4 commits into from
Sep 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,39 @@
# @author Raimund Schlüßler
# @copyright 2017 Raimund Schlüßler <raimund.schluessler@googlemail.com>

# Generic Makefile for building and packaging a Nextcloud app which uses npm and
# Generic Makefile for building and packaging a Nextcloud app which uses yarn and
# Composer.
#
# Dependencies:
# * make
# * which
# * curl: used if phpunit and composer are not installed to fetch them from the web
# * tar: for building the archive
# * npm: for building and testing everything JS
# * yarn: for building and testing everything JS
#
# If no composer.json is in the app root directory, the Composer step
# will be skipped. The same goes for the package.json which can be located in
# the app root or the js/ directory.
#
# The npm command by launches the npm build script:
# The yarn command by launches the yarn build script:
#
# npm run build
# yarn run build
#
# The npm test command launches the npm test script:
# The yarn test command launches the yarn test script:
#
# npm run test
# yarn run test
#
# The idea behind this is to be completely testing and build tool agnostic. All
# 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 yarn scripts in your package.json install and update the
# yarn 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": "yarn install && yarn upgrade",
# "build": "node node_modules/gulp-cli/bin/gulp.js"
# },

Expand All @@ -51,7 +51,7 @@ source_package_name=$(source_artifact_directory)/$(app_name)
appstore_build_directory=$(CURDIR)/build/appstore/tasks
appstore_artifact_directory=$(CURDIR)/build/artifacts/appstore
appstore_package_name=$(appstore_artifact_directory)/$(app_name)
npm=$(shell which npm 2> /dev/null)
yarn=$(shell which yarn 2> /dev/null)
gcp=$(shell which gcp 2> /dev/null)

ifeq (, $(gcp))
Expand Down Expand Up @@ -83,23 +83,22 @@ all: build

# Fetches the PHP and JS dependencies and compiles the JS. If no composer.json
# is present, the composer step is skipped, if no package.json or js/package.json
# is present, the npm step is skipped
# is present, the yarn step is skipped
.PHONY: build
build:
make npm
make yarn

# Installs npm dependencies
.PHONY: npm
npm:
cd js && $(npm) run build
# Installs yarn dependencies
.PHONY: yarn
yarn:
cd js && $(yarn) run build

# Removes the appstore build
.PHONY: clean
clean:
rm -rf ./build

# Same as clean but also removes dependencies installed by composer, bower and
# npm
# Same as clean but also removes dependencies installed by yarn
.PHONY: distclean
distclean: clean
rm -rf vendor
Expand Down Expand Up @@ -218,7 +217,7 @@ endif
# from the internet
.PHONY: test
test:
cd js && $(npm) run 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)
Expand Down
7 changes: 0 additions & 7 deletions js/.bowerrc

This file was deleted.

3 changes: 2 additions & 1 deletion js/.jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"exports": true,
"escapeHTML": true,
"possible": true,
"dav": true
"dav": true,
"OCA": true
}
}
15 changes: 15 additions & 0 deletions js/.stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "stylelint-config-standard",
"plugins": [
"stylelint-scss"
],
"rules": {
"indentation": "tab",
"number-leading-zero": "never",
"comment-empty-line-before": ["always", {
"except": ["first-nested"]
}],
"at-rule-no-unknown": null,
"scss/at-rule-no-unknown": true
}
}
130 changes: 0 additions & 130 deletions js/Gruntfile.js

This file was deleted.

20 changes: 0 additions & 20 deletions js/README.md

This file was deleted.

33 changes: 0 additions & 33 deletions js/bower.json

This file was deleted.

Loading