Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 172 lines (144 sloc) 4.613 kb
7a77fda 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();
ce53fbd Dave Geddes chore(Grunt): don't remove root dir from zip
geddski authored
13 var dist = 'angular-'+ NG_VERSION.full;
7a77fda 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,
5727eaf Igor Minar chore(Gruntfile): run webserver on 0.0.0.0
IgorMinar authored
28 hostname: '0.0.0.0',
7a77fda 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: {
91fa865 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',
7a77fda 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
91fa865 Vojta Jina chore: use Karma
vojtajina authored
52 end2end: 'karma-e2e.conf.js'
7a77fda Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
53 },
54
55
56 autotest: {
91fa865 Vojta Jina chore: use Karma
vojtajina authored
57 jqlite: 'karma-jqlite.conf.js',
58 jquery: 'karma-jquery.conf.js'
7a77fda 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 },
88 mocks: {
89 dest: 'build/angular-mocks.js',
90 src: ['src/ngMock/angular-mocks.js'],
91 strict: false
92 },
93 sanitize: {
94 dest: 'build/angular-sanitize.js',
95 src: util.wrap([
96 'src/ngSanitize/sanitize.js',
97 'src/ngSanitize/directive/ngBindHtml.js',
98 'src/ngSanitize/filter/linky.js',
99 ], 'module')
100 },
101 resource: {
102 dest: 'build/angular-resource.js',
103 src: util.wrap(['src/ngResource/resource.js'], 'module')
104 },
105 cookies: {
106 dest: 'build/angular-cookies.js',
107 src: util.wrap(['src/ngCookies/cookies.js'], 'module')
108 },
109 bootstrap: {
110 dest: 'build/angular-bootstrap.js',
111 src: util.wrap(['src/bootstrap/bootstrap.js'], 'module')
112 },
113 bootstrapPrettify: {
114 dest: 'build/angular-bootstrap-prettify.js',
115 src: util.wrap(['src/bootstrap/bootstrap-prettify.js', 'src/bootstrap/google-prettify/prettify.js'], 'module'),
116 styles: {
117 css: ['src/bootstrap/google-prettify/prettify.css'],
118 minify: true
119 }
120 }
121 },
122
123
124 min: {
125 angular: 'build/angular.js',
126 cookies: 'build/angular-cookies.js',
127 loader: 'build/angular-loader.js',
128 resource: 'build/angular-resource.js',
129 sanitize: 'build/angular-sanitize.js',
130 bootstrap: 'build/angular-bootstrap.js',
131 bootstrapPrettify: 'build/angular-bootstrap-prettify.js',
132 },
133
134
135 docs: {
136 process: ['build/docs/*.html', 'build/docs/.htaccess']
137 },
138
139
140 copy: {
141 i18n: {
142 files: [
143 { src: 'src/ngLocale/**', dest: 'build/i18n/', expand: true, flatten: true }
144 ]
145 }
146 },
147
148
149 compress: {
150 build: {
ce53fbd Dave Geddes chore(Grunt): don't remove root dir from zip
geddski authored
151 options: {archive: 'build/' + dist +'.zip'},
4816f7e Igor Minar chore(Grunt): include dot files in the final zip
IgorMinar authored
152 src: ['**'], cwd: 'build', expand: true, dot: true, dest: dist + '/'
7a77fda Dave Geddes chore(Grunt): switch from Rake to Grunt
geddski authored
153 }
154 },
155
156
157 write: {
158 versionTXT: {file: 'build/version.txt', val: NG_VERSION.full},
159 versionJSON: {file: 'build/version.json', val: JSON.stringify(NG_VERSION)}
160 }
161 });
162
163
164 //alias tasks
165 grunt.registerTask('test:unit', ['test:jqlite', 'test:jquery', 'test:modules']);
166 grunt.registerTask('minify', ['clean', 'build', 'minall']);
167 grunt.registerTask('test:e2e', ['connect:testserver', 'test:end2end']);
168 grunt.registerTask('webserver', ['connect:devserver']);
169 grunt.registerTask('package', ['clean', 'buildall', 'minall', 'docs', 'copy', 'write', 'compress']);
170 grunt.registerTask('default', ['package']);
171 };
Something went wrong with that request. Please try again.