forked from RobinHerbots/Inputmask
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
99 lines (96 loc) · 3.11 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
var webpackConfig = require('./webpack.config');
var webpackJqueryConfig = require('./webpack.jqueryconfig');
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"
}
}
},
eslint: {
target: "{extra/*,js}/*.js"
},
availabletasks: {
tasks: {
options: {
filter: 'exclude',
tasks: ['availabletasks', 'default', 'updateDistConfig'],
showTasks: ['user']
}
}
},
webpack: {
main: webpackConfig,
jquery: webpackJqueryConfig
},
copy: {
extensions: {
files: [
{src: 'lib/bindings/inputmask.binding.js', dest: 'dist/bindings/inputmask.binding.js'}
]
}
}
});
// 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']);
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"]);
};