forked from Polymer/polymer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgruntfile.js
90 lines (85 loc) · 2.04 KB
/
gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
* Copyright 2013 The Toolkitchen Authors. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
module.exports = function(grunt) {
Toolkit = [
'src/lang.js',
'src/oop.js',
'src/register.js',
'src/bindProperties.js',
'src/bindMDV.js',
'src/attrs.js',
'src/marshal.js',
'src/events.js',
'src/observeProperties.js',
'src/styling.js',
'src/path.js',
'src/boot.js'
];
// karma setup
var browsers;
(function() {
try {
var config = grunt.file.readJSON('local.json');
if (config.browsers) {
browsers = config.browsers;
}
} catch (e) {
var os = require('os');
browsers = ['Chrome', 'Firefox'];
if (os.type() === 'Darwin') {
browsers.push('ChromeCanary');
}
if (os.type() === 'Windows_NT') {
browsers.push('IE');
}
}
})();
grunt.initConfig({
karma: {
toolkit: {
configFile: 'conf/karma.conf.js',
browsers: browsers,
keepalive: true
}
},
uglify: {
Toolkit: {
options: {
},
files: {
'toolkit.min.js': Toolkit
}
}
},
yuidoc: {
compile: {
name: '<%= pkg.name %>',
description: '<%= pkg.description %>',
version: '<%= pkg.version %>',
url: '<%= pkg.homepage %>',
options: {
exclude: 'third_party',
extension: '.js,.html',
paths: '.',
outdir: 'docs',
linkNatives: 'true',
tabtospace: 2,
themedir: '../docs/doc_themes/bootstrap'
}
}
},
pkg: grunt.file.readJSON('package.json')
});
// plugins
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-yuidoc');
grunt.loadNpmTasks('grunt-karma-0.9.1');
// tasks
grunt.registerTask('default', ['uglify']);
grunt.registerTask('minify', ['uglify']);
grunt.registerTask('docs', ['yuidoc']);
grunt.registerTask('test', ['karma']);
};