Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 315 lines (277 sloc) 9.104 kb
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
1 var files = require('./angularFiles').files;
2 var util = require('./lib/grunt/utils.js');
265f0b5 Pete Bacon Darwin fix(build): get promise A+ tests to run on windows
petebacondarwin authored
3 var path = require('path');
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
4
5 module.exports = function(grunt) {
6 //grunt plugins
8c10db3 Tobias Bosch chore(build): automate cutting a release, publishing to bower and to cod...
tbosch authored
7 grunt.loadNpmTasks('grunt-bump');
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
8 grunt.loadNpmTasks('grunt-contrib-clean');
9 grunt.loadNpmTasks('grunt-contrib-connect');
10 grunt.loadNpmTasks('grunt-contrib-compress');
6dcfccb Igor Minar chore(grunt): sort the grunt task load statements
IgorMinar authored
11 grunt.loadNpmTasks('grunt-contrib-copy');
12 grunt.loadNpmTasks('grunt-contrib-jshint');
31631b2 Brian Ford chore(build): add check for merge conflicts, ddescribe, and iit
btford authored
13 grunt.loadNpmTasks('grunt-ddescribe-iit');
6dcfccb Igor Minar chore(grunt): sort the grunt task load statements
IgorMinar authored
14 grunt.loadNpmTasks('grunt-jasmine-node');
7f4edaf Igor Minar chore(build): add jscs code style check to our build
IgorMinar authored
15 grunt.loadNpmTasks("grunt-jscs-checker");
31631b2 Brian Ford chore(build): add check for merge conflicts, ddescribe, and iit
btford authored
16 grunt.loadNpmTasks('grunt-merge-conflict');
2c2adbc Vojta Jina chore(travis): speed up the build
vojtajina authored
17 grunt.loadNpmTasks('grunt-parallel');
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
18 grunt.loadNpmTasks('grunt-shell');
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
19 grunt.loadTasks('lib/grunt');
20
21 var NG_VERSION = util.getVersion();
8a96393 Dave Geddes chore(Grunt): don't remove root dir from zip
geddski authored
22 var dist = 'angular-'+ NG_VERSION.full;
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
23
24
25 //global beforeEach
26 util.init();
27
28
29 //config
30 grunt.initConfig({
31 NG_VERSION: NG_VERSION,
32
2c2adbc Vojta Jina chore(travis): speed up the build
vojtajina authored
33 parallel: {
34 travis: {
35 tasks: [
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
36 util.parallelTask(['test:unit', 'test:docgen', 'test:promises-aplus', 'tests:docs'], {stream: true}),
7909ebe Vojta Jina chore: run more browsers on Travis (IE8,IE9,IE10,Safari,FF)
vojtajina authored
37 util.parallelTask(['test:e2e'])
2c2adbc Vojta Jina chore(travis): speed up the build
vojtajina authored
38 ]
39 }
40 },
41
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
42 connect: {
43 devserver: {
44 options: {
45 port: 8000,
5fd39e0 Igor Minar chore(Gruntfile): run webserver on 0.0.0.0
IgorMinar authored
46 hostname: '0.0.0.0',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
47 base: '.',
48 keepalive: true,
49 middleware: function(connect, options){
50 return [
51 //uncomment to enable CSP
52 // util.csp(),
53 util.rewrite(),
54 connect.favicon('images/favicon.ico'),
55 connect.static(options.base),
56 connect.directory(options.base)
57 ];
58 }
59 }
60 },
2c2adbc Vojta Jina chore(travis): speed up the build
vojtajina authored
61 testserver: {
62 options: {
b73c46c Vojta Jina chore: fix Travis build
vojtajina authored
63 // We use end2end task (which does not start the webserver)
64 // and start the webserver as a separate process (in travis_build.sh)
65 // to avoid https://github.com/joyent/libuv/issues/826
66 port: 8000,
67 hostname: '0.0.0.0',
2c2adbc Vojta Jina chore(travis): speed up the build
vojtajina authored
68 middleware: function(connect, options){
69 return [
70 function(req, resp, next) {
71 // cache get requests to speed up tests on travis
72 if (req.method === 'GET') {
73 resp.setHeader('Cache-control', 'public, max-age=3600');
74 }
75
76 next();
77 },
78 connect.favicon('images/favicon.ico'),
79 connect.static(options.base)
80 ];
81 }
82 }
83 }
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
84 },
85
86
05b41ee Matias Niemelä fix(grunt): ensure all dependent tasks are called for all test task
matsko authored
87 tests: {
c2e215f Vojta Jina chore: use Karma
vojtajina authored
88 jqlite: 'karma-jqlite.conf.js',
89 jquery: 'karma-jquery.conf.js',
77c4fc6 Matias Niemelä chore(ngdocs): setup karma-docs testing suite to test docs components
matsko authored
90 docs: 'karma-docs.conf.js',
7aef2d5 Julie Ralph test(docs): convert example end to end doc tests from scenario runner to...
juliemr authored
91 modules: 'karma-modules.conf.js'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
92 },
93
94
95 autotest: {
c2e215f Vojta Jina chore: use Karma
vojtajina authored
96 jqlite: 'karma-jqlite.conf.js',
63c1e5b Igor Minar chore(grunt): add autotest:modules target
IgorMinar authored
97 jquery: 'karma-jquery.conf.js',
77c4fc6 Matias Niemelä chore(ngdocs): setup karma-docs testing suite to test docs components
matsko authored
98 modules: 'karma-modules.conf.js',
05b41ee Matias Niemelä fix(grunt): ensure all dependent tasks are called for all test task
matsko authored
99 docs: 'karma-docs.conf.js'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
100 },
101
102
2ed4ad5 Julie Ralph feat(build): add a grunt test for running protractor tests extracted fro...
juliemr authored
103 runprotractor: {
104 normal: 'protractor-conf.js'
105 },
106
107
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
108 clean: {
109 build: ['build'],
110 tmp: ['tmp']
111 },
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
112
934a95d Pete Bacon Darwin chore(grunt): add jshint tasks
petebacondarwin authored
113 jshint: {
05ef1bd chore(grunt): update to latest jshint task
James Brewer authored
114 options: {
115 jshintrc: true,
116 },
934a95d Pete Bacon Darwin chore(grunt): add jshint tasks
petebacondarwin authored
117 ng: {
118 files: { src: files['angularSrc'] },
119 },
120 ngAnimate: {
121 files: { src: 'src/ngAnimate/**/*.js' },
122 },
123 ngCookies: {
124 files: { src: 'src/ngCookies/**/*.js' },
125 },
126 ngLocale: {
127 files: { src: 'src/ngLocale/**/*.js' },
128 },
129 ngMock: {
130 files: { src: 'src/ngMock/**/*.js' },
131 },
132 ngResource: {
133 files: { src: 'src/ngResource/**/*.js' },
134 },
135 ngRoute: {
136 files: { src: 'src/ngRoute/**/*.js' },
137 },
138 ngSanitize: {
139 files: { src: 'src/ngSanitize/**/*.js' },
140 },
141 ngScenario: {
142 files: { src: 'src/ngScenario/**/*.js' },
143 },
144 ngTouch: {
145 files: { src: 'src/ngTouch/**/*.js' },
146 }
147 },
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
148
7f4edaf Igor Minar chore(build): add jscs code style check to our build
IgorMinar authored
149 jscs: {
150 src: ['src/**/*.js', 'test/**/*.js'],
151 options: {
152 config: ".jscs.json"
153 }
154 },
155
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
156 build: {
157 scenario: {
158 dest: 'build/angular-scenario.js',
159 src: [
576269b Ken Sheedlo fix(bower): update bower usage and resources
ksheedlo authored
160 'bower_components/jquery/jquery.js',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
161 util.wrap([files['angularSrc'], files['angularScenario']], 'ngScenario/angular')
162 ],
163 styles: {
164 css: ['css/angular.css', 'css/angular-scenario.css']
165 }
166 },
167 angular: {
168 dest: 'build/angular.js',
169 src: util.wrap([files['angularSrc']], 'angular'),
170 styles: {
171 css: ['css/angular.css'],
a86cf20 Tobias Bosch fix: don't inline css in csp mode.
tbosch authored
172 generateCspCssFile: true,
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
173 minify: true
174 }
175 },
176 loader: {
177 dest: 'build/angular-loader.js',
934a95d Pete Bacon Darwin chore(grunt): add jshint tasks
petebacondarwin authored
178 src: util.wrap(files['angularLoader'], 'loader')
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
179 },
94ec84e Brian Ford chore(ngMobile): rename module ngTouch and file to angular-touch.js
btford authored
180 touch: {
181 dest: 'build/angular-touch.js',
934a95d Pete Bacon Darwin chore(grunt): add jshint tasks
petebacondarwin authored
182 src: util.wrap(files['angularModules']['ngTouch'], 'module')
707c65d feat(ngMobile): add ngMobile module with mobile-specific ngClick
Braden Shepherdson authored
183 },
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
184 mocks: {
185 dest: 'build/angular-mocks.js',
5bd6596 David Mosher chore(mocks): wrap angular-mocks.js in closure
davemo authored
186 src: util.wrap(files['angularModules']['ngMock'], 'module'),
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
187 strict: false
188 },
189 sanitize: {
190 dest: 'build/angular-sanitize.js',
934a95d Pete Bacon Darwin chore(grunt): add jshint tasks
petebacondarwin authored
191 src: util.wrap(files['angularModules']['ngSanitize'], 'module')
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
192 },
193 resource: {
194 dest: 'build/angular-resource.js',
934a95d Pete Bacon Darwin chore(grunt): add jshint tasks
petebacondarwin authored
195 src: util.wrap(files['angularModules']['ngResource'], 'module')
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
196 },
81923f1 Matias Niemelä feat(ngAnimate): complete rewrite of animations
matsko authored
197 animate: {
198 dest: 'build/angular-animate.js',
934a95d Pete Bacon Darwin chore(grunt): add jshint tasks
petebacondarwin authored
199 src: util.wrap(files['angularModules']['ngAnimate'], 'module')
81923f1 Matias Niemelä feat(ngAnimate): complete rewrite of animations
matsko authored
200 },
5599b55 Igor Minar refactor($route): pull $route and friends into angular-route.js
IgorMinar authored
201 route: {
202 dest: 'build/angular-route.js',
934a95d Pete Bacon Darwin chore(grunt): add jshint tasks
petebacondarwin authored
203 src: util.wrap(files['angularModules']['ngRoute'], 'module')
5599b55 Igor Minar refactor($route): pull $route and friends into angular-route.js
IgorMinar authored
204 },
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
205 cookies: {
206 dest: 'build/angular-cookies.js',
934a95d Pete Bacon Darwin chore(grunt): add jshint tasks
petebacondarwin authored
207 src: util.wrap(files['angularModules']['ngCookies'], 'module')
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
208 },
209 "promises-aplus-adapter": {
210 dest:'tmp/promises-aplus-adapter++.js',
211 src:['src/ng/q.js','lib/promises-aplus/promises-aplus-test-adapter.js']
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
212 }
213 },
214
215
216 min: {
217 angular: 'build/angular.js',
81923f1 Matias Niemelä feat(ngAnimate): complete rewrite of animations
matsko authored
218 animate: 'build/angular-animate.js',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
219 cookies: 'build/angular-cookies.js',
220 loader: 'build/angular-loader.js',
94ec84e Brian Ford chore(ngMobile): rename module ngTouch and file to angular-touch.js
btford authored
221 touch: 'build/angular-touch.js',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
222 resource: 'build/angular-resource.js',
5599b55 Igor Minar refactor($route): pull $route and friends into angular-route.js
IgorMinar authored
223 route: 'build/angular-route.js',
f56125d Matias Niemelä chore(ngdocs): setup bower as the package manager for the docs pages
matsko authored
224 sanitize: 'build/angular-sanitize.js'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
225 },
226
227
228 docs: {
229 process: ['build/docs/*.html', 'build/docs/.htaccess']
230 },
231
c317a7b Pete Bacon Darwin chore(grunt): grunt-jasmine-node uses different config
petebacondarwin authored
232 "jasmine_node": {
233 projectRoot: 'docs/spec'
71bc1b7 Pete Bacon Darwin chore(doc_gen): add task to run doc-gen specs
petebacondarwin authored
234 },
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
235
31631b2 Brian Ford chore(build): add check for merge conflicts, ddescribe, and iit
btford authored
236 "ddescribe-iit": {
237 files: [
238 'test/**/*.js',
239 '!test/ngScenario/DescribeSpec.js'
240 ]
241 },
242
243 "merge-conflict": {
244 files: [
245 'src/**/*',
246 'test/**/*',
247 'docs/**/*',
248 'css/**/*'
249 ]
250 },
251
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
252 copy: {
253 i18n: {
254 files: [
255 { src: 'src/ngLocale/**', dest: 'build/i18n/', expand: true, flatten: true }
256 ]
257 }
258 },
259
260
261 compress: {
262 build: {
79a88ec Igor Minar chore(grunt): ensure that grunt uses zip for compression
IgorMinar authored
263 options: {archive: 'build/' + dist +'.zip', mode: 'zip'},
d38d844 Igor Minar chore(Grunt): include dot files in the final zip
IgorMinar authored
264 src: ['**'], cwd: 'build', expand: true, dot: true, dest: dist + '/'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
265 }
266 },
267
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
268 shell:{
269 "promises-aplus-tests":{
270 options:{
271 //stdout:true,
272 stderr:true,
273 failOnError:true
274 },
265f0b5 Pete Bacon Darwin fix(build): get promise A+ tests to run on windows
petebacondarwin authored
275 command:path.normalize('./node_modules/.bin/promises-aplus-tests tmp/promises-aplus-adapter++.js')
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
276 }
277 },
278
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
279
280 write: {
281 versionTXT: {file: 'build/version.txt', val: NG_VERSION.full},
282 versionJSON: {file: 'build/version.json', val: JSON.stringify(NG_VERSION)}
8c10db3 Tobias Bosch chore(build): automate cutting a release, publishing to bower and to cod...
tbosch authored
283 },
284
285 bump: {
286 options: {
287 files: ['package.json'],
288 commit: false,
289 createTag: false,
290 push: false
291 }
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
292 }
293 });
294
295
296 //alias tasks
7aef2d5 Julie Ralph test(docs): convert example end to end doc tests from scenario runner to...
juliemr authored
297 grunt.registerTask('test', 'Run unit, docs and e2e tests with Karma', ['jshint', 'package','test:unit','test:promises-aplus', 'tests:docs', 'test:protractor']);
953fa4c Matias Niemelä chore(grunt): fix up the help text for the new test commands
matsko authored
298 grunt.registerTask('test:jqlite', 'Run the unit tests with Karma' , ['tests:jqlite']);
299 grunt.registerTask('test:jquery', 'Run the jQuery unit tests with Karma', ['tests:jquery']);
300 grunt.registerTask('test:modules', 'Run the Karma module tests with Karma', ['tests:modules']);
301 grunt.registerTask('test:docs', 'Run the doc-page tests with Karma', ['package', 'tests:docs']);
302 grunt.registerTask('test:unit', 'Run unit, jQuery and Karma module tests with Karma', ['tests:jqlite', 'tests:jquery', 'tests:modules']);
2ed4ad5 Julie Ralph feat(build): add a grunt test for running protractor tests extracted fro...
juliemr authored
303 grunt.registerTask('test:protractor', 'Run the end to end tests with Protractor and keep a test server running in the background', ['webdriver', 'connect:testserver', 'runprotractor:normal']);
7aef2d5 Julie Ralph test(docs): convert example end to end doc tests from scenario runner to...
juliemr authored
304 grunt.registerTask('test:e2e', 'Alias for test:protractor', ['test:protractor']);
c317a7b Pete Bacon Darwin chore(grunt): grunt-jasmine-node uses different config
petebacondarwin authored
305 grunt.registerTask('test:docgen', ['jasmine_node']);
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
306 grunt.registerTask('test:promises-aplus',['build:promises-aplus-adapter','shell:promises-aplus-tests']);
05b41ee Matias Niemelä fix(grunt): ensure all dependent tasks are called for all test task
matsko authored
307
aa5a162 Ken Sheedlo chore(bower): write grunt task for running bower
ksheedlo authored
308 grunt.registerTask('minify', ['bower','clean', 'build', 'minall']);
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
309 grunt.registerTask('webserver', ['connect:devserver']);
aa5a162 Ken Sheedlo chore(bower): write grunt task for running bower
ksheedlo authored
310 grunt.registerTask('package', ['bower','clean', 'buildall', 'minall', 'collect-errors', 'docs', 'copy', 'write', 'compress']);
3379eeb Vojta Jina chore(travis): run bower install twice to make sure it does
vojtajina authored
311 grunt.registerTask('package-without-bower', ['clean', 'buildall', 'minall', 'collect-errors', 'docs', 'copy', 'write', 'compress']);
7f4edaf Igor Minar chore(build): add jscs code style check to our build
IgorMinar authored
312 grunt.registerTask('ci-checks', ['ddescribe-iit', 'merge-conflict', 'jshint', 'jscs']);
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
313 grunt.registerTask('default', ['package']);
314 };
Something went wrong with that request. Please try again.