|
@@ -33,7 +33,10 @@ module.exports = function(grunt) {
|
|
|
grunt.registerTask('default', 'archive');
|
|
grunt.registerTask('default', 'archive');
|
|
|
|
|
|
|
|
// Bare minimum for debugging
|
|
// Bare minimum for debugging
|
|
|
- grunt.registerTask('dev', 'lumbar:build');
|
|
|
|
|
|
|
+ grunt.registerTask('dev', [
|
|
|
|
|
+ 'lumbar:build',
|
|
|
|
|
+ 'generateLanguages'
|
|
|
|
|
+ ]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -41,6 +44,7 @@ module.exports = function(grunt) {
|
|
|
----------------------------------------------------------------------------------------------------*/
|
|
----------------------------------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
grunt.registerTask('modules', 'Build the FullCalendar modules', [
|
|
grunt.registerTask('modules', 'Build the FullCalendar modules', [
|
|
|
|
|
+ 'clean:modules',
|
|
|
'lumbar:build',
|
|
'lumbar:build',
|
|
|
'concat:moduleVariables',
|
|
'concat:moduleVariables',
|
|
|
'uglify:modules'
|
|
'uglify:modules'
|
|
@@ -75,7 +79,37 @@ module.exports = function(grunt) {
|
|
|
ext: '.min.js'
|
|
ext: '.min.js'
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- config.clean.modules = 'build/out/*';
|
|
|
|
|
|
|
+ config.clean.modules = 'build/out/**';
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /* Languages
|
|
|
|
|
+ ----------------------------------------------------------------------------------------------------*/
|
|
|
|
|
+
|
|
|
|
|
+ grunt.registerTask('languages', [
|
|
|
|
|
+ 'clean:languages',
|
|
|
|
|
+ 'generateLanguages',
|
|
|
|
|
+ 'uglify:languages'
|
|
|
|
|
+ ]);
|
|
|
|
|
+
|
|
|
|
|
+ config.generateLanguages = {
|
|
|
|
|
+ moment: 'lib/moment/lang/',
|
|
|
|
|
+ datepicker: 'lib/jquery-ui/ui/i18n/',
|
|
|
|
|
+ fullCalendar: 'lang/',
|
|
|
|
|
+ dest: 'build/out/lang/'
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ config.uglify.languages = {
|
|
|
|
|
+ expand: true,
|
|
|
|
|
+ cwd: 'build/out/lang/',
|
|
|
|
|
+ src: '*.js',
|
|
|
|
|
+ dest: 'build/out/lang-min/'
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ config.clean.languages = [
|
|
|
|
|
+ 'build/out/lang/*',
|
|
|
|
|
+ 'build/out/lang-min/*'
|
|
|
|
|
+ ];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -83,10 +117,12 @@ module.exports = function(grunt) {
|
|
|
----------------------------------------------------------------------------------------------------*/
|
|
----------------------------------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
grunt.registerTask('archive', 'Create a distributable ZIP archive', [
|
|
grunt.registerTask('archive', 'Create a distributable ZIP archive', [
|
|
|
- 'clean:modules',
|
|
|
|
|
'clean:archive',
|
|
'clean:archive',
|
|
|
'modules',
|
|
'modules',
|
|
|
|
|
+ 'languages',
|
|
|
'copy:archiveModules',
|
|
'copy:archiveModules',
|
|
|
|
|
+ 'copy:archiveLanguages',
|
|
|
|
|
+ 'copy:archiveMoment',
|
|
|
'copy:archiveJQuery',
|
|
'copy:archiveJQuery',
|
|
|
'concat:archiveJQueryUI',
|
|
'concat:archiveJQueryUI',
|
|
|
'copy:archiveDemos',
|
|
'copy:archiveDemos',
|
|
@@ -103,6 +139,18 @@ module.exports = function(grunt) {
|
|
|
dest: 'build/archive/fullcalendar/'
|
|
dest: 'build/archive/fullcalendar/'
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ config.copy.archiveLanguages = {
|
|
|
|
|
+ expand: true,
|
|
|
|
|
+ cwd: 'build/out/lang-min/',
|
|
|
|
|
+ src: '*.js',
|
|
|
|
|
+ dest: 'build/archive/fullcalendar/lang/'
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ config.copy.archiveMoment = {
|
|
|
|
|
+ src: 'lib/moment/min/moment.min.js',
|
|
|
|
|
+ dest: 'build/archive/lib/moment.min.js'
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
config.copy.archiveJQuery = {
|
|
config.copy.archiveJQuery = {
|
|
|
src: 'lib/jquery/jquery.min.js',
|
|
src: 'lib/jquery/jquery.min.js',
|
|
|
dest: 'build/archive/lib/jquery.min.js'
|
|
dest: 'build/archive/lib/jquery.min.js'
|
|
@@ -129,7 +177,7 @@ module.exports = function(grunt) {
|
|
|
return content;
|
|
return content;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- src: 'demos/*',
|
|
|
|
|
|
|
+ src: 'demos/**',
|
|
|
dest: 'build/archive/'
|
|
dest: 'build/archive/'
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -138,14 +186,15 @@ module.exports = function(grunt) {
|
|
|
expand: true,
|
|
expand: true,
|
|
|
cwd: 'lib/jquery-ui/themes/cupertino/',
|
|
cwd: 'lib/jquery-ui/themes/cupertino/',
|
|
|
src: [ 'jquery-ui.min.css', 'images/*' ],
|
|
src: [ 'jquery-ui.min.css', 'images/*' ],
|
|
|
- dest: 'build/archive/demos/cupertino/'
|
|
|
|
|
|
|
+ dest: 'build/archive/lib/cupertino/'
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// in demo HTML, rewrites paths to work in the archive
|
|
// in demo HTML, rewrites paths to work in the archive
|
|
|
function transformDemoPath(path) {
|
|
function transformDemoPath(path) {
|
|
|
|
|
+ path = path.replace('../lib/moment/moment.js', '../lib/moment.min.js');
|
|
|
path = path.replace('../lib/jquery/jquery.js', '../lib/jquery.min.js');
|
|
path = path.replace('../lib/jquery/jquery.js', '../lib/jquery.min.js');
|
|
|
path = path.replace('../lib/jquery-ui/ui/jquery-ui.js', '../lib/jquery-ui.custom.min.js');
|
|
path = path.replace('../lib/jquery-ui/ui/jquery-ui.js', '../lib/jquery-ui.custom.min.js');
|
|
|
- path = path.replace('../lib/jquery-ui/themes/', '');
|
|
|
|
|
|
|
+ path = path.replace('../lib/jquery-ui/themes/cupertino/', '../lib/cupertino/');
|
|
|
path = path.replace('../build/out/', '../fullcalendar/');
|
|
path = path.replace('../build/out/', '../fullcalendar/');
|
|
|
path = path.replace('/fullcalendar.js', '/fullcalendar.min.js');
|
|
path = path.replace('/fullcalendar.js', '/fullcalendar.min.js');
|
|
|
return path;
|
|
return path;
|
|
@@ -153,8 +202,10 @@ module.exports = function(grunt) {
|
|
|
|
|
|
|
|
// copy license and changelog
|
|
// copy license and changelog
|
|
|
config.copy.archiveMisc = {
|
|
config.copy.archiveMisc = {
|
|
|
- src: [ 'license.txt', 'changelog.txt' ],
|
|
|
|
|
- dest: 'build/archive/'
|
|
|
|
|
|
|
+ files: {
|
|
|
|
|
+ 'build/archive/license.txt': 'license.txt',
|
|
|
|
|
+ 'build/archive/changelog.txt': 'changelog.md'
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// create the ZIP
|
|
// create the ZIP
|
|
@@ -177,7 +228,6 @@ module.exports = function(grunt) {
|
|
|
----------------------------------------------------------------------------------------------------*/
|
|
----------------------------------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
grunt.registerTask('bower', 'Build the FullCalendar Bower component', [
|
|
grunt.registerTask('bower', 'Build the FullCalendar Bower component', [
|
|
|
- 'clean:modules',
|
|
|
|
|
'clean:bower',
|
|
'clean:bower',
|
|
|
'modules',
|
|
'modules',
|
|
|
'copy:bowerModules',
|
|
'copy:bowerModules',
|
|
@@ -220,7 +270,6 @@ module.exports = function(grunt) {
|
|
|
----------------------------------------------------------------------------------------------------*/
|
|
----------------------------------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
grunt.registerTask('cdnjs', 'Build files for CDNJS\'s hosted version of FullCalendar', [
|
|
grunt.registerTask('cdnjs', 'Build files for CDNJS\'s hosted version of FullCalendar', [
|
|
|
- 'clean:modules',
|
|
|
|
|
'clean:cdnjs',
|
|
'clean:cdnjs',
|
|
|
'modules',
|
|
'modules',
|
|
|
'copy:cdnjsModules',
|
|
'copy:cdnjsModules',
|
|
@@ -253,4 +302,7 @@ module.exports = function(grunt) {
|
|
|
|
|
|
|
|
// finally, give grunt the config object...
|
|
// finally, give grunt the config object...
|
|
|
grunt.initConfig(config);
|
|
grunt.initConfig(config);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ grunt.loadTasks('tasks');
|
|
|
};
|
|
};
|