keeweb/grunt.tasks.js

137 lines
4.3 KiB
JavaScript
Raw Normal View History

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',
'copy:content-dist',
'string-replace:service-worker',
2019-01-06 14:32:31 +01:00
'string-replace:manifest',
'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',
'string-replace:desktop-public-key'
2019-01-06 14:32:31 +01:00
]);
grunt.registerTask('build-desktop-update', [
'copy:desktop-update',
'copy:desktop-update-helper',
'sign-desktop-files:desktop-update',
'compress:desktop-update',
'sign-archive:desktop-update',
'validate-desktop-update'
]);
2020-04-04 10:52:53 +02:00
grunt.registerTask('build-desktop-executables-linux', [
'electron:linux',
'chmod:linux-desktop-x64',
'copy:native-modules-linux-x64'
2020-04-04 10:52:53 +02:00
]);
grunt.registerTask('build-desktop-executables-darwin', [
2020-11-30 20:52:09 +01:00
'electron:darwin-x64',
'electron:darwin-arm64',
'copy:desktop-darwin-helper-x64',
'copy:desktop-darwin-helper-arm64',
'copy:desktop-darwin-installer-helper-x64',
'copy:desktop-darwin-installer-helper-arm64',
'copy:native-modules-darwin-x64',
'copy:native-modules-darwin-arm64',
sign ? 'osx-sign:desktop-x64' : 'noop',
sign ? 'osx-sign:desktop-arm64' : 'noop',
sign ? 'notarize:desktop-x64' : 'noop',
sign ? 'notarize:desktop-arm64' : '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',
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-05-14 20:52:02 +02:00
'copy:desktop-windows-helper-x64',
2019-01-06 14:32:31 +01:00
'copy:desktop-windows-helper-ia32',
'copy:desktop-windows-helper-arm64',
'copy:native-modules-win32-x64',
'copy:native-modules-win32-ia32',
'copy:native-modules-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
]);
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-update',
'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
};