1
1
/*global config:true, task:true*/
2
+ function stripDirectory ( file ) {
3
+ return file . replace ( / .+ \/ ( .+ ) $ / , '$1' ) ;
4
+ }
5
+ function createBanner ( files ) {
6
+ // strip folders
7
+ var fileNames = files && files . map ( stripDirectory ) ;
8
+ return '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
9
+ '<%= template.today("isoDate") %>\n' +
10
+ '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
11
+ '* Includes: ' + ( files ? fileNames . join ( ', ' ) : '<%= stripDirectory(task.current.data.src[1]) %>' ) + '\n' +
12
+ '* Copyright (c) <%= template.today("yyyy") %> <%= pkg.author.name %>;' +
13
+ ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */' ;
14
+ }
15
+ // allow access from banner template
16
+ global . stripDirectory = stripDirectory ;
17
+
2
18
var coreFiles = 'jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.effects.core.js' . split ( ', ' ) ;
3
19
var uiFiles = coreFiles . map ( function ( file ) {
4
20
return 'ui/' + file ;
@@ -21,19 +37,6 @@ allI18nFiles.forEach(minFile);
21
37
// TODO move core to the front, theme to the end, exclude all and base
22
38
var cssFiles = file . expand ( 'themes/base/*.css' ) ;
23
39
24
- function createBanner ( files ) {
25
- // strip folders
26
- var fileNames = files && files . map ( function ( file ) {
27
- return file . replace ( / .+ \/ ( .+ ) $ / , '$1' ) ;
28
- } ) ;
29
- return '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
30
- '<%= template.today("isoDate") %>\n' +
31
- '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
32
- ( files ? '* Includes: ' + fileNames . join ( ', ' ) + '\n' : '' ) +
33
- '* Copyright (c) <%= template.today("yyyy") %> <%= pkg.author.name %>;' +
34
- ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */' ;
35
- }
36
-
37
40
config . init ( {
38
41
pkg : '<json:package.json>' ,
39
42
meta : {
0 commit comments