forked from cornerstonejs/cornerstone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
101 lines (95 loc) · 3.07 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
default: {
src: [
'dist'
]
}
},
copy: {
bower: {
src: [
'bower_components/jquery/dist/jquery.min.js',
'bower_components/jquery/dist/jquery.min.map',
],
dest: 'example',
expand: true,
flatten: true
}
},
concat: {
build: {
src : ['src/header.js','src/**/*.js'],
dest: 'build/built.js'
},
css: {
options: {
stripBanners: true,
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> ' +
'| (c) 2014 Chris Hafey | https://github.com/chafey/cornerstone */\n'
},
src: ['src/cornerstone.css'],
dest: 'dist/cornerstone.css',
},
dist: {
options: {
stripBanners: true,
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> ' +
'| (c) 2014 Chris Hafey | https://github.com/chafey/cornerstone */\n'
},
src : ['build/built.js'],
dest: 'dist/cornerstone.js'
}
},
uglify: {
dist: {
files: {
'dist/cornerstone.min.js': ['dist/cornerstone.js']
}
},
options: {
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> ' +
'| (c) 2014 Chris Hafey | https://github.com/chafey/cornerstone */\n'
}
},
qunit: {
all: ['test/**/*.html']
},
jshint: {
files: [
'src/*.js'
]
},
watch: {
scripts: {
files: ['src/**/*.js', 'test/**/*'],
tasks: ['buildAll']
}
},
cssmin: {
dist: {
files: {
'dist/cornerstone.min.css': ['dist/cornerstone.css']
}
}
}
});
require('load-grunt-tasks')(grunt);
grunt.registerTask('buildAll', ['copy', 'concat', 'uglify', 'jshint', 'cssmin', 'qunit']);
grunt.registerTask('default', ['clean', 'buildAll']);
};
// Release process:
// 1) Update version numbers in package.json and bower.json
// 2) do a build (needed to update dist versions with correct build number)
// 3) commit changes
// git commit -am "Changes...."
// 4) tag the commit
// git tag -a 0.1.0 -m "Version 0.1.0"
// 5) push to github
// git push origin master --tags