@@ -37,6 +37,23 @@ allI18nFiles.forEach(minFile);
37
37
// TODO move core to the front, theme to the end, exclude all and base
38
38
var cssFiles = file . expand ( 'themes/base/*.css' ) ;
39
39
40
+ var cdnFiles = [
41
+ 'AUTHORS.txt' ,
42
+ 'GPL-LICENSE.txt' ,
43
+ 'MIT-LICENSE.txt' ,
44
+ 'dist/i18n/jquery-ui-i18n.js' ,
45
+ 'dist/i18n/jquery-ui-i18n.min.js' ,
46
+ 'ui/i18n/jquery.ui.datepicker-*.js' ,
47
+ 'dist/ui/i18n/jquery.ui.datepicker-*.min.js' ,
48
+ 'dist/ui/jquery-ui.js' ,
49
+ 'dist/ui/minified/jquery-ui.min.js' ,
50
+ 'themes/base/images/*.png' ,
51
+ 'dist/themes/base/jquery-ui.css' ,
52
+ 'themes/base/jquery.ui.*.css' ,
53
+ 'dist/themes/base/minified/*.css' ,
54
+ 'version.txt'
55
+ ] ;
56
+
40
57
config . init ( {
41
58
pkg : '<json:package.json>' ,
42
59
meta : {
@@ -70,8 +87,15 @@ config.init({
70
87
'tests/**/*'
71
88
] ,
72
89
dest : 'dist/<%= pkg.name %>-<%= pkg.version %>.zip'
90
+ } ,
91
+ cdn : {
92
+ src : cdnFiles ,
93
+ dest : 'dist/<%= pkg.name %>-<%= pkg.version %>-cdn.zip'
73
94
}
74
95
} ,
96
+ md5 : {
97
+ 'dist/MANIFEST' : cdnFiles
98
+ } ,
75
99
qunit : {
76
100
files : file . expand ( 'tests/unit/**/*.html' ) . filter ( function ( file ) {
77
101
// 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
139
163
task . helper ( 'min_max_info' , min , max ) ;
140
164
} ) ;
141
165
166
+ task . registerBasicTask ( 'md5' , 'Create list of md5 hashes for CDN uploads' , function ( data ) {
167
+ var crypto = require ( 'crypto' ) ;
168
+ var hashes = [ ] ;
169
+ file . expand ( data . src ) . forEach ( function ( fileName ) {
170
+ var hash = crypto . createHash ( 'md5' ) ;
171
+ hash . update ( file . read ( fileName ) ) ;
172
+ hashes . push ( fileName + ' ' + hash . digest ( 'hex' ) ) ;
173
+ } ) ;
174
+ file . write ( data . dest , hashes . join ( '\n' ) + '\n' ) ;
175
+ } ) ;
176
+
142
177
task . registerTask ( 'default' , 'lint qunit' ) ;
143
- task . registerTask ( 'release' , 'concat min zip' ) ;
178
+ task . registerTask ( 'release' , 'concat min zip:dist' ) ;
179
+ task . registerTask ( 'release_cdn' , 'concat min md5 zip:cdn' ) ;
0 commit comments