Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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