From 7052fca49a8579455e88c44a16e60c74a69226ae Mon Sep 17 00:00:00 2001 From: Mario Romano Date: Mon, 25 Apr 2016 09:38:02 +0100 Subject: [PATCH] check license header --- demo-shell-ng2/app/license_header.txt | 16 ++++ demo-shell-ng2/app/main.ts | 17 ++++ demo-shell-ng2/gulpfile.js | 28 ++++-- demo-shell-ng2/package.json | 129 +++++++++++++------------- 4 files changed, 119 insertions(+), 71 deletions(-) create mode 100644 demo-shell-ng2/app/license_header.txt diff --git a/demo-shell-ng2/app/license_header.txt b/demo-shell-ng2/app/license_header.txt new file mode 100644 index 0000000000..7b691733f0 --- /dev/null +++ b/demo-shell-ng2/app/license_header.txt @@ -0,0 +1,16 @@ +/** + * @license + * Copyright (C) 2005-2017 Alfresco Software Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ \ No newline at end of file diff --git a/demo-shell-ng2/app/main.ts b/demo-shell-ng2/app/main.ts index b4c3ccbdf6..30f9e4f5a6 100644 --- a/demo-shell-ng2/app/main.ts +++ b/demo-shell-ng2/app/main.ts @@ -1,3 +1,20 @@ +/** + * @license + * Copyright (C) 2005-2017 Alfresco Software Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import {bootstrap} from 'angular2/platform/browser'; import {AppComponent} from './app.component'; import {ROUTER_PROVIDERS} from 'angular2/router'; diff --git a/demo-shell-ng2/gulpfile.js b/demo-shell-ng2/gulpfile.js index 674cab02ee..7ecdd69d66 100644 --- a/demo-shell-ng2/gulpfile.js +++ b/demo-shell-ng2/gulpfile.js @@ -7,23 +7,33 @@ const tslint = require('gulp-tslint'); const browserSync = require('browser-sync'); const reload = browserSync.reload; const tsconfig = require('tsconfig-glob'); +const license = require('gulp-license-check'); // clean the contents of the distribution directory gulp.task('clean', function () { return del('dist/*'); }); +gulp.task('license', function () { + gulp.src('./app/**/*.ts') + .pipe(license({ + path: 'app/license_header.txt', + blocking: false, + log: true + })); +}); + // copy static assets - i.e. non TypeScript compiled source -gulp.task('copy:assets', ['clean'], function() { +gulp.task('copy:assets', ['clean'], function () { return gulp.src(['app/**/*', - 'index.html', - 'typings.json', - '!app/**/*.ts'], { base : './' }) + 'index.html', + 'typings.json', + '!app/**/*.ts'], {base: './'}) .pipe(gulp.dest('dist')) }); // copy dependencies -gulp.task('copy:libs', ['clean'], function() { +gulp.task('copy:libs', ['clean'], function () { return gulp.src([ 'node_modules/**/*', '!node_modules/ng2-alfresco-*{,/**/*}' @@ -40,7 +50,7 @@ gulp.task('copy:components', ['clean'], function() { }); // copy typings -gulp.task('copy:typings', ['clean'], function() { +gulp.task('copy:typings', ['clean'], function () { return gulp.src([ 'typings/**/*' ]) @@ -48,7 +58,7 @@ gulp.task('copy:typings', ['clean'], function() { }); // linting -gulp.task('tslint', function() { +gulp.task('tslint', function () { return gulp.src('app/**/*.ts') .pipe(tslint()) .pipe(tslint.report('verbose')); @@ -74,7 +84,7 @@ gulp.task('tsconfig-glob', function () { }); // Run browsersync for development -gulp.task('serve', ['build'], function() { +gulp.task('serve', ['build'], function () { browserSync({ server: { baseDir: 'dist' @@ -84,7 +94,7 @@ gulp.task('serve', ['build'], function() { gulp.watch(['app/**/*', 'index.html'], ['buildAndReload']); }); -gulp.task('build', ['tslint', 'copy:assets', 'copy:libs', 'copy:components', 'copy:typings', 'compile']); +gulp.task('build', ['license', 'tslint', 'copy:assets', 'copy:libs', 'copy:components', 'copy:typings', 'compile']); gulp.task('dev', ['build', 'serve'], reload); gulp.task('default', ['build']); gulp.task('buildAndReload', ['build'], reload); diff --git a/demo-shell-ng2/package.json b/demo-shell-ng2/package.json index 930f4ce52a..7114479670 100644 --- a/demo-shell-ng2/package.json +++ b/demo-shell-ng2/package.json @@ -1,66 +1,71 @@ { - "name": "Alfresco-Angular2-Demo", - "description": "Demo shell for Alfresco Angular2 components", - "version": "0.1.0", - "author": "Alfresco Software, Ltd.", - "scripts": { - "build.dev": "gulp dev", - "build.prod": "gulp build", - "prestart": "npm install", - "start": "concurrently \"npm run tsc:w\" \"npm run lite\" ", - "test": "live-server --open=tests-runner.html", - "tsc": "tsc", - "tsc:w": "tsc -w -p tsconfig.dev.json", - "lite": "lite-server", - "typings": "typings", - "postinstall": "typings install" + "name": "Alfresco-Angular2-Demo", + "description": "Demo shell for Alfresco Angular2 components", + "version": "0.1.0", + "author": "Alfresco Software, Ltd.", + "scripts": { + "build.dev": "gulp dev", + "build.prod": "gulp build", + "prestart": "npm install", + "start": "concurrently \"npm run tsc:w\" \"npm run lite\" ", + "test": "live-server --open=tests-runner.html", + "tsc": "tsc", + "tsc:w": "tsc -w -p tsconfig.dev.json", + "lite": "lite-server", + "typings": "typings", + "postinstall": "typings install" + }, + "repository": { + "type": "git", + "url": "https://github.com/Alfresco/dev-platform-webcomponents.git" + }, + "bugs": { + "url": "https://github.com/Alfresco/dev-platform-webcomponents/issues" + }, + "license": "Apache-2.0", + "contributors": [ + { + "name": "Denys Vuika", + "email": "denis.vuyka@gmail.com" }, - "repository": { - "type": "git", - "url": "https://github.com/Alfresco/dev-platform-webcomponents.git" - }, - "bugs": { - "url": "https://github.com/Alfresco/dev-platform-webcomponents/issues" - }, - "license": "Apache-2.0", - "contributors": [ - { - "name": "Denys Vuika", - "email": "denis.vuyka@gmail.com" - } - ], - "keywords": [ - "ng2", - "angular", - "angular2", - "alfresco" - ], - "dependencies": { - "angular2": "2.0.0-beta.15", - "bootstrap": "^3.3.6", - "es6-shim": "^0.35.0", - "font-awesome": "^4.5.0", - "jquery": "^2.2.2", - "material-design-lite": "^1.1.3", - "ng2-uploader": "denisvuyka/ng2-uploader", - "reflect-metadata": "0.1.2", - "rxjs": "5.0.0-beta.2", - "systemjs": "0.19.26", - "zone.js": "0.6.10" - }, - "devDependencies": { - "browser-sync": "^2.10.0", - "concurrently": "^2.0.0", - "del": "^2.1.0", - "gulp": "^3.9.1", - "gulp-sourcemaps": "^1.6.0", - "gulp-tslint": "^3.6.0", - "gulp-typescript": "^2.8.0", - "jasmine-core": "2.4.1", - "lite-server": "^2.2.0", - "live-server": "^0.9.2", - "tsconfig-glob": "^0.3.3", - "typescript": "^1.8.10", - "typings": "^0.7.12" + { + "name": "Mario Romano", + "email": "mario.romano83@gmail.com" } + ], + "keywords": [ + "ng2", + "angular", + "angular2", + "alfresco" + ], + "dependencies": { + "angular2": "2.0.0-beta.15", + "bootstrap": "^3.3.6", + "es6-shim": "^0.35.0", + "font-awesome": "^4.5.0", + "jquery": "^2.2.2", + "material-design-lite": "^1.1.3", + "ng2-uploader": "denisvuyka/ng2-uploader", + "reflect-metadata": "0.1.2", + "rxjs": "5.0.0-beta.2", + "systemjs": "0.19.26", + "zone.js": "0.6.10" + }, + "devDependencies": { + "browser-sync": "^2.10.0", + "concurrently": "^2.0.0", + "del": "^2.1.0", + "gulp": "^3.9.1", + "gulp-sourcemaps": "^1.6.0", + "gulp-tslint": "^3.6.0", + "gulp-typescript": "^2.8.0", + "jasmine-core": "2.4.1", + "lite-server": "^2.2.0", + "live-server": "^0.9.2", + "tsconfig-glob": "^0.3.3", + "typescript": "^1.8.10", + "typings": "^0.7.12", + "gulp-license-check": "0.0.2" + } }