/*
 =============================================================
 = Foundation Utimate                                         =
 = http://github.com/relution-developments/foundation-remix  =
 = --------------------------------------------------------- =
 = Copyright (c) 2016 - Relution Developments Ltd            =
 = Licensed under the MIT license.                           =
 = @author JayDemitri                                        =
 =============================================================
 */
"use strict";

/*
    Libraries
    ---------
 */
var gulp    = require("gulp"), // Gulp
    gutil   = require("gulp-util"), // Gulp Utils
    gconfig = require("./gulp/gulp-config"), // Gulp Configuration
    bs = require('browser-sync').create("Server1");

// FoundationUltimate Libs
var cli     = require("./gulp/tasks/cli"),
    clean   = require("./gulp/tasks/clean"),
    utils   = require("./gulp/tasks/utils"),
    server  = require("./gulp/tasks/server"),
    imprt   = require("./gulp/tasks/import");
/*
 cli test
 just used during development to test the best setup
 */
//gulp.task('cli.test', cli.test);

gulp.task('clean.libs',function(){
    return clean.libs()
});
gulp.task('clean.build',function(){
    var env = utils.getEnv();
    // @Todo: Add Callbacks And Promises
    if (env.dev === true) {
        clean.dev();
    } else if (env.release === true) {
        clean.release();
    } else {
        clean.dev();
        clean.release();
    };
})

gulp.task('import:js', imprt.angular)

gulp.task('serve', server.start);

// Define our default task
gulp.task('default', function () {
    var env = utils.getEnv();
    (env.dev === true) ? gutil.log("Will Work On Devevelopment Mode"): false;
    (env.release === true) ? gutil.log("Will Work In Release Mode"): false;
    (env.dev === false && env.release === false) ? gutil.log("No Mode Specified Will Work in Development Then Release Mode"): false;
    return gutil.log('Gulp is running!');
});