diff --git a/gulpfile.js b/gulpfile.js index a36bf62510..d0c6d50535 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -37,7 +37,11 @@ const filters = { ], edge: [ '!build/edge/**/*' - ] + ], + nonSafariApp: [ + '!build/background.html', + '!build/popup/index.html' + ], }; function buildString() { @@ -193,6 +197,32 @@ function safariZip(buildPath) { }); } +function distSafariApp(cb) { + const buildPath = paths.dist + 'Safari/'; + const extBuildPath = buildPath + 'app_extension/'; + const appPath = './src/safari/app/desktop/' + + return del([buildPath + '**/*']) + .then(() => copy(appPath + '**/*', extBuildPath)) + .then(() => safariAppCopyBuild(paths.build + '**/*', extBuildPath + 'safari/app')) + .then(() => { + return cb; + }, () => { + return cb; + }); +} + +function safariAppCopyBuild(source, dest) { + return new Promise((resolve, reject) => { + gulp.src(source) + .on('error', reject) + .pipe(filter(['**'].concat(filters.edge).concat(filters.fonts).concat(filters.safari) + .concat(filters.webExt).concat(filters.nonSafariApp))) + .pipe(gulp.dest(dest)) + .on('end', resolve); + }); +} + function webfonts() { return gulp.src('./webfonts.list') .pipe(googleWebFonts({ @@ -230,6 +260,7 @@ exports['dist:chrome'] = distChrome; exports['dist:opera'] = distOpera; exports['dist:edge'] = distEdge; exports['dist:safari'] = distSafari; +exports['dist:safariApp'] = distSafariApp; exports.dist = gulp.parallel(distFirefox, distChrome, distOpera, distEdge, distSafari); exports['ci:coverage'] = ciCoverage; exports.ci = ciCoverage; diff --git a/jslib b/jslib index 692d1ec201..ee91cfc2df 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 692d1ec20163edaa404b52888af2ea45b13b59cd +Subproject commit ee91cfc2dfda974ab1ae8e0077e58998bbc6e832 diff --git a/package.json b/package.json index a890ac5c9d..03c75f1da5 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "dist:firefox": "npm run build:prod && gulp dist:firefox", "dist:opera": "npm run build:prod && gulp dist:opera", "dist:safari": "npm run build:prod && gulp dist:safari", + "dist:safariApp": "npm run build:prod && gulp dist:safariApp", "lint": "tslint src/**/*.ts || true", "lint:fix": "tslint src/**/*.ts --fix", "test": "karma start --single-run",