2020-11-05 18:58:23 +02:00
|
|
|
const gulp = require('gulp');
|
2020-11-07 17:59:37 +02:00
|
|
|
const utils = require('@joplin/tools/gulp/utils');
|
2021-09-12 17:35:08 +02:00
|
|
|
const compileSass = require('@joplin/tools/compileSass');
|
2021-10-09 16:30:39 +02:00
|
|
|
const compilePackageInfo = require('@joplin/tools/compilePackageInfo');
|
2020-11-05 18:58:23 +02:00
|
|
|
|
|
|
|
const tasks = {
|
|
|
|
compileScripts: {
|
|
|
|
fn: require('./tools/compileScripts'),
|
|
|
|
},
|
|
|
|
compilePackageInfo: {
|
2021-10-09 16:30:39 +02:00
|
|
|
fn: async () => {
|
|
|
|
await compilePackageInfo(`${__dirname}/package.json`, `${__dirname}/packageInfo.js`);
|
|
|
|
},
|
2020-11-05 18:58:23 +02:00
|
|
|
},
|
|
|
|
copyPluginAssets: {
|
|
|
|
fn: require('./tools/copyPluginAssets.js'),
|
|
|
|
},
|
2021-12-20 17:08:43 +02:00
|
|
|
copyApplicationAssets: {
|
|
|
|
fn: require('./tools/copyApplicationAssets.js'),
|
2020-11-05 18:58:23 +02:00
|
|
|
},
|
|
|
|
electronRebuild: {
|
|
|
|
fn: require('./tools/electronRebuild.js'),
|
|
|
|
},
|
2023-02-05 18:51:47 +02:00
|
|
|
electronBuilder: {
|
|
|
|
fn: require('./tools/electronBuilder.js'),
|
|
|
|
},
|
2020-11-07 17:59:37 +02:00
|
|
|
tsc: require('@joplin/tools/gulp/tasks/tsc'),
|
|
|
|
updateIgnoredTypeScriptBuild: require('@joplin/tools/gulp/tasks/updateIgnoredTypeScriptBuild'),
|
2021-09-04 14:43:25 +02:00
|
|
|
buildCommandIndex: require('@joplin/tools/gulp/tasks/buildCommandIndex'),
|
2021-09-12 17:35:08 +02:00
|
|
|
compileSass: {
|
|
|
|
fn: async () => {
|
2021-10-03 17:00:49 +02:00
|
|
|
await compileSass(
|
|
|
|
`${__dirname}/style.scss`,
|
|
|
|
`${__dirname}/style.min.css`
|
|
|
|
);
|
2021-09-12 17:35:08 +02:00
|
|
|
},
|
|
|
|
},
|
2020-11-05 18:58:23 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
utils.registerGulpTasks(gulp, tasks);
|
|
|
|
|
|
|
|
const buildParallel = [
|
|
|
|
'compileScripts',
|
|
|
|
'compilePackageInfo',
|
|
|
|
'copyPluginAssets',
|
2021-12-20 17:08:43 +02:00
|
|
|
'copyApplicationAssets',
|
2021-09-03 17:43:06 +02:00
|
|
|
'updateIgnoredTypeScriptBuild',
|
2021-09-04 14:43:25 +02:00
|
|
|
'buildCommandIndex',
|
2021-09-12 17:35:08 +02:00
|
|
|
'compileSass',
|
2020-11-05 18:58:23 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
gulp.task('build', gulp.parallel(...buildParallel));
|