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,12 +7,22 @@ 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 () {
return gulp.src(['app/**/*',
@@ -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

@@ -27,6 +27,10 @@
{
"name": "Denys Vuika",
"email": "denis.vuyka@gmail.com"
},
{
"name": "Mario Romano",
"email": "mario.romano83@gmail.com"
}
],
"keywords": [
@@ -61,6 +65,7 @@
"live-server": "^0.9.2",
"tsconfig-glob": "^0.3.3",
"typescript": "^1.8.10",
"typings": "^0.7.12"
"typings": "^0.7.12",
"gulp-license-check": "0.0.2"
}
}