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');
|
2024-08-08 20:57:32 +02:00
|
|
|
const compilePackageInfo = require('@joplin/tools/compilePackageInfo');
|
2023-11-12 17:07:30 +02:00
|
|
|
|
2024-03-11 17:02:15 +02:00
|
|
|
import injectedJsGulpTasks from './tools/buildInjectedJs/gulpTasks';
|
2020-11-05 18:58:23 +02:00
|
|
|
|
|
|
|
const tasks = {
|
|
|
|
encodeAssets: {
|
|
|
|
fn: require('./tools/encodeAssets'),
|
|
|
|
},
|
2024-08-02 15:51:49 +02:00
|
|
|
copyWebAssets: {
|
|
|
|
fn: require('./tools/copyAssets').default,
|
|
|
|
},
|
2024-08-08 20:57:32 +02:00
|
|
|
compilePackageInfo: {
|
|
|
|
fn: async () => {
|
|
|
|
await compilePackageInfo(`${__dirname}/package.json`, `${__dirname}/packageInfo.js`);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2024-03-11 17:02:15 +02:00
|
|
|
...injectedJsGulpTasks,
|
2020-11-05 18:58:23 +02:00
|
|
|
podInstall: {
|
|
|
|
fn: require('./tools/podInstall'),
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
utils.registerGulpTasks(gulp, tasks);
|
|
|
|
|
2023-11-12 17:07:30 +02:00
|
|
|
gulp.task('buildInjectedJs', gulp.series(
|
|
|
|
'beforeBundle',
|
|
|
|
'buildCodeMirrorEditor',
|
|
|
|
'buildJsDrawEditor',
|
2024-03-11 17:02:15 +02:00
|
|
|
'buildPluginBackgroundScript',
|
2024-03-20 13:01:09 +02:00
|
|
|
'buildNoteViewerBundle',
|
2023-11-12 17:07:30 +02:00
|
|
|
'copyWebviewLib',
|
|
|
|
));
|
|
|
|
|
|
|
|
gulp.task('watchInjectedJs', gulp.series(
|
|
|
|
'beforeBundle',
|
|
|
|
'copyWebviewLib',
|
|
|
|
gulp.parallel(
|
|
|
|
'watchCodeMirrorEditor',
|
|
|
|
'watchJsDrawEditor',
|
2024-03-11 17:02:15 +02:00
|
|
|
'watchPluginBackgroundScript',
|
2024-03-20 13:01:09 +02:00
|
|
|
'watchNoteViewerBundle',
|
2023-11-12 17:07:30 +02:00
|
|
|
),
|
|
|
|
));
|
|
|
|
|
2020-11-05 18:58:23 +02:00
|
|
|
gulp.task('build', gulp.series(
|
2024-08-08 20:57:32 +02:00
|
|
|
'compilePackageInfo',
|
2021-07-13 20:13:13 +02:00
|
|
|
'buildInjectedJs',
|
2024-08-02 15:51:49 +02:00
|
|
|
'copyWebAssets',
|
2020-11-05 18:58:23 +02:00
|
|
|
'encodeAssets',
|
2023-08-22 12:58:53 +02:00
|
|
|
'podInstall',
|
2020-11-05 18:58:23 +02:00
|
|
|
));
|