-
-
Notifications
You must be signed in to change notification settings - Fork 126
/
Copy pathjakefile.js
48 lines (40 loc) · 1.33 KB
/
jakefile.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
const { task, desc } = require('jake')
const { spawn } = require('child_process')
// Easily run commands
const run = (what, args, where = './') => {
return new Promise((resolve, reject) => {
let proc = spawn(what, args, { cwd: where, stdio: 'inherit', shell: true});
proc.on('close', (code) => code == 0 ? resolve() : reject())
})
}
desc('Run the server in develop mode');
task('dev_server', async function () {
run('pnpm', ['run', '--filter', 'web', 'dev'])
await run('cargo run', [], './server')
});
desc('Run the desktop in develop mode');
task('dev_desktop', async function () {
await run('cargo tauri dev', [], './desktop')
});
desc('Build the desktop');
task('build_desktop', async function () {
await run('cargo tauri build', [], './desktop')
});
desc('Run tests');
task('core_tests', async function () {
await run('cargo', ['nextest', 'run'])
});
task('web_tests', async function () {
await run('pnpm', ['run', '--filter', 'web', 'test'])
});
desc('Format the code');
task('format_core', async function () {
await run('cargo', ['fmt'])
});
task('format_web', async function () {
await run('pnpm', ['run', '--filter', 'web', 'format'])
});
desc('Lint the code');
task('lint_core', async function () {
await run('cargo', ['clippy'])
});