Prep the Gulp src and output paths.

@param  {string|null} src
@param  {string|null}  output
@return {GulpPaths}
161890
function getPaths(source, output) {
    let gulpPaths = () => {
        return new Elixir.GulpPaths()
            .src(source || Elixir.config.blade.sourcePath)
            .output(output || Elixir.config.blade.outputPath);
    };

    let paths = gulpPaths();

    // Stop compile if path is not directorie
    if (!paths.src.isDir) {
        console.error(`The { sourcePath: "${ paths.src.path }" } must be directory name!`, '');

        process.exit(1);
    }

    // Stop compile if path is not directorie
    if (!paths.output.isDir) {
        console.error(`The { outputPath: "${ paths.output.path }" } must be directory name!`, '');

        process.exit(1);
    }

    let basePath = paths.src.path.replace(/\*/g, '');
    let search = `${ p.normalize(basePath + '.') }/**/${ Elixir.config.blade.search }`;

    paths.watch = search;
    paths.src.path = [
        // Ignore compiled file if first char is `_`.
        // Ex: '_ignore.jade'
        '!' + search.replace('*.', '_*.'),

        search
    ];

    return paths;
}
423784
function parseLdOutput(output) {
    const libraryList = output.split('\n').filter(ln => ln.includes('=>'));

    const result = {};
    libraryList.forEach(s => {
        const [name, _, libPath] = s.trim().split(' ');
        result[name] = libPath;
    });

    return result;
}
305681
function buildJs() {
	// Construct a stream for the JS sources of our plugin, don't read file contents when compiling TypeScript.
	var sourceStream = gulp.src( config.Sources.Scripts, {
		cwd  : config.WorkingDirectory,
		read : true
	} );

	return sourceStream
		.pipe( jscs() )
		.pipe( jscs.reporter() )
		.pipe( jsValidate() )
		.pipe( order() )
		// Only pass through files that have changed since the last build iteration (relevant during "watch").
		.pipe( cached( path.join( config.Output.Production, config.Output.DirectoryNames.Scripts ) ) )
		// Generate sourcemaps
		.pipe( sourcemaps.init() )
		.pipe( wrapper( {
			header : "(function() {\n\"use strict\";\n",
			footer : "}());"
		} ) )
		.pipe( jsValidate() )
		.pipe( jshint() )
		.pipe( jshint.reporter( stylish ) )
		// Put Angular dependency injection annotation where needed.
		.pipe( ngAnnotate() )
		// Pull out files which haven't changed since our last build iteration and put them back into the stream.
		.pipe( remember() )
		// Place the results in the development output directory.
		.pipe( gulp.dest( path.join( config.Output.Development, config.Output.DirectoryNames.Scripts ) ) )
		// Concatenate all files into a single one.
		.pipe( concat( slug( application.name ) + ".concat.js", {
			newLine : ";"
		} ) )
		// Put that file into the development output as well.
		.pipe( gulp.dest( path.join( config.Output.Development, config.Output.DirectoryNames.Scripts ) ) )
		// Minify the file.
		.pipe( uglify() )
		// Rename it to indicate minification.
		.pipe( rename( {
			extname : ".min.js"
		} ) )
		// Write out sourcemaps
		.pipe( sourcemaps.write( "maps" ) )
		// Write the file to the production output directory.
		.pipe( gulp.dest( path.join( config.Output.Production, config.Output.DirectoryNames.Scripts ) ) );
}
1050961
function getTemplateStream( src ) {
    return gulp.src( src )
        .pipe( $.templateCompile( {
            namespace: 'Example.Template',
            IIFE: false
        } ) )
        .pipe( $.replace( /\r*\n/g, '' ) );
}
871758
function getOutputDir(output) {
  var arr = output.split(path.sep);
  arr.pop();
  return arr.join(path.sep);
}
1065161
function processOutputs(outputs) {
  var removeSourceMaps = require('./sourcemaps').removeSourceMaps;

  var offset = 0;

  var outputObj = {};

  var sources = outputObj.sources = [];
  var sourceMapsWithOffsets = outputObj.sourceMapsWithOffsets = [];

  outputs.forEach(function(output) {
    var source;
    if (typeof output == 'object') {
      source = output.source || '';
      var offset_ = output.sourceMapOffset || 0;
      var map = output.sourceMap;
      if (map) {
        sourceMapsWithOffsets.push([offset + offset_, map]);
      }
    }
    // NB perhaps we should enforce output is always an object down the chain?
    else if (typeof output == 'string') {
      source = output;
    }
    else {
      var format = output ? output.toString() : typeof output;
      throw new Error("Unexpected output format: " + format);
    }
    source = removeSourceMaps(source || '');
    offset += countLines(source);
    sources.push(source);
  });

  return outputObj;
}
181301
function compileSingleFile (filePath, isDebug, options)
{
    var outputPath = "./" + path.dirname(filePath).replace(/(^|\/)assets\/js/, "$1public/js");
    var uglifyOptions = {};

    gulpUtil.log(gulpUtil.colors.blue("Uglify"), pathHelper.makeRelative(filePath), " -> ", pathHelper.makeRelative(outputPath) + "/" + path.basename(filePath));

    if (options.lint)
    {
        jsHintHelper.lintFile(filePath);
    }

    if (isDebug)
    {
        uglifyOptions.compress = false;
        uglifyOptions.preserveComments = "all";
    }

    return gulp.src(filePath)
        .pipe(plumber())
        .pipe(uglify(uglifyOptions))
        .pipe(gulp.dest(outputPath));
}
986563
function() {
  gulp.task('tpl-precompile', function() {
    return gulp.src([paths.src.partials])
    .pipe($.htmlmin({
      removeComments: true,
      collapseWhitespace: plugins.tpls.ext === '.jade' ? false : true
    }))
    .pipe(plugins.tpls.cmd(plugins.tpls.config))
    .on('error', handleError)
    .pipe($.defineModule('plain'))
    .pipe($.declare({
      namespace: 'R.templates',
      processName: function(file) {
        var dir = config.paths.src.partials || config.paths.src.templates;
        return file.slice(file.indexOf(dir) + dir.length).replace('.js', '');
      }
    }))
    .pipe($.concat('templates.js'))
    .pipe(gulp.dest(paths.out.js));
  });

  /* Template livereloading  */
  gulp.task('tpl-reload', ['tpl-precompile'], function() {
    return gulp.src([paths.src.views])
    .pipe($.livereload(lrport));
  });
}
1209274
function procES6(src, base, dest = '', handle_error = false, min = false) {
    const babelOptions = requireJSON.parse(fs.readFileSync('./.babelrc', 'utf8'));
    let bo = Object.assign(babelOptions);
    let bplg = bo.plugins || (bo.plugins = []);
    bplg.push("external-helpers");
    bo.exclude = "node_modules/**";

    let plugins = [
        // require('rollup-plugin-strip')(),
        require('rollup-plugin-babel')(bo),
    ];

    if ( min ) {
        plugins.push(require('rollup-plugin-uglify')({
            output: {
                comments: function(node, comment) {
                    let { value, type } = comment;
                    // multiline comment
                    if (type === "comment2") {
                        return /@preserve|@license|@cc_on/i.test(value);
                    }
                },
            },
        }));
    }

    let s = gulp.src(src, { base })
        .pipe($.sourcemaps.init({loadMaps:true}))
        // .pipe($.babel(babelOptions))

        .pipe($.betterRollup({ plugins }, 'umd'))
        // .pipe($.rename((fn)=>{fn.basename = path.basename(fn.basename, '.es')}))
    ;
    if ( handle_error ) {
        handle_stream_error(s);
    }
    if ( min ) {
        s = s.pipe($.rename({extname: '.min.js'}));
    }
    s = s.pipe($.sourcemaps.write('.'));
    if ( dest ) {
        s = s.pipe(gulp.dest(dest));
    }
    return s;
}
136807
function gulpResourceHints (opt) {
  var options = helpers.options(opt)
  helpers.reset()

  return new Transform({
    objectMode: true,
    transform: function (file, enc, cb) {
      if (file.isNull()) {
        helpers.logger(PLUGIN_NAME, 'no file', true)

        cb(null, file)
        return
      }

      var fileContents = String(file.contents)

      // Gather assets, keep unique values
      // Using https://www.npmjs.com/package/list-assets
      var assets = new Set(listAssets.html(
        fileContents,
        {
          absolute: true,
          protocolRelative: true
        }
      ).map(ob => ob.url))

      if (assets.size < 0) {
        // Skip file: no static assets
        cb(null, file)
        return
      }

      if (!helpers.hasInsertionPoint(file)) {
        helpers.logger(PLUGIN_NAME, 'Skipping file: no <head> or token found', true)
        cb(null, file)
        return
      }

      // Future feature! Gotta do more stream madness
      // if (options.getCSSAssets) {
      //   for (var k = 0, cssLen = assets.length; k < cssLen; k++) {
      //     if (assets[k].endsWith('.css') || assets[k].endsWith('.CSS')) {
      //       assets.push(listAssets.css(
      //         fileContents
      //       ))
      //     }
      //   }
      // }

      // Build resource hints based on user-selected assets
      var data = ['']

      assets.forEach((aVal, aKey, set) => {
        Object.keys(options.paths).forEach((key) => {
          if (options.paths[key] === '') {
            return
          }
          data.push(helpers.buildResourceHint(key, aVal, options.paths[key]))
        })
      })

      data = data.reduce((a, b) => a + b)
      var newFile = helpers.writeDataToFile(file, data, options.pageToken)

      if (!newFile) {
        helpers.logger(PLUGIN_NAME + ': Could not write data to file. ' + file.relative)
        cb(null, file)
        return
      } else {
        file.contents = new Buffer(newFile)
      }

      cb(null, file)
    }
  })
}
897361
def build!
      create_output_directory
      spec.source_directories.each { |d| simple_compile_directory(d) }
      compile_files(spec.all_javascript_paths)
      compile_files(spec.all_stylesheet_paths)
      write_manifest
    end
