Skip to content

Commit

Permalink
Merge branch 'v2.4.0-dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
almasaeed2010 committed May 18, 2017
2 parents b5f4bba + 4169db0 commit a60df9f
Show file tree
Hide file tree
Showing 109 changed files with 6,422 additions and 1,695 deletions.
235 changes: 159 additions & 76 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,101 +1,159 @@
// AdminLTE Gruntfile
module.exports = function (grunt) {
module.exports = function (grunt) { // jshint ignore:line

'use strict';

grunt.initConfig({
pkg : grunt.file.readJSON('package.json'),
watch: {
// If any .less file changes in directory "build/less/" run the "less"-task.
files: ["build/less/*.less", "build/less/skins/*.less", "dist/js/app.js"],
tasks: ["less", "uglify"]
less : {
// Compiles less files upon saving
files: ['build/less/*.less'],
tasks: ['less:development', 'less:production']
},
js : {
// Compile js files upon saving
files: ['build/js/*.js', 'dist/js/app.js'],
tasks: ['js']
},
skins: {
// Compile any skin less files upon saving
files: ['build/less/skins/*.less'],
tasks: ['less:skins', 'less:minifiedSkins']
}
},
// "less"-task configuration
// 'less'-task configuration
// This task will compile all less files upon saving to create both AdminLTE.css and AdminLTE.min.css
less: {
less : {
// Development not compressed
development: {
options: {
// Whether to compress or not
compress: false
},
development : {
files: {
// compilation.css : source.less
"dist/css/AdminLTE.css": "build/less/AdminLTE.less",
'dist/css/AdminLTE.css' : 'build/less/AdminLTE.less',
// AdminLTE without plugins
"dist/css/alt/AdminLTE-without-plugins.css": "build/less/AdminLTE-without-plugins.less",
'dist/css/alt/AdminLTE-without-plugins.css' : 'build/less/AdminLTE-without-plugins.less',
// Separate plugins
"dist/css/alt/AdminLTE-select2.css": "build/less/select2.less",
"dist/css/alt/AdminLTE-fullcalendar.css": "build/less/fullcalendar.less",
"dist/css/alt/AdminLTE-bootstrap-social.css": "build/less/bootstrap-social.less",
//Non minified skin files
"dist/css/skins/skin-blue.css": "build/less/skins/skin-blue.less",
"dist/css/skins/skin-black.css": "build/less/skins/skin-black.less",
"dist/css/skins/skin-yellow.css": "build/less/skins/skin-yellow.less",
"dist/css/skins/skin-green.css": "build/less/skins/skin-green.less",
"dist/css/skins/skin-red.css": "build/less/skins/skin-red.less",
"dist/css/skins/skin-purple.css": "build/less/skins/skin-purple.less",
"dist/css/skins/skin-blue-light.css": "build/less/skins/skin-blue-light.less",
"dist/css/skins/skin-black-light.css": "build/less/skins/skin-black-light.less",
"dist/css/skins/skin-yellow-light.css": "build/less/skins/skin-yellow-light.less",
"dist/css/skins/skin-green-light.css": "build/less/skins/skin-green-light.less",
"dist/css/skins/skin-red-light.css": "build/less/skins/skin-red-light.less",
"dist/css/skins/skin-purple-light.css": "build/less/skins/skin-purple-light.less",
"dist/css/skins/_all-skins.css": "build/less/skins/_all-skins.less"
'dist/css/alt/AdminLTE-select2.css' : 'build/less/select2.less',
'dist/css/alt/AdminLTE-fullcalendar.css' : 'build/less/fullcalendar.less',
'dist/css/alt/AdminLTE-bootstrap-social.css': 'build/less/bootstrap-social.less'
}
},
// Production compresses version
production: {
// Production compressed version
production : {
options: {
// Whether to compress or not
compress: true
},
files: {
files : {
// compilation.css : source.less
"dist/css/AdminLTE.min.css": "build/less/AdminLTE.less",
'dist/css/AdminLTE.min.css' : 'build/less/AdminLTE.less',
// AdminLTE without plugins
"dist/css/alt/AdminLTE-without-plugins.min.css": "build/less/AdminLTE-without-plugins.less",
'dist/css/alt/AdminLTE-without-plugins.min.css' : 'build/less/AdminLTE-without-plugins.less',
// Separate plugins
"dist/css/alt/AdminLTE-select2.min.css": "build/less/select2.less",
"dist/css/alt/AdminLTE-fullcalendar.min.css": "build/less/fullcalendar.less",
"dist/css/alt/AdminLTE-bootstrap-social.min.css": "build/less/bootstrap-social.less",
// Skins minified
"dist/css/skins/skin-blue.min.css": "build/less/skins/skin-blue.less",
"dist/css/skins/skin-black.min.css": "build/less/skins/skin-black.less",
"dist/css/skins/skin-yellow.min.css": "build/less/skins/skin-yellow.less",
"dist/css/skins/skin-green.min.css": "build/less/skins/skin-green.less",
"dist/css/skins/skin-red.min.css": "build/less/skins/skin-red.less",
"dist/css/skins/skin-purple.min.css": "build/less/skins/skin-purple.less",
"dist/css/skins/skin-blue-light.min.css": "build/less/skins/skin-blue-light.less",
"dist/css/skins/skin-black-light.min.css": "build/less/skins/skin-black-light.less",
"dist/css/skins/skin-yellow-light.min.css": "build/less/skins/skin-yellow-light.less",
"dist/css/skins/skin-green-light.min.css": "build/less/skins/skin-green-light.less",
"dist/css/skins/skin-red-light.min.css": "build/less/skins/skin-red-light.less",
"dist/css/skins/skin-purple-light.min.css": "build/less/skins/skin-purple-light.less",
"dist/css/skins/_all-skins.min.css": "build/less/skins/_all-skins.less"
'dist/css/alt/AdminLTE-select2.min.css' : 'build/less/select2.less',
'dist/css/alt/AdminLTE-fullcalendar.min.css' : 'build/less/fullcalendar.less',
'dist/css/alt/AdminLTE-bootstrap-social.min.css': 'build/less/bootstrap-social.less'
}
},
// Non minified skin files
skins : {
files: {
'dist/css/skins/skin-blue.css' : 'build/less/skins/skin-blue.less',
'dist/css/skins/skin-black.css' : 'build/less/skins/skin-black.less',
'dist/css/skins/skin-yellow.css' : 'build/less/skins/skin-yellow.less',
'dist/css/skins/skin-green.css' : 'build/less/skins/skin-green.less',
'dist/css/skins/skin-red.css' : 'build/less/skins/skin-red.less',
'dist/css/skins/skin-purple.css' : 'build/less/skins/skin-purple.less',
'dist/css/skins/skin-blue-light.css' : 'build/less/skins/skin-blue-light.less',
'dist/css/skins/skin-black-light.css' : 'build/less/skins/skin-black-light.less',
'dist/css/skins/skin-yellow-light.css': 'build/less/skins/skin-yellow-light.less',
'dist/css/skins/skin-green-light.css' : 'build/less/skins/skin-green-light.less',
'dist/css/skins/skin-red-light.css' : 'build/less/skins/skin-red-light.less',
'dist/css/skins/skin-purple-light.css': 'build/less/skins/skin-purple-light.less',
'dist/css/skins/_all-skins.css' : 'build/less/skins/_all-skins.less'
}
},
// Skins minified
minifiedSkins: {
options: {
compress: true
},
files : {
'dist/css/skins/skin-blue.min.css' : 'build/less/skins/skin-blue.less',
'dist/css/skins/skin-black.min.css' : 'build/less/skins/skin-black.less',
'dist/css/skins/skin-yellow.min.css' : 'build/less/skins/skin-yellow.less',
'dist/css/skins/skin-green.min.css' : 'build/less/skins/skin-green.less',
'dist/css/skins/skin-red.min.css' : 'build/less/skins/skin-red.less',
'dist/css/skins/skin-purple.min.css' : 'build/less/skins/skin-purple.less',
'dist/css/skins/skin-blue-light.min.css' : 'build/less/skins/skin-blue-light.less',
'dist/css/skins/skin-black-light.min.css' : 'build/less/skins/skin-black-light.less',
'dist/css/skins/skin-yellow-light.min.css': 'build/less/skins/skin-yellow-light.less',
'dist/css/skins/skin-green-light.min.css' : 'build/less/skins/skin-green-light.less',
'dist/css/skins/skin-red-light.min.css' : 'build/less/skins/skin-red-light.less',
'dist/css/skins/skin-purple-light.min.css': 'build/less/skins/skin-purple-light.less',
'dist/css/skins/_all-skins.min.css' : 'build/less/skins/_all-skins.less'
}
}
},

// Uglify task info. Compress the js files.
uglify: {
options: {
mangle: true,
options : {
mangle : true,
preserveComments: 'some'
},
my_target: {
production: {
files: {
'dist/js/app.min.js': ['dist/js/app.js']
'dist/js/app.min.js' : ['dist/js/app.js'],
'dist/js/adminlte.min.js': ['dist/js/adminlte.js']
}
}
},

// Concatenate JS Files
concat: {
options: {
separator: '\n\n',
banner : '/*! AdminLTE app.js\n'
+ '* ================\n'
+ '* Main JS application file for AdminLTE v2. This file\n'
+ '* should be included in all pages. It controls some layout\n'
+ '* options and implements exclusive AdminLTE plugins.\n'
+ '*\n'
+ '* @Author Almsaeed Studio\n'
+ '* @Support <https://www.almsaeedstudio.com>\n'
+ '* @Email <abdullah@almsaeedstudio.com>\n'
+ '* @version <%= pkg.version %>\n'
+ '* @repository <%= pkg.repository.url %>\n'
+ '* @license MIT <http://opensource.org/licenses/MIT>\n'
+ '*/\n\n'
+ '// Make sure jQuery has been loaded\n'
+ 'if (typeof jQuery === \'undefined\') {\n'
+ 'throw new Error(\'AdminLTE requires jQuery\')\n'
+ '}\n\n'
},
dist : {
src : [
'build/js/Layout.js',
'build/js/PushMenu.js',
'build/js/Tree.js',
'build/js/ControlSidebar.js',
'build/js/BoxWidget.js',
'build/js/TodoList.js',
'build/js/DirectChat.js'
],
dest: 'dist/js/adminlte.js'
}
},

// Build the documentation files
includes: {
build: {
src: ['*.html'], // Source files
dest: 'documentation/', // Destination directory
src : ['*.html'], // Source files
dest : 'documentation/', // Destination directory
flatten: true,
cwd: 'documentation/build',
cwd : 'documentation/build',
options: {
silent: true,
silent : true,
includePath: 'documentation/build/include'
}
}
Expand All @@ -104,37 +162,57 @@ module.exports = function (grunt) {
// Optimize images
image: {
dynamic: {
files: [{
expand: true,
cwd: 'build/img/',
src: ['**/*.{png,jpg,gif,svg,jpeg}'],
dest: 'dist/img/'
}]
files: [
{
expand: true,
cwd : 'build/img/',
src : ['**/*.{png,jpg,gif,svg,jpeg}'],
dest : 'dist/img/'
}
]
}
},

// Validate JS code
jshint: {
options: {
jshintrc: '.jshintrc'
jshintrc: 'build/js/.jshintrc'
},
grunt : {
options: {
jshintrc: 'build/grunt/.jshintrc'
},
src : 'Gruntfile.js'
},
core: {
src: 'dist/js/app.js'
core : {
src: 'build/js/*.js'
},
demo: {
demo : {
src: 'dist/js/demo.js'
},
pages: {
pages : {
src: 'dist/js/pages/*.js'
}
},

jscs: {
options: {
config: 'build/js/.jscsrc'
},
core : {
src: '<%= jshint.core.src %>'
},
pages : {
src: '<%= jshint.pages.src %>'
}
},

// Validate CSS files
csslint: {
options: {
csslintrc: 'build/less/.csslintrc'
},
dist: [
dist : [
'dist/css/AdminLTE.css'
]
},
Expand All @@ -144,14 +222,14 @@ module.exports = function (grunt) {
options: {
relaxerror: ['W005']
},
files: ['pages/**/*.html', '*.html']
files : ['pages/**/*.html', '*.html']
},

// Delete images in build directory
// After compressing the images in the build/img dir, there is no need
// for them
clean: {
build: ["build/img/*"]
build: ['build/img/*']
}
});

Expand All @@ -169,16 +247,21 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-image');
// Validate JS code
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jscs');
// Delete not needed files
grunt.loadNpmTasks('grunt-contrib-clean');
// Lint CSS
grunt.loadNpmTasks('grunt-contrib-csslint');
// Lint Bootstrap
grunt.loadNpmTasks('grunt-bootlint');
// Concatenate JS files
grunt.loadNpmTasks('grunt-contrib-concat');

// Linting task
grunt.registerTask('lint', ['jshint', 'csslint', 'bootlint']);
// JS task
grunt.registerTask('js', ['concat', 'uglify']);

// The default task (running "grunt" in console) is "watch"
// The default task (running 'grunt' in console) is 'watch'
grunt.registerTask('default', ['watch']);
};
Loading

0 comments on commit a60df9f

Please sign in to comment.