-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
65 lines (63 loc) · 1.68 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
module.exports = function (grunt) {
grunt.loadNpmTasks("grunt-exec");
grunt.initConfig({
exec: {
fmt: {
command: "deno fmt",
},
lint: {
command: "deno lint",
},
deno_test: {
command: "deno test --coverage=cov_profile",
},
deno_lcov: {
command: "deno coverage cov_profile --lcov --output=cov_profile.lcov",
},
setVersion: {
command: 'deno run -A prepare-spa.ts --action set-version --version <%= grunt.config.get("version") %>',
},
testQuasar: {
cwd: './q-manui',
command: 'yarn cov',
},
buildQuasar: {
cwd: './q-manui',
command: 'quasar build',
},
spa: {
command: 'deno run -A prepare-spa.ts --action spa',
},
sonar: {
command: 'sonar-scanner.bat -D"sonar.organization=fakoua" -D"sonar.projectKey=fakoua_denoman" -D"sonar.sources=." -D"sonar.host.url=https://sonarcloud.io"',
},
},
});
//Run grunt publish to publish a new version
//This will prompt for a new version number
grunt.registerTask("prompt", "Prompt for version", function () {
const done = this.async();
grunt.log.writeln("Prompting for version");
const prompt = require("prompt");
prompt.start();
prompt.get(["version"], function (err, result) {
if (err) {
return done(err);
}
grunt.config.set("version", result.version);
done();
});
});
grunt.registerTask("publish", [
"prompt",
"exec:fmt",
"exec:lint",
"exec:deno_test",
"exec:deno_lcov",
"exec:setVersion",
"exec:testQuasar",
"exec:buildQuasar",
"exec:spa",
"exec:sonar",
]);
};