mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 07:22:11 +00:00
374 lines
9.5 KiB
JavaScript
374 lines
9.5 KiB
JavaScript
module.exports = function (grunt) {
|
|
'use strict';
|
|
|
|
// if you set bootstrapDir to views/bootstrap/vendors then make sure
|
|
// bootbox is not installed, because version 5 of bootbox will not work
|
|
// with bootstrap 2
|
|
var bootstrapDir = 'views/bootstrap4/vendors',
|
|
tdkDir = 'views/tdk/vendors',
|
|
nodeDir = 'node_modules';
|
|
|
|
grunt.initConfig({
|
|
clean: {
|
|
vendors: [ bootstrapDir ]
|
|
},
|
|
copy: {
|
|
'bootstrap': {
|
|
files: [{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/jquery/dist/*'
|
|
],
|
|
dest: bootstrapDir + '/jquery',
|
|
flatten: true
|
|
}, {
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/chartjs/chart.js',
|
|
nodeDir + '/chartjs/README.md',
|
|
nodeDir + '/chartjs/LICENSE'
|
|
],
|
|
dest: bootstrapDir + '/chartjs',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/cytoscape/dist/*',
|
|
nodeDir + '/cytoscape-grid-guide/cytoscape-grid-guide.js'
|
|
],
|
|
dest: bootstrapDir + '/cytoscape',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/jqtree/tree.jquery.js',
|
|
nodeDir + '/jqtree/jqtree.css'
|
|
],
|
|
dest: bootstrapDir + '/jqtree',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/noty/js/noty/jquery.noty.js'
|
|
],
|
|
dest: bootstrapDir + '/noty',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/noty/js/noty/themes/*'
|
|
],
|
|
dest: bootstrapDir + '/noty/themes',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/noty/js/noty/layouts/*'
|
|
],
|
|
dest: bootstrapDir + '/noty/layouts',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/select2/dist/js/*'
|
|
],
|
|
dest: bootstrapDir + '/select2/js',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/select2/dist/css/*'
|
|
],
|
|
dest: bootstrapDir + '/select2/css',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/@ttskch/select2-bootstrap4-theme/dist/*'
|
|
],
|
|
dest: bootstrapDir + '/select2-bootstrap4-theme',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/vis-timeline/dist/*'
|
|
],
|
|
dest: bootstrapDir + '/vis-timeline',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/fine-uploader/jquery.fine-uploader/*'
|
|
],
|
|
dest: bootstrapDir + '/fine-uploader',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/jquery-validation/dist/*'
|
|
],
|
|
dest: bootstrapDir + '/jquery-validation',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/jquery-typeahead/dist/*'
|
|
],
|
|
dest: bootstrapDir + '/jquery-typeahead',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/bootbox/dist/*'
|
|
],
|
|
dest: bootstrapDir + '/bootbox',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/flot/source/jquery.canvaswrapper.js',
|
|
nodeDir + '/flot/source/jquery.colorhelpers.js',
|
|
nodeDir + '/flot/source/jquery.flot.*'
|
|
],
|
|
dest: bootstrapDir + '/flot',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/font-awesome/fonts/*'
|
|
],
|
|
dest: bootstrapDir + '/font-awesome/fonts',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/font-awesome/css/*'
|
|
],
|
|
dest: bootstrapDir + '/font-awesome/css',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/fullcalendar/LICENSE.txt',
|
|
nodeDir + '/fullcalendar/dist/*'
|
|
],
|
|
dest: bootstrapDir + '/fullcalendar',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/fullcalendar/dist/locale/*'
|
|
],
|
|
dest: bootstrapDir + '/fullcalendar/locale',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/moment/LICENSE.txt',
|
|
nodeDir + '/moment/min/*'
|
|
],
|
|
dest: bootstrapDir + '/moment',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/moment/dist/locale/*'
|
|
],
|
|
dest: bootstrapDir + '/moment/locale',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/popper.js/dist/umd/*'
|
|
],
|
|
dest: bootstrapDir + '/popper',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/perfect-scrollbar/dist/*'
|
|
],
|
|
dest: bootstrapDir + '/perfect-scrollbar',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/bootstrap/dist/js/bootstrap.min.js',
|
|
nodeDir + '/bootstrap/dist/css/bootstrap.min.css'
|
|
],
|
|
dest: bootstrapDir + '/bootstrap',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/spectrum-colorpicker2/dist/spectrum.min.js',
|
|
nodeDir + '/spectrum-colorpicker2/dist/spectrum.min.css'
|
|
],
|
|
dest: bootstrapDir + '/spectrum-colorpicker2',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/bootstrap-datepicker/dist/js/*'
|
|
],
|
|
dest: bootstrapDir + '/bootstrap-datepicker/js',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/bootstrap-datepicker/dist/css/*'
|
|
],
|
|
dest: bootstrapDir + '/bootstrap-datepicker/css',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/bootstrap-datepicker/dist/locales/*'
|
|
],
|
|
dest: bootstrapDir + '/bootstrap-datepicker/locales',
|
|
flatten: true
|
|
}]
|
|
},
|
|
'tdk': {
|
|
files: [{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/jquery/dist/*'
|
|
],
|
|
dest: tdkDir + '/jquery',
|
|
flatten: true
|
|
}, {
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/@coreui/coreui/dist/js/*'
|
|
],
|
|
dest: tdkDir + '/@coreui/coreui/js',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/@coreui/coreui/dist/css/*'
|
|
],
|
|
dest: tdkDir + '/@coreui/coreui/css',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/@coreui/icons/css/*'
|
|
],
|
|
dest: tdkDir + '/@coreui/icons/css',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/@coreui/icons/fonts/*'
|
|
],
|
|
dest: tdkDir + '/@coreui/icons/fonts',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/popper.js/dist/esm/*'
|
|
],
|
|
dest: tdkDir + '/popper.js',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/perfect-scrollbar/dist/*'
|
|
],
|
|
dest: tdkDir + '/perfect-scrollbar',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/bootstrap/dist/js/*'
|
|
],
|
|
dest: tdkDir + '/bootstrap/js',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/bootstrap/dist/css/*'
|
|
],
|
|
dest: tdkDir + '/bootstrap/css',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/font-awesome/fonts/*'
|
|
],
|
|
dest: tdkDir + '/font-awesome/fonts',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/font-awesome/css/*'
|
|
],
|
|
dest: tdkDir + '/font-awesome/css',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/pace-progressbar/index.js'
|
|
],
|
|
dest: tdkDir + '/pace-progressbar',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/pace-progressbar/themes/*'
|
|
],
|
|
dest: tdkDir + '/pace-progressbar/themes',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/pace-progressbar/templates/*'
|
|
],
|
|
dest: tdkDir + '/pace-progressbar/templates',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/flag-icon-css/css/*'
|
|
],
|
|
dest: tdkDir + '/flag-icon-css/css',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/simple-line-icons/dist/fonts/*'
|
|
],
|
|
dest: tdkDir + '/simple-line-icons/fonts',
|
|
flatten: true
|
|
},{
|
|
expand: true,
|
|
src: [
|
|
nodeDir + '/simple-line-icons/dist/styles/*'
|
|
],
|
|
dest: tdkDir + '/simple-line-icons/css',
|
|
flatten: true
|
|
}]
|
|
},
|
|
}
|
|
});
|
|
|
|
grunt.registerTask('createVendorDir', 'Creates the necessary vendor directory', function() {
|
|
// Create the bootstrapDir when it doesn't exists.
|
|
if (!grunt.file.isDir(bootstrapDir)) {
|
|
grunt.file.mkdir(bootstrapDir);
|
|
|
|
// Output a success message
|
|
grunt.log.oklns(grunt.template.process(
|
|
'Directory "<%= directory %>" was created successfully.',
|
|
{ data: { directory: bootstrapDir } }
|
|
));
|
|
}
|
|
});
|
|
|
|
grunt.registerTask('default', [ 'clean', 'createVendorDir', 'copy' ]);
|
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
|
grunt.loadNpmTasks('grunt-contrib-copy');
|
|
};
|