sebastien 6 år sedan
förälder
incheckning
d4b3821750

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 8273 - 8273
Playground/babylon.d.txt


+ 0 - 133
Tools/Gulp/gulp-babylonModule.js

@@ -1,133 +0,0 @@
-var gutil = require('gulp-util');
-var through = require('through2');
-var path = require('path');
-
-module.exports = function (moduleName, dependencyTree, generateIndex, perFile, shaders, shaderIncludes) {
-    return through.obj(function (file, enc, cb) {
-
-        let basename = (path.basename(file.path, ".js"));
-
-        //console.log("Compiling module: " + moduleName + "/" + basename.replace("babylon.", ""));
-
-        var extendsAddition =
-            `var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)o.hasOwnProperty(n)&&(t[n]=o[n])};return function(o,n){function r(){this.constructor=o}t(o,n),o.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();
-`;
-
-        var decorateAddition =
-            'var __decorate=this&&this.__decorate||function(e,t,r,c){var o,f=arguments.length,n=f<3?t:null===c?c=Object.getOwnPropertyDescriptor(t,r):c;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,r,c);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(f<3?o(n):f>3?o(t,r,n):o(t,r))||n);return f>3&&n&&Object.defineProperty(t,r,n),n};\n';
-
-        let content = file.contents.toString();
-        if (content.indexOf('__extends') === -1 && !dependencyTree.length) {
-            extendsAddition = '';
-        }
-
-        if (content.indexOf('__decorate') === -1) {
-            decorateAddition = '';
-        }
-
-        let dependenciesText = `${extendsAddition}
-${decorateAddition}
-if(typeof require !== 'undefined'){
-    var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
-    var BABYLON = globalObject["BABYLON"] || {}; 
-    var EXPORTS = {};
-`;
-        let exportsText = '';
-        if (!generateIndex) {
-            let loadedFiles = [];
-            dependencyTree[basename].forEach(function (d, idx) {
-                if (d.module.indexOf("core") !== -1) return;
-                let name = d.file.split(".").pop();
-
-                if (loadedFiles.indexOf(name) === -1) {
-                    if (d.main)
-                        dependenciesText += `var ${name}Module = require('babylonjs/${d.module[0]}/${name}');
-`;
-                    else
-                        exportsText += `var ${name}Module = require('babylonjs/${d.module[0]}/${name}');
-`;
-                    loadedFiles.push(name);
-                }
-
-                dependenciesText += `BABYLON["${d.name}"] = ${name}Module["${d.name}"];
-`;
-                //dependenciesText += `if(BABYLON !== BABYLON${idx}) __extends(BABYLON, BABYLON${idx});
-            });
-            perFile[basename].declarations.forEach(dec => {
-                exportsText += `EXPORTS['${dec}'] = BABYLON["${dec}"];
-`;
-            });
-            if (shaders) {
-                dependenciesText += `require("babylonjs/${moduleName}/shaders");
-`;
-            }
-            if (shaderIncludes) {
-                dependenciesText += `require("babylonjs/${moduleName}/shaderIncludes");
-`;
-            }
-        } else {
-            content = '';
-            let basenames = Object.keys(perFile).filter(basefilename => {
-                return perFile[basefilename].module.indexOf(moduleName) !== -1;
-            });
-
-            basenames.forEach(bname => {
-                let name = bname.split(".").pop();
-                dependenciesText += `var ${name} = require("babylonjs/${moduleName}/${name}");
-`;
-                // now add the internal dependencies to EXPORTS
-                perFile[bname].declarations.forEach(dec => {
-                    dependenciesText += `EXPORTS['${dec}'] = BABYLON["${dec}"] = ${name}["${dec}"];
-`;
-                });
-            })
-        }
-
-        exportsText += `(function() {
-    globalObject["BABYLON"] = globalObject["BABYLON"] || BABYLON;
-    module.exports = EXPORTS;
-    })();
-}`;
-
-
-
-        /*let exportRegex = /BABYLON.([0-9A-Za-z-_]*) = .*;\n/g
-
-        var match = exportRegex.exec(content);
-
-        let exportsArray = [];
-        while (match != null) {
-            if (match[1]) {
-                exportsArray.push(match[1])
-            }
-            match = exportRegex.exec(content);
-        }*/
-
-
-        /*if (moduleName === "core") {
-            exportsText = `(function() {
-    globalObject["BABYLON"] = globalObject["BABYLON"] || BABYLON;
-    module.exports = BABYLON; 
-})();
-}`
-        }*/
-
-        if (file.isNull()) {
-            cb(null, file);
-            return;
-        }
-
-        if (file.isStream()) {
-            //streams not supported, no need for now.
-            return;
-        }
-
-        try {
-            file.contents = Buffer.from(dependenciesText.concat(Buffer.from(String(content).concat(exportsText))));
-            this.push(file);
-        } catch (err) {
-            this.emit('error', new gutil.PluginError('gulp-add-babylon-module', err, { fileName: file.path }));
-        }
-        cb();
-    });
-}

+ 0 - 96
Tools/Gulp/gulp-dtsModuleSupport.js

@@ -1,96 +0,0 @@
-var gutil = require('gulp-util');
-var through = require('through2');
-var path = require('path');
-
-// inject - if set to true, it will add all declarations as imports.
-module.exports = function (moduleName, inject, declarations, perFile, dependencyTree) {
-    return through.obj(function (file, enc, cb) {
-        let basename = (path.basename(file.path, ".d.ts"));
-        let fileContent = file.contents.toString();
-        let importsString = '';
-
-        if (!inject) {
-            perFile[basename] = perFile[basename] || {
-                module: [moduleName],
-                dependencies: [],
-                declarations: []
-            };
-            if (perFile[basename].module.indexOf(moduleName) === -1) {
-                perFile[basename].module.push(moduleName);
-            }
-            declarations[moduleName] = declarations[moduleName] || [];
-            let regexp = /    (abstract class|function|class|interface|type|const|enum|var) ([\w]*)/g;
-
-            var match = regexp.exec(fileContent);
-            while (match != null) {
-                if (match[2]) {
-                    // check it is not SIMD:
-                    let simdMatch = /    interface (\w*\dx\d{1,2}\w*)/.exec(match[0]);
-                    if (!simdMatch && match[2] !== 'earcut' && match[2] !== 'deviation' && match[2] !== 'flatten') {
-                        declarations[moduleName].push(match[2]);
-                        perFile[basename].declarations.push(match[2]);
-                    }
-                }
-                match = regexp.exec(fileContent);
-            }
-        } else {
-            /*let declared = [];
-            Object.keys(declarations).forEach(name => {
-                if (name === moduleName) return;
-                let imports = declarations[name].filter(obj => {
-                    let exists = declared.indexOf(obj) !== -1;
-                    if (!exists) {
-                        declared.push(obj);
-                    }
-                    return !exists;
-                });
-                if (imports.length)
-                    importsString += `import {${imports.join(',')}} from 'babylonjs/${name}';
-`;
-            });*/
-
-            // find all of the related files for the dependency tree integration
-            let basenames = Object.keys(perFile).filter(basefilename => {
-                return perFile[basefilename].module.indexOf(moduleName) !== -1;
-            });
-
-            let classesForImports = {} // key : module name, content - array of objects
-            basenames.forEach(bname => {
-                dependencyTree[bname].forEach(dep => {
-                    if (dep.module.indexOf(moduleName) !== -1) return;
-                    let depModule = dep.module.indexOf("core") === -1 ? dep.module[0] : "core";
-                    classesForImports[depModule] = classesForImports[depModule] || [];
-                    if (classesForImports[depModule].indexOf(dep.name) === -1) {
-                        //babylon.imageProcessingPostProcess
-                        classesForImports[depModule].push(dep.name);
-                    }
-                });
-            });
-
-            Object.keys(classesForImports).forEach(modName => {
-                importsString += `import {${classesForImports[modName].join(',')}} from 'babylonjs/${modName}';
-`;
-            });
-        }
-
-        if (file.isNull()) {
-            cb(null, file);
-            return;
-        }
-
-        if (file.isStream()) {
-            //streams not supported, no need for now.
-            return;
-        }
-
-        try {
-            file.contents = Buffer.from(String(file.contents) + '\n' + importsString);
-            this.push(file);
-
-        } catch (err) {
-            this.emit('error', new gutil.PluginError('gulp-add-module-exports', err, { fileName: file.path }));
-        }
-        cb();
-    });
-};
-

+ 0 - 214
Tools/Gulp/gulp-es6ModuleExports.js

