/**
 * Define install tasks.
 * @module ci.tasks.installTasks
 * @author "ci.worker.generateStructure"
 *
 */
var apeman = require('apeman'),
    helpers = require('../helpers'),
    t = helpers.taskDefineHelper,
    currentProject = apeman.currentProject,
    dependencies = currentProject.lookupRequire('ci/config/dependencies-config');

/**
 * Install apeman module. Use npm link from  global package.
 * @name ci.tasks.installApeman
 * @type {Object}
 */
exports.installApeman = t.linkNpmPackage({
    packageName: 'apeman',
    options: ['--no-bin-links']
});

/**
 * Install node package via npm.
 * @name ci.tasks.installNodePackages
 * @type {Object}
 */
exports.installNodePackages = t.installNodeModules({
    packages: dependencies.nodePackages
});

/**
 * Install node package via npm for development.
 * @name ci.tasks.installNodePackages
 * @type {Object}
 */
exports.installNodeDevPackages = t.installNodeModules({
    packages: dependencies.nodeDevPackages
});

/**
 * Install external modules.
 * @name ci.tasks.install
 * @type {object}
 */
exports.install = [
    'installApeman',
    'installNodePackages',
    'installNodeDevPackages'
];