Updated yeoman  generator to support external ng-xos-lib
Updateding Custom Views:
- ceilometerDashboard
- contentProvider
- dashboardManager
- developer
- diagnostic
- hpc
- mCordTopology
- openVPN
- serviceGrid
- subscribers
- syncNotifier
- tenant
- truckroll

Change-Id: I8bdebf70d3b72ceca8ec04565213efa60bc0b8d3
diff --git a/views/ngXosLib/generator-xos/app/templates/bower.json b/views/ngXosLib/generator-xos/app/templates/bower.json
index 0abca60..e94e145 100644
--- a/views/ngXosLib/generator-xos/app/templates/bower.json
+++ b/views/ngXosLib/generator-xos/app/templates/bower.json
@@ -5,7 +5,7 @@
     "<%= author.name %> <<%= author.email %>>"
   ],
   "description": "The <%= name %> view",
-  "license": "MIT",
+  "license": "Apache-2.0",
   "ignore": [
     "**/.*",
     "node_modules",
@@ -28,6 +28,7 @@
     "bootstrap-css": "3.3.6",
     "angular-chart.js": "~0.10.2",
     "d3": "~3.5.17",
-    "angular-recursion": "~1.0.5"
+    "angular-recursion": "~1.0.5",
+    "ng-xos-lib": "opencord/ng-xos-lib#~1.0.0"
   }
 }
