Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 303 lines (268 sloc) 8.86 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-copy');
10 grunt.loadNpmTasks('grunt-contrib-connect');
11 grunt.loadNpmTasks('grunt-contrib-compress');
dd7cb15 Jorik Tangelder chore(npm): grunt-contrib-jasmine-node changed name
jtangelder authored
12 grunt.loadNpmTasks('grunt-jasmine-node');
31631b2 Brian Ford chore(build): add check for merge conflicts, ddescribe, and iit
btford authored
13 grunt.loadNpmTasks('grunt-ddescribe-iit');
14 grunt.loadNpmTasks('grunt-merge-conflict');
2c2adbc Vojta Jina chore(travis): speed up the build
vojtajina authored
15 grunt.loadNpmTasks('grunt-parallel');
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
16 grunt.loadNpmTasks('grunt-shell');
934a95d Pete Bacon Darwin chore(grunt): add jshint tasks
petebacondarwin authored
17 grunt.loadNpmTasks('grunt-contrib-jshint');
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
18 grunt.loadTasks('lib/grunt');
19
20 var NG_VERSION = util.getVersion();
8a96393 Dave Geddes chore(Grunt): don't remove root dir from zip
geddski authored
21 var dist = 'angular-'+ NG_VERSION.full;
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
22
23
24 //global beforeEach
25 util.init();
26
27
28 //config
29 grunt.initConfig({
30 NG_VERSION: NG_VERSION,
31
2c2adbc Vojta Jina chore(travis): speed up the build
vojtajina authored
32 parallel: {
33 travis: {
34 tasks: [
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
35 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
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',
77c4fc6 Matias Niemelä chore(ngdocs): setup karma-docs testing suite to test docs components
matsko authored
89 docs: 'karma-docs.conf.js',
c2e215f Vojta Jina chore: use Karma
vojtajina authored
90 modules: 'karma-modules.conf.js',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
91 //NOTE run grunt test:e2e instead and it will start a webserver for you
c2e215f Vojta Jina chore: use Karma
vojtajina authored
92 end2end: 'karma-e2e.conf.js'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
93 },
94
95
96 autotest: {
c2e215f Vojta Jina chore: use Karma
vojtajina authored
97 jqlite: 'karma-jqlite.conf.js',
63c1e5b Igor Minar chore(grunt): add autotest:modules target
IgorMinar authored
98 jquery: 'karma-jquery.conf.js',
77c4fc6 Matias Niemelä chore(ngdocs): setup karma-docs testing suite to test docs components
matsko authored
99 modules: 'karma-modules.conf.js',
05b41ee Matias Niemelä fix(grunt): ensure all dependent tasks are called for all test task
matsko authored
100 docs: 'karma-docs.conf.js'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
101 },
102
103
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
104 clean: {
105 build: ['build'],
106 tmp: ['tmp']
107 },
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
108
934a95d Pete Bacon Darwin chore(grunt): add jshint tasks
petebacondarwin authored
109 jshint: {
05ef1bd chore(grunt): update to latest jshint task
James Brewer authored
110 options: {
111 jshintrc: true,
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 },
125 ngMock: {
126 files: { src: 'src/ngMock/**/*.js' },
127 },
128 ngResource: {
129 files: { src: 'src/ngResource/**/*.js' },
130 },
131 ngRoute: {
132 files: { src: 'src/ngRoute/**/*.js' },
133 },
134 ngSanitize: {
135 files: { src: 'src/ngSanitize/**/*.js' },
136 },
137 ngScenario: {
138 files: { src: 'src/ngScenario/**/*.js' },
139 },
140 ngTouch: {
141 files: { src: 'src/ngTouch/**/*.js' },
142 }
143 },
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
144
145 build: {
146 scenario: {
147 dest: 'build/angular-scenario.js',
148 src: [
576269b Ken Sheedlo fix(bower): update bower usage and resources
ksheedlo authored
149 'bower_components/jquery/jquery.js',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
150 util.wrap([files['angularSrc'], files['angularScenario']], 'ngScenario/angular')
151 ],
152 styles: {
153 css: ['css/angular.css', 'css/angular-scenario.css']
154 }
155 },
156 angular: {
157 dest: 'build/angular.js',
158 src: util.wrap([files['angularSrc']], 'angular'),
159 styles: {
160 css: ['css/angular.css'],
a86cf20 Tobias Bosch fix: don't inline css in csp mode.
tbosch authored
161 generateCspCssFile: true,
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
162 minify: true
163 }
164 },
165 loader: {
166 dest: 'build/angular-loader.js',
934a95d Pete Bacon Darwin chore(grunt): add jshint tasks
petebacondarwin authored
167 src: util.wrap(files['angularLoader'], 'loader')
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
168 },
94ec84e Brian Ford chore(ngMobile): rename module ngTouch and file to angular-touch.js
btford authored
169 touch: {
170 dest: 'build/angular-touch.js',
934a95d Pete Bacon Darwin chore(grunt): add jshint tasks
petebacondarwin authored
171 src: util.wrap(files['angularModules']['ngTouch'], 'module')
707c65d feat(ngMobile): add ngMobile module with mobile-specific ngClick
Braden Shepherdson authored
172 },
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
173 mocks: {
174 dest: 'build/angular-mocks.js',
5bd6596 David Mosher chore(mocks): wrap angular-mocks.js in closure
davemo authored
175 src: util.wrap(files['angularModules']['ngMock'], 'module'),
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
176 strict: false
177 },
178 sanitize: {
179 dest: 'build/angular-sanitize.js',
934a95d Pete Bacon Darwin chore(grunt): add jshint tasks
petebacondarwin authored
180 src: util.wrap(files['angularModules']['ngSanitize'], 'module')
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
181 },
182 resource: {
183 dest: 'build/angular-resource.js',
934a95d Pete Bacon Darwin chore(grunt): add jshint tasks
petebacondarwin authored
184 src: util.wrap(files['angularModules']['ngResource'], 'module')
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
185 },
81923f1 Matias Niemelä feat(ngAnimate): complete rewrite of animations
matsko authored
186 animate: {
187 dest: 'build/angular-animate.js',
934a95d Pete Bacon Darwin chore(grunt): add jshint tasks
petebacondarwin authored
188 src: util.wrap(files['angularModules']['ngAnimate'], 'module')
81923f1 Matias Niemelä feat(ngAnimate): complete rewrite of animations
matsko authored
189 },
5599b55 Igor Minar refactor($route): pull $route and friends into angular-route.js
IgorMinar authored
190 route: {
191 dest: 'build/angular-route.js',
934a95d Pete Bacon Darwin chore(grunt): add jshint tasks
petebacondarwin authored
192 src: util.wrap(files['angularModules']['ngRoute'], 'module')
5599b55 Igor Minar refactor($route): pull $route and friends into angular-route.js
IgorMinar authored
193 },
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
194 cookies: {
195 dest: 'build/angular-cookies.js',
934a95d Pete Bacon Darwin chore(grunt): add jshint tasks
petebacondarwin authored
196 src: util.wrap(files['angularModules']['ngCookies'], 'module')
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
197 },
198 "promises-aplus-adapter": {
199 dest:'tmp/promises-aplus-adapter++.js',
200 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
201 }
202 },
203
204
205 min: {
206 angular: 'build/angular.js',
81923f1 Matias Niemelä feat(ngAnimate): complete rewrite of animations
matsko authored
207 animate: 'build/angular-animate.js',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
208 cookies: 'build/angular-cookies.js',
209 loader: 'build/angular-loader.js',
94ec84e Brian Ford chore(ngMobile): rename module ngTouch and file to angular-touch.js
btford authored
210 touch: 'build/angular-touch.js',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
211 resource: 'build/angular-resource.js',
5599b55 Igor Minar refactor($route): pull $route and friends into angular-route.js
IgorMinar authored
212 route: 'build/angular-route.js',
f56125d Matias Niemelä chore(ngdocs): setup bower as the package manager for the docs pages
matsko authored
213 sanitize: 'build/angular-sanitize.js'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
214 },
215
216
217 docs: {
218 process: ['build/docs/*.html', 'build/docs/.htaccess']
219 },
220
c317a7b Pete Bacon Darwin chore(grunt): grunt-jasmine-node uses different config
petebacondarwin authored
221 "jasmine_node": {
222 projectRoot: 'docs/spec'
71bc1b7 Pete Bacon Darwin chore(doc_gen): add task to run doc-gen specs
petebacondarwin authored
223 },
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
224
31631b2 Brian Ford chore(build): add check for merge conflicts, ddescribe, and iit
btford authored
225 "ddescribe-iit": {
226 files: [
227 'test/**/*.js',
228 '!test/ngScenario/DescribeSpec.js'
229 ]
230 },
231
232 "merge-conflict": {
233 files: [
234 'src/**/*',
235 'test/**/*',
236 'docs/**/*',
237 'css/**/*'
238 ]
239 },
240
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
241 copy: {
242 i18n: {
243 files: [
244 { src: 'src/ngLocale/**', dest: 'build/i18n/', expand: true, flatten: true }
245 ]
246 }
247 },
248
249
250 compress: {
251 build: {
79a88ec Igor Minar chore(grunt): ensure that grunt uses zip for compression
IgorMinar authored
252 options: {archive: 'build/' + dist +'.zip', mode: 'zip'},
d38d844 Igor Minar chore(Grunt): include dot files in the final zip
IgorMinar authored
253 src: ['**'], cwd: 'build', expand: true, dot: true, dest: dist + '/'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
254 }
255 },
256
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
257 shell:{
258 "promises-aplus-tests":{
259 options:{
260 //stdout:true,
261 stderr:true,
262 failOnError:true
263 },
265f0b5 Pete Bacon Darwin fix(build): get promise A+ tests to run on windows
petebacondarwin authored
264 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
265 }
266 },
267
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
268
269 write: {
270 versionTXT: {file: 'build/version.txt', val: NG_VERSION.full},
271 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
272 },
273
274 bump: {
275 options: {
276 files: ['package.json'],
277 commit: false,
278 createTag: false,
279 push: false
280 }
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
281 }
282 });
283
284
285 //alias tasks
3e79c9b Pete Bacon Darwin chore(grunt): add jshint to the test task
petebacondarwin authored
286 grunt.registerTask('test', 'Run unit, docs and e2e tests with Karma', ['jshint', 'package','test:unit','test:promises-aplus', 'tests:docs', 'test:e2e']);
953fa4c Matias Niemelä chore(grunt): fix up the help text for the new test commands
matsko authored
287 grunt.registerTask('test:jqlite', 'Run the unit tests with Karma' , ['tests:jqlite']);
288 grunt.registerTask('test:jquery', 'Run the jQuery unit tests with Karma', ['tests:jquery']);
289 grunt.registerTask('test:modules', 'Run the Karma module tests with Karma', ['tests:modules']);
290 grunt.registerTask('test:docs', 'Run the doc-page tests with Karma', ['package', 'tests:docs']);
291 grunt.registerTask('test:unit', 'Run unit, jQuery and Karma module tests with Karma', ['tests:jqlite', 'tests:jquery', 'tests:modules']);
292 grunt.registerTask('test:e2e', 'Run the end to end tests with Karma and keep a test server running in the background', ['connect:testserver', 'tests:end2end']);
c317a7b Pete Bacon Darwin chore(grunt): grunt-jasmine-node uses different config
petebacondarwin authored
293 grunt.registerTask('test:docgen', ['jasmine_node']);
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
294 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
295
aa5a162 Ken Sheedlo chore(bower): write grunt task for running bower
ksheedlo authored
296 grunt.registerTask('minify', ['bower','clean', 'build', 'minall']);
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
297 grunt.registerTask('webserver', ['connect:devserver']);
aa5a162 Ken Sheedlo chore(bower): write grunt task for running bower
ksheedlo authored
298 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
299 grunt.registerTask('package-without-bower', ['clean', 'buildall', 'minall', 'collect-errors', 'docs', 'copy', 'write', 'compress']);
d5c5e2b Vojta Jina chore: run docs unit test only once
vojtajina authored
300 grunt.registerTask('ci-checks', ['ddescribe-iit', 'merge-conflict', 'jshint']);
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
301 grunt.registerTask('default', ['package']);
302 };
Something went wrong with that request. Please try again.