// Include gulp
var gulp = require('gulp'); 

// Include Our Plugins
var jshint = require('gulp-jshint');
var closure = require('gulp-closure-compiler');
var browserify = require('gulp-browserify');
var jsdoc = require('gulp-jsdoc');

// Lint
gulp.task('lint', function() {
    return gulp.src('src/**/*.js')
        .pipe(jshint())
        .pipe(jshint.reporter('default'));
});

gulp.task('check', function(){
    // Perform type checking, etc. with closure compiler
    gulp.src('build/wireframe.js')
        .pipe(closure({
            compilerPath: '/usr/share/java/closure-compiler/closure-compiler.jar',
            fileName: 'wireframe.min.js',
            compilerFlags: {
                warning_level: 'VERBOSE',
                summary_detail_level: 1
            }
        }))
});

// Compress/minify
gulp.task('compress', function(){
    gulp.src('build/wireframe.js')
        .pipe(closure({
            compilerPath: '/usr/share/java/closure-compiler/closure-compiler.jar',
            fileName: 'wireframe.min.js',
            compilerFlags: {
                warning_level: 'QUIET',
                compilation_level: 'SIMPLE_OPTIMIZATIONS'
            }
        }))
        .pipe(gulp.dest('build'));
});

gulp.task('browserify', function() {
    gulp.src('src/wireframe.js')
        .pipe(browserify({
            standalone: 'wireframe'
        }))
        .pipe(gulp.dest('build'));
});

// Build documentation
gulp.task('docs', function() {
    gulp.src('src/**/*.js')
        .pipe(jsdoc('docs'));
});

gulp.task('watch', function() {
    gulp.watch('src/**/*.(js|html)', ['lint', 'browserify']);
});

// Default Task
gulp.task('default', ['lint', 'browserify', 'watch']);
gulp.task('compile', ['browserify', 'compress']);
gulp.task('check', ['lint', 'browserify', 'check']);
gulp.task('docs', ['docs']);
// Include gulp
var gulp = require('gulp'); 

// Include Our Plugins
var jshint = require('gulp-jshint');
var closure = require('gulp-closure-compiler');
var browserify = require('gulp-browserify');
var jsdoc = require('gulp-jsdoc');

// Lint
gulp.task('lint', function() {
    return gulp.src('src/**/*.js')
        .pipe(jshint())
        .pipe(jshint.reporter('default'));
});

gulp.task('check', function(){
    // Perform type checking, etc. with closure compiler
    gulp.src('build/wireframe.js')
        .pipe(closure({
            compilerPath: '/usr/share/java/closure-compiler/closure-compiler.jar',
            fileName: 'wireframe.min.js',
            compilerFlags: {
                warning_level: 'VERBOSE',
                summary_detail_level: 1
            }
        }))
});

// Compress/minify
gulp.task('compress', function(){
    gulp.src('build/wireframe.js')
        .pipe(closure({
            compilerPath: '/usr/share/java/closure-compiler/closure-compiler.jar',
            fileName: 'wireframe.min.js',
            compilerFlags: {
                warning_level: 'QUIET',
                compilation_level: 'SIMPLE_OPTIMIZATIONS'
            }
        }))
        .pipe(gulp.dest('build'));
});

gulp.task('browserify', function() {
    gulp.src('src/wireframe.js')
        .pipe(browserify({
            standalone: 'wireframe'
        }))
        .pipe(gulp.dest('build'));
});

// Build documentation
gulp.task('builddocs', function() {
    gulp.src('src/**/*.js')
        .pipe(jsdoc('docs'));
});

gulp.task('watch', function() {
    gulp.watch('src/**/*.(js|html)', ['lint', 'browserify']);
});

// Default Task
gulp.task('default', ['lint', 'browserify', 'watch']);
gulp.task('compile', ['browserify', 'compress']);
gulp.task('check', ['lint', 'browserify', 'check']);
gulp.task('docs', ['builddocs']);
Fix docs task (name collision issue)