"use strict";
var watch_resolve_1 = require("./watch.resolve");
var task_resolve_1 = require("./task.resolve");
var seq = require("./task.sequence");
var debug = require("debug");
function getBeforeTaskRunner(trigger, watchTasks) {
    /**
     * Get 'before' task list
     */
    var beforeTasksAsCliInput = watch_resolve_1.resolveBeforeTasks(trigger.config.before, trigger.input, watchTasks.valid);
    debug("Combined global + task specific 'before' tasks [" + beforeTasksAsCliInput + "]");
    /**
     * Now Resolve the before task names given in input.
     */
    var beforeTasks = task_resolve_1.resolveTasks(beforeTasksAsCliInput, trigger);
    var beforeSequence = seq.createFlattenedSequence(beforeTasks.valid, trigger);
    var beforeRunner = seq.createRunner(beforeSequence, trigger);
    return {
        tasks: beforeTasks,
        sequence: beforeSequence,
        runner: beforeRunner,
        beforeTasksAsCliInput: beforeTasksAsCliInput
    };
}
exports.getBeforeTaskRunner = getBeforeTaskRunner;
//# sourceMappingURL=watch.before.js.map