// 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');
var mocha = require("gulp-mocha");

// 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('test', function () {
    gulp.src('tests/**/*.js')
    .pipe(mocha({ reporter: 'spec'}));
});

gulp.task('testwatch', function () {
    gulp.watch('tests/**/*.js', ['test']);
});

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']);
// 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');
var mocha = require("gulp-mocha");

// 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('test', function () {
    gulp.src('tests/**/*.js')
    .pipe(mocha({ reporter: 'min', ui: 'tdd'}));
});

gulp.task('testwatch', function () {
    gulp.watch('tests/**/*.js', ['test']);
});

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']);
Change tests to TDD