Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 268 lines (234 sloc) 8.002 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');
3
4 module.exports = function(grunt) {
5 //grunt plugins
6 grunt.loadNpmTasks('grunt-contrib-clean');
7 grunt.loadNpmTasks('grunt-contrib-copy');
8 grunt.loadNpmTasks('grunt-contrib-connect');
9 grunt.loadNpmTasks('grunt-contrib-compress');
71bc1b7 Pete Bacon Darwin chore(doc_gen): add task to run doc-gen specs
petebacondarwin authored
10 grunt.loadNpmTasks('grunt-contrib-jasmine-node');
31631b2 Brian Ford chore(build): add check for merge conflicts, ddescribe, and iit
btford authored
11 grunt.loadNpmTasks('grunt-ddescribe-iit');
12 grunt.loadNpmTasks('grunt-merge-conflict');
2c2adbc Vojta Jina chore(travis): speed up the build
vojtajina authored
13 grunt.loadNpmTasks('grunt-parallel');
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
14 grunt.loadNpmTasks('grunt-shell');
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
15 grunt.loadTasks('lib/grunt');
16
17 var NG_VERSION = util.getVersion();
8a96393 Dave Geddes chore(Grunt): don't remove root dir from zip
geddski authored
18 var dist = 'angular-'+ NG_VERSION.full;
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
19
20
21 //global beforeEach
22 util.init();
23
24
25 //config
26 grunt.initConfig({
27 NG_VERSION: NG_VERSION,
28
2c2adbc Vojta Jina chore(travis): speed up the build
vojtajina authored
29 parallel: {
30 travis: {
31 tasks: [
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
32 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
33 util.parallelTask(['test:e2e'])
2c2adbc Vojta Jina chore(travis): speed up the build
vojtajina authored
34 ]
35 }
36 },
37
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
38 connect: {
39 devserver: {
40 options: {
41 port: 8000,
5fd39e0 Igor Minar chore(Gruntfile): run webserver on 0.0.0.0
IgorMinar authored
42 hostname: '0.0.0.0',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
43 base: '.',
44 keepalive: true,
45 middleware: function(connect, options){
46 return [
47 //uncomment to enable CSP
48 // util.csp(),
49 util.rewrite(),
50 connect.favicon('images/favicon.ico'),
51 connect.static(options.base),
52 connect.directory(options.base)
53 ];
54 }
55 }
56 },
2c2adbc Vojta Jina chore(travis): speed up the build
vojtajina authored
57 testserver: {
58 options: {
b73c46c Vojta Jina chore: fix Travis build
vojtajina authored
59 // We use end2end task (which does not start the webserver)
60 // and start the webserver as a separate process (in travis_build.sh)
61 // to avoid https://github.com/joyent/libuv/issues/826
62 port: 8000,
63 hostname: '0.0.0.0',
2c2adbc Vojta Jina chore(travis): speed up the build
vojtajina authored
64 middleware: function(connect, options){
65 return [
66 function(req, resp, next) {
67 // cache get requests to speed up tests on travis
68 if (req.method === 'GET') {
69 resp.setHeader('Cache-control', 'public, max-age=3600');
70 }
71
72 next();
73 },
74 connect.favicon('images/favicon.ico'),
75 connect.static(options.base)
76 ];
77 }
78 }
79 }
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
80 },
81
82
05b41ee Matias Niemelä fix(grunt): ensure all dependent tasks are called for all test task
matsko authored
83 tests: {
c2e215f Vojta Jina chore: use Karma
vojtajina authored
84 jqlite: 'karma-jqlite.conf.js',
85 jquery: 'karma-jquery.conf.js',
77c4fc6 Matias Niemelä chore(ngdocs): setup karma-docs testing suite to test docs components
matsko authored
86 docs: 'karma-docs.conf.js',
c2e215f Vojta Jina chore: use Karma
vojtajina authored
87 modules: 'karma-modules.conf.js',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
88 //NOTE run grunt test:e2e instead and it will start a webserver for you
c2e215f Vojta Jina chore: use Karma
vojtajina authored
89 end2end: 'karma-e2e.conf.js'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
90 },
91
92
93 autotest: {
c2e215f Vojta Jina chore: use Karma
vojtajina authored
94 jqlite: 'karma-jqlite.conf.js',
63c1e5b Igor Minar chore(grunt): add autotest:modules target
IgorMinar authored
95 jquery: 'karma-jquery.conf.js',
77c4fc6 Matias Niemelä chore(ngdocs): setup karma-docs testing suite to test docs components
matsko authored
96 modules: 'karma-modules.conf.js',
05b41ee Matias Niemelä fix(grunt): ensure all dependent tasks are called for all test task
matsko authored
97 docs: 'karma-docs.conf.js'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski 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
106
107 build: {
108 scenario: {
109 dest: 'build/angular-scenario.js',
110 src: [
576269b Ken Sheedlo fix(bower): update bower usage and resources
ksheedlo authored
111 'bower_components/jquery/jquery.js',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
112 util.wrap([files['angularSrc'], files['angularScenario']], 'ngScenario/angular')
113 ],
114 styles: {
115 css: ['css/angular.css', 'css/angular-scenario.css']
116 }
117 },
118 angular: {
119 dest: 'build/angular.js',
120 src: util.wrap([files['angularSrc']], 'angular'),
121 styles: {
122 css: ['css/angular.css'],
123 minify: true
124 }
125 },
126 loader: {
127 dest: 'build/angular-loader.js',
128 src: util.wrap(['src/loader.js'], 'loader')
129 },
94ec84e Brian Ford chore(ngMobile): rename module ngTouch and file to angular-touch.js
btford authored
130 touch: {
131 dest: 'build/angular-touch.js',
707c65d feat(ngMobile): add ngMobile module with mobile-specific ngClick
Braden Shepherdson authored
132 src: util.wrap([
94ec84e Brian Ford chore(ngMobile): rename module ngTouch and file to angular-touch.js
btford authored
133 'src/ngTouch/touch.js',
134 'src/ngTouch/swipe.js',
135 'src/ngTouch/directive/ngClick.js',
136 'src/ngTouch/directive/ngSwipe.js'
707c65d feat(ngMobile): add ngMobile module with mobile-specific ngClick
Braden Shepherdson authored
137 ], 'module')
138 },
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
139 mocks: {
140 dest: 'build/angular-mocks.js',
141 src: ['src/ngMock/angular-mocks.js'],
142 strict: false
143 },
144 sanitize: {
145 dest: 'build/angular-sanitize.js',
146 src: util.wrap([
147 'src/ngSanitize/sanitize.js',
5599b55 Igor Minar refactor($route): pull $route and friends into angular-route.js
IgorMinar authored
148 'src/ngSanitize/filter/linky.js'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
149 ], 'module')
150 },
151 resource: {
152 dest: 'build/angular-resource.js',
153 src: util.wrap(['src/ngResource/resource.js'], 'module')
154 },
81923f1 Matias Niemelä feat(ngAnimate): complete rewrite of animations
matsko authored
155 animate: {
156 dest: 'build/angular-animate.js',
157 src: util.wrap(['src/ngAnimate/animate.js'], 'module')
158 },
5599b55 Igor Minar refactor($route): pull $route and friends into angular-route.js
IgorMinar authored
159 route: {
160 dest: 'build/angular-route.js',
161 src: util.wrap([
162 'src/ngRoute/routeUtils.js',
163 'src/ngRoute/route.js',
164 'src/ngRoute/routeParams.js',
165 'src/ngRoute/directive/ngView.js'
166 ], 'module')
167 },
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
168 cookies: {
169 dest: 'build/angular-cookies.js',
170 src: util.wrap(['src/ngCookies/cookies.js'], 'module')
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
171 },
172 "promises-aplus-adapter": {
173 dest:'tmp/promises-aplus-adapter++.js',
174 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
175 }
176 },
177
178
179 min: {
180 angular: 'build/angular.js',
81923f1 Matias Niemelä feat(ngAnimate): complete rewrite of animations
matsko authored
181 animate: 'build/angular-animate.js',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
182 cookies: 'build/angular-cookies.js',
183 loader: 'build/angular-loader.js',
94ec84e Brian Ford chore(ngMobile): rename module ngTouch and file to angular-touch.js
btford authored
184 touch: 'build/angular-touch.js',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
185 resource: 'build/angular-resource.js',
5599b55 Igor Minar refactor($route): pull $route and friends into angular-route.js
IgorMinar authored
186 route: 'build/angular-route.js',
f56125d Matias Niemelä chore(ngdocs): setup bower as the package manager for the docs pages
matsko authored
187 sanitize: 'build/angular-sanitize.js'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
188 },
189
190
191 docs: {
192 process: ['build/docs/*.html', 'build/docs/.htaccess']
193 },
194
71bc1b7 Pete Bacon Darwin chore(doc_gen): add task to run doc-gen specs
petebacondarwin authored
195 "jasmine-node": {
196 run: { spec: 'docs/spec' }
197 },
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
198
31631b2 Brian Ford chore(build): add check for merge conflicts, ddescribe, and iit
btford authored
199 "ddescribe-iit": {
200 files: [
201 'test/**/*.js',
202 '!test/ngScenario/DescribeSpec.js'
203 ]
204 },
205
206 "merge-conflict": {
207 files: [
208 'src/**/*',
209 'test/**/*',
210 'docs/**/*',
211 'css/**/*'
212 ]
213 },
214
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
215 copy: {
216 i18n: {
217 files: [
218 { src: 'src/ngLocale/**', dest: 'build/i18n/', expand: true, flatten: true }
219 ]
220 }
221 },
222
223
224 compress: {
225 build: {
79a88ec Igor Minar chore(grunt): ensure that grunt uses zip for compression
IgorMinar authored
226 options: {archive: 'build/' + dist +'.zip', mode: 'zip'},
d38d844 Igor Minar chore(Grunt): include dot files in the final zip
IgorMinar authored
227 src: ['**'], cwd: 'build', expand: true, dot: true, dest: dist + '/'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
228 }
229 },
230
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
231 shell:{
232 "promises-aplus-tests":{
233 options:{
234 //stdout:true,
235 stderr:true,
236 failOnError:true
237 },
238 command:'./node_modules/.bin/promises-aplus-tests tmp/promises-aplus-adapter++.js'
239 }
240 },
241
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
242
243 write: {
244 versionTXT: {file: 'build/version.txt', val: NG_VERSION.full},
245 versionJSON: {file: 'build/version.json', val: JSON.stringify(NG_VERSION)}
246 }
247 });
248
249
250 //alias tasks
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
251 grunt.registerTask('test', 'Run unit, docs and e2e tests with Karma', ['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
252 grunt.registerTask('test:jqlite', 'Run the unit tests with Karma' , ['tests:jqlite']);
253 grunt.registerTask('test:jquery', 'Run the jQuery unit tests with Karma', ['tests:jquery']);
254 grunt.registerTask('test:modules', 'Run the Karma module tests with Karma', ['tests:modules']);
255 grunt.registerTask('test:docs', 'Run the doc-page tests with Karma', ['package', 'tests:docs']);
256 grunt.registerTask('test:unit', 'Run unit, jQuery and Karma module tests with Karma', ['tests:jqlite', 'tests:jquery', 'tests:modules']);
257 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']);
71bc1b7 Pete Bacon Darwin chore(doc_gen): add task to run doc-gen specs
petebacondarwin authored
258 grunt.registerTask('test:docgen', ['jasmine-node']);
e848099 James Talmage chore(tests): add Promises/A+ Test Suite to the build
jamestalmage authored
259 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
260
aa5a162 Ken Sheedlo chore(bower): write grunt task for running bower
ksheedlo authored
261 grunt.registerTask('minify', ['bower','clean', 'build', 'minall']);
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
262 grunt.registerTask('webserver', ['connect:devserver']);
aa5a162 Ken Sheedlo chore(bower): write grunt task for running bower
ksheedlo authored
263 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
264 grunt.registerTask('package-without-bower', ['clean', 'buildall', 'minall', 'collect-errors', 'docs', 'copy', 'write', 'compress']);
31631b2 Brian Ford chore(build): add check for merge conflicts, ddescribe, and iit
btford authored
265 grunt.registerTask('ci-checks', ['ddescribe-iit', 'merge-conflict']);
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
266 grunt.registerTask('default', ['package']);
267 };
Something went wrong with that request. Please try again.