Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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