-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from JBartscher/feature/restructure_headings
Feature/restructure headings
- Loading branch information
Showing
9 changed files
with
22,843 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,114 @@ | ||
var gulp = require('gulp'); | ||
var connect = require('gulp-connect'); | ||
var wiredep = require('wiredep').stream; | ||
var $ = require('gulp-load-plugins')(); | ||
var del = require('del'); | ||
var jsReporter = require('jshint-stylish'); | ||
var annotateAdfPlugin = require('ng-annotate-adf-plugin'); | ||
var pkg = require('./package.json'); | ||
const imagemin = require('gulp-imagemin'); | ||
|
||
var annotateOptions = { | ||
'use strict'; | ||
|
||
const gulp = require('gulp'); | ||
const connect = require('gulp-connect'); | ||
const wiredep = require('wiredep').stream; | ||
const $ = require('gulp-load-plugins')(); | ||
const inject = require('gulp-inject'); | ||
const del = require('del'); | ||
const jsReporter = require('jshint-stylish'); | ||
const annotateAdfPlugin = require('ng-annotate-adf-plugin'); | ||
const pkg = require('./package.json'); | ||
|
||
const annotateOptions = { | ||
plugin: [ | ||
annotateAdfPlugin | ||
] | ||
}; | ||
|
||
var templateOptions = { | ||
const templateOptions = { | ||
root: '{widgetsPath}/jenkins/src', | ||
module: 'adf.widget.jenkins' | ||
}; | ||
|
||
/** lint **/ | ||
|
||
gulp.task('csslint', function(){ | ||
gulp.task('csslint', (done) => { | ||
gulp.src('src/**/*.css') | ||
.pipe($.csslint()) | ||
.pipe($.csslint.reporter()); | ||
.pipe($.csslint()) | ||
.pipe($.csslint.reporter()); | ||
done(); | ||
}); | ||
|
||
gulp.task('jslint', function(){ | ||
gulp.task('jslint', (done) => { | ||
gulp.src('src/**/*.js') | ||
.pipe($.jshint()) | ||
.pipe($.jshint.reporter(jsReporter)); | ||
.pipe($.jshint()) | ||
.pipe($.jshint.reporter(jsReporter)); | ||
done(); | ||
}); | ||
|
||
gulp.task('lint', ['csslint', 'jslint']); | ||
gulp.task('lint', gulp.series('csslint', 'jslint')); | ||
|
||
/** serve **/ | ||
|
||
gulp.task('templates', function(){ | ||
return gulp.src('src/**/*.html') | ||
.pipe($.angularTemplatecache('templates.tpl.js', templateOptions)) | ||
.pipe(gulp.dest('.tmp/dist')); | ||
gulp.task('templates', (done) => { | ||
gulp.src('src/**/*.html') | ||
.pipe($.angularTemplatecache('templates.tpl.js', templateOptions)) | ||
.pipe(gulp.dest('.tmp/dist')); | ||
done(); | ||
}); | ||
|
||
gulp.task('sample', ['templates'], function(){ | ||
var files = gulp.src(['src/**/*.js', 'src/**/*.css', 'src/**/*.less', '.tmp/dist/*.js']) | ||
.pipe($.if('*.js', $.angularFilesort())); | ||
|
||
gulp.src(['sample/index.html']) | ||
.pipe(wiredep({ | ||
directory: './components/', | ||
bowerJson: require('./bower.json'), | ||
devDependencies: true, | ||
dependencies: true | ||
})) | ||
.pipe($.inject(files)) | ||
.pipe(gulp.dest('.tmp/dist')) | ||
.pipe(connect.reload()); | ||
gulp.task('sample', (done) => { | ||
let files = gulp.src(['src/**/*.js', 'src/**/*.css', 'src/**/*.less', '.tmp/dist/*.js']) | ||
.pipe($.if('*.js', $.angularFilesort())); | ||
|
||
gulp.src('sample/index.html') | ||
.pipe(wiredep({ | ||
directory: './components/', | ||
bowerJson: require('./bower.json'), | ||
devDependencies: true, | ||
dependencies: true | ||
})) | ||
.pipe(inject(files)) | ||
.pipe(gulp.dest('.tmp/dist')); | ||
// .pipe(connect.reload()); | ||
done(); | ||
}); | ||
|
||
|
||
gulp.task('watch', function(){ | ||
gulp.watch(['src/**'], ['sample']); | ||
gulp.task('watch', function (done) { | ||
gulp.watch(['src/**'], gulp.series('sample')); | ||
done(); | ||
}); | ||
|
||
gulp.task('serve', ['watch', 'sample'], function(){ | ||
gulp.task('serve', gulp.series('templates', 'sample', 'watch', function () { | ||
connect.server({ | ||
root: ['.tmp/dist', '.'], | ||
livereload: true, | ||
port: 9002 | ||
}); | ||
}); | ||
})); | ||
|
||
/** build **/ | ||
|
||
gulp.task('css', function(){ | ||
gulp.src(['src/**/*.css', 'src/**/*.less']) | ||
.pipe($.if('*.less', $.less())) | ||
.pipe($.concat(pkg.name + '.css')) | ||
.pipe(gulp.dest('dist')) | ||
.pipe($.rename(pkg.name + '.min.css')) | ||
.pipe($.minifyCss()) | ||
.pipe(gulp.dest('dist')); | ||
gulp.task('css', function () { | ||
return gulp.src(['src/**/*.css', 'src/**/*.less']) | ||
.pipe($.if('*.less', $.less())) | ||
.pipe($.concat(pkg.name + '.css')) | ||
.pipe(gulp.dest('dist')) | ||
.pipe($.rename(pkg.name + '.min.css')) | ||
.pipe($.minifyCss()) | ||
.pipe(gulp.dest('dist')); | ||
}); | ||
|
||
gulp.task('js', function() { | ||
gulp.src(['src/**/*.js', 'src/**/*.html']) | ||
.pipe($.if('*.html', $.minifyHtml())) | ||
.pipe($.if('*.html', $.angularTemplatecache(pkg.name + '.tpl.js', templateOptions))) | ||
.pipe($.angularFilesort()) | ||
.pipe($.if('*.js', $.replace(/'use strict';/g, ''))) | ||
.pipe($.concat(pkg.name + '.js')) | ||
.pipe($.headerfooter('(function(window, undefined) {\'use strict\';\n', '})(window);')) | ||
.pipe($.ngAnnotate(annotateOptions)) | ||
.pipe(gulp.dest('dist')) | ||
.pipe($.rename(pkg.name + '.min.js')) | ||
.pipe($.uglify()) | ||
.pipe(gulp.dest('dist')); | ||
gulp.task('js', function () { | ||
return gulp.src(['src/**/*.js', 'src/**/*.html']) | ||
.pipe($.if('*.html', $.minifyHtml())) | ||
.pipe($.if('*.html', $.angularTemplatecache(pkg.name + '.tpl.js', templateOptions))) | ||
.pipe($.angularFilesort()) | ||
.pipe($.if('*.js', $.replace(/'use strict';/g, ''))) | ||
.pipe($.concat(pkg.name + '.js')) | ||
.pipe($.headerfooter('(function(window, undefined) {\'use strict\';\n', '})(window);')) | ||
.pipe($.ngAnnotate(annotateOptions)) | ||
.pipe(gulp.dest('dist')) | ||
.pipe($.rename(pkg.name + '.min.js')) | ||
.pipe($.uglify()) | ||
.pipe(gulp.dest('dist')); | ||
}); | ||
|
||
/** clean **/ | ||
|
||
gulp.task('clean', function(cb){ | ||
gulp.task('clean', function (cb) { | ||
del(['dist', '.tmp'], cb); | ||
}); | ||
|
||
gulp.task('default',['css', 'js']); | ||
gulp.task('default', gulp.series('css', 'js')); |
Oops, something went wrong.