This repository has been archived by the owner on Apr 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGruntfile.js
115 lines (100 loc) · 3.5 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
113
114
115
var gulp = require('gulp');
var iconfont = require('gulp-iconfont');
var iconfontCss = require('gulp-iconfont-css');
module.exports = function (grunt) {
'use strict';
require('matchdep').filterAll('grunt-*').forEach(grunt.loadNpmTasks);
var fontName = "ovh-font";
var fontDashName = fontName + "-";
grunt.initConfig({
pkg : grunt.file.readJSON('package.json'),
bower : grunt.file.readJSON('bower.json'),
name : grunt.file.readJSON('package.json').name || 'ovh-manager-webfont', // module name
// To release
bump : {
options : {
pushTo : 'origin',
files : [
'package.json',
'bower.json'
],
updateConfigs : ['pkg', 'bower'],
commitFiles : ['-a']
}
},
webfont: {
icons: {
src : "src/icons/**/*.svg",
dest : "dist/fonts",
destCss : "dist/less",
destHtml: "dist",
options : {
engine : "node",
stylesheet : "less",
descent : 0,
styles : [
"font",
"icon"
],
font : fontName,
fontHeight : 80,
types : [
"eot",
"woff",
"woff2",
"ttf",
"svg"
],
ie7 : true,
template : "src/templates/icons.less",
relativeFontPath : "../fonts",
templateOptions: {
baseClass : fontName,
classPrefix : fontDashName,
mixinPrefix : fontDashName
},
destCss : "dist/less",
destHtml: "dist",
htmlDemoTemplate : "src/templates/index.html"
}
}
},
less: {
development: {
options: {
paths: ["assets/css"]
},
files: {
"dist/css/ovh-font.css": "dist/less/ovh-font.less"
}
},
showcase : {
options: {
paths: ["assets/css"]
},
files: {
"dist/css/ovh-font.css": "dist/less/ovh-font.less"
}
}
}
});
grunt.registerTask("default", ["build"]);
grunt.task.renameTask("watch", "delta");
grunt.registerTask("watch", ["build", "delta"]);
grunt.registerTask("test", function () {
return true;
});
grunt.registerTask('build', 'Gulp', function () {
grunt.task.run(['webfont', 'less']);
});
// Increase version number. Type = minor|major|patch
grunt.registerTask("release", "Release", function () {
var type = grunt.option("type");
if (type && ~["patch", "minor", "major"].indexOf(type)) {
grunt.task.run(["bump-only:" + type]);
} else {
grunt.verbose.or.write("You try to release in a weird version type [" + type + "]").error();
grunt.fail.warn("Please try with --type=patch|minor|major");
}
});
};