/**
 * Define scaffold tasks.
 * @module ci.tasks.scaffoldTasks
 * @author "ci.worker.generateStructure"
 *
 */
var helpers = require('../helpers'),
    apeman = require('apeman'),
    currentProject = apeman.currentProject,
    t = helpers.taskDefineHelper;

var scaffoldConfig = require(currentProject.lookup('ci/config/scaffold-config'));


exports.scaffoldCiWorkers = t.generateScaffoldFiles({
    names: scaffoldConfig.ciWorkers,
    destFormat: 'ci/worker/%s.js',
    tmplFile: 'tmpl/js/ci_worker.js.hbs'
});

exports.scaffoldCiTasks = t.generateScaffoldFiles({
    names: scaffoldConfig.ciTasks,
    destFormat: 'ci/tasks/%s_tasks.js',
    tmplFile: 'tmpl/js/ci_tasks.js.hbs',
    data: {
        hasPrototype: !!currentProject.prototypeProject,
        lookupPath: 'ci/tasks'
    }
});

/**
 * @name ci.tasks.scaffold
 * @type {object}
 */
exports.scaffold = [
    'scaffoldCiWorkers',
    'scaffoldCiTasks'
];