Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 181 lines (153 sloc) 5.011 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');
10 grunt.loadTasks('lib/grunt');
11
12 var NG_VERSION = util.getVersion();
8a96393 Dave Geddes chore(Grunt): don't remove root dir from zip
geddski authored
13 var dist = 'angular-'+ NG_VERSION.full;
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
14
15
16 //global beforeEach
17 util.init();
18
19
20 //config
21 grunt.initConfig({
22 NG_VERSION: NG_VERSION,
23
24 connect: {
25 devserver: {
26 options: {
27 port: 8000,
5fd39e0 Igor Minar chore(Gruntfile): run webserver on 0.0.0.0
IgorMinar authored
28 hostname: '0.0.0.0',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
29 base: '.',
30 keepalive: true,
31 middleware: function(connect, options){
32 return [
33 //uncomment to enable CSP
34 // util.csp(),
35 util.rewrite(),
36 connect.favicon('images/favicon.ico'),
37 connect.static(options.base),
38 connect.directory(options.base)
39 ];
40 }
41 }
42 },
43 testserver: {}
44 },
45
46
47 test: {
c2e215f Vojta Jina chore: use Karma
vojtajina authored
48 jqlite: 'karma-jqlite.conf.js',
49 jquery: 'karma-jquery.conf.js',
50 modules: 'karma-modules.conf.js',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
51 //NOTE run grunt test:e2e instead and it will start a webserver for you
c2e215f Vojta Jina chore: use Karma
vojtajina authored
52 end2end: 'karma-e2e.conf.js'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
53 },
54
55
56 autotest: {
c2e215f Vojta Jina chore: use Karma
vojtajina authored
57 jqlite: 'karma-jqlite.conf.js',
58 jquery: 'karma-jquery.conf.js'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
59 },
60
61
62 clean: {build: ['build']},
63
64
65 build: {
66 scenario: {
67 dest: 'build/angular-scenario.js',
68 src: [
69 'lib/jquery/jquery.js',
70 util.wrap([files['angularSrc'], files['angularScenario']], 'ngScenario/angular')
71 ],
72 styles: {
73 css: ['css/angular.css', 'css/angular-scenario.css']
74 }
75 },
76 angular: {
77 dest: 'build/angular.js',
78 src: util.wrap([files['angularSrc']], 'angular'),
79 styles: {
80 css: ['css/angular.css'],
81 minify: true
82 }
83 },
84 loader: {
85 dest: 'build/angular-loader.js',
86 src: util.wrap(['src/loader.js'], 'loader')
87 },
707c65d feat(ngMobile): add ngMobile module with mobile-specific ngClick
Braden Shepherdson authored
88 mobile: {
89 dest: 'build/angular-mobile.js',
90 src: util.wrap([
91 'src/ngMobile/mobile.js',
5e0f876 feat(ngSwipe): Add ngSwipeRight/Left directives to ngMobile
Braden Shepherdson authored
92 'src/ngMobile/directive/ngClick.js',
93 'src/ngMobile/directive/ngSwipe.js'
707c65d feat(ngMobile): add ngMobile module with mobile-specific ngClick
Braden Shepherdson authored
94 ], 'module')
95 },
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
96 mocks: {
97 dest: 'build/angular-mocks.js',
98 src: ['src/ngMock/angular-mocks.js'],
99 strict: false
100 },
101 sanitize: {
102 dest: 'build/angular-sanitize.js',
103 src: util.wrap([
104 'src/ngSanitize/sanitize.js',
105 'src/ngSanitize/directive/ngBindHtml.js',
106 'src/ngSanitize/filter/linky.js',
107 ], 'module')
108 },
109 resource: {
110 dest: 'build/angular-resource.js',
111 src: util.wrap(['src/ngResource/resource.js'], 'module')
112 },
113 cookies: {
114 dest: 'build/angular-cookies.js',
115 src: util.wrap(['src/ngCookies/cookies.js'], 'module')
116 },
117 bootstrap: {
2f571a9 Matias Niemelä chore(ngdocs): move angular-bootstrap.js to be generated only inside the...
matsko authored
118 dest: 'build/docs/components/angular-bootstrap.js',
119 src: util.wrap(['docs/components/bootstrap/bootstrap.js'], 'module')
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
120 },
121 bootstrapPrettify: {
2f571a9 Matias Niemelä chore(ngdocs): move angular-bootstrap.js to be generated only inside the...
matsko authored
122 dest: 'build/docs/components/angular-bootstrap-prettify.js',
123 src: util.wrap(['docs/components/bootstrap/bootstrap-prettify.js', 'docs/components/bootstrap/google-prettify/prettify.js'], 'module'),
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
124 styles: {
2f571a9 Matias Niemelä chore(ngdocs): move angular-bootstrap.js to be generated only inside the...
matsko authored
125 css: ['docs/components/bootstrap/google-prettify/prettify.css'],
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
126 minify: true
127 }
128 }
129 },
130
131
132 min: {
133 angular: 'build/angular.js',
134 cookies: 'build/angular-cookies.js',
135 loader: 'build/angular-loader.js',
707c65d feat(ngMobile): add ngMobile module with mobile-specific ngClick
Braden Shepherdson authored
136 mobile: 'build/angular-mobile.js',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
137 resource: 'build/angular-resource.js',
138 sanitize: 'build/angular-sanitize.js',
2f571a9 Matias Niemelä chore(ngdocs): move angular-bootstrap.js to be generated only inside the...
matsko authored
139 bootstrap: 'build/docs/components/angular-bootstrap.js',
140 bootstrapPrettify: 'build/docs/components/angular-bootstrap-prettify.js',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
141 },
142
143
144 docs: {
145 process: ['build/docs/*.html', 'build/docs/.htaccess']
146 },
147
148
149 copy: {
150 i18n: {
151 files: [
152 { src: 'src/ngLocale/**', dest: 'build/i18n/', expand: true, flatten: true }
153 ]
154 }
155 },
156
157
158 compress: {
159 build: {
8a96393 Dave Geddes chore(Grunt): don't remove root dir from zip
geddski authored
160 options: {archive: 'build/' + dist +'.zip'},
d38d844 Igor Minar chore(Grunt): include dot files in the final zip
IgorMinar authored
161 src: ['**'], cwd: 'build', expand: true, dot: true, dest: dist + '/'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
162 }
163 },
164
165
166 write: {
167 versionTXT: {file: 'build/version.txt', val: NG_VERSION.full},
168 versionJSON: {file: 'build/version.json', val: JSON.stringify(NG_VERSION)}
169 }
170 });
171
172
173 //alias tasks
174 grunt.registerTask('test:unit', ['test:jqlite', 'test:jquery', 'test:modules']);
175 grunt.registerTask('minify', ['clean', 'build', 'minall']);
176 grunt.registerTask('test:e2e', ['connect:testserver', 'test:end2end']);
177 grunt.registerTask('webserver', ['connect:devserver']);
178 grunt.registerTask('package', ['clean', 'buildall', 'minall', 'docs', 'copy', 'write', 'compress']);
179 grunt.registerTask('default', ['package']);
180 };
Something went wrong with that request. Please try again.