var fs = require('fs');
Blend.defineClass('Builder.commands.build.webapp.Builder', {
    extend: 'Builder.commands.build.Base',
    runInternal: function () {
        var me = this, files = [], jsfiles, numFiles,
                numJsFiles;
        me.initFileCache();
        me.initDepAnalyzer();

        files = me.cache.update();
        numFiles = Object.keys(files).length;

        if (numFiles !== 0) {
            /**
             * Some files have been updated
             */
            jsfiles = me.cache.getJSFiles();
            numJsFiles = Object.keys(jsfiles).length;

            if (numJsFiles !== 0) {
                if (me.depAnalyzer.analyze(files)) {
                    me.depMap = me.depAnalyzer.getDependencyMap();
                } else {
                    console.error('Unable to build this application due previous errors!');
                }
            }
        }
        return true;
    }
});


@@ -187,16 +187,43 @@
 s = %5B%5D, 
+dmap = %5B%5D,%0A                
 jsfiles,
@@ -232,32 +232,16 @@
 umFiles,
-%0A               
  numJsFi
@@ -245,16 +245,17 @@
 sFiles;%0A
+%0A
         
@@ -645,20 +645,23 @@
         
-if (
+dmap = 
 me.depAn
@@ -671,162 +671,668 @@
 zer.
-analyze(files)) %7B%0A                    me.depMap = me.depAnalyzer.getDependencyMap();%0A                %7D else %7B%0A                    console.error('Unable to
+getDependencyMap(files);%0A                if (!Blend.isObject(dmap)) %7B%0A                    console.error('Unable to build this application due previous errors!');%0A                %7D%0A            %7D%0A            /**%0A             * If the dmap is null when something has gone wrong in parsing/analyzing%0A             * the JS files. If so there is no reason to build the application.%0A             */%0A            if (!Blend.isNullOrUndef(dmap)) %7B%0A%0A                Blend.foreach(dmap, function (classDef) %7B%0A                    console.log(classDef.classFile);%0A                %7D);%0A            %7D else %7B%0A                /**%0A                 * We need to log that we did not
  bui
@@ -1328,34 +1328,33 @@
 did not build th
-is
+e
  application due
@@ -1353,33 +1353,10 @@
 tion
- due previous errors!');
 %0A
+ 
     
@@ -1359,33 +1359,34 @@
                 
-%7D
+*/
 %0A            %7D%0A 

Save point