forked from tuxpiper/q-json2json
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
86 lines (78 loc) · 2.52 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
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
lic: grunt.file.read('LICENSE'),
clean: {
dist: [
'dist'
]
},
coffee: {
compile: {
files: {
//'dist/json2json.js': ['lib/*.coffee'] // compile and concat into single file
'dist/json2json.js': ['lib/TemplateConfig.coffee', 'lib/ObjectTemplate.coffee'] // compile and concat into single file
}
}
},
meta: {
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage : "" %>\n' +
//'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>;\n' +
' <%= lic %> */\n\n'
},
concat: {
options: {
stripBanners: true,
banner: '<%= meta.banner %>'
},
dist_js: {
src: ['bower_components/Sysmo/lib/sysmo.js', 'dist/json2json.js'],
dest: 'dist/json2json.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'dist/json2json.min.js': ['dist/json2json.js']
}
}
},
bump: {
options: {
files: ['package.json', 'bower.json'],
updateConfigs: ['pkg'],
commit: true,
commitMessage: 'Release v%VERSION%',
commitFiles: ['package.json', 'bower.json', 'dist/'], // '-a' for all files
createTag: true,
tagName: 'v%VERSION%',
tagMessage: 'Version %VERSION%',
push: false,
pushTo: 'origin',
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
}
}
});
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-bump');
// Default task.
grunt.registerTask('default', ['clean', 'build']);
grunt.registerTask('build', ['coffee', 'concat', 'uglify']);
//use one of the four release tasks to build the artifacts for the release (it will push the docs pages only)
grunt.registerTask('release:patch', ['clean', 'bump-only:patch', 'build']);
grunt.registerTask('release:minor', ['clean', 'bump-only:minor', 'build']);
grunt.registerTask('release:major', ['clean', 'bump-only:major', 'build']);
grunt.registerTask('release:git', ['clean', 'bump-only:git', 'build']);
//use this task to publish the release artifacts
grunt.registerTask('release:commit', ['bump-commit']);
};