Skip to content

Commit

Permalink
Merge pull request #266 from owncloud/release/2.0.3
Browse files Browse the repository at this point in the history
Release/2.0.3
  • Loading branch information
DeepDiver1975 authored Jun 18, 2018
2 parents e9fdbaa + 6f331e8 commit d67faac
Show file tree
Hide file tree
Showing 29 changed files with 2,509 additions and 1,304 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ build/artifacts
.rvm
report
clover.xml
build

# just sane ignores
.*.sw[po]
Expand Down
22 changes: 9 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: php
php:
- 5.6
- 7.0
- 7.1
- 7.2

env:
global:
Expand Down Expand Up @@ -36,27 +36,23 @@ script:
- php ocular.phar code-coverage:upload --format=php-clover clover.xml

# execute js tests
- cd js
- npm install
- npm install -g gulp
- gulp test

# Create coverage report
- sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi"
- sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then php ocular.phar code-coverage:upload --format=php-clover clover.xml; fi"
- make
- cd js && npm run test

matrix:
include:
- php: 7.0
- php: 7.1
env: DB=sqlite
- php: 7.0
- php: 7.1
env: DB=pgsql
- php: 5.4
env: "DB=mysql CORE_BRANCH=stable8.1"
- php: 5.4
env: "DB=mysql CORE_BRANCH=stable8.2"
- php: 5.4
env: "DB=mysql CORE_BRANCH=stable9"
- php: 5.4
- php: 5.6
env: "DB=mysql CORE_BRANCH=stable9.1"
- php: 7.0
env: "DB=mysql CORE_BRANCH=stable10"
fast_finish: true
4 changes: 4 additions & 0 deletions CHANGELOG → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
owncloud-notes (2.0.3)
* Ready for ownCloud 10
* First release on the marketplace

owncloud-notes (1.1.0)
* **New Dependency**: Require ownCloud 8.1
* **Enhancement**: Add back markdown support because a secure enough library was available. The supported markdown dialect is GitHub flavored markdown and includes syntax highlightning
Expand Down
259 changes: 164 additions & 95 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,106 +1,175 @@
# This file is licensed under the Affero General Public License version 3 or
# later. See the COPYING file.
# @author Bernhard Posselt <[email protected]>
# @copyright Bernhard Posselt 2016
# @author Georg Ehrke <[email protected]>
# @copyright Georg Ehrke 2016

# Generic Makefile for building and packaging a ownCloud app which uses npm and
# Composer.
#
# ownCloud scaffolder tool
# 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
#
# Copyright (C) 2013 Bernhard Posselt, <[email protected]>
# 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.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# The npm command by launches the npm build script:
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# npm run build
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.


# Makefile for building the project
app_name=notes
project_dir=$(CURDIR)/../$(app_name)
build_dir=$(CURDIR)/build/artifacts
appstore_dir=$(build_dir)/appstore
package_name=$(app_name)

# binary directories for running the CI tests
firefox_bin=/usr/bin/firefox
chrome_bin=/usr/bin/chromium
phantomjs_bin=/usr/bin/phantomjs

js_dir=$(CURDIR)/js
js_public_dir=$(js_dir)/public

# common directories
grunt_dir=$(js_dir)/node_modules/grunt-cli/bin/grunt
bower_dir=$(js_dir)/node_modules/bower/bin/bower
gruntfile_dir=$(js_dir)/Gruntfile.js

php_unit_tests_dir=$(CURDIR)/tests/unit
php_integration_tests_dir=$(CURDIR)/tests/integration
php_acceptance_tests_dir=$(CURDIR)/tests/acceptance


# The npm test command launches the npm test script:
#
# npm 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
# 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",
# "build": "node node_modules/gulp-cli/bin/gulp.js"
# },

app_name=$(notdir $(CURDIR))
build_tools_directory=$(CURDIR)/build/tools
source_build_directory=$(CURDIR)/build/source/notes
source_artifact_directory=$(CURDIR)/build/artifacts/source
source_package_name=$(source_artifact_directory)/$(app_name)
appstore_build_directory=$(CURDIR)/build/appstore/notes
appstore_artifact_directory=$(CURDIR)/build/artifacts/appstore
appstore_package_name=$(appstore_artifact_directory)/$(app_name)
npm=$(shell which npm 2> /dev/null)
gcp=$(shell which gcp 2> /dev/null)

ifeq (, $(gcp))
copy_command=cp
else
copy_command=gcp
endif

# code signing
# assumes the following:
# * the app is inside the owncloud/apps folder
# * the private key is located in ~/.owncloud/notes.key
# * the certificate is located in ~/.owncloud/notes.crt
occ=$(CURDIR)/../../occ
phpunit_oc10=$(CURDIR)/../../lib/composer/bin/phpunit
configdir=$(CURDIR)/../../config
private_key=$(HOME)/.owncloud/certificates/$(app_name).key
certificate=$(HOME)/.owncloud/certificates/$(app_name).crt
sign=php -f $(occ) integrity:sign-app --privateKey="$(private_key)" --certificate="$(certificate)"
sign_skip_msg="Skipping signing, either no key and certificate found in $(private_key) and $(certificate) or occ can not be found at $(occ)"
ifneq (,$(wildcard $(private_key)))
ifneq (,$(wildcard $(certificate)))
ifneq (,$(wildcard $(occ)))
CAN_SIGN=true
endif
endif
endif

# building the javascript
all: build

build: deps
mkdir -p $(js_public_dir)
$(grunt_dir) --config $(gruntfile_dir) build

watch: build
$(grunt_dir) --config $(gruntfile_dir) watch:concat

