 STYLES_PATH = require './src/themes/styl.includes.coffee'
 ENTRY_PATH  = ['./playground/main.coffee']
 COFFEE_PATH = ['./src/components/**/*.coffee','./src/core/**/*.coffee','./src/init.coffee']
+LIBS_PATH   = ['./libs/*.js']
 TEST_PATH   = ['./test/**/*.coffee']
 LIBS        = require './src/lib.includes.coffee'
 

    .pipe rename "kd.libs.#{version}js"
    .pipe gulp.dest "#{buildDir}/js"

  stream.pipe(livereload())  if useLiveReload


gulp.task 'coffee', ->


gulp.task 'live', -> useLiveReload = yes

# Watch Tasks

watchLogger = (color, watcher) ->
  watcher.on 'change', (event) ->
    gutil.log gutil.colors[color] "file #{event.path} was #{event.type}"


gulp.task 'watch-test', ->
  watcher = gulp.watch TEST_PATH, ['test']
  watchLogger 'cyan', watcher


gulp.task 'watch-coffee', ->
  watcher = gulp.watch COFFEE_PATH, ['coffee']
  watchLogger 'yellow', watcher


gulp.task 'watch-libs', ->
  watcher = gulp.watch LIBS_PATH, ['libs']
  watchLogger 'yellow', watcher


gulp.task 'watch-styles', ->
  watcher = gulp.watch STYLES_PATH, ['styles']
  watchLogger 'yellow', watcher


gulp.task 'watch-playground', ->
  watcher = gulp.watch [
    './playground/**/*.coffee'
    './playground/**/*.html'
  ], ['play']

  watchLogger 'blue', watcher


# Aggregate Tasks

gulp.task 'compile', ['styles', 'libs', 'coffee', 'test']

defaultTasks = [
  'live', 'compile', 'play',
  'watch-styles', 'watch-coffee', 'watch-libs',
  'watch-playground', 'watch-test'
]

gulp.task 'default', defaultTasks , ->

