2020-06-01 16:53:51 +02:00
|
|
|
module.exports = function (grunt) {
|
2020-06-04 20:13:15 +02:00
|
|
|
const sign = !grunt.option('skip-sign');
|
|
|
|
|
2019-01-06 14:32:31 +01:00
|
|
|
grunt.registerTask('build-web-app', [
|
|
|
|
'clean',
|
|
|
|
'eslint',
|
|
|
|
'copy:html',
|
|
|
|
'copy:icons',
|
|
|
|
'copy:manifest',
|
2019-10-12 13:24:37 +02:00
|
|
|
'webpack:app',
|
2019-01-06 14:32:31 +01:00
|
|
|
'inline',
|
|
|
|
'htmlmin',
|
2020-04-02 16:27:10 +02:00
|
|
|
'csp-hashes',
|
2020-05-04 19:06:05 +02:00
|
|
|
'copy:content-dist',
|
2019-09-23 20:32:56 +02:00
|
|
|
'string-replace:service-worker',
|
2021-01-07 22:05:04 +01:00
|
|
|
'string-replace:update-manifest',
|
2019-01-06 14:32:31 +01:00
|
|
|
'copy:dist-icons',
|
|
|
|
'copy:dist-manifest'
|
|
|
|
]);
|
|
|
|
|
|
|
|
grunt.registerTask('build-desktop-app-content', [
|
2019-09-28 20:27:39 +02:00
|
|
|
'copy:desktop-html',
|
2019-01-06 14:32:31 +01:00
|
|
|
'copy:desktop-app-content',
|
2019-09-23 20:32:56 +02:00
|
|
|
'string-replace:desktop-public-key'
|
2019-01-06 14:32:31 +01:00
|
|
|
]);
|
|
|
|
|
2020-04-04 10:52:53 +02:00
|
|
|
grunt.registerTask('build-desktop-executables-linux', [
|
|
|
|
'electron:linux',
|
2021-02-06 14:46:24 +01:00
|
|
|
'electron-patch:linux',
|
2020-06-02 13:58:25 +02:00
|
|
|
'chmod:linux-desktop-x64',
|
2021-04-13 22:39:07 +02:00
|
|
|
'copy:native-modules-linux-x64',
|
|
|
|
'cmake:native-messaging-host-linux-x64'
|
2020-04-04 10:52:53 +02:00
|
|
|
]);
|
|
|
|
|
2020-06-01 22:51:42 +02:00
|
|
|
grunt.registerTask('build-desktop-executables-darwin', [
|
2020-11-30 20:52:09 +01:00
|
|
|
'electron:darwin-x64',
|
|
|
|
'electron:darwin-arm64',
|
2021-02-06 14:46:24 +01:00
|
|
|
'electron-patch:darwin-x64',
|
|
|
|
'electron-patch:darwin-arm64',
|
2021-01-09 11:44:13 +01:00
|
|
|
'build-darwin-installer',
|
2020-11-30 20:52:09 +01:00
|
|
|
'copy:desktop-darwin-installer-helper-x64',
|
|
|
|
'copy:desktop-darwin-installer-helper-arm64',
|
|
|
|
'copy:native-modules-darwin-x64',
|
2021-04-13 22:39:07 +02:00
|
|
|
'cmake:native-messaging-host-darwin-x64',
|
2020-11-30 20:52:09 +01:00
|
|
|
'copy:native-modules-darwin-arm64',
|
2021-04-13 22:39:07 +02:00
|
|
|
'cmake:native-messaging-host-darwin-arm64',
|
2020-11-30 20:52:09 +01:00
|
|
|
sign ? 'osx-sign:desktop-x64' : 'noop',
|
|
|
|
sign ? 'osx-sign:desktop-arm64' : 'noop',
|
|
|
|
sign ? 'notarize:desktop-x64' : 'noop',
|
|
|
|
sign ? 'notarize:desktop-arm64' : 'noop'
|
2020-06-01 22:51:42 +02:00
|
|
|
]);
|
2020-04-04 10:52:53 +02:00
|
|
|
|
2021-01-09 11:44:13 +01:00
|
|
|
grunt.registerTask('build-darwin-installer', [
|
|
|
|
'osacompile:installer',
|
|
|
|
'copy:darwin-installer-icon',
|
|
|
|
sign ? 'osx-sign:installer' : 'noop'
|
|
|
|
]);
|
|
|
|
|
2020-04-04 10:52:53 +02:00
|
|
|
grunt.registerTask('build-desktop-executables-win32', [
|
2020-05-14 20:52:02 +02:00
|
|
|
'electron:win32-x64',
|
|
|
|
'electron:win32-ia32',
|
|
|
|
'electron:win32-arm64',
|
2021-02-06 14:46:24 +01:00
|
|
|
'electron-patch:win32-x64',
|
|
|
|
'electron-patch:win32-ia32',
|
|
|
|
'electron-patch:win32-arm64',
|
2020-06-04 20:13:15 +02:00
|
|
|
sign ? 'sign-exe:win32-build-x64' : 'noop',
|
|
|
|
sign ? 'sign-exe:win32-build-ia32' : 'noop',
|
|
|
|
sign ? 'sign-exe:win32-build-arm64' : 'noop',
|
2020-06-02 13:58:25 +02:00
|
|
|
'copy:native-modules-win32-x64',
|
|
|
|
'copy:native-modules-win32-ia32',
|
2021-04-13 22:39:07 +02:00
|
|
|
'copy:native-modules-win32-arm64',
|
|
|
|
'cmake:native-messaging-host-win32-x64',
|
|
|
|
'cmake:native-messaging-host-win32-ia32',
|
|
|
|
'cmake:native-messaging-host-win32-arm64'
|
2019-01-06 14:32:31 +01:00
|
|
|
]);
|
|
|
|
|
2020-04-04 10:52:53 +02:00
|
|
|
grunt.registerTask('build-desktop-executables', [
|
|
|
|
'build-desktop-executables-linux',
|
|
|
|
'build-desktop-executables-darwin',
|
|
|
|
'build-desktop-executables-win32'
|
|
|
|
]);
|
|
|
|
|
|
|
|
grunt.registerTask('build-desktop-archives-linux', ['compress:linux-x64']);
|
|
|
|
|
|
|
|
grunt.registerTask('build-desktop-archives-win32', [
|
2019-01-06 14:32:31 +01:00
|
|
|
'compress:win32-x64',
|
2020-05-14 20:52:02 +02:00
|
|
|
'compress:win32-ia32',
|
|
|
|
'compress:win32-arm64'
|
2020-04-04 10:52:53 +02:00
|
|
|
]);
|
|
|
|
|
|
|
|
grunt.registerTask('build-desktop-archives', [
|
|
|
|
'build-desktop-archives-linux',
|
|
|
|
'build-desktop-archives-win32'
|
2019-01-06 14:32:31 +01:00
|
|
|
]);
|
|
|
|
|
2020-11-30 20:52:09 +01:00
|
|
|
grunt.registerTask('build-desktop-dist-darwin', ['appdmg:x64', 'appdmg:arm64']);
|
2019-01-06 14:32:31 +01:00
|
|
|
|
|
|
|
grunt.registerTask('build-desktop-dist-win32', [
|
|
|
|
'nsis:win32-un-x64',
|
|
|
|
'nsis:win32-un-ia32',
|
2020-05-14 22:59:11 +02:00
|
|
|
'nsis:win32-un-arm64',
|
2020-06-04 20:13:15 +02:00
|
|
|
sign ? 'sign-exe:win32-uninst-x64' : 'noop',
|
|
|
|
sign ? 'sign-exe:win32-uninst-ia32' : 'noop',
|
|
|
|
sign ? 'sign-exe:win32-uninst-arm64' : 'noop',
|
2019-01-06 14:32:31 +01:00
|
|
|
'nsis:win32-x64',
|
|
|
|
'nsis:win32-ia32',
|
2020-05-14 22:59:11 +02:00
|
|
|
'nsis:win32-arm64',
|
2020-06-04 20:13:15 +02:00
|
|
|
sign ? 'sign-exe:win32-installer-x64' : 'noop',
|
|
|
|
sign ? 'sign-exe:win32-installer-ia32' : 'noop',
|
|
|
|
sign ? 'sign-exe:win32-installer-arm64' : 'noop',
|
2019-01-06 14:32:31 +01:00
|
|
|
'copy:desktop-win32-dist-x64',
|
2020-05-14 22:59:11 +02:00
|
|
|
'copy:desktop-win32-dist-ia32',
|
|
|
|
'copy:desktop-win32-dist-arm64'
|
2019-01-06 14:32:31 +01:00
|
|
|
]);
|
|
|
|
|
2020-03-17 22:46:21 +01:00
|
|
|
grunt.registerTask('build-desktop-dist-linux', [
|
|
|
|
'deb:linux-x64',
|
|
|
|
'electron-builder:linux',
|
|
|
|
'copy:electron-builder-dist-linux-rpm',
|
|
|
|
'copy:electron-builder-dist-linux-snap',
|
|
|
|
'copy:electron-builder-dist-linux-appimage'
|
|
|
|
]);
|
2019-01-06 14:32:31 +01:00
|
|
|
|
|
|
|
grunt.registerTask('build-desktop-dist', [
|
|
|
|
'build-desktop-dist-darwin',
|
|
|
|
'build-desktop-dist-win32',
|
|
|
|
'build-desktop-dist-linux'
|
|
|
|
]);
|
|
|
|
|
|
|
|
grunt.registerTask('build-desktop', [
|
|
|
|
'clean:desktop',
|
|
|
|
'build-desktop-app-content',
|
|
|
|
'build-desktop-executables',
|
|
|
|
'build-desktop-archives',
|
|
|
|
'build-desktop-dist',
|
|
|
|
'sign-dist'
|
|
|
|
]);
|
|
|
|
|
2019-10-12 13:24:37 +02:00
|
|
|
grunt.registerTask('build-test', ['webpack:test']);
|
2019-01-06 14:32:31 +01:00
|
|
|
};
|