Changed ngXosLib CI tests to include builded views
diff --git a/views/ngXosViews/ceilometerDashboard/gulp/build.js b/views/ngXosViews/ceilometerDashboard/gulp/build.js
index f49cc1e..d9736c4 100644
--- a/views/ngXosViews/ceilometerDashboard/gulp/build.js
+++ b/views/ngXosViews/ceilometerDashboard/gulp/build.js
@@ -13,7 +13,7 @@
var uglify = require('gulp-uglify');
var templateCache = require('gulp-angular-templatecache');
var runSequence = require('run-sequence');
-var concat = require('gulp-concat');
+var concat = require('gulp-concat-util');
var del = require('del');
var wiredep = require('wiredep');
var angularFilesort = require('gulp-angular-filesort');
@@ -27,16 +27,22 @@
var mqpacker = require('css-mqpacker');
var csswring = require('csswring');
-var TEMPLATE_FOOTER = `}]);
-angular.module('xos.ceilometerDashboard').run(function($location){$location.path('/')});
-angular.element(document).ready(function() {angular.bootstrap(angular.element('#xosCeilometerDashboard'), ['xos.ceilometerDashboard']);});`;
+const TEMPLATE_FOOTER = `
+angular.module('xos.ceilometerDashboard')
+.run(['$location', function(a){
+ a.path('/');
+}])
+`
module.exports = function(options){
// delete previous builded file
gulp.task('clean', function(){
return del(
- [options.dashboards + 'xosCeilometerDashboard.html'],
+ [
+ options.dashboards + 'xosCeilometerDashboard.html',
+ options.static + 'css/xosCeilometerDashboard.css'
+ ],
{force: true}
);
});
@@ -48,7 +54,7 @@
mqpacker,
csswring
];
-
+
gulp.src([
`${options.css}**/*.css`,
`!${options.css}dev.css`
@@ -57,7 +63,8 @@
.pipe(gulp.dest(options.tmp + '/css/'));
});
- gulp.task('copyCss', ['css'], function(){
+ // copy css in correct folder
+ gulp.task('copyCss', ['wait'], function(){
return gulp.src([`${options.tmp}/css/*.css`])
.pipe(concat('xosCeilometerDashboard.css'))
.pipe(gulp.dest(options.static + 'css/'))
@@ -71,7 +78,9 @@
.pipe(ngAnnotate())
.pipe(angularFilesort())
.pipe(concat('xosCeilometerDashboard.js'))
- //.pipe(uglify())
+ .pipe(concat.header('//Autogenerated, do not edit!!!\n'))
+ .pipe(concat.footer(TEMPLATE_FOOTER))
+ .pipe(uglify())
.pipe(gulp.dest(options.static + 'js/'));
});
@@ -80,21 +89,17 @@
return gulp.src('./src/templates/*.html')
.pipe(templateCache({
module: 'xos.ceilometerDashboard',
- root: 'templates/',
- templateFooter: TEMPLATE_FOOTER
+ root: 'templates/'
}))
.pipe(gulp.dest(options.tmp));
});
// copy html index to Django Folder
- gulp.task('copyHtml', ['clean'], function(){
+ gulp.task('copyHtml', function(){
return gulp.src(options.src + 'index.html')
// remove dev dependencies from html
- .pipe(replace(/<!-- bower:css -->(\n.*)*\n<!-- endbower --><!-- endcss -->/, ''))
- .pipe(replace(/<!-- bower:js -->(\n.*)*\n<!-- endbower --><!-- endjs -->/, ''))
- .pipe(replace(/ng-app=".*"\s/, ''))
- //rewriting css path
- // .pipe(replace(/(<link.*">)/, ''))
+ .pipe(replace(/<!-- bower:css -->(\n^<link.*)*\n<!-- endbower -->/gmi, ''))
+ .pipe(replace(/<!-- bower:js -->(\n^<script.*)*\n<!-- endbower -->/gmi, ''))
// injecting minified files
.pipe(
inject(
@@ -135,15 +140,24 @@
.pipe(eslint.failAfterError());
});
+ gulp.task('wait', function (cb) {
+ // setTimeout could be any async task
+ setTimeout(function () {
+ cb();
+ }, 1000);
+ });
+
gulp.task('build', function() {
runSequence(
- 'lint',
+ 'clean',
+ 'sass',
'templates',
'babel',
'scripts',
'wiredep',
- 'copyHtml',
+ 'css',
'copyCss',
+ 'copyHtml',
'cleanTmp'
);
});