1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-30 10:36:35 +02:00
joplin/packages/app-cli/gulpfile.js

48 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-11-05 18:58:23 +02:00
const gulp = require('gulp');
const fs = require('fs-extra');
const utils = require('@joplin/tools/gulp/utils');
2020-11-05 18:58:23 +02:00
const tasks = {};
2020-11-06 23:25:07 +02:00
2020-11-05 18:58:23 +02:00
tasks.prepareBuild = {
fn: async () => {
const buildDir = `${__dirname}/build`;
await utils.copyDir(`${__dirname}/app`, buildDir, {
excluded: ['node_modules'],
});
2020-11-06 23:25:07 +02:00
2020-11-05 18:58:23 +02:00
await utils.copyFile(`${__dirname}/package.json`, `${buildDir}/package.json`);
await utils.setPackagePrivateField(`${buildDir}/package.json`, false);
2020-11-06 23:25:07 +02:00
// await utils.copyFile(`${__dirname}/package-lock.json`, `${buildDir}/package-lock.json`);
2020-11-05 18:58:23 +02:00
await utils.copyFile(`${__dirname}/gulpfile.js`, `${buildDir}/gulpfile.js`);
fs.chmodSync(`${buildDir}/main.js`, 0o755);
},
};
tasks.prepareTestBuild = {
fn: async () => {
const testBuildDir = `${__dirname}/tests-build`;
await utils.copyDir(`${__dirname}/tests`, testBuildDir, {
excluded: [
'lib/',
'locales/',
'node_modules/',
'*.ts',
'*.tsx',
],
});
await fs.mkdirp(`${testBuildDir}/data`);
},
};
utils.registerGulpTasks(gulp, tasks);
gulp.task('build', gulp.series([
'prepareBuild',
]));