Show More
@@ -1,187 +1,189 b'' | |||
|
1 | 1 | module.exports = function(grunt) { |
|
2 | 2 | grunt.initConfig({ |
|
3 | 3 | |
|
4 | 4 | dirs: { |
|
5 | 5 | css: "rhodecode/public/css", |
|
6 | 6 | js: { |
|
7 | 7 | "src": "rhodecode/public/js/src", |
|
8 | 8 | "dest": "rhodecode/public/js" |
|
9 | 9 | } |
|
10 | 10 | }, |
|
11 | 11 | copy: { |
|
12 | 12 | main: { |
|
13 | 13 | expand: true, |
|
14 | 14 | cwd: 'bower_components', |
|
15 | 15 | src: 'webcomponentsjs/**', |
|
16 | 16 | dest: '<%= dirs.js.dest %>/vendors', |
|
17 | 17 | }, |
|
18 | 18 | }, |
|
19 | 19 | concat: { |
|
20 | 20 | polymercss:{ |
|
21 | 21 | src: [ |
|
22 | 22 | // Base libraries |
|
23 | 23 | '<%= dirs.js.src %>/components/shared-styles-prefix.html', |
|
24 | 24 | '<%= dirs.css %>/style-polymer.css', |
|
25 | 25 | '<%= dirs.js.src %>/components/shared-styles-suffix.html' |
|
26 | 26 | ], |
|
27 | 27 | dest: '<%= dirs.js.dest %>/src/components/shared-styles.html', |
|
28 | 28 | nonull: true |
|
29 | 29 | }, |
|
30 | 30 | dist: { |
|
31 | 31 | src: [ |
|
32 | 32 | // Base libraries |
|
33 | 33 | '<%= dirs.js.src %>/jquery-1.11.1.min.js', |
|
34 | 34 | '<%= dirs.js.src %>/logging.js', |
|
35 | 35 | '<%= dirs.js.src %>/bootstrap.js', |
|
36 | 36 | '<%= dirs.js.src %>/mousetrap.js', |
|
37 | 37 | '<%= dirs.js.src %>/moment.js', |
|
38 | 38 | '<%= dirs.js.src %>/appenlight-client-0.4.1.min.js', |
|
39 | 39 | '<%= dirs.js.src %>/i18n_utils.js', |
|
40 | 40 | '<%= dirs.js.src %>/deform.js', |
|
41 | 41 | |
|
42 | 42 | // Plugins |
|
43 | 43 | '<%= dirs.js.src %>/plugins/jquery.pjax.js', |
|
44 | 44 | '<%= dirs.js.src %>/plugins/jquery.dataTables.js', |
|
45 | 45 | '<%= dirs.js.src %>/plugins/flavoured_checkbox.js', |
|
46 | 46 | '<%= dirs.js.src %>/plugins/jquery.auto-grow-input.js', |
|
47 | 47 | '<%= dirs.js.src %>/plugins/jquery.autocomplete.js', |
|
48 | 48 | '<%= dirs.js.src %>/plugins/jquery.debounce.js', |
|
49 | 49 | '<%= dirs.js.src %>/plugins/jquery.mark.js', |
|
50 | 50 | '<%= dirs.js.src %>/plugins/jquery.timeago.js', |
|
51 | 51 | '<%= dirs.js.src %>/plugins/jquery.timeago-extension.js', |
|
52 | 52 | |
|
53 | 53 | // Select2 |
|
54 | 54 | '<%= dirs.js.src %>/select2/select2.js', |
|
55 | 55 | |
|
56 | 56 | // Code-mirror |
|
57 | 57 | '<%= dirs.js.src %>/codemirror/codemirror.js', |
|
58 | 58 | '<%= dirs.js.src %>/codemirror/codemirror_loadmode.js', |
|
59 | 59 | '<%= dirs.js.src %>/codemirror/codemirror_hint.js', |
|
60 | 60 | '<%= dirs.js.src %>/codemirror/codemirror_overlay.js', |
|
61 | 61 | '<%= dirs.js.src %>/codemirror/codemirror_placeholder.js', |
|
62 | 62 | // TODO: mikhail: this is an exception. Since the code mirror modes |
|
63 | 63 | // are loaded "on the fly", we need to keep them in a public folder |
|
64 | 64 | '<%= dirs.js.dest %>/mode/meta.js', |
|
65 | 65 | '<%= dirs.js.dest %>/mode/meta_ext.js', |
|
66 | 66 | '<%= dirs.js.dest %>/rhodecode/i18n/select2/translations.js', |
|
67 | 67 | |
|
68 | 68 | // Rhodecode utilities |
|
69 | 69 | '<%= dirs.js.src %>/rhodecode/utils/array.js', |
|
70 | 70 | '<%= dirs.js.src %>/rhodecode/utils/string.js', |
|
71 | 71 | '<%= dirs.js.src %>/rhodecode/utils/pyroutes.js', |
|
72 | 72 | '<%= dirs.js.src %>/rhodecode/utils/ajax.js', |
|
73 | 73 | '<%= dirs.js.src %>/rhodecode/utils/autocomplete.js', |
|
74 | 74 | '<%= dirs.js.src %>/rhodecode/utils/colorgenerator.js', |
|
75 | 75 | '<%= dirs.js.src %>/rhodecode/utils/ie.js', |
|
76 | 76 | '<%= dirs.js.src %>/rhodecode/utils/os.js', |
|
77 | 77 | '<%= dirs.js.src %>/rhodecode/utils/topics.js', |
|
78 | 78 | |
|
79 | 79 | // Rhodecode widgets |
|
80 | 80 | '<%= dirs.js.src %>/rhodecode/widgets/multiselect.js', |
|
81 | 81 | |
|
82 | 82 | // Rhodecode components |
|
83 | 83 | '<%= dirs.js.src %>/rhodecode/init.js', |
|
84 | 84 | '<%= dirs.js.src %>/rhodecode/connection_controller.js', |
|
85 | 85 | '<%= dirs.js.src %>/rhodecode/codemirror.js', |
|
86 | 86 | '<%= dirs.js.src %>/rhodecode/comments.js', |
|
87 | 87 | '<%= dirs.js.src %>/rhodecode/constants.js', |
|
88 | 88 | '<%= dirs.js.src %>/rhodecode/files.js', |
|
89 | 89 | '<%= dirs.js.src %>/rhodecode/followers.js', |
|
90 | 90 | '<%= dirs.js.src %>/rhodecode/menus.js', |
|
91 | 91 | '<%= dirs.js.src %>/rhodecode/notifications.js', |
|
92 | 92 | '<%= dirs.js.src %>/rhodecode/permissions.js', |
|
93 | 93 | '<%= dirs.js.src %>/rhodecode/pjax.js', |
|
94 | 94 | '<%= dirs.js.src %>/rhodecode/pullrequests.js', |
|
95 | 95 | '<%= dirs.js.src %>/rhodecode/settings.js', |
|
96 | 96 | '<%= dirs.js.src %>/rhodecode/select2_widgets.js', |
|
97 | 97 | '<%= dirs.js.src %>/rhodecode/tooltips.js', |
|
98 | 98 | '<%= dirs.js.src %>/rhodecode/users.js', |
|
99 | 99 | '<%= dirs.js.src %>/rhodecode/utils/notifications.js', |
|
100 | 100 | '<%= dirs.js.src %>/rhodecode/appenlight.js', |
|
101 | 101 | |
|
102 | 102 | // Rhodecode main module |
|
103 | 103 | '<%= dirs.js.src %>/rhodecode.js' |
|
104 | 104 | ], |
|
105 | 105 | dest: '<%= dirs.js.dest %>/scripts.js', |
|
106 | 106 | nonull: true |
|
107 | 107 | } |
|
108 | 108 | }, |
|
109 | 109 | |
|
110 | 110 | less: { |
|
111 | 111 | development: { |
|
112 | 112 | options: { |
|
113 | 113 | compress: false, |
|
114 | 114 | yuicompress: false, |
|
115 | 115 | optimization: 0 |
|
116 | 116 | }, |
|
117 | 117 | files: { |
|
118 | 118 | "<%= dirs.css %>/style.css": "<%= dirs.css %>/main.less", |
|
119 | 119 | "<%= dirs.css %>/style-polymer.css": "<%= dirs.css %>/polymer.less" |
|
120 | 120 | } |
|
121 | 121 | }, |
|
122 | 122 | production: { |
|
123 | 123 | options: { |
|
124 | 124 | compress: true, |
|
125 | 125 | yuicompress: true, |
|
126 | 126 | optimization: 2 |
|
127 | 127 | }, |
|
128 | 128 | files: { |
|
129 | 129 | "<%= dirs.css %>/style.css": "<%= dirs.css %>/main.less", |
|
130 | 130 | "<%= dirs.css %>/style-polymer.css": "<%= dirs.css %>/polymer.less" |
|
131 | 131 | } |
|
132 | 132 | }, |
|
133 | 133 | components: { |
|
134 | 134 | files: [{ |
|
135 | 135 | cwd: '<%= dirs.js.src %>/components/', |
|
136 | 136 | dest: '<%= dirs.js.src %>/components/', |
|
137 | 137 | src: ['**/*.less'], |
|
138 | 138 | expand: true, |
|
139 | 139 | ext: '.css' |
|
140 | 140 | }] |
|
141 | 141 | } |
|
142 | 142 | }, |
|
143 | 143 | |
|
144 | 144 | watch: { |
|
145 | 145 | less: { |
|
146 | 146 | files: ["<%= dirs.css %>/*.less"], |
|
147 | 147 | tasks: ["less:development", 'less:components', 'concat:polymercss', "vulcanize"] |
|
148 | 148 | }, |
|
149 | 149 | js: { |
|
150 | 150 | files: ["<%= dirs.js.src %>/**/*.js", "<%= dirs.js.src %>/components/*.*"], |
|
151 | 151 | tasks: ["vulcanize", "concat:dist"] |
|
152 | 152 | } |
|
153 | 153 | }, |
|
154 | 154 | |
|
155 | 155 | jshint: { |
|
156 | 156 | rhodecode: { |
|
157 | 157 | src: '<%= dirs.js.src %>/rhodecode/**/*.js', |
|
158 | 158 | options: { |
|
159 | 159 | jshintrc: '.jshintrc' |
|
160 | 160 | } |
|
161 | 161 | } |
|
162 | 162 | }, |
|
163 | 163 | vulcanize: { |
|
164 | 164 | default: { |
|
165 | 165 | options: { |
|
166 | 166 | abspath: '', |
|
167 | 167 | inlineScripts: true, |
|
168 | 168 | inlineCss: true, |
|
169 | 169 | stripComments: true |
|
170 | 170 | }, |
|
171 | 171 | files: { |
|
172 | 172 | '<%= dirs.js.dest %>/rhodecode-components.html': '<%= dirs.js.src %>/components/shared-components.html' |
|
173 | 173 | } |
|
174 | 174 | } |
|
175 | 175 | } |
|
176 | 176 | }); |
|
177 | 177 | |
|
178 | 178 | grunt.loadNpmTasks('grunt-contrib-less'); |
|
179 | 179 | grunt.loadNpmTasks('grunt-contrib-concat'); |
|
180 | 180 | grunt.loadNpmTasks('grunt-contrib-watch'); |
|
181 | 181 | grunt.loadNpmTasks('grunt-contrib-jshint'); |
|
182 | 182 | grunt.loadNpmTasks('grunt-vulcanize'); |
|
183 | 183 | grunt.loadNpmTasks('grunt-crisper'); |
|
184 | 184 | grunt.loadNpmTasks('grunt-contrib-copy'); |
|
185 | 185 | |
|
186 | grunt.registerTask('default', ['less:production', 'less:components', 'concat:polymercss', 'copy','vulcanize', 'concat:dist']); | |
|
186 | // TODO: johbo: missing bower bits | |
|
187 | // grunt.registerTask('default', ['less:production', 'less:components', 'concat:polymercss', 'copy','vulcanize', 'concat:dist']); | |
|
188 | grunt.registerTask('default', ['less:production', 'concat:dist']); | |
|
187 | 189 | }; |
General Comments 0
You need to be logged in to leave comments.
Login now