 compileLangHandler = (this_lang, source_path, dest_dir, options) ->
   gulp.src source_path
     .pipe plugins[this_lang.plugin](options)
-    .pipe gulp.dest(dest_dir + '/' + this_lang.dest)
+    .pipe gulp.dest(path.join(dest_dir, this_lang.dest))
 compileManifest = (dest_dir, update_fn) ->
-  manifest_json = yamljs.load resources_path + '/manifest.yml'
+  manifest_json = yamljs.load path.join(resources_path, 'manifest.yml')
   update_fn manifest_json
 
-  dest_path = dest_dir + '/manifest.json'
+  dest_path = path.join dest_dir, 'manifest.json'
   fs.writeJSONSync dest_path, manifest_json
-getSourcePath = (this_lang) -> this_lang.source + '/*.' + this_lang.extName
+getSourcePath = (this_lang) -> path.join this_lang.source, '*.' + this_lang.extName
 watchLang = (lang_name, dest_dir, options) ->
   this_lang = lang[lang_name]
 

  rmdirp dir_path

  fs.mkdirSync dir_path
  fs.mkdirSync dir_path + '/' + lang.css.dest
  fs.mkdirSync dir_path + '/' + lang.js.dest

# recursively remove folder if exist
rmdirp = (path) ->

  watchLang 'html', dev_path, pretty: true

  # for js only (no compile, just soft link)
  js_dest_path = path.join(dev_path, lang.js.dest)
  rmdirp js_dest_path
  fs.symlinkSync path.join('..', lang.js.source), js_dest_path

  compileManifest dev_path, (manifest_json) ->
    manifest_json.name += '(dev)'
    manifest_json.version = '0.0.0.0'

  for file_name in ['font', '_locales']
    fs.copySync file_name, path.join(dev_path, file_name)
  fs.copySync path.join(resources_path, 'img-dev'), path.join(dev_path, 'img')
