Skip to content
This repository was archived by the owner on Sep 10, 2022. It is now read-only.

Commit 2d01a33

Browse files
author
Matt Gaunt
committed
Adding Apache license to config
1 parent 11b1e73 commit 2d01a33

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

gulp-tasks/copy.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ gulp.task('copy:cleanRoot', function(cb) {
3030
});
3131
});
3232

33-
gulp.task('copy:root', function() {
33+
gulp.task('copy:root', ['copy:cleanRoot'], function() {
3434
return gulp.src([
3535
GLOBAL.config.src + '/*.{json,txt,ico}',
3636
])
@@ -39,7 +39,6 @@ gulp.task('copy:root', function() {
3939

4040
gulp.task('copy', function(cb) {
4141
runSequence(
42-
'copy:cleanRoot',
4342
'copy:root',
4443
cb);
4544
});

gulp-tasks/scripts.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ var uglify = require('gulp-uglify');
2929
var gulpif = require('gulp-if');
3030
var streamify = require('gulp-streamify');
3131
var replace = require('gulp-replace');
32+
var license = require('gulp-license');
3233

3334
gulp.task('scripts:watch', function() {
3435
gulp.watch(GLOBAL.config.src + '/**/*.es6.js', ['scripts:es6']);
@@ -51,6 +52,7 @@ function compileES6Bundles(browserifyBundles, minify) {
5152

5253
// If this is a production build - minify JS
5354
.pipe(gulpif(GLOBAL.config.env == 'prod', streamify(uglify())))
55+
.pipe(gulpif((typeof GLOBAL.config.license) !== 'undefined', license(GLOBAL.config.license, GLOBAL.config.licenseOptions)))
5456
.pipe(gulp.dest(bundle.dest));
5557
});
5658
}

gulp-tasks/styles.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ gulp.task('styles:sass', function() {
5757
.pipe(sass())
5858
.pipe(autoprefixer(AUTOPREFIXER_BROWSERS))
5959
.pipe(minifyCSS())
60-
.pipe(license('Apache', {
61-
organization: 'Google Inc. All rights reserved.',
62-
}))
60+
.pipe(gulpif((typeof GLOBAL.config.license) !== 'undefined', license(GLOBAL.config.license, GLOBAL.config.licenseOptions)))
6361
.pipe(gulpif(GLOBAL.config.env != 'prod', sourcemaps.write()))
6462
.pipe(gulp.dest(GLOBAL.config.dest));
6563
});

gulpfile.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@ var runSequence = require('run-sequence');
2222
// Get tasks from gulp-tasks directory
2323
require('require-dir')('gulp-tasks');
2424

25+
var projectPackage = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
2526
GLOBAL.config = {
2627
env: 'prod',
2728
src: 'src',
2829
dest: 'dist',
29-
version: JSON.parse(fs.readFileSync('./package.json', 'utf8')).version,
30+
version: projectPackage.version,
31+
license: projectPackage.license,
32+
licenseOptions: {
33+
organization: 'Google Inc. All rights reserved.',
34+
},
3035
};
3136

3237
var allTasks = ['styles', 'scripts', 'copy', 'html', 'images', 'third_party'];

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"name": "app-shell",
3-
"version": "0.1.98",
3+
"version": "0.1.106",
44
"private": true,
5+
"license": "Apache",
56
"engines": {
67
"node": ">=0.10.0"
78
},

0 commit comments

Comments
 (0)