diff --git a/views/ngXosLib/generator-xos/app/templates/gulp/build.js b/views/ngXosLib/generator-xos/app/templates/gulp/build.js
index 00dc995..88d88d3 100644
--- a/views/ngXosLib/generator-xos/app/templates/gulp/build.js
+++ b/views/ngXosLib/generator-xos/app/templates/gulp/build.js
@@ -112,7 +112,7 @@
       .pipe(
         inject(
           gulp.src([
-            options.static + 'js/vendor/xos<%= fileName %>Vendor.js',
+            options.static + 'vendor/xos<%= fileName %>Vendor.js',
             options.static + 'js/xos<%= fileName %>.js',
             options.static + 'css/xos<%= fileName %>.css'
           ]),
@@ -138,7 +138,7 @@
     return gulp.src(bowerDeps)
       .pipe(concat('xos<%= fileName %>Vendor.js'))
       .pipe(uglify())
-      .pipe(gulp.dest(options.static + 'js/vendor/'));
+      .pipe(gulp.dest(options.static + 'vendor/'));
   });
 
   gulp.task('lint', function () {
diff --git a/views/ngXosLib/generator-xos/app/templates/gulp/server.js b/views/ngXosLib/generator-xos/app/templates/gulp/server.js
index 1e40a34..36fdded 100644
--- a/views/ngXosLib/generator-xos/app/templates/gulp/server.js
+++ b/views/ngXosLib/generator-xos/app/templates/gulp/server.js
@@ -52,7 +52,6 @@
       server: {
         baseDir: options.src,
         routes: {
-          '/xos/core/xoslib/static/js/vendor': options.helpers,
           '/xos/core/static': options.static + '../../static/'
         },
         middleware: function(req, res, next){
@@ -115,7 +114,7 @@
         inject(
           gulp.src([
             options.tmp + '**/*.js',
-            options.helpers + 'ngXosHelpers.js'
+            options.helpers + 'ngXosHelpers.min.js'
           ])
           .pipe(angularFilesort()),
           {
diff --git a/views/ngXosLib/generator-xos/app/templates/gulpfile.js b/views/ngXosLib/generator-xos/app/templates/gulpfile.js
index eca4e45..c825df8 100644
--- a/views/ngXosLib/generator-xos/app/templates/gulpfile.js
+++ b/views/ngXosLib/generator-xos/app/templates/gulpfile.js
@@ -12,7 +12,7 @@
   tmp: 'src/.tmp',
   dist: 'dist/',
   api: '../../ngXosLib/api/',
-  helpers: '../../../xos/core/xoslib/static/js/vendor/',
+  helpers: './src/vendor/ng-xos-lib/dist/',
   static: '../../../xos/core/xoslib/static/', // this is the django static folder
   dashboards: '../../../xos/core/xoslib/dashboards/' // this is the django html folder
 };
diff --git a/views/ngXosLib/generator-xos/app/templates/karma.conf.js b/views/ngXosLib/generator-xos/app/templates/karma.conf.js
index 4123be9..e5abf39 100644
--- a/views/ngXosLib/generator-xos/app/templates/karma.conf.js
+++ b/views/ngXosLib/generator-xos/app/templates/karma.conf.js
@@ -26,8 +26,9 @@
 
     // list of files / patterns to load in the browser
     files: bowerComponents.concat([
-      '../../../xos/core/xoslib/static/js/vendor/ngXosVendor.js',
-      '../../../xos/core/xoslib/static/js/vendor/ngXosHelpers.js',
+      './src/vendor/ng-xos-lib/dist/ngXosVendor.min.js',
+      './src/vendor/ng-xos-lib/dist/ngXosHelpers.min.js',
+      'src/js/main.js',
       'src/js/**/*.js',
       'spec/**/*.mock.js',
       'spec/**/*.test.js',
@@ -45,6 +46,7 @@
     preprocessors: {
       'src/js/**/*.js': ['babel'],
       'spec/**/*.test.js': ['babel'],
+      'spec/**/*.mock.js': ['babel'],
       'src/**/*.html': ['ng-html2js']
     },
 
diff --git a/views/ngXosLib/generator-xos/app/templates/package.json b/views/ngXosLib/generator-xos/app/templates/package.json
index b0f77f9..0705f5d 100644
--- a/views/ngXosLib/generator-xos/app/templates/package.json
+++ b/views/ngXosLib/generator-xos/app/templates/package.json
@@ -17,7 +17,7 @@
     "XOSlib"
   ],
   "author": "<%= author.name %>",
-  "license": "MIT",
+  "license": "Apache-2.0",
   "dependencies": {},
   "devDependencies": {
     "autoprefixer": "^6.3.3",
diff --git a/views/ngXosLib/generator-xos/test/build.spec.js b/views/ngXosLib/generator-xos/test/build.spec.js
index c6cab4c3..e2f6b49 100644
--- a/views/ngXosLib/generator-xos/test/build.spec.js
+++ b/views/ngXosLib/generator-xos/test/build.spec.js
@@ -28,7 +28,7 @@
 const basePath = '../../../../xos/core/xoslib';
 const destHtml = path.join(__dirname, basePath + '/dashboards/xosTestDashboard.html');
 const destJs = path.join(__dirname, basePath + '/static/js/xosTestDashboard.js');
-const destVendor = path.join(__dirname, basePath + '/static/js/vendor/xosTestDashboardVendor.js');
+const destVendor = path.join(__dirname, basePath + '/static/vendor/xosTestDashboardVendor.js');
 const destCss = path.join(__dirname, basePath + '/static/css/xosTestDashboard.css');
 
 describe('The XOS Build script', function(){
@@ -140,7 +140,7 @@
 
     it('should include only minified files and minified deps in the index', () => {
       assert.fileContent(destHtml, `<script src="/static/js/xos${fileName}.js"></script>`);
-      assert.fileContent(destHtml, `<script src="/static/js/vendor/xos${fileName}Vendor.js"></script>`);
+      assert.fileContent(destHtml, `<script src="/static/vendor/xos${fileName}Vendor.js"></script>`);
       assert.noFileContent(destHtml, `<!-- bower:css -->`);
       assert.noFileContent(destHtml, `<!-- bower:js -->`);
     });
diff --git a/views/ngXosLib/generator-xos/test/generator.spec.js b/views/ngXosLib/generator-xos/test/generator.spec.js
index 81ac985..50ec25e 100644
--- a/views/ngXosLib/generator-xos/test/generator.spec.js
+++ b/views/ngXosLib/generator-xos/test/generator.spec.js
@@ -9,17 +9,18 @@
 
 const firstCharTouppercase = string => string.replace(/^./, string[0].toUpperCase())
 
-// get bower deps installed in ngXosLib
-let bowerDeps = wiredep({
-  cwd: path.join(__dirname, '../../'), // pretending to be in the ngXosLib root
-  exclude: ['Chart.js']
-});
-bowerDeps = bowerDeps.js.map(d => {
-  let path = d.match(/bower_components\/([1-9a-zA-Z\-`.]+)\//);
-  if(path){
-    return path[1];
-  }
-});
+const bowerDeps = [
+  'angular',
+  'angular-ui-router',
+  'angular-resource',
+  'angular-cookies',
+  'angular-animate',
+  'lodash',
+  'angular-chart.js',
+  'd3',
+  'angular-recursion',
+  'ng-xos-lib'
+];
 
 // test values
 const viewName = 'testDashboard';
@@ -100,7 +101,7 @@
     assert.fileContent(`${testPath}gulp/build.js`, `.pipe(concat('xos${fileName}.css'))`)
     assert.fileContent(`${testPath}gulp/build.js`, `.pipe(concat('xos${fileName}.js'))`)
     assert.fileContent(`${testPath}gulp/build.js`, `module: 'xos.${viewName}'`)
-    assert.fileContent(`${testPath}gulp/build.js`, `options.static + 'js/vendor/xos${fileName}Vendor.js'`)
+    assert.fileContent(`${testPath}gulp/build.js`, `options.static + 'vendor/xos${fileName}Vendor.js'`)
     assert.fileContent(`${testPath}gulp/build.js`, `options.static + 'js/xos${fileName}.js'`)
     assert.fileContent(`${testPath}gulp/build.js`, `options.static + 'css/xos${fileName}.css'`)
     assert.fileContent(`${testPath}gulp/build.js`, `.pipe(concat('xos${fileName}Vendor.js'))`)