Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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