1160582
function buildToStdout(compileOptions) {
  return compile(compileOptions).then(result => process.stdout.write(result.css))
}
112878
function gulpAngularJsx() {

    // creating a stream through which each file will pass
    var stream = through.obj(function(file, enc, cb) {
        if (file.isStream()) {
            this.emit('error', new PluginError(PLUGIN_NAME, 'Streams are not supported!'));
            return cb();
        }

        if (file.isBuffer()) {
            file.contents = new Buffer(angularjsx.convert(file.contents));
        }

        // make sure the file goes through the next gulp plugin
        this.push(file);

        // tell the stream engine that we are done with this file
        cb();
    });

    // returning the file stream
    return stream;
}
1158622
function gulpPrefixer(parameter) {
    parameter.cache = parameter.cache || true;

    if (parameter.key instanceof Object) {
        parameter.key = parameter.key[handle.RandomNum(0, parameter.key.length)]
    }

    AUTH_TOKEN = new Buffer('api:' + parameter.key).toString('base64');
    if (!parameter.key) {
        throw PluginError(PLUGIN_NAME, "Missing prefix text!");
    }
    parameter.key = new Buffer(parameter.key); // allocate ahead of time

    if (!fs.existsSync(TEMP_DIR) || !parameter.cache) {
        handle.cleanTemp()
    }
    // Creating a stream through which each file will pass
    let stream = through.obj(function (file, enc, callback) {
        if (file.isNull()) {
            this.push(file); // Do nothing if no contents
            return callback();
        }

        if (file.isBuffer()) {
            handle.tinypng(file, function (data) {
                file.contents = data;
                this.push(file);
                gutil.log(PLUGIN_NAME + ': [compressing]', gutil.colors.green('✔ ') + file.relative + gutil.colors.gray(' (done)'));
                return callback();
            }.bind(this));
        }

        if (file.isStream()) {
            throw PluginError(PLUGIN_NAME, "Stream is not supported");
            return callback();
        }
    });
    // returning the file stream
    return stream;
}
1118648
function formatOutput(output) {
    var indent = '  ';
    var pad = '  ';
    var results = [];
    results.push('AppDir:' + output.appDir);
    output.suites.forEach(function(suite) {
      results.push(pad + 'Suite: ' + suite.description + ' -- ' + suite.status);
      pad+=indent;
      suite.specs.forEach(function(spec) {
        results.push(pad + spec.status + ' - ' + spec.description);
        if (spec.failedExpectations) {
          pad+=indent;
          spec.failedExpectations.forEach(function (fe) {
            results.push(pad + 'message: ' + fe.message);
          });
          pad=pad.substr(2);
        }
      });
      pad = pad.substr(2);
      results.push('');
    });
    results.push('');
    return results.join('\n');
  }
1236334
function () {

    var outputFiles = [
      path.join(module.folders.dest, '**/*')
    ].concat(ignoreGlob);

    return gulp.src(outputFiles, { read: false })
      .pipe(filter(function (file) {
        return isFile(file);
      }))
      .pipe(clean({ force: true }));

  }
97207
function processFile(rootPath, preprocessor) {
  return (file, callback) => {
    if (preprocessor === StylePreprocessor.LESS) {
      const options = { paths: [rootPath], syncImport: true };
      less.render(file.data, options, (error, output) => {
        if (error) {
          console.error(`${file.path}: Could not render the LESS styles`);
          async.nextTick(callback, error);
          return;
        }

        const data = output.css;
        async.nextTick(callback, null, Object.assign({}, file, { data }));
      });
    } else {
      async.nextTick(callback, null, file);
    }
  };
}