aboutsummaryrefslogtreecommitdiffstats
path: root/grunt.js
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2012-03-07 15:16:32 +0100
committerJörn Zaefferer <joern.zaefferer@gmail.com>2012-03-07 15:16:32 +0100
commit0bf7d25d6663ae6e5283cffbf8ac33f52dcf18f5 (patch)
treea6c62bdebcb21d1bc75435f8e7ea2ca7f7f598c5 /grunt.js
parent34f813413b9ccdb2eebd429a2e69198dcceec057 (diff)
downloadjquery-ui-0bf7d25d6663ae6e5283cffbf8ac33f52dcf18f5.tar.gz
jquery-ui-0bf7d25d6663ae6e5283cffbf8ac33f52dcf18f5.zip
Build/grunt: First draft for cdn tasks. Hashing works fine, zip file doesn't quite match the intended structure.
Diffstat (limited to 'grunt.js')
-rw-r--r--grunt.js38
1 files changed, 37 insertions, 1 deletions
diff --git a/grunt.js b/grunt.js
index 93896f6cb..76f2d71ac 100644
--- a/grunt.js
+++ b/grunt.js
@@ -37,6 +37,23 @@ allI18nFiles.forEach(minFile);
// TODO move core to the front, theme to the end, exclude all and base
var cssFiles = file.expand('themes/base/*.css');
+var cdnFiles = [
+ 'AUTHORS.txt',
+ 'GPL-LICENSE.txt',
+ 'MIT-LICENSE.txt',
+ 'dist/i18n/jquery-ui-i18n.js',
+ 'dist/i18n/jquery-ui-i18n.min.js',
+ 'ui/i18n/jquery.ui.datepicker-*.js',
+ 'dist/ui/i18n/jquery.ui.datepicker-*.min.js',
+ 'dist/ui/jquery-ui.js',
+ 'dist/ui/minified/jquery-ui.min.js',
+ 'themes/base/images/*.png',
+ 'dist/themes/base/jquery-ui.css',
+ 'themes/base/jquery.ui.*.css',
+ 'dist/themes/base/minified/*.css',
+ 'version.txt'
+];
+
config.init({
pkg: '<json:package.json>',
meta: {
@@ -70,8 +87,15 @@ config.init({
'tests/**/*'
],
dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.zip'
+ },
+ cdn: {
+ src: cdnFiles,
+ dest: 'dist/<%= pkg.name %>-<%= pkg.version %>-cdn.zip'
}
},
+ md5: {
+ 'dist/MANIFEST': cdnFiles
+ },
qunit: {
files: file.expand('tests/unit/**/*.html').filter(function(file) {
// disabling everything that doesn't (quite) work with PhantomJS for now
@@ -139,5 +163,17 @@ task.registerBasicTask( 'css_min', 'Minify CSS files with Sqwish.', function( da
task.helper( 'min_max_info', min, max );
});
+task.registerBasicTask('md5', 'Create list of md5 hashes for CDN uploads', function(data) {
+ var crypto = require('crypto');
+ var hashes = [];
+ file.expand(data.src).forEach(function(fileName) {
+ var hash = crypto.createHash('md5');
+ hash.update(file.read(fileName));
+ hashes.push(fileName + ' ' + hash.digest('hex'));
+ });
+ file.write(data.dest, hashes.join('\n') + '\n');
+});
+
task.registerTask('default', 'lint qunit');
-task.registerTask('release', 'concat min zip');
+task.registerTask('release', 'concat min zip:dist');
+task.registerTask('release_cdn', 'concat min md5 zip:cdn'); \ No newline at end of file