Browse Source

updated build common to point to the lib version of tslint and tsc instead of the bin version. Hoping that this is what is causing the windows build to fail. Also updated to recurse through the AtomicEditor directory and lint each of the .ts files. Removed the linting of the atomic.d.ts files since d.ts files do not seem to be normally linted.

Shaddock Heath 10 years ago
parent
commit
c79f577dd4
1 changed files with 21 additions and 10 deletions
  1. 21 10
      Build/Scripts/BuildCommon.js

+ 21 - 10
Build/Scripts/BuildCommon.js

@@ -3,6 +3,7 @@ var os = require('os');
 var path = require("path");
 var path = require("path");
 var host = require("./Host");
 var host = require("./Host");
 var atomicRoot = host.atomicRoot;
 var atomicRoot = host.atomicRoot;
+var glob = require('glob');
 
 
 namespace('build', function() {
 namespace('build', function() {
 
 
@@ -15,6 +16,8 @@ namespace('build', function() {
         var modules = host.getScriptModules(platform);
         var modules = host.getScriptModules(platform);
         var bindCmd = host.atomicTool + " bind \"" + atomicRoot + "\" ";
         var bindCmd = host.atomicTool + " bind \"" + atomicRoot + "\" ";
         var node;
         var node;
+        var tsc = "./Build/node_modules/typeScript/lib/tsc";
+        var tslint = "./Build/node_modules/tslint/lib/tslint-cli";
 
 
         switch(os.platform()) {
         switch(os.platform()) {
             case "win32":
             case "win32":
@@ -35,21 +38,29 @@ namespace('build', function() {
 
 
         if (node) {
         if (node) {
           // compile
           // compile
-          cmds.push(node + " ./Build/node_modules/typeScript/bin/tsc -p ./Script");
+          cmds.push(node + " " + tsc + " -p ./Script");
+
           // lint
           // lint
-          cmds.push(node + " ./Build/node_modules/tslint/bin/tslint -c ./Script/tslint.json ./Script/TypeScript/*.ts");
-          cmds.push(node + " ./Build/node_modules/tslint/bin/tslint -c ./Script/tslint.json ./Script/AtomicEditor/**/*.ts");
+          // Since TSLint does not yet support recursively searching for files, then we need to
+          // create a command per file.  The main issue with this is that it will abort on the first error instead
+          // of listing out all lint errors
+          glob("./Script/AtomicEditor/**/*.ts", (err, results) => {
+            results.forEach((file)=>{
+              cmds.push(node + " " + tslint + " -c ./Script/tslint.json " + file);
+            });
+
+            jake.exec(cmds, function() {
+
+              complete();
+
+            }, {
+              printStdout: true
+            });
+          });
         } else {
         } else {
             throw new Error("Node not configured for this platform: " + os.platform());
             throw new Error("Node not configured for this platform: " + os.platform());
         }
         }
 
 
-         jake.exec(cmds, function() {
-
-          complete();
-
-        }, {
-          printStdout: true
-        });
 
 
   });
   });