2018-12-03 13:11:51 +01:00
|
|
|
var src_poa = 'src/poa/';
|
|
|
|
var dest_poa = 'dist/poa/';
|
2015-05-12 17:02:51 +02:00
|
|
|
|
2018-12-03 13:11:51 +01:00
|
|
|
var scripts_poa = [
|
|
|
|
'src/poa/js/app.js',
|
|
|
|
'src/poa/js/controllers.js',
|
|
|
|
'src/poa/js/filters.js',
|
|
|
|
'src/poa/js/directives.js',
|
|
|
|
'src/poa/js/script.js'
|
2015-05-12 17:02:51 +02:00
|
|
|
];
|
|
|
|
|
2018-12-03 13:11:51 +01:00
|
|
|
var vendor_poa = [
|
|
|
|
'dist/poa/js/lib/jquery-1.11.3.min.js',
|
|
|
|
'dist/poa/js/lib/bootstrap.min.js',
|
|
|
|
'dist/poa/js/lib/angular.min.js',
|
|
|
|
'dist/poa/js/lib/ngStorage.min.js',
|
|
|
|
'dist/poa/js/lib/lodash.min.js',
|
|
|
|
'dist/poa/js/lib/d3.min.js',
|
|
|
|
'dist/poa/js/lib/d3.tip.min.js',
|
|
|
|
'dist/poa/js/lib/topojson.min.js',
|
|
|
|
'dist/poa/js/lib/datamaps.min.js',
|
|
|
|
'dist/poa/js/lib/moment.min.js',
|
|
|
|
'dist/poa/js/lib/moment.en.min.js',
|
|
|
|
'dist/poa/js/lib/toastr.min.js',
|
|
|
|
'dist/poa/js/lib/jquery.sparkline.min.js',
|
|
|
|
'dist/poa/js/lib/primus.min.js'
|
2015-05-12 17:02:51 +02:00
|
|
|
];
|
|
|
|
|
2018-12-03 13:11:51 +01:00
|
|
|
var styles_poa = [
|
|
|
|
'bootstrap.min.css',
|
|
|
|
'minimal-icons-embedded.css',
|
|
|
|
'toastr.min.css',
|
|
|
|
'style.css'
|
|
|
|
];
|
|
|
|
|
|
|
|
var src_pow = 'src/pow/';
|
|
|
|
var dest_pow = 'dist/pow/';
|
|
|
|
|
|
|
|
var scripts_pow = [
|
|
|
|
'src/pow/js/app.js',
|
|
|
|
'src/pow/js/controllers.js',
|
|
|
|
'src/pow/js/filters.js',
|
|
|
|
'src/pow/js/directives.js',
|
|
|
|
'src/pow/js/script.js'
|
|
|
|
];
|
|
|
|
|
|
|
|
var vendor_pow = [
|
|
|
|
'dist/pow/js/lib/jquery-1.11.3.min.js',
|
|
|
|
'dist/pow/js/lib/bootstrap.min.js',
|
|
|
|
'dist/pow/js/lib/angular.min.js',
|
|
|
|
'dist/pow/js/lib/lodash.min.js',
|
|
|
|
'dist/pow/js/lib/d3.min.js',
|
|
|
|
'dist/pow/js/lib/d3.tip.min.js',
|
|
|
|
'dist/pow/js/lib/moment.min.js',
|
|
|
|
'dist/pow/js/lib/moment.en.min.js',
|
|
|
|
'dist/pow/js/lib/toastr.min.js',
|
|
|
|
'dist/pow/js/lib/jquery.sparkline.min.js',
|
|
|
|
'dist/pow/js/lib/primus.min.js'
|
|
|
|
];
|
|
|
|
|
|
|
|
var styles_pow = [
|
2015-05-12 17:02:51 +02:00
|
|
|
'bootstrap.min.css',
|
|
|
|
'minimal-icons-embedded.css',
|
|
|
|
'toastr.min.css',
|
|
|
|
'style.css'
|
|
|
|
];
|
|
|
|
|
|
|
|
module.exports = function(grunt) {
|
|
|
|
grunt.initConfig({
|
|
|
|
pkg: grunt.file.readJSON('package.json'),
|
|
|
|
clean: {
|
2018-12-03 13:11:51 +01:00
|
|
|
build_poa: ['dist/poa'],
|
|
|
|
cleanup_js_poa: ['dist/poa/js/*.*', '!dist/poa/js/netstats.*'],
|
|
|
|
cleanup_css_poa: ['dist/poa/css/*.css', '!dist/poa/css/netstats.*.css'],
|
|
|
|
build_pow: ['dist/pow'],
|
|
|
|
cleanup_js_pow: ['dist/pow/js/*.*', '!dist/pow/js/netstats.*'],
|
|
|
|
cleanup_css_pow: ['dist/pow/css/*.css', '!dist/pow/css/netstats.*.css']
|
2015-05-12 17:02:51 +02:00
|
|
|
},
|
|
|
|
jade: {
|
2018-12-03 13:11:51 +01:00
|
|
|
build_poa: {
|
2015-05-12 17:02:51 +02:00
|
|
|
options: {
|
|
|
|
data: {
|
|
|
|
debug: false,
|
|
|
|
pretty: true
|
|
|
|
}
|
|
|
|
},
|
2015-07-27 14:02:38 +02:00
|
|
|
files: {
|
2018-12-03 13:11:51 +01:00
|
|
|
'dist/poa/index.html': 'src/poa/views/index.jade'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
build_pow: {
|
|
|
|
options: {
|
|
|
|
data: {
|
|
|
|
debug: false,
|
|
|
|
pretty: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
files: {
|
|
|
|
'dist/pow/index.html': 'src/pow/views/index.jade'
|
2015-07-27 14:02:38 +02:00
|
|
|
}
|
2015-05-12 17:02:51 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
copy: {
|
2018-12-03 13:11:51 +01:00
|
|
|
build_poa: {
|
2015-05-12 17:02:51 +02:00
|
|
|
files: [
|
|
|
|
{
|
|
|
|
expand: true,
|
2018-12-03 13:11:51 +01:00
|
|
|
cwd: 'src/poa/fonts/',
|
|
|
|
src: ['minimal-*.*'],
|
|
|
|
dest: 'dist/poa/fonts/',
|
|
|
|
filter: 'isFile'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
expand: true,
|
|
|
|
cwd: 'src/poa/images/',
|
|
|
|
src: ['*.ico'],
|
|
|
|
dest: 'dist/poa/',
|
2015-05-12 17:02:51 +02:00
|
|
|
filter: 'isFile'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
expand: true,
|
2018-12-03 13:11:51 +01:00
|
|
|
cwd: 'src/poa/css/',
|
|
|
|
src: styles_poa,
|
|
|
|
dest: 'dist/poa/css/',
|
|
|
|
filter: 'isFile'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
expand: true,
|
|
|
|
cwd: 'src/poa/js/lib/',
|
2017-09-04 06:38:22 +02:00
|
|
|
src: ['*.*'],
|
2018-12-03 13:11:51 +01:00
|
|
|
dest: 'dist/poa/js/lib'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
build_pow: {
|
|
|
|
files: [
|
|
|
|
{
|
|
|
|
expand: true,
|
|
|
|
cwd: 'src/pow/fonts/',
|
|
|
|
src: ['minimal-*.*'],
|
|
|
|
dest: 'dist/pow/fonts/',
|
|
|
|
filter: 'isFile'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
expand: true,
|
|
|
|
cwd: 'src/pow/images/',
|
|
|
|
src: ['*.ico'],
|
|
|
|
dest: 'dist/pow/',
|
2015-05-12 17:02:51 +02:00
|
|
|
filter: 'isFile'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
expand: true,
|
2018-12-03 13:11:51 +01:00
|
|
|
cwd: 'src/pow/css/',
|
|
|
|
src: styles_pow,
|
|
|
|
dest: 'dist/pow/css/',
|
2015-05-12 17:02:51 +02:00
|
|
|
filter: 'isFile'
|
|
|
|
},
|
|
|
|
{
|
2015-05-19 14:59:29 +02:00
|
|
|
expand: true,
|
2018-12-03 13:11:51 +01:00
|
|
|
cwd: 'src/pow/js/lib/',
|
2015-05-19 14:59:29 +02:00
|
|
|
src: ['*.*'],
|
2018-12-03 13:11:51 +01:00
|
|
|
dest: 'dist/pow/js/lib'
|
2015-05-12 17:02:51 +02:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
cssmin: {
|
2018-12-03 13:11:51 +01:00
|
|
|
build_poa: {
|
|
|
|
files: [{
|
|
|
|
expand: true,
|
|
|
|
cwd: 'dist/poa/css',
|
|
|
|
src: ['*.css', '!*.min.css'],
|
|
|
|
dest: 'dist/poa/css/'
|
|
|
|
}]
|
|
|
|
},
|
|
|
|
build_pow: {
|
2015-05-12 17:02:51 +02:00
|
|
|
files: [{
|
|
|
|
expand: true,
|
2018-12-03 13:11:51 +01:00
|
|
|
cwd: 'dist/pow/css',
|
2015-05-12 17:02:51 +02:00
|
|
|
src: ['*.css', '!*.min.css'],
|
2018-12-03 13:11:51 +01:00
|
|
|
dest: 'dist/pow/css/'
|
2015-05-12 17:02:51 +02:00
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
concat: {
|
2018-12-03 13:11:51 +01:00
|
|
|
vendor_poa: {
|
2015-05-19 14:59:29 +02:00
|
|
|
options: {
|
2015-12-04 19:39:45 +01:00
|
|
|
souceMap: false,
|
2015-05-19 14:59:29 +02:00
|
|
|
sourceMapIncludeSources: true,
|
2018-12-03 13:11:51 +01:00
|
|
|
sourceMapIn: ['dist/poa/js/lib/*.map']
|
2015-05-19 14:59:29 +02:00
|
|
|
},
|
2018-12-03 13:11:51 +01:00
|
|
|
src: vendor_poa,
|
|
|
|
dest: 'dist/poa/js/vendor.min.js'
|
2015-05-12 17:02:51 +02:00
|
|
|
},
|
2018-12-03 13:11:51 +01:00
|
|
|
scripts_poa : {
|
2015-05-12 17:02:51 +02:00
|
|
|
options: {
|
2015-05-19 14:59:29 +02:00
|
|
|
separator: ';\n',
|
2015-05-12 17:02:51 +02:00
|
|
|
},
|
2018-12-03 13:11:51 +01:00
|
|
|
src: scripts_poa,
|
|
|
|
dest: 'dist/poa/js/app.js'
|
2015-05-12 17:02:51 +02:00
|
|
|
},
|
2018-12-03 13:11:51 +01:00
|
|
|
netstats_poa: {
|
2015-05-12 17:02:51 +02:00
|
|
|
options: {
|
2015-12-04 19:39:45 +01:00
|
|
|
sourceMap: false,
|
2015-05-19 14:59:29 +02:00
|
|
|
sourceMapIncludeSources: true,
|
2018-12-03 13:11:51 +01:00
|
|
|
sourceMapIn: ['dist/poa/js/vendor.min.js.map', 'dist/poa/js/app.min.js.map']
|
2015-05-12 17:02:51 +02:00
|
|
|
},
|
2018-12-03 13:11:51 +01:00
|
|
|
src: ['<%= concat.vendor_poa.dest %>', '<%= uglify.app_poa.dest %>'],
|
|
|
|
dest: 'dist/poa/js/netstats.min.js',
|
2015-12-04 19:39:45 +01:00
|
|
|
nonull: true
|
2015-05-12 17:02:51 +02:00
|
|
|
},
|
2018-12-03 13:11:51 +01:00
|
|
|
css_poa: {
|
|
|
|
src: ['dist/poa/css/*.min.css', 'dist/poa/css/*.css'],
|
|
|
|
dest: 'dist/poa/css/netstats.min.css'
|
|
|
|
},
|
|
|
|
vendor_pow: {
|
|
|
|
options: {
|
|
|
|
sourceMap: false,
|
|
|
|
sourceMapIncludeSources: true,
|
|
|
|
sourceMapIn: ['dist/pow/js/lib/*.map']
|
|
|
|
},
|
|
|
|
src: vendor_pow,
|
|
|
|
dest: 'dist/pow/js/vendor.min.js'
|
|
|
|
},
|
|
|
|
scripts_pow : {
|
|
|
|
options: {
|
|
|
|
separator: ';\n',
|
|
|
|
},
|
|
|
|
src: scripts_pow,
|
|
|
|
dest: 'dist/pow/js/app.js'
|
|
|
|
},
|
|
|
|
netstats_pow: {
|
|
|
|
options: {
|
|
|
|
sourceMap: false,
|
|
|
|
sourceMapIncludeSources: true,
|
|
|
|
sourceMapIn: ['dist/pow/js/vendor.min.js.map', 'dist/pow/js/app.min.js.map']
|
|
|
|
},
|
|
|
|
src: ['<%= concat.vendor_pow.dest %>', '<%= uglify.app_pow.dest %>'],
|
|
|
|
dest: 'dist/pow/js/netstats.min.js',
|
|
|
|
nonull: true,
|
|
|
|
},
|
|
|
|
css_pow: {
|
|
|
|
src: ['dist/pow/css/*.min.css', 'dist/pow/css/*.css'],
|
|
|
|
dest: 'dist/pow/css/netstats.min.css'
|
2015-05-12 17:02:51 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
uglify: {
|
2018-12-03 13:11:51 +01:00
|
|
|
app_poa: {
|
|
|
|
options: {
|
|
|
|
mangle: false,
|
|
|
|
sourceMap: false,
|
|
|
|
sourceMapIncludeSources: true
|
|
|
|
},
|
|
|
|
dest: 'dist/poa/js/app.min.js',
|
|
|
|
src: ['<%= concat.scripts_poa.dest %>']
|
|
|
|
},
|
|
|
|
app_pow: {
|
2015-05-12 17:02:51 +02:00
|
|
|
options: {
|
|
|
|
mangle: false,
|
2015-12-04 19:39:45 +01:00
|
|
|
sourceMap: false,
|
2015-05-19 14:59:29 +02:00
|
|
|
sourceMapIncludeSources: true
|
2015-05-12 17:02:51 +02:00
|
|
|
},
|
2018-12-03 13:11:51 +01:00
|
|
|
dest: 'dist/pow/js/app.min.js',
|
|
|
|
src: ['<%= concat.scripts_pow.dest %>']
|
2015-05-12 17:02:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-copy');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-concat');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-jade');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
|
|
|
2018-12-03 13:11:51 +01:00
|
|
|
grunt.registerTask('poa', ['clean:build_poa', 'clean:cleanup_js_poa', 'clean:cleanup_css_poa', 'jade:build_poa', 'copy:build_poa', 'cssmin:build_poa', 'concat:vendor_poa', 'concat:scripts_poa', 'uglify:app_poa', 'concat:netstats_poa', 'concat:css_poa', 'clean:cleanup_js_poa', 'clean:cleanup_css_poa']);
|
|
|
|
grunt.registerTask('pow', ['clean:build_pow', 'clean:cleanup_js_pow', 'clean:cleanup_css_pow', 'jade:build_pow', 'copy:build_pow', 'cssmin:build_pow', 'concat:vendor_pow', 'concat:scripts_pow', 'uglify:app_pow', 'concat:netstats_pow', 'concat:css_pow', 'clean:cleanup_js_pow', 'clean:cleanup_css_pow']);
|
|
|
|
grunt.registerTask('default', 'poa');
|
|
|
|
grunt.registerTask('build', 'default');
|
|
|
|
grunt.registerTask('all', ['poa', 'pow']);
|
2015-12-04 19:39:45 +01:00
|
|
|
};
|