update: deps
$(bower_dir) update
# 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
.PHONY: build
build:
make npm

# testing
tests: js-unit-tests php-unit-tests php-integration-tests php-acceptance-tests

unit-tests: js-unit-tests php-unit-tests


# testing js
js-unit-tests: deps
export PHANTOMJS_BIN=$(phantomjs_bin) && \
$(grunt_dir) --config $(gruntfile_dir) karma:continuous

watch-js-unit-tests: deps
export CHROME_BIN=$(chrome_bin) && export FIREFOX_BIN=$(firefox_bin) && \
$(grunt_dir) --config $(gruntfile_dir) karma:unit


# testing php
php-unit-tests: deps
phpunit $(php_unit_tests_dir)

watch-php-unit-tests: deps
$(grunt_dir) --config $(gruntfile_dir) watch:phpunit

php-integration-tests: deps
phpunit $(php_integration_tests_dir)

php-acceptance-tests: deps
cd $(php_acceptance_tests_dir); make headless


# general
deps:
cd js
npm install --deps
cd ..
# Installs npm dependencies
.PHONY: npm
npm:
cd js && $(npm) run build

# Removes the appstore build
.PHONY: clean
clean:
rm -rf $(CURDIR)/node_modules
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)/tests \
#--exclude=$(project_dir)/.travis.yml
rm -rf ./build
rm -rf css/public
rm -rf js/public

# Same as clean but also removes dependencies installed by composer, bower 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
.PHONY: dist
dist:
make source
make appstore

# Builds the source package
.PHONY: source
source:
rm -rf $(source_build_directory) $(source_artifact_directory)
mkdir -p $(source_build_directory) $(source_artifact_directory)
rsync -rv . $(source_build_directory) \
--exclude=/.git/ \
--exclude=/.idea/ \
--exclude=/build/ \
--exclude=/js/node_modules/ \
--exclude=*.log
ifdef CAN_SIGN
$(sign) --path "$(source_build_directory)"
else
@echo $(sign_skip_msg)
endif
tar -cvzf $(source_package_name).tar.gz -C $(source_build_directory)/../ $(app_name)

# Builds the source package for the app store, ignores php and js tests
.PHONY: appstore
appstore: build
rm -rf $(appstore_build_directory) $(appstore_artifact_directory)
mkdir -p $(appstore_build_directory) $(appstore_artifact_directory)
$(copy_command) --parents -r \
"appinfo" \
"controller" \
"css" \
"db" \
"img" \
"js/vendor" \
"js/public" \
"l10n" \
"service" \
"templates" \
"COPYING" \
"CHANGELOG.md" \
$(appstore_build_directory)
ifdef CAN_SIGN
mv $(configdir)/config.php $(configdir)/config-2.php
$(sign) --path="$(appstore_build_directory)"
mv $(configdir)/config-2.php $(configdir)/config.php
else
@echo $(sign_skip_msg)
endif
tar -czf $(appstore_package_name).tar.gz -C $(appstore_build_directory)/../ $(app_name)


# Command for running JS and PHP tests. Works for package.json files in the js/
# and root directory. If phpunit is not installed systemwide, a copy is fetched
# from the internet
.PHONY: test
test:
cd js && $(npm) run test
ifneq ("$(wildcard $(phpunit_oc10))","")
php $(phpunit_oc10) -c phpunit.xml --coverage-clover coverage.clover
else
phpunit -c phpunit.xml --coverage-clover coverage.clover
# phpunit -c phpunit.integration.xml --coverage-clover build/php-unit.clover
endif
6 changes: 3 additions & 3 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<name>Notes</name>
<licence>AGPL</licence>
<author>Bernhard Posselt, Jan-Christoph Borchardt, Hendrik Leppelsack</author>
<version>2.0.2</version>
<version>2.0.3</version>
<namespace>Notes</namespace>
<category>tools</category>
<summary>Distraction-free notes and writing</summary>
<description>Distraction-free notes and writing</description>
<bugs>https://github.com/owncloud/notes/issues</bugs>
<repository type="git">https://github.com/owncloud/notes.git</repository>
<ocsid>174554</ocsid>
<dependencies>
<owncloud min-version="8.1" max-version="10.0" />
<owncloud min-version="8.1" max-version="11.0" />
</dependencies>
</info>
8 changes: 7 additions & 1 deletion js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,26 @@
"dependencies": {},
"devDependencies": {
"del": "^1.2.0",
"bower": "^1.8.4",
"gulp": "^3.9.0",
"gulp-cli": "^2.0.1",
"gulp-concat": "^2.6.0",
"gulp-jshint": "^1.11.2",
"gulp-ng-annotate": "^1.1.0",
"gulp-phpunit": "^0.8.1",
"gulp-sourcemaps": "^1.5.2",
"gulp-uglify": "^1.2.0",
"gulp-wrap": "^0.11.0",
"jshint-stylish": "^2.0.1",
"jasmine-core": "^3.1.0",
"karma": "^0.13.3",
"karma-firefox-launcher": "^0.1.6",
"karma-jasmine": "^0.3.6"
},
"engine": "node >= 0.8",
"scripts": {
"test": "gulp test-all"
"prebuild": "npm install && node_modules/bower/bin/bower install && node_modules/bower/bin/bower update",
"build": "node node_modules/gulp-cli/bin/gulp.js",
"test": "node node_modules/gulp-cli/bin/gulp.js test"
}
}
2 changes: 0 additions & 2 deletions js/public/app.min.js

This file was deleted.

1 change: 0 additions & 1 deletion js/public/app.min.js.map

This file was deleted.

Loading

0 comments on commit d67faac

Please sign in to comment.