<commit_before>var gulp = require("gulp");
var msbuild = require("gulp-msbuild");
var debug = require("gulp-debug");
var foreach = require("gulp-foreach");
var rename = require("gulp-rename");
var watch = require("gulp-watch");
var newer = require("gulp-newer");
var runSequence = require("run-sequence");
var path = require("path");
var config = require("./gulp-config.js")();
var nugetRestore = require('gulp-nuget-restore');
var fs = require('fs');
var unicorn = require("./scripts/unicorn.js");
var habitat = require("./scripts/habitat.js");

module.exports.config = config;

gulp.task("default", function (callback) {
  config.runCleanBuilds = true;
  return runSequence(
    "01-Copy-Sitecore-Lib",
    "02-Nuget-Restore",
    "03-Publish-All-Projects",
    "04-Apply-Xml-Transform", 
    "05-Sync-Unicorn", 
	callback);
});

/*****************************
  Initial setup
*****************************/
gulp.task("01-Copy-Sitecore-Lib", function () {
  console.log("Copying Sitecore Libraries");
  var files = config.sitecoreLibraries + "/**/*";
  return gulp.src(files).pipe(gulp.dest("./lib/Sitecore"));
});

gulp.task("02-Nuget-Restore", function (callback) {
  var solution = "./" + config.solutionName + ".sln";
  return gulp.src(solution).pipe(nugetRestore());	
});


gulp.task("03-Publish-All-Projects", function (callback) {
  return runSequence(
    "Publish-Foundation-Projects",
    "Publish-Feature-Projects",
    "Publish-Project-Projects", callback);
});

gulp.task("04-Apply-Xml-Transform", function () {
  return gulp.src("./src/Project/**/code/*.csproj")
    .pipe(foreach(function (stream, file) {
      return stream
        .pipe(debug({ title: "Applying transform project:" }))
        .pipe(msbuild({
          targets: ["ApplyTransform"],
          configuration: config.buildConfiguration,
          logCommand: false,
          verbosity: "normal",
          maxcpucount: 0,
          toolsVersion: 14.0,
          properties: {
            WebConfigToTransform: config.websiteRoot + "\\web.config"
          }
        }));
    }));

});

gulp.task("05-Sync-Unicorn", function (callback) {
  var options = {};
  options.configurationConfigFiles = [
    __dirname + "/src/Foundation/Serialization/code/App_Config/Include/*/*.Serialization.config",
    __dirname + "/src/Foundation/!(Serialization)/code/App_Config/Include/*/*.Serialization.config",
    __dirname + "/src/Feature/**/code/App_Config/Include/*/*.Serialization.config",
    __dirname + "/src/Project/Common/code/App_Config/Include/*/*.Serialization.config",
    __dirname + "/src/Project/!(Common)/code/App_Config/Include/*/*.Serialization.config"];
  options.siteHostName = habitat.getSiteUrl();
  options.authenticationConfigFile = __dirname + "/src/Foundation/Serialization/code/App_config/Include/Foundation/Foundation.Serialization.config";
  <commit_msg>Remove config files from gulp<commit_after>var gulp = require("gulp");
var msbuild = require("gulp-msbuild");
var debug = require("gulp-debug");
var foreach = require("gulp-foreach");
var rename = require("gulp-rename");
var watch = require("gulp-watch");
var newer = require("gulp-newer");
var runSequence = require("run-sequence");
var path = require("path");
var config = require("./gulp-config.js")();
var nugetRestore = require('gulp-nuget-restore');
var fs = require('fs');
var unicorn = require("./scripts/unicorn.js");
var habitat = require("./scripts/habitat.js");

module.exports.config = config;

gulp.task("default", function (callback) {
  config.runCleanBuilds = true;
  return runSequence(
    "01-Copy-Sitecore-Lib",
    "02-Nuget-Restore",
    "03-Publish-All-Projects",
    "04-Apply-Xml-Transform", 
    "05-Sync-Unicorn", 
	callback);
});

/*****************************
  Initial setup
*****************************/
gulp.task("01-Copy-Sitecore-Lib", function () {
  console.log("Copying Sitecore Libraries");
  var files = config.sitecoreLibraries + "/**/*";
  return gulp.src(files).pipe(gulp.dest("./lib/Sitecore"));
});

gulp.task("02-Nuget-Restore", function (callback) {
  var solution = "./" + config.solutionName + ".sln";
  return gulp.src(solution).pipe(nugetRestore());	
});


gulp.task("03-Publish-All-Projects", function (callback) {
  return runSequence(
    "Publish-Foundation-Projects",
    "Publish-Feature-Projects",
    "Publish-Project-Projects", callback);
});

gulp.task("04-Apply-Xml-Transform", function () {
  return gulp.src("./src/Project/**/code/*.csproj")
    .pipe(foreach(function (stream, file) {
      return stream
        .pipe(debug({ title: "Applying transform project:" }))
        .pipe(msbuild({
          targets: ["ApplyTransform"],
          configuration: config.buildConfiguration,
          logCommand: false,
          verbosity: "normal",
          maxcpucount: 0,
          toolsVersion: 14.0,
          properties: {
            WebConfigToTransform: config.websiteRoot + "\\web.config"
          }
        }));
    }));

});

gulp.task("05-Sync-Unicorn", function (callback) {
  var options = {};
  options.siteHostName = habitat.getSiteUrl();
  options.authenticationConfigFile = __dirname + "/src/Foundation/Serialization/code/App_config/Include/Foundation/Foundation.Serialization.config";
  
{'fraction_non_alphanumeric': 0.19264649559555727, 'fraction_numerical': 0.009191880505553428, 'mean_word_length': 3.845083487940631, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5340637', 'n_tokens_mistral': 1656, 'n_tokens_neox': 1614, 'n_words': 271}