@@ -1,214 +0,0 @@
-var gutil = require('gulp-util');
-var through = require('through2');
-var path = require('path');
-
-module.exports = function (moduleName, dependencyTree, generateIndex, perFile, shaders, shaderIncludes) {
-    return through.obj(function (file, enc, cb) {
-
-        let basename = (path.basename(file.path, ".js"));
-
-        //console.log("Compiling es6 module: " + moduleName + "/" + basename.replace("babylon.", ""));
-
-        var extendsAddition =
-            `var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)o.hasOwnProperty(n)&&(t[n]=o[n])};return function(o,n){function r(){this.constructor=o}t(o,n),o.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();
-`;
-
-        var decorateAddition =
-            'var __decorate=this&&this.__decorate||function(e,t,r,c){var o,f=arguments.length,n=f<3?t:null===c?c=Object.getOwnPropertyDescriptor(t,r):c;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,r,c);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(f<3?o(n):f>3?o(t,r,n):o(t,r))||n);return f>3&&n&&Object.defineProperty(t,r,n),n};\n';
-
-        let content = file.contents.toString();
-        if (content.indexOf('__extends') === -1 && !dependencyTree.length) {
-            extendsAddition = '';
-        }
-
-        if (content.indexOf('__decorate') === -1) {
-            decorateAddition = '';
-        }
-
-        let dependenciesText = `${extendsAddition}
-${decorateAddition}
-`;
-        //if (moduleName !== 'core') {
-        dependenciesText += `var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
-            var BABYLON = globalObject["BABYLON"] || {};
-`;
-        /*} else {
-            dependenciesText += `var BABYLON;
-`;
-        }*/
-
-        let exportsText = '';
-        if (!generateIndex) {
-
-            // process parenting!
-            let parentRegex = /__extends\(([A-Z]\w*), _super\)/g;
-            var match = parentRegex.exec(content);
-            while (match != null) {
-                let extendingClass = match[1];
-                // find the first row
-                let extendedMatcher = new RegExp("}\\([BABYLON\\.]*([A-Z]\\w*)\\)\\);\\n\\s*BABYLON." + extendingClass + " = " + extendingClass + ";");
-
-                let extendedArray = extendedMatcher.exec(content);
-                if (extendedArray) {
-                    let firstRowReg = new RegExp("var " + extendingClass + " = .* \\(function");
-                    content = content.replace(firstRowReg, "var " + extendingClass + " = function");
-
-                    extended = extendedArray[1];
-                    content = content.replace(extendedMatcher, `};
-    var CLS${extendingClass};
-    BABYLON.__${extendingClass} = function() {
-        CLS${extendingClass} = CLS${extendingClass} || ${extendingClass}.call(null, BABYLON.__${extended} && BABYLON.__${extended}() || BABYLON.${extended});
-    }
-    Object.defineProperty(BABYLON, "${extendingClass}", {
-        get: function () {
-            BABYLON.__${extendingClass}();
-            return CLS${extendingClass};
-        },
-        enumerable: true,
-        configurable: true
-    });`);
-                    console.log(extendingClass, extended);
-                } else {
-                    console.log(extendingClass + " is not exported");
-                }
-
-                match = parentRegex.exec(content);
-            }
-
-            let loadedFiles = [];
-            dependencyTree[basename].forEach(function (d, idx) {
-                //if (d.module.indexOf("core") !== -1) return;
-                let name = d.file.split(".").pop();
-
-                if (loadedFiles.indexOf(name) === -1/* && !d.newDec*/) {
-                    let regexp = new RegExp("BABYLON." + d.name);
-                    let match = regexp.exec(content);
-                    if (!match) return;
-                    if (d.main)
-                        dependenciesText += `import {${d.name}} from 'babylonjs/${d.module[0]}/es6/${name}';
-`;
-                    else
-                        exportsText += `import {${d.name}} from 'babylonjs/${d.module[0]}/es6/${name}';
-`;
-                    loadedFiles.push(name);
-                }
-                //dependenciesText += `if(BABYLON !== BABYLON${idx}) __extends(BABYLON, BABYLON${idx});
-            });
-            let exported = [];
-            perFile[basename].declarations.forEach(dec => {
-                if (exported.indexOf(dec) !== -1) return;
-                exported.push(dec);
-                exportsText += `var ${dec} = BABYLON.${dec}; export {${dec}};
-`;
-            });
-            if (shaders) {
-                dependenciesText += `import * as Shaders from "babylonjs/${moduleName}/es6/shaders";
-if(BABYLON.Effect) Object.keys(Shaders).forEach(function(shaderName) {BABYLON.Effect.ShadersStore[shaderName] = Shaders[shaderName]})
-`;
-            }
-            if (shaderIncludes) {
-                dependenciesText += `import * as ShaderIncludes from "babylonjs/${moduleName}/es6/shaderIncludes";
-if(BABYLON.Effect) Object.keys(ShaderIncludes).forEach(function(shaderName) {BABYLON.Effect.IncludesShadersStore[shaderName] = ShaderIncludes[shaderName]})
-`;
-            }
-
-            //if (moduleName === "core") {
-            exportsText += `(function() {
-    //var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
-    globalObject["BABYLON"] = globalObject["BABYLON"] || BABYLON;
-})();
-`;
-            //}
-        } else {
-            content = '';
-            let basenames = Object.keys(perFile).filter(basefilename => {
-                return perFile[basefilename].module.indexOf(moduleName) !== -1;
-            });
-
-            basenames.forEach(bname => {
-                let name = bname.split(".").pop();
-                dependenciesText += `export * from "babylonjs/${moduleName}/es6/${name}";
-`;
-            })
-        }
-
-
-
-        /*exportsText += `(function() {
-    globalObject["BABYLON"] = globalObject["BABYLON"] || BABYLON;
-    })();
-`;*/
-
-        /*if (dependencies) {
-            dependencies.forEach(function (d, idx) {
-                if (d === 'core') return;
-                dependenciesText += `import * as ${d} from 'babylonjs/${d}/es6';
-`;
-                //if (idx > 0) {
-                dependenciesText += `__extends(BABYLON, ${d});
-`;
-                //}
-            });
-        }
- 
- 
- 
-        let exportRegex = /BABYLON.([0-9A-Za-z-_]*) = .*;\n/g
- 
-        var match = exportRegex.exec(content);
- 
-        let exportsArray = [];
-        while (match != null) {
-            if (match[1]) {
-                exportsArray.push(match[1])
-            }
-            match = exportRegex.exec(content);
-        }
- 
-        let exportsText = '';
-        if (moduleName === "core") {
-            exportsText = `(function() {
-    var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
-    globalObject["BABYLON"] = BABYLON;
-})();
-`
-        }
- 
-        let exportedItems = '';
-        exportsArray.forEach((e, idx) => {
-            if (e.indexOf('.') === -1) {
-                exportedItems += `${idx ? ',' : ''}${e}`
-                exportsText += `var ${e} = BABYLON.${e};
-`
-            }
-        });
- 
-        exportsText += `
-export { ${exportedItems} };`*/
-
-        /*if (moduleName === "core") {
-            exportsText = `(function() {
-var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
-globalObject["BABYLON"] = BABYLON;
-})();
-`*/
-
-        if (file.isNull()) {
-            cb(null, file);
-            return;
-        }
-
-        if (file.isStream()) {
-            //streams not supported, no need for now.
-            return;
-        }
-
-        try {
-            file.contents = Buffer.from(dependenciesText.concat(Buffer.from(String(content).concat(exportsText))));
-            this.push(file);
-        } catch (err) {
-            this.emit('error', new gutil.PluginError('gulp-es6-module-exports', err, { fileName: file.path }));
-        }
-        cb();
-    });
-}

+ 35 - 855
Tools/Gulp/gulpfile.js

@@ -1,46 +1,45 @@
+// Gulp Tools
 var gulp = require("gulp");
 var uglify = require("gulp-uglify");
 var typescript = require("gulp-typescript");
 var sourcemaps = require("gulp-sourcemaps");
 var srcToVariable = require("gulp-content-to-variable");
-var appendSrcToVariable = require("./gulp-appendSrcToVariable");
-var addDtsExport = require("./gulp-addDtsExport");
-var addDecorateAndExtends = require("./gulp-decorateAndExtends");
-var addModuleExports = require("./gulp-addModuleExports");
-var addES6Exports = require("./gulp-addES6Exports");
-var babylonModuleExports = require("./gulp-babylonModule");
-var babylonES6ModuleExports = require("./gulp-es6ModuleExports");
-var dtsModuleSupport = require("./gulp-dtsModuleSupport");
-let calculateDependencies = require("./gulp-calculateDependencies");
 var merge2 = require("merge2");
 var concat = require("gulp-concat");
 var rename = require("gulp-rename");
 var cleants = require("gulp-clean-ts-extends");
 var replace = require("gulp-replace");
-var uncommentShader = require("./gulp-removeShaderComments");
 var expect = require("gulp-expect-file");
 var optimisejs = require("gulp-optimize-js");
-var webserver = require("gulp-webserver");
 var path = require("path");
-const webpack = require('webpack');
+var webpack = require('webpack');
 var webpackStream = require("webpack-stream");
-var typedoc = require("gulp-typedoc");
-var validateTypedoc = require("./gulp-validateTypedoc");
 var fs = require("fs");
 var dtsBundle = require('dts-bundle');
-const through = require('through2');
-var karmaServer = require('karma').Server;
-var gulpTslint = require("gulp-tslint");
-var tslint = require("tslint");
-
-//viewer declaration
-var processDeclaration = require('./processViewerDeclaration');
+var through = require('through2');
+
+// Gulp Helpers
+var appendSrcToVariable = require("./helpers/gulp-appendSrcToVariable");
+var addDtsExport = require("./helpers/gulp-addDtsExport");
+var addDecorateAndExtends = require("./helpers/gulp-decorateAndExtends");
+var addModuleExports = require("./helpers/gulp-addModuleExports");
+var addES6Exports = require("./helpers/gulp-addES6Exports");
+var uncommentShader = require("./helpers/gulp-removeShaderComments");
+
+// Import Gulp Tasks
+require("./tasks/gulpTasks-tsLint");
+require("./tasks/gulpTasks-netlify");
+require("./tasks/gulpTasks-whatsNew");
+require("./tasks/gulpTasks-localRun");
+require("./tasks/gulpTasks-watch");
+require("./tasks/gulpTasks-typedoc");
+require("./tasks/gulpTasks-intellisense");
+require("./tasks/gulpTasks-tests");
+
+var processDeclaration = require('./helpers/processViewerDeclaration');
 
 var config = require("./config.json");
 
