check license header

This commit is contained in:
Mario Romano
2016-04-25 09:38:02 +01:00
parent 9a3b6a3e0f
commit 7052fca49a
4 changed files with 119 additions and 71 deletions

View File

@@ -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.
*/

View File

@@ -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';

View File

@@ -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);

View File

@@ -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"
}
}