-
Notifications
You must be signed in to change notification settings - Fork 17
/
Gruntfile.coffee
75 lines (62 loc) · 2.14 KB
/
Gruntfile.coffee
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
module.exports = (grunt) ->
require('load-grunt-tasks')(grunt)
grunt.loadTasks 'tasks'
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
meta:
banner: """/*!
* <%= pkg.name %> - <%= pkg.description %>
* v<%= pkg.version %> - <%= grunt.template.today("UTC:yyyy-mm-dd h:MM:ss TT Z") %>
* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>; License: <%= pkg.license %>
*/
"""
minbanner: """/*!
* <%= pkg.name %> v<%= pkg.version %> - Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %> - License: <%= pkg.license %>
*/
"""
less:
dist:
files:
'dist/<%= pkg.compactname %>.css': ['src/phpdiffmerge.less']
cssmin:
options:
banner: '<%= meta.minbanner %>'
styles:
files:
'dist/<%= pkg.compactname %>.min.css': ['dist/<%= pkg.compactname %>.css']
concat:
options:
stripBanners: true
banner: '<%= meta.banner %>'
dist:
src: ['src/phpdiffmerge.js']
dest: 'dist/<%= pkg.compactname %>.js'
styles:
src: ['dist/<%= pkg.compactname %>.css']
dest: 'dist/<%= pkg.compactname %>.css'
uglify:
options:
banner: '<%= meta.minbanner %>\n'
dist:
files:
'dist/<%= pkg.compactname %>.min.js': ['dist/<%= pkg.compactname %>.js']
karma:
options:
configFile: 'karma.conf.coffee'
single:
singleRun: true
watch:
singleRun: false
autoWatch: true
bump:
options:
files: ['package.json']
updateConfigs: ['pkg']
commitFiles: ['package.json', 'dist/']
tagName: 'v%VERSION%'
pushTo: 'origin'
grunt.registerTask 'test', ['karma:single']
grunt.registerTask 'watch', ['karma:watch']
grunt.registerTask 'build', ['less', 'cssmin', 'concat', 'uglify']
grunt.registerTask 'default', ['test', 'build']
grunt.registerTask 'release', (type) -> grunt.task.run ['test', "bump-only:#{type||'patch'}", 'build', 'bump-commit']