Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 180 lines (152 sloc) 4.852 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',
92 'src/ngMobile/directive/ngClick.js'
93 ], 'module')
94 },
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
95 mocks: {
96 dest: 'build/angular-mocks.js',
97 src: ['src/ngMock/angular-mocks.js'],
98 strict: false
99 },
100 sanitize: {
101 dest: 'build/angular-sanitize.js',
102 src: util.wrap([
103 'src/ngSanitize/sanitize.js',
104 'src/ngSanitize/directive/ngBindHtml.js',
105 'src/ngSanitize/filter/linky.js',
106 ], 'module')
107 },
108 resource: {
109 dest: 'build/angular-resource.js',
110 src: util.wrap(['src/ngResource/resource.js'], 'module')
111 },
112 cookies: {
113 dest: 'build/angular-cookies.js',
114 src: util.wrap(['src/ngCookies/cookies.js'], 'module')
115 },
116 bootstrap: {
117 dest: 'build/angular-bootstrap.js',
118 src: util.wrap(['src/bootstrap/bootstrap.js'], 'module')
119 },
120 bootstrapPrettify: {
121 dest: 'build/angular-bootstrap-prettify.js',
122 src: util.wrap(['src/bootstrap/bootstrap-prettify.js', 'src/bootstrap/google-prettify/prettify.js'], 'module'),
123 styles: {
124 css: ['src/bootstrap/google-prettify/prettify.css'],
125 minify: true
126 }
127 }
128 },
129
130
131 min: {
132 angular: 'build/angular.js',
133 cookies: 'build/angular-cookies.js',
134 loader: 'build/angular-loader.js',
707c65d feat(ngMobile): add ngMobile module with mobile-specific ngClick
Braden Shepherdson authored
135 mobile: 'build/angular-mobile.js',
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
136 resource: 'build/angular-resource.js',
137 sanitize: 'build/angular-sanitize.js',
138 bootstrap: 'build/angular-bootstrap.js',
139 bootstrapPrettify: 'build/angular-bootstrap-prettify.js',
140 },
141
142
143 docs: {
144 process: ['build/docs/*.html', 'build/docs/.htaccess']
145 },
146
147
148 copy: {
149 i18n: {
150 files: [
151 { src: 'src/ngLocale/**', dest: 'build/i18n/', expand: true, flatten: true }
152 ]
153 }
154 },
155
156
157 compress: {
158 build: {
8a96393 Dave Geddes chore(Grunt): don't remove root dir from zip
geddski authored
159 options: {archive: 'build/' + dist +'.zip'},
d38d844 Igor Minar chore(Grunt): include dot files in the final zip
IgorMinar authored
160 src: ['**'], cwd: 'build', expand: true, dot: true, dest: dist + '/'
79b51d5 Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
161 }
162 },
163
164
165 write: {
166 versionTXT: {file: 'build/version.txt', val: NG_VERSION.full},
167 versionJSON: {file: 'build/version.json', val: JSON.stringify(NG_VERSION)}
168 }
169 });
170
171
172 //alias tasks
173 grunt.registerTask('test:unit', ['test:jqlite', 'test:jquery', 'test:modules']);
174 grunt.registerTask('minify', ['clean', 'build', 'minall']);
175 grunt.registerTask('test:e2e', ['connect:testserver', 'test:end2end']);
176 grunt.registerTask('webserver', ['connect:devserver']);
177 grunt.registerTask('package', ['clean', 'buildall', 'minall', 'docs', 'copy', 'write', 'compress']);
178 grunt.registerTask('default', ['package']);
179 };
Something went wrong with that request. Please try again.