Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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