forked from Addepar/ember-table
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
108 lines (95 loc) · 2.77 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
module.exports = function (grunt) {
'use strict';
var path = require('path');
grunt.loadNpmTasks('grunt-banner');
grunt.loadNpmTasks('grunt-broccoli');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-release-it');
grunt.loadNpmTasks('grunt-text-replace');
// TODO(azirbel): We should register Ember Table, with its version, to Ember.Libraries
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: '/*!\n* <%=pkg.name %> v<%=pkg.version%>\n' +
'* Copyright 2012-<%=grunt.template.today("yyyy")%> Addepar Inc.\n' +
'* See LICENSE.md\n*/',
broccoli: {
dist: {
dest: 'dist',
config: 'packaging/Brocfile.js'
}
},
clean: ['tmp', 'ember-dist', 'node_modules', 'bower_components'],
replace: {
// The VERSION file for easy reference of the current version
global_version: {
src: ['VERSION'],
overwrite: true,
replacements: [{
from: /.*\..*\..*/,
to: '<%=pkg.version%>'
}]
},
// On the project homepage, there is a reference to the CHANGELOG and
// listing of the project's current version.
overview_page: {
src: ['tests/dummy/app/templates/overview.hbs'],
overwrite: true,
replacements: [{
from: /The current version is .*\..*\..*\./,
to: "The current version is <%=pkg.version%>."
}]
}
},
uglify: {
file: {
options: {
preserveComments: false,
beautify: false,
mangle: true,
report: 'min'
},
files: {
'./dist/ember-table.min.js': ['./dist/ember-table.js']
}
}
},
// Add a banner to dist files which includes version & year of release
usebanner: {
js: {
options: {
banner: '<%=banner%>'
},
files: {
src: ['dist/*.js']
}
},
css: {
options: {
banner: '<%=banner%>'
},
files: {
src: ['dist/*.css']
}
}
},
'release-it': {
options: {
'pkgFiles': ['package.json'],
'commitMessage': 'Release %s',
'tagName': 'v%s',
'tagAnnotation': 'Release %s',
'increment': 'patch',
'buildCommand': 'grunt dist && ember build --environment="gh-pages"',
'distRepo': '-b gh-pages git@github.com:addepar/ember-table',
'distStageDir': '.stage',
'distBase': 'ember-dist',
'distFiles': ['**/*'],
'publish': false
}
}
});
grunt.registerTask("dist", ["replace", "broccoli:dist:build", "uglify", "usebanner"]);
grunt.registerTask("default", ["dist"]);
};