-
Notifications
You must be signed in to change notification settings - Fork 32
/
Gruntfile.js
112 lines (97 loc) · 3.83 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
108
109
110
111
112
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
dir : {
src : 'stylesheets',
dist : 'dist'
},
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
banner: '/*! <%= pkg.name %> - version : <%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n',
},
dist: {
src: [
// Defaults
'<%= dir.src %>/_defaults.scss',
// Logger
'<%= dir.src %>/logger/_global.scss',
'<%= dir.src %>/logger/_context-logger.scss',
'<%= dir.src %>/logger/_block-logger.scss',
'<%= dir.src %>/logger/_element-logger.scss',
'<%= dir.src %>/logger/_modifier-logger.scss',
'<%= dir.src %>/logger/_scope-logger.scss',
// Error checks
'<%= dir.src %>/_error-checks.scss',
// Constructors
'<%= dir.src %>/_block.scss',
'<%= dir.src %>/_element.scss',
'<%= dir.src %>/_modifier.scss',
'<%= dir.src %>/_modifies-element.scss',
'<%= dir.src %>/_scope.scss',
'<%= dir.src %>/_theme.scss',
'<%= dir.src %>/_state.scss',
'<%= dir.src %>/_hack.scss',
'<%= dir.src %>/_debug.scss',
'<%= dir.src %>/_suffix.scss',
],
dest: '<%= dir.dist %>/_<%= pkg.name %>.scss',
},
},
bump: {
options: {
files: ['package.json', 'bower.json', 'lib/bem-constructor.rb', 'dist/_bem-constructor.scss'],
updateConfigs: [],
commit: true,
commitMessage: 'Bump version %VERSION%',
commitFiles: ['package.json', 'bower.json', 'lib/bem-constructor.rb', 'dist/_bem-constructor.scss'],
createTag: true,
tagName: 'v%VERSION%',
tagMessage: 'Version %VERSION%',
push: true,
pushTo: 'upstream',
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d',
prereleaseName: 'pre',
// Override default regExp to make it find in the version in lib/bem-constructor.rb
regExp: new RegExp('([\'|\"]?[version][\'|\"]?[ ]*[:|=][ ]*[\'|\"]?)(\\d+\\.\\d+\\.\\d+(-\\.\\d+)?(-\\d+)?)[\\d||A-a|.|-]*([\'|\"]?)', 'i')
}
},
bootcamp: {
test: {
files: {
src: ['./tmp/results.css']
}
}
},
sass: {
tests: {
options: {
compass: false,
loadPath: ['./node_modules/bootcamp/dist', 'stylesheets']
},
files: {
'./tmp/results.css': 'test/tests.scss'
}
}
},
watch: {
dist: {
files: [
'test/**/*.scss',
'./<%= dir.src %>/**/*.scss'
],
tasks: ['sass', 'bootcamp']
}
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('bootcamp');
grunt.registerTask('test', ['sass', 'bootcamp']);
grunt.registerTask('dev', ['test', 'watch']);
grunt.registerTask('build', ['test', 'concat']);
var versionBump = grunt.option('versionBump') || 'minor';
grunt.registerTask('release', ['build', 'bump-only:' + versionBump, 'bump-commit']);
}