Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 248 lines (215 sloc) 7.086 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');
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
14 grunt.loadTasks('lib/grunt');
15
16 var NG_VERSION = util.getVersion();
8a96393 Dave Geddes chore(Grunt): don't remove root dir from zip
geddski authored
17 var dist = 'angular-'+ NG_VERSION.full;
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
18
19
20 //global beforeEach
21 util.init();
22
23
24 //config
25 grunt.initConfig({
26 NG_VERSION: NG_VERSION,
27
2c2adbc Vojta Jina chore(travis): speed up the build
vojtajina authored
28 parallel: {
29 travis: {
30 options: {
d88dc4a Pete Bacon Darwin chore(grunt): tweak ng-closure-runner setup
petebacondarwin authored
31 stream: true
2c2adbc Vojta Jina chore(travis): speed up the build
vojtajina authored
32 },
33 tasks: [
05b41ee Matias Niemelä fix(grunt): ensure all dependent tasks are called for all test task
matsko authored
34 util.parallelTask('tests:docs'),
35 util.parallelTask('tests:modules'),
36 util.parallelTask('tests:jquery'),
37 util.parallelTask('tests:jqlite'),
38 util.parallelTask('tests:end2end')
2c2adbc Vojta Jina chore(travis): speed up the build
vojtajina authored
39 ]
40 }
41 },
42
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
43 connect: {
44 devserver: {
45 options: {
46 port: 8000,
5fd39e0 Igor Minar chore(Gruntfile): run webserver on 0.0.0.0
IgorMinar authored
47 hostname: '0.0.0.0',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
48 base: '.',
49 keepalive: true,
50 middleware: function(connect, options){
51 return [
52 //uncomment to enable CSP
53 // util.csp(),
54 util.rewrite(),
55 connect.favicon('images/favicon.ico'),
56 connect.static(options.base),
57 connect.directory(options.base)
58 ];
59 }
60 }
61 },
2c2adbc Vojta Jina chore(travis): speed up the build
vojtajina authored
62 testserver: {
63 options: {
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
101 clean: {build: ['build']},
102
103
104 build: {
105 scenario: {
106 dest: 'build/angular-scenario.js',
107 src: [
576269b Ken Sheedlo fix(bower): update bower usage and resources
ksheedlo authored
108 'bower_components/jquery/jquery.js',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
109 util.wrap([files['angularSrc'], files['angularScenario']], 'ngScenario/angular')
110 ],
111 styles: {
112 css: ['css/angular.css', 'css/angular-scenario.css']
113 }
114 },
115 angular: {
116 dest: 'build/angular.js',
117 src: util.wrap([files['angularSrc']], 'angular'),
118 styles: {
119 css: ['css/angular.css'],
120 minify: true
121 }
122 },
123 loader: {
124 dest: 'build/angular-loader.js',
125 src: util.wrap(['src/loader.js'], 'loader')
126 },
94ec84e Brian Ford chore(ngMobile): rename module ngTouch and file to angular-touch.js
btford authored
127 touch: {
128 dest: 'build/angular-touch.js',
707c65d feat(ngMobile): add ngMobile module with mobile-specific ngClick
Braden Shepherdson authored
129 src: util.wrap([
94ec84e Brian Ford chore(ngMobile): rename module ngTouch and file to angular-touch.js
btford authored
130 'src/ngTouch/touch.js',
131 'src/ngTouch/swipe.js',
132 'src/ngTouch/directive/ngClick.js',
133 'src/ngTouch/directive/ngSwipe.js'
707c65d feat(ngMobile): add ngMobile module with mobile-specific ngClick
Braden Shepherdson authored
134 ], 'module')
135 },
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
136 mocks: {
137 dest: 'build/angular-mocks.js',
138 src: ['src/ngMock/angular-mocks.js'],
139 strict: false
140 },
141 sanitize: {
142 dest: 'build/angular-sanitize.js',
143 src: util.wrap([
144 'src/ngSanitize/sanitize.js',
5599b55 Igor Minar refactor($route): pull $route and friends into angular-route.js
IgorMinar authored
145 'src/ngSanitize/filter/linky.js'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
146 ], 'module')
147 },
148 resource: {
149 dest: 'build/angular-resource.js',
150 src: util.wrap(['src/ngResource/resource.js'], 'module')
151 },
81923f1 Matias Niemelä feat(ngAnimate): complete rewrite of animations
matsko authored
152 animate: {
153 dest: 'build/angular-animate.js',
154 src: util.wrap(['src/ngAnimate/animate.js'], 'module')
155 },
5599b55 Igor Minar refactor($route): pull $route and friends into angular-route.js
IgorMinar authored
156 route: {
157 dest: 'build/angular-route.js',
158 src: util.wrap([
159 'src/ngRoute/routeUtils.js',
160 'src/ngRoute/route.js',
161 'src/ngRoute/routeParams.js',
162 'src/ngRoute/directive/ngView.js'
163 ], 'module')
164 },
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
165 cookies: {
166 dest: 'build/angular-cookies.js',
167 src: util.wrap(['src/ngCookies/cookies.js'], 'module')
168 }
169 },
170
171
172 min: {
173 angular: 'build/angular.js',
81923f1 Matias Niemelä feat(ngAnimate): complete rewrite of animations
matsko authored
174 animate: 'build/angular-animate.js',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
175 cookies: 'build/angular-cookies.js',
176 loader: 'build/angular-loader.js',
94ec84e Brian Ford chore(ngMobile): rename module ngTouch and file to angular-touch.js
btford authored
177 touch: 'build/angular-touch.js',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
178 resource: 'build/angular-resource.js',
5599b55 Igor Minar refactor($route): pull $route and friends into angular-route.js
IgorMinar authored
179 route: 'build/angular-route.js',
f56125d Matias Niemelä chore(ngdocs): setup bower as the package manager for the docs pages
matsko authored
180 sanitize: 'build/angular-sanitize.js'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
181 },
182
183
184 docs: {
185 process: ['build/docs/*.html', 'build/docs/.htaccess']
186 },
187
71bc1b7 Pete Bacon Darwin chore(doc_gen): add task to run doc-gen specs
petebacondarwin authored
188 "jasmine-node": {
189 run: { spec: 'docs/spec' }
190 },
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
191
31631b2 Brian Ford chore(build): add check for merge conflicts, ddescribe, and iit
btford authored
192 "ddescribe-iit": {
193 files: [
194 'test/**/*.js',
195 '!test/ngScenario/DescribeSpec.js'
196 ]
197 },
198
199 "merge-conflict": {
200 files: [
201 'src/**/*',
202 'test/**/*',
203 'docs/**/*',
204 'css/**/*'
205 ]
206 },
207
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
208 copy: {
209 i18n: {
210 files: [
211 { src: 'src/ngLocale/**', dest: 'build/i18n/', expand: true, flatten: true }
212 ]
213 }
214 },
215
216
217 compress: {
218 build: {
8a96393 Dave Geddes chore(Grunt): don't remove root dir from zip
geddski authored
219 options: {archive: 'build/' + dist +'.zip'},
d38d844 Igor Minar chore(Grunt): include dot files in the final zip
IgorMinar authored
220 src: ['**'], cwd: 'build', expand: true, dot: true, dest: dist + '/'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
221 }
222 },
223
224
225 write: {
226 versionTXT: {file: 'build/version.txt', val: NG_VERSION.full},
227 versionJSON: {file: 'build/version.json', val: JSON.stringify(NG_VERSION)}
228 }
229 });
230
231
232 //alias tasks
953fa4c Matias Niemelä chore(grunt): fix up the help text for the new test commands
matsko authored
233 grunt.registerTask('test', 'Run unit, docs and e2e tests with Karma', ['package','test:unit', 'tests:docs', 'test:e2e']);
234 grunt.registerTask('test:jqlite', 'Run the unit tests with Karma' , ['tests:jqlite']);
235 grunt.registerTask('test:jquery', 'Run the jQuery unit tests with Karma', ['tests:jquery']);
236 grunt.registerTask('test:modules', 'Run the Karma module tests with Karma', ['tests:modules']);
237 grunt.registerTask('test:docs', 'Run the doc-page tests with Karma', ['package', 'tests:docs']);
238 grunt.registerTask('test:unit', 'Run unit, jQuery and Karma module tests with Karma', ['tests:jqlite', 'tests:jquery', 'tests:modules']);
239 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
240 grunt.registerTask('test:docgen', ['jasmine-node']);
05b41ee Matias Niemelä fix(grunt): ensure all dependent tasks are called for all test task
matsko authored
241
aa5a162 Ken Sheedlo chore(bower): write grunt task for running bower
ksheedlo authored
242 grunt.registerTask('minify', ['bower','clean', 'build', 'minall']);
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
243 grunt.registerTask('webserver', ['connect:devserver']);
aa5a162 Ken Sheedlo chore(bower): write grunt task for running bower
ksheedlo authored
244 grunt.registerTask('package', ['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
245 grunt.registerTask('ci-checks', ['ddescribe-iit', 'merge-conflict']);
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
246 grunt.registerTask('default', ['package']);
247 };
Something went wrong with that request. Please try again.