Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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