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