-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
Gruntfile.js
119 lines (116 loc) · 3.05 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
116
117
118
119
const webpackConfig = require("./webpack.config");
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
clean: ["dist"],
bump: {
options: {
files: ["package.json", "bower.json", "composer.json"],
updateConfigs: ["pkg"],
commit: false,
createTag: false,
push: false,
prereleaseName: "beta"
}
},
release: {
options: {
bump: false,
commit: false,
add: false
}
},
nugetpack: {
dist: {
src: (function () {
return "nuspecs/Inputmask.nuspec";
})(),
dest: "build/",
options: {
version: "<%= pkg.version %>"
}
},
dist2: {
src: (function () {
return "nuspecs/jquery.inputmask.nuspec";
})(),
dest: "build/",
options: {
version: "<%= pkg.version %>"
}
}
},
nugetpush: {
dist: {
src: "build/InputMask.<%= pkg.version %>.nupkg",
options: {
source: "https://www.nuget.org"
}
},
dist2: {
src: "build/jquery.inputMask.<%= pkg.version %>.nupkg",
options: {
source: "https://www.nuget.org"
}
}
},
karma: {
options: {
configFile: "karma.conf.js"
},
unit: {
singleRun: true
}
},
eslint: {
target: "lib/*.js"
},
availabletasks: {
tasks: {
options: {
filter: "exclude",
tasks: ["availabletasks", "default"],
showTasks: ["user"]
}
}
},
webpack: {
main: webpackConfig("production")[0],
jquery: webpackConfig("production")[1],
colormask: webpackConfig("production")[2]
},
copy: {
extensions: {
files: [
{
src: "lib/bindings/inputmask.binding.js",
dest: "dist/bindings/inputmask.binding.js"
},
{
src: "lib/bindings/inputmask.es6.js",
dest: "dist/inputmask.es6.js"
},
{ src: "lib/extensions/colormask.css", dest: "dist/colormask.css" },
{
src: "Changelog.md",
dest: "inputmask-pages/src/assets/Changelog.md"
}
]
}
}
});
// Load the plugin that provides the tasks.
require("load-grunt-tasks")(grunt);
grunt.registerTask("publish", ["release", "nugetpack", "nugetpush"]);
grunt.registerTask("publishnext", function () {
grunt.config("release.options.npmtag", "next");
grunt.task.run("release");
});
grunt.registerTask("validate", ["webpack", "copy", "eslint", "karma"]);
grunt.registerTask("build", ["bump:prerelease", "clean", "webpack", "copy"]);
grunt.registerTask("build:patch", ["bump:patch", "clean", "webpack", "copy"]);
grunt.registerTask("build:minor", ["bump:minor", "clean", "webpack", "copy"]);
grunt.registerTask("build:major", ["bump:major", "clean", "webpack", "copy"]);
grunt.registerTask("default", ["availabletasks"]);
};