From f4a9e06e5993f1a5e37132a02eb5ef414a8720ab Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Fri, 11 Aug 2017 14:49:31 -0700 Subject: [PATCH] [ci skip] Add license headers to externs --- externs/closure-types.js | 10 +++++++++- externs/polymer-externs.js | 8 ++++++++ externs/webcomponents-externs.js | 8 ++++++++ gulpfile.js | 13 ++++++++++++- 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/externs/closure-types.js b/externs/closure-types.js index 86cb4c3d6d..e9e8917859 100644 --- a/externs/closure-types.js +++ b/externs/closure-types.js @@ -1,4 +1,12 @@ - +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt + */ /** * @fileoverview Closure types for Polymer mixins * diff --git a/externs/polymer-externs.js b/externs/polymer-externs.js index 84651615d4..7841ecba83 100644 --- a/externs/polymer-externs.js +++ b/externs/polymer-externs.js @@ -1,4 +1,12 @@ /** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt + * * @fileoverview Externs for Polymer * @externs */ diff --git a/externs/webcomponents-externs.js b/externs/webcomponents-externs.js index d06dc892ee..881e6d3785 100644 --- a/externs/webcomponents-externs.js +++ b/externs/webcomponents-externs.js @@ -1,4 +1,12 @@ /** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt + * * @fileoverview Externs for webcomponents polyfills * @externs */ diff --git a/gulpfile.js b/gulpfile.js index 744efaf108..6776cd1474 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -68,6 +68,17 @@ let CLOSURE_LINT_ONLY = false; let firstImportFinder = dom5.predicates.AND(dom5.predicates.hasTagName('link'), dom5.predicates.hasAttrValue('rel', 'import')); +const licenseHeader = +`/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt + */`; + class AddClosureTypeImport extends Transform { constructor(entryFileName, typeFileName) { super({objectMode: true}); @@ -241,6 +252,6 @@ gulp.task('lint', function() { gulp.task('generate-closure-externs', ['clean'], () => { let genClosure = require('@polymer/gen-closure-declarations').generateDeclarations; return genClosure().then((declarations) => { - fs.writeFileSync('externs/closure-types.js', declarations); + fs.writeFileSync('externs/closure-types.js', `${licenseHeader}${declarations}`); }); }); \ No newline at end of file