createDocTask = function(languages){
    languages.forEach(function(language, i){
        var cleanTask = 'doc-clean-' + language;
        var commentTask = 'doc-comment-' + language;
        var buildTask = 'doc-' + language;

        var codeSrc = 'docs/api-' + language + '/code/';

        gulp.task(cleanTask, function(cb){
            del('docs/api-' + language, cb);
        });

        gulp.task(commentTask, [cleanTask], function(){
            return gulp.src(pkg.sources.files, {
                cwd:pkg.sources.dir,
                base:pkg.sources.dir
            })
            .pipe(replace(apiCommentReg, '$' + (i+1)))
            .pipe(replace(/\*[\s]*@language=[a-z]+[\s]*/g, ''))
            .pipe(gulp.dest(codeSrc));
        });

        gulp.task(buildTask, [commentTask], (function(){
            var files = pkg.sources.files.map(function(src){
                return codeSrc + src;
            });

            var cmd = 'java ' + [
                '-jar',
                'tools/jsdoc-toolkit-2.4.0/jsrun.jar',
                'tools/jsdoc-toolkit-2.4.0/app/run.js',
                codeSrc,
                '-d=docs/api-' + language + '/',
                '-t=docs/api_template/',
                '-r=5',
                '-x=js',
                // '-q',
                '-E=FilesLoad.js',
                '-D="ver:' + pkg.version + '"',
                '-lang=' + language
            ].join(' ');
            return shell.task(cmd);
        })());
    });
}
/*.js')
        .pipe(gulpif(!isWatch, uglify()))
        .pipe(header(getFileInfo(type)))
        .pipe(rename({extname:".min.js"}))
        .pipe(gulp.dest(destPath))
    });

    //zip
    gulp.task(zipTask, [uglifyTask], function(){
        return gulp.src(destPath + '/*