-var del = require("del");
-
-var debug = require("gulp-debug");
 var includeShadersStream;
 var shadersStream;
 var workersStream;
@@ -94,13 +93,6 @@ var externalTsConfig = {
     ]
 };
 
-var minimist = require("minimist");
-var commandLineOptions = minimist(process.argv.slice(2), {
-    boolean: ["public", "tsLintFix"]
-});
-
-var tsLintFix = commandLineOptions.tsLintFix
-
 function processDependency(kind, dependency, filesToLoad, firstLevelOnly) {
     if (!firstLevelOnly && dependency.dependUpon) {
         for (var i = 0; i < dependency.dependUpon.length; i++) {
@@ -269,78 +261,6 @@ gulp.task("build", gulp.series("shaders", function build() {
 }));
 
 /*
-* TsLint all typescript files from the src directory.
-*/
-gulp.task("typescript-tsLint", function() {
-    return gulp.src(config.typescript)
-        .pipe(gulpTslint({
-            formatter: "stylish",
-            configuration: "../../tslint.json",
-            fix: tsLintFix
-        }))
-        .pipe(gulpTslint.report());
-});
-
-/*
-* TsLint all typescript files from the src directory.
-*/
-var tsLintExternalLibrary = function(library, settings, watch) {
-    if (library.files && library.files.length) {
-        return gulp.src(library.files, { base: settings.build.srcOutputDirectory })
-            .pipe(gulpTslint({
-                formatter: "stylish",
-                configuration: "../../tslint.json",
-                fix: tsLintFix
-            }))
-            .pipe(gulpTslint.report());
-    }
-    else {
-        return gulp.src((settings.build.srcDirectory || settings.build.srcOutputDirectory) + "/**/*.ts")
-            .pipe(gulpTslint({
-                formatter: "stylish",
-                configuration: "../../tslint.json",
-                fix: tsLintFix
-            }))
-            .pipe(gulpTslint.report());
-    }
-}
-
-/**
- * Helper methods to tsLint external library (mat, post processes, ...).
- */
-var tsLintExternalLibraries = function(settings) {
-    var tasks = settings.libraries.map(function(library) {
-        return tsLintExternalLibrary(library, settings, false);
-    });
-
-    let mergedTasks = merge2(tasks);
-    return mergedTasks;
-}
-
-/**
- * Dynamic module creation tsLint.
- */
-config.modules.map(function(module) {
-    gulp.task(module + "-tsLint", function() {
-        return tsLintExternalLibraries(config[module]);
-    });
-});
-
-/**
- * Full Librairies tsLint.
- */
-gulp.task("typescript-libraries-tsLint",
-    gulp.series(config.modules.map((module) => {
-        return module + "-tsLint";
-    })
-    ));
-
-/**
- * Full TsLint.
- */
-gulp.task("tsLint", gulp.series("typescript-tsLint", "typescript-libraries-tsLint"));
-
-/*
 * Compiles all typescript files and creating a js and a declaration file.
 */
 gulp.task("typescript-compile", function() {
@@ -378,6 +298,11 @@ gulp.task("typescript-compile", function() {
 });
 
 /**
+ * Build the releasable files.
+ */
+gulp.task("typescript", gulp.series("typescript-compile", "buildWorker", "build"));
+
+/**
  * Helper methods to build external library (mat, post processes, ...).
  */
 var buildExternalLibraries = function(settings) {
@@ -704,13 +629,6 @@ var buildExternalLibrary = function(library, settings, watch) {
     }
 }
 
-gulp.task("mainBuild", gulp.series("buildWorker", "build"));
-
-/**
- * Build the releasable files.
- */
-gulp.task("typescript", gulp.series("typescript-compile", "mainBuild"));
-
 /**
  * Dynamic module creation In Serie for WebPack leaks.
  */
@@ -752,764 +670,26 @@ gulp.task("typescript-libraries", gulp.series(config.modules));
 gulp.task("build-custom", gulp.series("typescript-compile", "build"));
 
 /**
- * Watch ts files from typescript .
- */
-gulp.task("srcTscWatch", function() {
-    // Reuse The TSC CLI from gulp to enable -w.
-    process.argv[2] = "-w";
-    process.argv[3] = "-p";
-    process.argv[4] = "../../src/tsconfig.json";
-    require("./node_modules/typescript/lib/tsc.js");
-    return Promise.resolve();
-});
-
-/**
- * Watch ts files and fire repective tasks.
- */
-gulp.task("watch", gulp.series("srcTscWatch", function startWatch() {
-    var interval = 1000;
-
-    var tasks = [];
-
-    config.modules.map(function(module) {
-        if (config[module].build && config[module].build.webpack) {
-            var library = config[module].libraries[0];
-            if (library.noWatch) return;
-            var outputDirectory = config.build.tempDirectory + config[module].build.distOutputDirectory;
-            let wpconfig = require(config[module].build.webpack);
-            wpconfig.watch = true;
-            // dev mode and absolute path sourcemaps for debugging
-            wpconfig.mode = "development";
-            wpconfig.output.devtoolModuleFilenameTemplate = "[absolute-resource-path]";
-            //config.stats = "minimal";
-            tasks.push(webpackStream(wpconfig, webpack).pipe(gulp.dest(outputDirectory)))
-        }
-        else {
-            // Soon To Be Gone
-            config[module].libraries.map(function(library) {
-                if (library.webpack) {
-                    if (library.noWatch) return;
-                    var outputDirectory = config.build.tempDirectory + config[module].build.distOutputDirectory;
-                    let wpconfig = require(library.webpack);
-                    wpconfig.watch = true;
-                    // dev mode and absolute path sourcemaps for debugging
-                    wpconfig.mode = "development";
-                    wpconfig.output.devtoolModuleFilenameTemplate = "[absolute-resource-path]";
-                    //config.stats = "minimal";
-                    tasks.push(webpackStream(wpconfig, webpack).pipe(gulp.dest(outputDirectory)))
-                } else {
-                    tasks.push(gulp.watch(library.files, { interval: interval }, function() {
-                        console.log(library.output);
-                        return buildExternalLibrary(library, config[module], true)
-                            .pipe(debug());
-                    }));
-                    tasks.push(gulp.watch(library.shaderFiles, { interval: interval }, function() {
-                        console.log(library.output);
-                        return buildExternalLibrary(library, config[module], true)
-                            .pipe(debug())
-                    }));
-                    tasks.push(gulp.watch(library.sassFiles, { interval: interval }, function() {
-                        console.log(library.output);
-                        return buildExternalLibrary(library, config[module], true)
-                            .pipe(debug())
-                    }));
-                }
-            });
-        }
-    });
-
-    console.log(tasks.length);
-
-    return Promise.resolve();
-}));
-
-gulp.task("intellisense", function() {
-    return gulp.src(config.build.intellisenseSources)
-        .pipe(concat(config.build.intellisenseFile))
-        .pipe(replace(/^\s+_.*?;/gm, ""))
-        .pipe(replace(/^\s+_[\S\s]*?}/gm, ""))
-        .pipe(replace(/^\s*readonly _/gm, "protected readonly _"))
-        .pipe(replace(/^\s*static _/gm, "private static _"))
-        .pipe(replace(/^\s*abstract _/gm, ""))
-        .pipe(gulp.dest(config.build.playgroundDirectory));
-});
-
-/**
- * Embedded local dev env management.
- */
-gulp.task("deployLocalDev", function() {
-    return gulp.src("../../localDev/template/**.*")
-        .pipe(gulp.dest("../../localDev/src/"));
-});
-
-/**
- * Embedded webserver for test convenience.
- */
-gulp.task("webserver", function() {
-    var options = {
-        port: 1338,
-        livereload: false,
-
-    };
-
-    if (commandLineOptions.public) {
-        options.host = "0.0.0.0";
-    }
-
-    return gulp.src("../../.").pipe(webserver(options));
-});
-
-/**
- * Combine Webserver and Watch as long as vscode does not handle multi tasks.
- */
-gulp.task("run", gulp.series("watch", "webserver"));
-
-/**
- * Cleans map and js files from the src folder.
- */
-gulp.task("clean-JS-MAP", function() {
-    return del([
-        "../../src/**/*.js.map", "../../src/**/*.js"
-    ], { force: true });
-});
-
-gulp.task("netlify-cleanup", function() {
-    //set by netlify
-    if (process.env.REPOSITORY_URL) {
-        return del([
-            "../../inspector/node_modules/**/*", "../../gui/node_modules/**/*",
-            "../../Viewer/node_modules/**/*"
-        ], { force: true });
-    }
-    else {
-        return Promise.resolve();
-    }
-})
-
-// this is needed for the modules for the declaration files.
-gulp.task("modules-compile", function() {
-    var tsResult = gulp.src(config.typescript)
-        .pipe(sourcemaps.init())
-        .pipe(tsProject());
-
-    // If this gulp task is running on travis
-    if (process.env.TRAVIS) {
-        tsResult.once("error", function() {
-            tsResult.once("finish", function() {
-                console.log("Typescript compile failed");
-                process.exit(1);
-            });
-        });
-    }
-
-    return merge2([
-        tsResult.dts
-            .pipe(gulp.dest(config.build.srcOutputDirectory)),
-        tsResult.js
-            .pipe(sourcemaps.write("./",
-                {
-                    includeContent: false,
-                    sourceRoot: (filePath) => {
-                        return "";
-                    }
-                }))
-            .pipe(gulp.dest(config.build.srcOutputDirectory))
-    ]);
-});
-
-// this holds the declared objects in each module
-let declared = {}
-let perFile = {};
-let dependencyTree = {};
-
-gulp.task('prepare-for-modules', /*["modules-compile"],*/ function() {
-    let tasks = [];
-    Object.keys(config.workloads).forEach((moduleName) => {
-        let dtsFiles = config.workloads[moduleName].files.map(f => f.replace(".js", ".d.ts"))
-        let dtsTask = gulp.src(dtsFiles)
-            .pipe(dtsModuleSupport(moduleName, false, declared, perFile));
-
-        tasks.push(dtsTask);
-    });
-
-    // now calculate internal dependencies in the .ts files!
-    /*Object.keys(config.workloads).forEach((moduleName) => {
-        let tsFiles = config.workloads[moduleName].files.map(f => f.replace(".js", ".ts"))
-        let depTask = gulp.src(tsFiles)
-            .pipe(calculateDependencies(moduleName, perFile, dependencyTree));
-
-        tasks.push(depTask);
-    });*/
-
-    return merge2(tasks);
-});
-
-gulp.task('prepare-dependency-tree', gulp.series("prepare-for-modules", function() {
-    let tasks = [];
-
-    // now calculate internal dependencies in the .ts files!
-    Object.keys(config.workloads).forEach((moduleName) => {
-        let tsFiles = config.workloads[moduleName].files.map(f => f.replace(".js", ".ts"))
-        let depTask = gulp.src(tsFiles)
-            .pipe(calculateDependencies(moduleName, perFile, declared, dependencyTree));
-
-        tasks.push(depTask);
-    });
-
-    return merge2(tasks);
-}));
-
-// generate the modules directory, along with commonjs modules and es6 modules
-// Note - the generated modules are UNMINIFIED! The user will choose whether they want to minify or not.
-gulp.task("modules", gulp.series("prepare-dependency-tree", function() {
-    let tasks = [];
-
-    Object.keys(config.workloads)
-        .forEach((moduleName) => {
-            let shadersFiles = [];
-            processDependency("shaders", config.workloads[moduleName], shadersFiles, true);
-            for (var index = 0; index < shadersFiles.length; index++) {
-                shadersFiles[index] = "../../src/Shaders/" + shadersFiles[index] + ".fx";
-            }
-
-            let shaderIncludeFiles = [];
-            processDependency("shaderIncludes", config.workloads[moduleName], shaderIncludeFiles, true);
-            for (var index = 0; index < shaderIncludeFiles.length; index++) {
-                shaderIncludeFiles[index] = "../../src/Shaders/ShadersInclude/" + shaderIncludeFiles[index] + ".fx";
-            }
-
-            let commonJsTask = merge2([
-                gulp.src(config.workloads[moduleName].files)
-                    .pipe(replace(extendsSearchRegex, ""))
-                    .pipe(replace(decorateSearchRegex, ""))
-                    .pipe(replace(referenceSearchRegex, ""))
-                    .pipe(replace(/var BABYLON;\n/g, ""))
-                    .pipe(babylonModuleExports(moduleName, dependencyTree, false, perFile, shadersFiles.length, shaderIncludeFiles.length))
-                    .pipe(rename(function(path) {
-                        path.basename = path.basename.split(".").pop()
-                        path.extname = ".js"
-                    })),
-                gulp.src(shadersFiles)
-                    .pipe(expect.real({ errorOnFailure: true }, shadersFiles))
-                    .pipe(uncommentShader())
-                    .pipe(appendSrcToVariable("BABYLON.Effect.ShadersStore", shadersName, config.build.outputDirectory + '/commonjs/' + moduleName + ".fx", "commonjs"))
-                    .pipe(rename("shaders.js")),
-                gulp.src(shaderIncludeFiles)
-                    .pipe(expect.real({ errorOnFailure: true }, shaderIncludeFiles))
-                    .pipe(uncommentShader())
-                    .pipe(appendSrcToVariable("BABYLON.Effect.IncludesShadersStore", includeShadersName, config.build.outputDirectory + '/commonjs/' + moduleName + ".include.fx", "commonjs"))
-                    .pipe(rename("shaderIncludes.js")),
-                gulp.src(config.workloads[moduleName].files)
-                    .pipe(concat('index.js'))
-                    .pipe(babylonModuleExports(moduleName, dependencyTree, true, perFile))
-
-            ]).pipe(gulp.dest(config.build.outputDirectory + '/modules/' + moduleName + '/'))
-
-            let es6Tasks = merge2([
-                gulp.src(config.workloads[moduleName].files)
-                    .pipe(replace(extendsSearchRegex, ""))
-                    .pipe(replace(decorateSearchRegex, ""))
-                    .pipe(replace(referenceSearchRegex, ""))
-                    .pipe(replace(/var BABYLON;\n/g, ""))
-                    .pipe(babylonES6ModuleExports(moduleName, dependencyTree, false, perFile, shadersFiles.length, shaderIncludeFiles.length))
-                    .pipe(rename(function(path) {
-                        path.basename = path.basename.split(".").pop()
-                        path.extname = ".js"
-                    })),
-                gulp.src(shadersFiles)
-                    .pipe(expect.real({ errorOnFailure: true }, shadersFiles))
-                    .pipe(uncommentShader())
-                    .pipe(appendSrcToVariable("BABYLON.Effect.ShadersStore", shadersName, config.build.outputDirectory + '/es6/' + moduleName + ".fx", "es6"))
-                    .pipe(rename("shaders.js")),
-                gulp.src(shaderIncludeFiles)
-                    .pipe(expect.real({ errorOnFailure: true }, shaderIncludeFiles))
-                    .pipe(uncommentShader())
-                    .pipe(appendSrcToVariable("BABYLON.Effect.IncludesShadersStore", includeShadersName, config.build.outputDirectory + '/es6/' + moduleName + ".include.fx", "es6"))
-                    .pipe(rename("shaderIncludes.js")),
-                gulp.src(config.workloads[moduleName].files)
-                    .pipe(concat('index.js'))
-                    .pipe(babylonES6ModuleExports(moduleName, dependencyTree, true, perFile))
-
-            ]).pipe(gulp.dest(config.build.outputDirectory + '/modules/' + moduleName + '/es6/'))
-
-            //commonjs js generation task
-            /*let jsTask = merge2([
-                gulp.src(config.workloads[moduleName].files),
-                gulp.src(shadersFiles).
-                    //pipe(expect.real({ errorOnFailure: true }, shadersFiles)).
-                    pipe(uncommentShader()).
-                    pipe(appendSrcToVariable("BABYLON.Effect.ShadersStore", shadersName, config.build.outputDirectory + '/commonjs/' + moduleName + ".fx", true)),
-                gulp.src(shaderIncludeFiles).
-                    //pipe(expect.real({ errorOnFailure: true }, shaderIncludeFiles)).
-                    pipe(uncommentShader()).
-                    pipe(appendSrcToVariable("BABYLON.Effect.IncludesShadersStore", includeShadersName, config.build.outputDirectory + '/commonjs/' + moduleName + ".include.fx", true))
-            ]).pipe(concat('index.js'))
-                .pipe(replace(extendsSearchRegex, ""))
-                .pipe(replace(decorateSearchRegex, ""))
-                .pipe(replace(referenceSearchRegex, ""))
-                .pipe(babylonModuleExports(moduleName, config.workloads[moduleName].dependUpon))
-                .pipe(gulp.dest(config.build.outputDirectory + '/modules/' + moduleName + '/'));*/
-
-
-            // es6 modules generation task
-            /*let es6Task = merge2([
-                gulp.src(config.workloads[moduleName].files),
-                gulp.src(shadersFiles).
-                    //pipe(expect.real({ errorOnFailure: true }, shadersFiles)).
-                    pipe(uncommentShader()).
-                    pipe(appendSrcToVariable("BABYLON.Effect.ShadersStore", shadersName, config.build.outputDirectory + '/commonjs/' + moduleName + ".fx", true)),
-                gulp.src(shaderIncludeFiles).
-                    //pipe(expect.real({ errorOnFailure: true }, shaderIncludeFiles)).
-                    pipe(uncommentShader()).
-                    pipe(appendSrcToVariable("BABYLON.Effect.IncludesShadersStore", includeShadersName, config.build.outputDirectory + '/commonjs/' + moduleName + ".include.fx", true))
-            ]).pipe(concat('es6.js'))
-                .pipe(replace(extendsSearchRegex, ""))
-                .pipe(replace(decorateSearchRegex, ""))
-                .pipe(replace(referenceSearchRegex, ""))
-                .pipe(replace(/var BABYLON;/g, ""))
-                .pipe(babylonES6ModuleExports(moduleName, config.workloads[moduleName].dependUpon))
-                .pipe(gulp.dest(config.build.outputDirectory + '/modules/' + moduleName + '/'));
-
-            // dts genration task
-            let dtsFiles = config.workloads[moduleName].files.map(f => f.replace(".js", ".d.ts"))
-            let dtsTask = gulp.src(dtsFiles)
-                .pipe(concat("index.d.ts"))
-                .pipe(replace(/declare module BABYLON {/g, `declare module 'babylonjs/${moduleName}' {`))
-                .pipe(replace(/\ninterface /g, `\nexport interface `))
-                .pipe(dtsModuleSupport(moduleName, true, declared, perFile, dependencyTree))
-                .pipe(gulp.dest(config.build.outputDirectory + '/modules/' + moduleName + '/'));
-*/
-            tasks.push(commonJsTask, es6Tasks);
-        });
-
-    // run da tasks man!
-    return merge2(tasks);
-}));
-
-/**
- * Generate the TypeDoc JSON output in order to create code metadata.
- */
-gulp.task("typedoc-generate", function() {
-    return gulp
-        .src([
-            "../../dist/preview release/babylon.d.ts",
-            "../../dist/preview release/gui/babylon.gui.d.ts",
-            "../../dist/preview release/loaders/babylon.glTF2FileLoader.d.ts",
-            "../../dist/preview release/serializers/babylon.glTF2Serializer.d.ts",
-            "../../dist/preview release/glTF2Interface/babylon.glTF2Interface.d.ts"])
-        .pipe(typedoc({
-            // TypeScript options (see typescript docs)
-            mode: "modules",
-            module: "commonjs",
-            target: "es5",
-            includeDeclarations: true,
-
-            // Output options (see typedoc docs)
-            json: config.build.typedocJSON,
-
-            // TypeDoc options (see typedoc docs)
-            ignoreCompilerErrors: true,
-
-            readme: "none",
-
-            excludeExternals: true,
-            excludePrivate: true,
-            excludeProtected: true,
-
-            entryPoint: ["\"babylon.d\"", "BABYLON"]
-        }));
-});
-
-/**
- * Validate the TypeDoc JSON output against the current baselin to ensure our code is correctly documented.
- * (in the newly introduced areas)
- */
-gulp.task("typedoc-validate", function() {
-    return gulp.src(config.build.typedocJSON)
-        .pipe(validateTypedoc(config.build.typedocValidationBaseline, "BABYLON", true, false));
-});
-
-/**
- * Generate the validation reference to ensure our code is correctly documented.
- */
-gulp.task("typedoc-generateValidationBaseline", function() {
-    return gulp.src(config.build.typedocJSON)
-        .pipe(validateTypedoc(config.build.typedocValidationBaseline, "BABYLON", true, true));
-});
-
-/**
- * Validate the code comments and style case convention through typedoc and
- * generate the new baseline.
- */
-gulp.task("typedoc-all", gulp.series("typedoc-generate", "typedoc-validate", "typedoc-generateValidationBaseline"));
-
-
-/**
  * Validate compile the code and check the comments and style case convention through typedoc
  */
 gulp.task("typedoc-check", gulp.series("typescript-compile", "gui", "loaders", "serializers", "typedoc-generate", "typedoc-validate"));
 
 /**
- * Launches the KARMA validation tests in chrome in order to debug them.
- * (Can only be launch locally.)
- */
-gulp.task("tests-validation-karma", function(done) {
-    var kamaServerOptions = {
-        configFile: __dirname + "/../../tests/validation/karma.conf.js",
-        singleRun: false
-    };
-
-    var server = new karmaServer(kamaServerOptions, done);
-    server.start();
-});
-
-/**
- * Launches the KARMA validation tests in ff or virtual screen ff on travis for a quick analysis during the build.
- * (Can only be launch on any branches.)
- */
-gulp.task("tests-validation-virtualscreen", function(done) {
-    var kamaServerOptions = {
-        configFile: __dirname + "/../../tests/validation/karma.conf.js",
-        singleRun: true,
-        browsers: ['Firefox']
-    };
-
-    var server = new karmaServer(kamaServerOptions, done);
-    server.start();
-});
-
-/**
- * Launches the KARMA validation tests in browser stack for remote and cross devices validation tests.
- * (Can only be launch from secure branches.)
- */
-gulp.task("tests-validation-browserstack", function(done) {
-    if (!process.env.BROWSER_STACK_USERNAME) {
-        done();
-        return;
-    }
-
-    var kamaServerOptions = {
-        configFile: __dirname + "/../../tests/validation/karma.conf.browserstack.js",
-        singleRun: true
-    };
-
-    var server = new karmaServer(kamaServerOptions, done);
-    server.start();
-});
-
-/**
- * Transpiles typescript unit tests. 
- */
-gulp.task("tests-unit-transpile", function(done) {
-    var tsProject = typescript.createProject('../../tests/unit/tsconfig.json');
-
-    var tsResult = gulp.src("../../tests/unit/**/*.ts", { base: "../../" })
-        .pipe(tsProject());
-
-    tsResult.once("error", function() {
-        tsResult.once("finish", function() {
-            console.log("Typescript compile failed");
-            process.exit(1);
-        });
-    });
-
-    return tsResult.js.pipe(gulp.dest("../../"));
-});
-
-/**
- * Launches the KARMA unit tests in phantomJS.
- * (Can only be launch on any branches.)
- */
-gulp.task("tests-unit-debug", gulp.series("tests-unit-transpile", function(done) {
-    var kamaServerOptions = {
-        configFile: __dirname + "/../../tests/unit/karma.conf.js",
-        singleRun: false,
-        browsers: ['Chrome']
-    };
-
-    var server = new karmaServer(kamaServerOptions, done);
-    server.start();
-}));
-
-gulp.task("tests-babylon-unit", gulp.series("tests-unit-transpile", function(done) {
-    var kamaServerOptions = {
-        configFile: __dirname + "/../../tests/unit/karma.conf.js",
-        singleRun: true
-    };
-
-    var server = new karmaServer(kamaServerOptions, done);
-    server.start();
-}));
-
-var rmDir = function(dirPath) {
-    try { var files = fs.readdirSync(dirPath); }
-    catch (e) { return; }
-    if (files.length > 0)
-        for (var i = 0; i < files.length; i++) {
-            var filePath = dirPath + '/' + files[i];
-            if (fs.statSync(filePath).isFile())
-                fs.unlinkSync(filePath);
-            else
-                rmDir(filePath);
-        }
-    fs.rmdirSync(dirPath);
-};
-
-/**
- * Transpiles viewer typescript unit tests. 
- */
-gulp.task("tests-viewer-validation-transpile", function() {
-
-    let wpBuild = webpackStream(require('../../Viewer/webpack.gulp.config.js'), webpack);
-
-    // clean the built directory
-    rmDir("../../Viewer/tests/build/");
-
-    return wpBuild
-        .pipe(rename(function(path) {
-            if (path.extname === '.js') {
-                path.basename = "test";
-            }
-        }))
-        .pipe(gulp.dest("../../Viewer/tests/build/"));
-});
-
-/**
- * Launches the viewer's KARMA validation tests in chrome in order to debug them.
- * (Can only be launch locally.)
- */
-gulp.task("tests-viewer-validation-karma", gulp.series("tests-viewer-validation-transpile", function(done) {
-    var kamaServerOptions = {
-        configFile: __dirname + "/../../Viewer/tests/validation/karma.conf.js",
-        singleRun: false
-    };
-
-    var server = new karmaServer(kamaServerOptions, done);
-    server.start();
-}));
-
-/**
- * Launches the KARMA validation tests in ff or virtual screen ff on travis for a quick analysis during the build.
- * (Can only be launch on any branches.)
- */
-gulp.task("tests-viewer-validation-virtualscreen", gulp.series("tests-viewer-validation-transpile", function(done) {
-    var kamaServerOptions = {
-        configFile: __dirname + "/../../Viewer/tests/validation/karma.conf.js",
-        singleRun: true,
-        browsers: ['Firefox']
-    };
-
-    var server = new karmaServer(kamaServerOptions, done);
-    server.start();
-}));
-
-/**
- * Launches the KARMA validation tests in browser stack for remote and cross devices validation tests.
- * (Can only be launch from secure branches.)
- */
-gulp.task("tests-viewer-validation-browserstack", gulp.series("tests-viewer-validation-transpile", function(done) {
-    if (!process.env.BROWSER_STACK_USERNAME) {
-        done();
-        return;
-    }
-
-    var kamaServerOptions = {
-        configFile: __dirname + "/../../Viewer/tests/validation/karma.conf.browserstack.js",
-        singleRun: true
-    };
-
-    var server = new karmaServer(kamaServerOptions, done);
-    server.start();
-}));
-
-/**
- * Transpiles viewer typescript unit tests. 
- */
-gulp.task("tests-viewer-transpile", function() {
-
-    let wpBuild = webpackStream(require('../../Viewer/tests/unit/webpack.config.js'), webpack);
-
-    // clean the built directory
-    rmDir("../../Viewer/tests/build/");
-
-    return wpBuild
-        .pipe(rename(function(path) {
-            if (path.extname === '.js') {
-                path.basename = "test";
-            }
-        }))
-        .pipe(gulp.dest("../../Viewer/tests/build/"));
-});
-
-/**
- * Launches the KARMA unit tests in chrome.
- * (Can be launch on any branches.)
- */
-gulp.task("tests-viewer-unit-debug", gulp.series("tests-viewer-transpile", function(done) {
-    var kamaServerOptions = {
-        configFile: __dirname + "/../../Viewer/tests/karma.conf.js",
-        singleRun: false,
-        browsers: ['Chrome']
-    };
-
-    var server = new karmaServer(kamaServerOptions, done);
-    server.start();
-}));
-
-/**
- * Launches the KARMA unit tests in phantomJS.
- * (Can be launch on any branches.)
+ * Combine Webserver and Watch as long as vscode does not handle multi tasks.
  */
-gulp.task("tests-viewer-unit", gulp.series("tests-viewer-transpile", function(done) {
-    var kamaServerOptions = {
-        configFile: __dirname + "/../../Viewer/tests/karma.conf.js",
-        singleRun: true
-    };
-
-    var server = new karmaServer(kamaServerOptions, done);
-    server.start();
-}));
+gulp.task("run", gulp.series("watch", "webserver"));
 
 /**
- * Launches the KARMA unit tests in phantomJS.
- * (Can only be launch on any branches.)
+ * Do it all (Build).
  */
-gulp.task("tests-unit", gulp.series("tests-babylon-unit", "tests-viewer-unit"));
-
-gulp.task("tests-modules", function() {
-    let testsToRun = require('../../tests/modules/tests.json');
-
-    let sequencePromise = Promise.resolve();
-
-    testsToRun.tests.forEach(test => {
-        sequencePromise = sequencePromise.then(() => {
-            console.log("Running " + test.name);
-            let basePath = '../../tests/modules/' + test.name + '/';
-            rmDir("../../tests/modules/build/");
-            let compilePromise = Promise.resolve();
-
-            if (test.dependencies) {
-                compilePromise = new Promise(function(resolve, reject) {
-                    let counter = 0;
-                    let copyTask = gulp.src(test.dependencies.map(dep => config.build.outputDirectory + '/' + dep)).pipe(rename(function(path) {
-                        path.basename = (counter++) + '';
-                    })).pipe(gulp.dest("../../tests/modules/build/dependencies/"))
-                    copyTask.once("finish", resolve);
-                })
-            }
-            // any compilation needed?
-            if (test.typescript || test.bundler) {
-                //typescript only
-                if (test.typescript && !test.bundler) {
-                    compilePromise = compilePromise.then(() => {
-                        return new Promise(function(resolve, reject) {
-                            var tsProject = typescript.createProject(basePath + (test.tsconfig || 'tsconfig.json'));
-
-                            var tsResult = gulp.src(basePath + '/src/**/*.ts', { base: basePath })
-                                .pipe(tsProject());
-
-                            let error = false;
-                            tsResult.once("error", function() {
-                                error = true;
-                            });
-
-                            let jsPipe = tsResult.js.pipe(gulp.dest("../../tests/modules/"));
-
-                            jsPipe.once("finish", function() {
-                                if (error)
-                                    reject('error compiling test');
-                                else
-                                    resolve();
-                            });
-                        });
-                    });
-                } else {
-                    if (test.bundler === 'webpack') {
-                        console.log("webpack");
-                        compilePromise = compilePromise.then(() => {
-                            return new Promise(function(resolve, reject) {
-                                let wpBuild = webpackStream(require(basePath + '/webpack.config.js'), webpack);
-
-                                wpBuild = wpBuild
-                                    .pipe(rename(function(path) {
-                                        if (path.extname === '.js') {
-                                            path.basename = "tests-loader";
-                                        }
-                                    }))
-                                    .pipe(gulp.dest("../../tests/modules/build/"));
-
-                                wpBuild.once("finish", resolve);
-                            })
-                        });
-                    }
-                }
-            }
-
-            return compilePromise.then(() => {
-                return new Promise(function(resolve, reject) {
-                    var kamaServerOptions = {
-                        configFile: __dirname + "/../../tests/modules/karma.conf.js",
-                        singleRun: true
-                    };
-
-                    var server = new karmaServer(kamaServerOptions, resolve);
-                    server.start();
-                });
-            })
-        })
-    });
-
-    return sequencePromise;
-});
-
-gulp.task("tests-whatsnew", function(done) {
-    // Only checks on Travis
-    if (!process.env.TRAVIS) {
-        done();
-        return;
-    }
-
-    // Only checks on Pull Requests
-    if (process.env.TRAVIS_PULL_REQUEST == "false") {
-        done();
-        return;
-    }
-
-    // Do not check deploy
-    if (process.env.TRAVIS_BRANCH == "preview") {
-        done();
-        return;
-    }
-
-    // Compare what's new with the current one in the preview release folder.
-    const https = require("https");
-    const url = "https://rawgit.com/BabylonJS/Babylon.js/master/dist/preview%20release/what's%20new.md";
-    https.get(url, res => {
-        res.setEncoding("utf8");
-        let oldData = "";
-        res.on("data", data => {
-            oldData += data;
-        });
-        res.on("end", () => {
-            fs.readFile("../../dist/preview release/what's new.md", "utf-8", function(err, newData) {
-                if (err || oldData != newData) {
-                    done();
-                    return;
-                }
-
-                console.error("What's new file did not change.");
-                process.exit(1);
-            });
-        });
-    });
-});
+gulp.task("typescript-all", gulp.series("typescript", "typescript-libraries", "netlify-cleanup"));
 
 /**
- * Do it all.
+ * Do it all (tests).
  */
-gulp.task("typescript-all", gulp.series("typescript", "typescript-libraries", "netlify-cleanup"));
+gulp.task("tests-all", gulp.series("tests-unit", "tests-modules", "tests-validation-virtualscreen", "tests-validation-browserstack"));
 
 /**
  * The default task, concat and min the main BJS files.
  */
-gulp.task("default", gulp.series("tsLint", "typescript-all", "intellisense", "typedoc-all", "tests-unit", "tests-modules", "tests-validation-virtualscreen", "tests-validation-browserstack"));
+gulp.task("default", gulp.series("tsLint", "typescript-all", "intellisense", "typedoc-all", "tests-all"));

Tools/Gulp/gulp-addDtsExport.js → Tools/Gulp/helpers/gulp-addDtsExport.js


Tools/Gulp/gulp-addES6Exports.js → Tools/Gulp/helpers/gulp-addES6Exports.js


Tools/Gulp/gulp-addModuleExports.js → Tools/Gulp/helpers/gulp-addModuleExports.js


Tools/Gulp/gulp-appendSrcToVariable.js → Tools/Gulp/helpers/gulp-appendSrcToVariable.js


Tools/Gulp/gulp-calculateDependencies.js → Tools/Gulp/helpers/gulp-calculateDependencies.js


Tools/Gulp/gulp-decorateAndExtends.js → Tools/Gulp/helpers/gulp-decorateAndExtends.js


Tools/Gulp/gulp-removeShaderComments.js → Tools/Gulp/helpers/gulp-removeShaderComments.js


Tools/Gulp/gulp-validateTypedoc.js → Tools/Gulp/helpers/gulp-validateTypedoc.js


Tools/Gulp/processViewerDeclaration.js → Tools/Gulp/helpers/processViewerDeclaration.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
Tools/Gulp/package.json


+ 21 - 0
Tools/Gulp/tasks/gulpTasks-intellisense.js

@@ -0,0 +1,21 @@
+// Import Dependencies.
+var gulp = require("gulp");
+var concat = require("gulp-concat");
+var replace = require("gulp-replace");
+
+// Read the full config.
+var config = require("../config.json");
+
+/**
+ * Process the .d.ts files or Playground intellisense.
+ */
+gulp.task("intellisense", function() {
+    return gulp.src(config.build.intellisenseSources)
+        .pipe(concat(config.build.intellisenseFile))
+        .pipe(replace(/^\s+_.*?;/gm, ""))
+        .pipe(replace(/^\s+_[\S\s]*?}/gm, ""))
+        .pipe(replace(/^\s*readonly _/gm, "protected readonly _"))
+        .pipe(replace(/^\s*static _/gm, "private static _"))
+        .pipe(replace(/^\s*abstract _/gm, ""))
+        .pipe(gulp.dest(config.build.playgroundDirectory));
+});

+ 26 - 0
Tools/Gulp/tasks/gulpTasks-localRun.js

@@ -0,0 +1,26 @@
+// Import Dependencies.
+var gulp = require("gulp");
+var webserver = require("gulp-webserver");
+var minimist = require("minimist");
+
+// Comand line parsing.
+var commandLineOptions = minimist(process.argv.slice(2), {
+    boolean: ["public"]
+});
+
+/**
+ * Embedded webserver for test convenience.
+ */
+gulp.task("webserver", function() {
+    var options = {
+        port: 1338,
+        livereload: false,
+
+    };
+
+    if (commandLineOptions.public) {
+        options.host = "0.0.0.0";
+    }
+
+    return gulp.src("../../.").pipe(webserver(options));
+});

+ 18 - 0
Tools/Gulp/tasks/gulpTasks-netlify.js

@@ -0,0 +1,18 @@
+// Import Dependencies.
+var gulp = require("gulp");
+var del = require("del");
+
+// Cleanup Netlify folder before deploy.
+gulp.task("netlify-cleanup", function() {
+    //set by netlify
+    if (process.env.REPOSITORY_URL) {
+        return del([
+            "../../../inspector/node_modules/**/*",
+            "../../../gui/node_modules/**/*",
+            "../../../Viewer/node_modules/**/*"
+        ], { force: true });
+    }
+    else {
+        return Promise.resolve();
+    }
+})

+ 327 - 0
Tools/Gulp/tasks/gulpTasks-tests.js

@@ -0,0 +1,327 @@
+// Import Dependencies.
+var gulp = require("gulp");
+var typescript = require("gulp-typescript");
+var fs = require("fs");
+var karmaServer = require('karma').Server;
+var webpack = require('webpack');
+var webpackStream = require("webpack-stream");
+var rename = require("gulp-rename");
+
+// Read the full config.
+var config = require("../config.json");
+var relativeRootDir = "../../../";
+var rootDir = __dirname + "/" + relativeRootDir;
+
+// Helper functions
+var rmDir = function(dirPath) {
+    try { var files = fs.readdirSync(dirPath); }
+    catch (e) { return; }
+    if (files.length > 0)
+        for (var i = 0; i < files.length; i++) {
+            var filePath = dirPath + '/' + files[i];
+            if (fs.statSync(filePath).isFile())
+                fs.unlinkSync(filePath);
+            else
+                rmDir(filePath);
+        }
+    fs.rmdirSync(dirPath);
+};
+
+/**
+ * Launches the KARMA validation tests in chrome in order to debug them.
+ */
+gulp.task("tests-validation-karma", function(done) {
+    var kamaServerOptions = {
+        configFile: rootDir + "tests/validation/karma.conf.js",
+        singleRun: false
+    };
+
+    var server = new karmaServer(kamaServerOptions, done);
+    server.start();
+});
+
+/**
+ * Launches the KARMA validation tests in ff or virtual screen ff on travis for a quick analysis during the build.
+ */
+gulp.task("tests-validation-virtualscreen", function(done) {
+    var kamaServerOptions = {
+        configFile: rootDir + "tests/validation/karma.conf.js",
+        singleRun: true,
+        browsers: ['Firefox']
+    };
+
+    var server = new karmaServer(kamaServerOptions, done);
+    server.start();
+});
+
+/**
+ * Launches the KARMA validation tests in browser stack for remote and cross devices validation tests.
+ */
+gulp.task("tests-validation-browserstack", function(done) {
+    if (!process.env.BROWSER_STACK_USERNAME) {
+        done();
+        return;
+    }
+
+    var kamaServerOptions = {
+        configFile: rootDir + "tests/validation/karma.conf.browserstack.js",
+        singleRun: true
+    };
+
+    var server = new karmaServer(kamaServerOptions, done);
+    server.start();
+});
+
+/**
+ * Transpiles typescript unit tests. 
+ */
+gulp.task("tests-unit-transpile", function(done) {
+    var tsProject = typescript.createProject(rootDir + "tests/unit/tsconfig.json");
+
+    var tsResult = gulp.src(rootDir + "tests/unit/**/*.ts", { base: relativeRootDir })
+        .pipe(tsProject());
+
+    tsResult.once("error", function() {
+        tsResult.once("finish", function() {
+            console.log("Typescript compile failed");
+            process.exit(1);
+        });
+    });
+
+    return tsResult.js.pipe(gulp.dest(relativeRootDir));
+});
+
+/**
+ * Launches the KARMA unit tests in Chrome.
+ */
+gulp.task("tests-unit-debug", gulp.series("tests-unit-transpile", function(done) {
+    var kamaServerOptions = {
+        configFile: rootDir + "tests/unit/karma.conf.js",
+        singleRun: false,
+        browsers: ['Chrome']
+    };
+
+    var server = new karmaServer(kamaServerOptions, done);
+    server.start();
+}));
+
+/**
+ * Launches the KARMA unit tests in phantomJS.
+ */
+gulp.task("tests-babylon-unit", gulp.series("tests-unit-transpile", function(done) {
+    var kamaServerOptions = {
+        configFile: rootDir + "tests/unit/karma.conf.js",
+        singleRun: true
+    };
+
+    var server = new karmaServer(kamaServerOptions, done);
+    server.start();
+}));
+
+/**
+ * Transpiles viewer typescript unit tests. 
+ */
+gulp.task("tests-viewer-validation-transpile", function() {
+
+    let wpBuild = webpackStream(require(relativeRootDir + 'Viewer/webpack.gulp.config.js'), webpack);
+
+    // clean the built directory
+    rmDir(relativeRootDir + "Viewer/tests/build/");
+
+    return wpBuild
+        .pipe(rename(function(path) {
+            if (path.extname === '.js') {
+                path.basename = "test";
+            }
+        }))
+        .pipe(gulp.dest("../../Viewer/tests/build/"));
+});
+
+/**
+ * Launches the viewer's KARMA validation tests in chrome in order to debug them.
+ * (Can only be launch locally.)
+ */
+gulp.task("tests-viewer-validation-karma", gulp.series("tests-viewer-validation-transpile", function(done) {
+    var kamaServerOptions = {
+        configFile: rootDir + "Viewer/tests/validation/karma.conf.js",
+        singleRun: false
+    };
+
+    var server = new karmaServer(kamaServerOptions, done);
+    server.start();
+}));
+
+/**
+ * Launches the KARMA validation tests in ff or virtual screen ff on travis for a quick analysis during the build.
+ * (Can only be launch on any branches.)
+ */
+gulp.task("tests-viewer-validation-virtualscreen", gulp.series("tests-viewer-validation-transpile", function(done) {
+    var kamaServerOptions = {
+        configFile: rootDir + "Viewer/tests/validation/karma.conf.js",
+        singleRun: true,
+        browsers: ['Firefox']
+    };
+
+    var server = new karmaServer(kamaServerOptions, done);
+    server.start();
+}));
+
+/**
+ * Launches the KARMA validation tests in browser stack for remote and cross devices validation tests.
+ * (Can only be launch from secure branches.)
+ */
+gulp.task("tests-viewer-validation-browserstack", gulp.series("tests-viewer-validation-transpile", function(done) {
+    if (!process.env.BROWSER_STACK_USERNAME) {
+        done();
+        return;
+    }
+
+    var kamaServerOptions = {
+        configFile: rootDir + "Viewer/tests/validation/karma.conf.browserstack.js",
+        singleRun: true
+    };
+
+    var server = new karmaServer(kamaServerOptions, done);
+    server.start();
+}));
+
+/**
+ * Transpiles viewer typescript unit tests. 
+ */
+gulp.task("tests-viewer-transpile", function() {
+
+    let wpBuild = webpackStream(require(relativeRootDir + 'Viewer/tests/unit/webpack.config.js'), webpack);
+
+    // clean the built directory
+    rmDir(relativeRootDir + "Viewer/tests/build/");
+
+    return wpBuild
+        .pipe(rename(function(path) {
+            if (path.extname === '.js') {
+                path.basename = "test";
+            }
+        }))
+        .pipe(gulp.dest("../../Viewer/tests/build/"));
+});
+
+/**
+ * Launches the KARMA unit tests in chrome.
+ * (Can be launch on any branches.)
+ */
+gulp.task("tests-viewer-unit-debug", gulp.series("tests-viewer-transpile", function(done) {
+    var kamaServerOptions = {
+        configFile: rootDir + "Viewer/tests/karma.conf.js",
+        singleRun: false,
+        browsers: ['Chrome']
+    };
+
+    var server = new karmaServer(kamaServerOptions, done);
+    server.start();
+}));
+
+/**
+ * Launches the KARMA unit tests in phantomJS.
+ */
+gulp.task("tests-viewer-unit", gulp.series("tests-viewer-transpile", function(done) {
+    var kamaServerOptions = {
+        configFile: rootDir + "Viewer/tests/karma.conf.js",
+        singleRun: true
+    };
+
+    var server = new karmaServer(kamaServerOptions, done);
+    server.start();
+}));
+
+/**
+ * Launches the KARMA unit tests in phantomJS.
+ */
+gulp.task("tests-unit", gulp.series("tests-babylon-unit", "tests-viewer-unit"));
+
+/**
+ * Launches the KARMA module tests in phantomJS.
+ */
+gulp.task("tests-modules", function() {
+    let testsToRun = require(relativeRootDir + 'tests/modules/tests.json');
+
+    let sequencePromise = Promise.resolve();
+
+    testsToRun.tests.forEach(test => {
+        sequencePromise = sequencePromise.then(() => {
+            console.log("Running " + test.name);
+            let basePath = relativeRootDir + 'tests/modules/' + test.name + '/';
+            rmDir(relativeRootDir + "tests/modules/build/");
+            let compilePromise = Promise.resolve();
+
+            if (test.dependencies) {
+                compilePromise = new Promise(function(resolve, reject) {
+                    let counter = 0;
+                    let copyTask = gulp.src(test.dependencies.map(dep => config.build.outputDirectory + '/' + dep)).pipe(rename(function(path) {
+                        path.basename = (counter++) + '';
+                    })).pipe(gulp.dest("../../tests/modules/build/dependencies/"))
+                    copyTask.once("finish", resolve);
+                })
+            }
+            // any compilation needed?
+            if (test.typescript || test.bundler) {
+                //typescript only
+                if (test.typescript && !test.bundler) {
+                    compilePromise = compilePromise.then(() => {
+                        return new Promise(function(resolve, reject) {
+                            var tsProject = typescript.createProject(basePath + (test.tsconfig || 'tsconfig.json'));
+
+                            var tsResult = gulp.src(basePath + '/src/**/*.ts', { base: basePath })
+                                .pipe(tsProject());
+
+                            let error = false;
+                            tsResult.once("error", function() {
+                                error = true;
+                            });
+
+                            let jsPipe = tsResult.js.pipe(gulp.dest(relativeRootDir + "tests/modules/"));
+
+                            jsPipe.once("finish", function() {
+                                if (error)
+                                    reject('error compiling test');
+                                else
+                                    resolve();
+                            });
+                        });
+                    });
+                } else {
+                    if (test.bundler === 'webpack') {
+                        console.log("webpack");
+                        compilePromise = compilePromise.then(() => {
+                            return new Promise(function(resolve, reject) {
+                                let wpBuild = webpackStream(require(basePath + '/webpack.config.js'), webpack);
+
+                                wpBuild = wpBuild
+                                    .pipe(rename(function(path) {
+                                        if (path.extname === '.js') {
+                                            path.basename = "tests-loader";
+                                        }
+                                    }))
+                                    .pipe(gulp.dest("../../tests/modules/build/"));
+
+                                wpBuild.once("finish", resolve);
+                            })
+                        });
+                    }
+                }
+            }
+
+            return compilePromise.then(() => {
+                return new Promise(function(resolve, reject) {
+                    var kamaServerOptions = {
+                        configFile: rootDir + "tests/modules/karma.conf.js",
+                        singleRun: true
+                    };
+
+                    var server = new karmaServer(kamaServerOptions, resolve);
+                    server.start();
+                });
+            })
+        })
+    });
+
+    return sequencePromise;
+});

+ 76 - 0
Tools/Gulp/tasks/gulpTasks-tsLint.js

@@ -0,0 +1,76 @@
+// Import Dependencies.
+var gulp = require("gulp");
+var merge2 = require("merge2");
+var gulpTslint = require("gulp-tslint");
+var minimist = require("minimist");
+
+// Parse Command Line.
+var commandLineOptions = minimist(process.argv.slice(2), {
+    boolean: ["tsLintFix"]
+});
+
+// Define Constants
+var tsLintConfig = {
+    formatter: "stylish",
+    configuration: "../../tslint.json",
+    fix: commandLineOptions.tsLintFix
+}
+
+// Read the full config.
+var config = require("../config.json");
+
+/*
+ * TsLint all typescript files from the src directory.
+ */
+gulp.task("typescript-tsLint", function() {
+    return gulp.src(config.typescript)
+        .pipe(gulpTslint(tsLintConfig))
+        .pipe(gulpTslint.report());
+});
+
+/*
+ * TsLint all typescript files from the src directory.
+ */
+var tsLintExternalLibrary = function(library, settings, watch) {
+    if (library.files && library.files.length) {
+        return gulp.src(library.files, { base: settings.build.srcOutputDirectory })
+            .pipe(gulpTslint(tsLintConfig))
+            .pipe(gulpTslint.report());
+    }
+    else {
+        return gulp.src((settings.build.srcDirectory || settings.build.srcOutputDirectory) + "/**/*.ts")
+            .pipe(gulpTslint(tsLintConfig))
+            .pipe(gulpTslint.report());
+    }
+}
+
+/**
+ * Dynamic module linting for external library (mat, post processes, ...).
+ */
+config.modules.map(function(module) {
+    // Task will be like moduleName-tsLint
+    gulp.task(module + "-tsLint", function() {
+        var settings = config[module];
+
+        var tasks = settings.libraries.map(function(library) {
+            return tsLintExternalLibrary(library, settings, false);
+        });
+    
+        let mergedTasks = merge2(tasks);
+        return mergedTasks;
+    });
+});
+
+/**
+ * Full Librairies tsLint.
+ */
+gulp.task("typescript-libraries-tsLint",
+    gulp.series(config.modules.map((module) => {
+        return module + "-tsLint";
+    })
+));
+
+/**
+ * Full TsLint.
+ */
+gulp.task("tsLint", gulp.series("typescript-tsLint", "typescript-libraries-tsLint"));

+ 66 - 0
Tools/Gulp/tasks/gulpTasks-typedoc.js

@@ -0,0 +1,66 @@
+// Import Dependencies.
+var gulp = require("gulp");
+var typedoc = require("gulp-typedoc");
+
+// Import Tools.
+var validateTypedoc = require("../helpers/gulp-validateTypedoc");
+
+// Read the full config.
+var config = require("../config.json");
+
+/**
+ * Generate the TypeDoc JSON output in order to create code metadata.
+ */
+gulp.task("typedoc-generate", function() {
+    return gulp
+        .src([
+            "../../dist/preview release/babylon.d.ts",
+            "../../dist/preview release/gui/babylon.gui.d.ts",
+            "../../dist/preview release/loaders/babylon.glTF2FileLoader.d.ts",
+            "../../dist/preview release/serializers/babylon.glTF2Serializer.d.ts",
+            "../../dist/preview release/glTF2Interface/babylon.glTF2Interface.d.ts"])
+        .pipe(typedoc({
+            // TypeScript options (see typescript docs)
+            mode: "modules",
+            module: "commonjs",
+            target: "es5",
+            includeDeclarations: true,
+
+            // Output options (see typedoc docs)
+            json: config.build.typedocJSON,
+
+            // TypeDoc options (see typedoc docs)
+            ignoreCompilerErrors: true,
+
+            readme: "none",
+
+            excludeExternals: true,
+            excludePrivate: true,
+            excludeProtected: true,
+
+            entryPoint: ["\"babylon.d\"", "BABYLON"]
+        }));
+});
+
+/**
+ * Validate the TypeDoc JSON output against the current baselin to ensure our code is correctly documented.
+ * (in the newly introduced areas)
+ */
+gulp.task("typedoc-validate", function() {
+    return gulp.src(config.build.typedocJSON)
+        .pipe(validateTypedoc(config.build.typedocValidationBaseline, "BABYLON", true, false));
+});
+
+/**
+ * Generate the validation reference to ensure our code is correctly documented.
+ */
+gulp.task("typedoc-generateValidationBaseline", function() {
+    return gulp.src(config.build.typedocJSON)
+        .pipe(validateTypedoc(config.build.typedocValidationBaseline, "BABYLON", true, true));
+});
+
+/**
+ * Validate the code comments and style case convention through typedoc and
+ * generate the new baseline.
+ */
+gulp.task("typedoc-all", gulp.series("typedoc-generate", "typedoc-validate", "typedoc-generateValidationBaseline"));

+ 81 - 0
Tools/Gulp/tasks/gulpTasks-watch.js

@@ -0,0 +1,81 @@
+// Import Dependencies.
+var gulp = require("gulp");
+var webpack = require('webpack');
+var webpackStream = require("webpack-stream");
+var debug = require("gulp-debug");
+
+// Read the full config.
+var config = require("../config.json");
+
+/**
+ * Watch ts files from typescript .
+ * Hack into the cli :-)
+ */
+gulp.task("srcTscWatch", function() {
+    // Reuse The TSC CLI from gulp to enable -w.
+    process.argv[2] = "-w";
+    process.argv[3] = "-p";
+    process.argv[4] = "../../src/tsconfig.json";
+    require("../node_modules/typescript/lib/tsc.js");
+    return Promise.resolve();
+});
+
+/**
+ * Watch ts files and fire repective tasks.
+ */
+gulp.task("watch", gulp.series("srcTscWatch", function startWatch() {
+    var interval = 1000;
+
+    var tasks = [];
+
+    config.modules.map(function(module) {
+        if (config[module].build && config[module].build.webpack) {
+            var library = config[module].libraries[0];
+            if (library.noWatch) return;
+            var outputDirectory = config.build.tempDirectory + config[module].build.distOutputDirectory;
+            let wpconfig = require(config[module].build.webpack);
+            wpconfig.watch = true;
+            // dev mode and absolute path sourcemaps for debugging
+            wpconfig.mode = "development";
+            wpconfig.output.devtoolModuleFilenameTemplate = "[absolute-resource-path]";
+            //config.stats = "minimal";
+            tasks.push(webpackStream(wpconfig, webpack).pipe(gulp.dest(outputDirectory)))
+        }
+        else {
+            // Soon To Be Gone
+            config[module].libraries.map(function(library) {
+                if (library.webpack) {
+                    if (library.noWatch) return;
+                    var outputDirectory = config.build.tempDirectory + config[module].build.distOutputDirectory;
+                    let wpconfig = require(library.webpack);
+                    wpconfig.watch = true;
+                    // dev mode and absolute path sourcemaps for debugging
+                    wpconfig.mode = "development";
+                    wpconfig.output.devtoolModuleFilenameTemplate = "[absolute-resource-path]";
+                    //config.stats = "minimal";
+                    tasks.push(webpackStream(wpconfig, webpack).pipe(gulp.dest(outputDirectory)))
+                } else {
+                    tasks.push(gulp.watch(library.files, { interval: interval }, function() {
+                        console.log(library.output);
+                        return buildExternalLibrary(library, config[module], true)
+                            .pipe(debug());
+                    }));
+                    tasks.push(gulp.watch(library.shaderFiles, { interval: interval }, function() {
+                        console.log(library.output);
+                        return buildExternalLibrary(library, config[module], true)
+                            .pipe(debug())
+                    }));
+                    tasks.push(gulp.watch(library.sassFiles, { interval: interval }, function() {
+                        console.log(library.output);
+                        return buildExternalLibrary(library, config[module], true)
+                            .pipe(debug())
+                    }));
+                }
+            });
+        }
+    });
+
+    console.log(tasks.length);
+
+    return Promise.resolve();
+}));

+ 50 - 0
Tools/Gulp/tasks/gulpTasks-whatsNew.js

@@ -0,0 +1,50 @@
+// Import Dependencies.
+var gulp = require("gulp");
+var fs = require("fs");
+
+/**
+ * Tests the whats new file to ensure changes have been made in the PR.
+ */
+gulp.task("tests-whatsnew", function(done) {
+    // // Only checks on Travis
+    // if (!process.env.TRAVIS) {
+    //     done();
+    //     return;
+    // }
+
+    // // Only checks on Pull Requests
+    // if (process.env.TRAVIS_PULL_REQUEST == "false") {
+    //     done();
+    //     return;
+    // }
+
+    // // Do not check deploy
+    // if (process.env.TRAVIS_BRANCH == "preview") {
+    //     done();
+    //     return;
+    // }
+
+    // Compare what's new with the current one in the preview release folder.
+    const https = require("https");
+    const url = "https://rawgit.com/BabylonJS/Babylon.js/master/dist/preview%20release/what's%20new.md";
+    https.get(url, res => {
+        res.setEncoding("utf8");
+        let oldData = "";
+        res.on("data", data => {
+            oldData += data;
+        });
+        res.on("end", () => {
+            fs.readFile("../../dist/preview release/what's new.md", "utf-8", function(err, newData) {
+                
+            console.log(newData)
+                if (err || oldData != newData) {
+                    done();
+                    return;
+                }
+
+                console.error("What's new file did not change.");
+                process.exit(1);
+            });
+        });
+    });
+});

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 8190 - 8190
dist/preview release/babylon.d.ts