File tree Expand file tree Collapse file tree 4 files changed +74
-25
lines changed Expand file tree Collapse file tree 4 files changed +74
-25
lines changed Original file line number Diff line number Diff line change @@ -68,12 +68,17 @@ module.exports = function (grunt) {
68
68
'less:luma' ,
69
69
'less:backend'
70
70
] ,
71
+
71
72
/**
72
73
* Documentation
73
74
*/
74
75
documentation : [
76
+ 'replace:documentation' ,
75
77
'less:documentation' ,
76
78
'styledocco:documentation' ,
79
+ 'usebanner:documentationCss' ,
80
+ 'usebanner:documentationLess' ,
81
+ 'usebanner:documentationHtml' ,
77
82
'clean:var' ,
78
83
'clean:pub'
79
84
] ,
@@ -82,12 +87,6 @@ module.exports = function (grunt) {
82
87
'mage-minify:legacy'
83
88
] ,
84
89
85
- 'documentation-banners' : [
86
- 'usebanner:documentationCss' ,
87
- 'usebanner:documentationLess' ,
88
- 'usebanner:documentationHtml'
89
- ] ,
90
-
91
90
spec : function ( theme ) {
92
91
var runner = require ( './dev/tests/js/jasmine/spec_runner' ) ;
93
92
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright © 2015 Magento. All rights reserved.
3
+ * See COPYING.txt for license details.
4
+ */
5
+
6
+ 'use strict' ;
7
+
8
+ function findCopyright ( lang ) {
9
+ var copyrightText = {
10
+ firstLine : 'Copyright © 2015 Magento. All rights reserved.' ,
11
+ secondLine : 'See COPYING.txt for license details.'
12
+ } ;
13
+ switch ( lang ) {
14
+ case 'less' :
15
+ return new RegExp (
16
+ '// /\\*\\*\r\n// \\* ' +
17
+ copyrightText . firstLine +
18
+ '\r\n// \\* ' +
19
+ copyrightText . secondLine +
20
+ '\r\n// \\*/\r\n\r\n'
21
+ ) ;
22
+ break ;
23
+ default :
24
+ return ;
25
+ }
26
+ }
27
+
28
+ module . exports = {
29
+ documentation : {
30
+ options : {
31
+ patterns : [ {
32
+ match : findCopyright ( 'less' ) ,
33
+ replacement : ''
34
+ } ]
35
+ } ,
36
+ files : [ {
37
+ expand : true ,
38
+ flatten : true ,
39
+ src : [
40
+ '<%= path.doc %>/source/**/*.less'
41
+ ] ,
42
+ dest : '<%= path.doc %>/source/'
43
+ } ]
44
+ }
45
+
46
+ } ;
Original file line number Diff line number Diff line change 5
5
6
6
'use strict' ;
7
7
8
- var banner = {
9
- firstLine : 'Copyright © 2015 Magento. All rights reserved.' ,
10
- secondLine : 'See COPYING.txt for license details.' ,
11
-
12
- css : function ( ) {
13
- return '/**\n * ' + this . firstLine + '\n * ' + this . secondLine + '\n */\n' ;
14
- } ,
15
-
16
- less : function ( ) {
17
- return '// /**\n// * ' + this . firstLine + '\n// * ' + this . secondLine + '\n// */\n' ;
18
- } ,
19
-
20
- html : function ( ) {
21
- return '<!--\n/**\n * ' + this . firstLine + '\n * ' + this . secondLine + '\n */\n-->\n' ;
8
+ function printCopyright ( lang ) {
9
+ var copyrightText = {
10
+ firstLine : 'Copyright © 2015 Magento. All rights reserved.' ,
11
+ secondLine : 'See COPYING.txt for license details.'
12
+ } ;
13
+ switch ( lang ) {
14
+ case 'css' :
15
+ return '/**\n * ' + copyrightText . firstLine + '\n * ' + copyrightText . secondLine + '\n */\n' ;
16
+ break ;
17
+ case 'less' :
18
+ return '// /**\n// * ' + copyrightText . firstLine + '\n// * ' + copyrightText . secondLine + '\n// */\n' ;
19
+ break ;
20
+ case 'html' :
21
+ return '<!--\n/**\n * ' + copyrightText . firstLine + '\n * ' + copyrightText . secondLine + '\n */\n-->\n' ;
22
+ break ;
23
+ default :
24
+ return ;
22
25
}
23
- } ;
26
+ }
24
27
25
28
module . exports = {
26
29
options : {
@@ -29,31 +32,31 @@ module.exports = {
29
32
} ,
30
33
setup : {
31
34
options : {
32
- banner : banner . css ( )
35
+ banner : printCopyright ( 'css' )
33
36
} ,
34
37
files : {
35
38
src : '<%= path.css.setup %>/*.css'
36
39
}
37
40
} ,
38
41
documentationCss : {
39
42
options : {
40
- banner : banner . css ( )
43
+ banner : printCopyright ( 'css' )
41
44
} ,
42
45
files : {
43
46
src : '<%= path.doc %>/**/*.css'
44
47
}
45
48
} ,
46
49
documentationLess : {
47
50
options : {
48
- banner : banner . less ( )
51
+ banner : printCopyright ( 'less' )
49
52
} ,
50
53
files : {
51
54
src : '<%= path.doc %>/**/*.less'
52
55
}
53
56
} ,
54
57
documentationHtml : {
55
58
options : {
56
- banner : banner . html ( )
59
+ banner : printCopyright ( 'html' )
57
60
} ,
58
61
files : {
59
62
src : '<%= path.doc %>/**/*.html'
Original file line number Diff line number Diff line change 20
20
"grunt-contrib-less" : " ^0.12.0" ,
21
21
"grunt-contrib-watch" : " ^0.6.1" ,
22
22
"grunt-exec" : " ^0.4.6" ,
23
+ "grunt-replace" : " ^0.9.2" ,
23
24
"grunt-styledocco" : " ^0.1.4" ,
24
25
"grunt-template-jasmine-requirejs" : " ^0.2.3" ,
25
26
"grunt-text-replace" : " ^0.4.0" ,
You can’t perform that action at this time.
0 commit comments