diff --git a/gulpfile.js b/gulpfile.js index d552f558c26..639a0e10a23 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -160,11 +160,22 @@ function edgeCopyAssets(source, dest) { function distSafari(cb) { const buildPath = paths.dist + 'Safari/'; + const builtAppexPath = buildPath + 'build/Release/safari.appex'; + const entitlementsPath = paths.safari + 'safari/safari.entitlements'; + const devId = 'Developer ID Application: 8bit Solutions LLC'; return del([buildPath + '**/*']) .then(() => safariCopyAssets(paths.safari + '**/*', buildPath)) .then(() => safariCopyBuild(paths.build + '**/*', buildPath + 'safari/app')) .then(() => { + const proc = child.spawn('xcodebuild', ['-project', buildPath + 'desktop.xcodeproj', '-target', 'safari', '-configuration', 'Release']); + stdOutProc(proc); + return new Promise((resolve) => proc.on('close', resolve)); + }).then(() => { + const proc = child.spawn('codesign', ['--verbose', '--force', '-o', 'runtime', '--sign', devId, '--entitlements', entitlementsPath, builtAppexPath]); + stdOutProc(proc); + return new Promise((resolve) => proc.on('close', resolve)); + }).then(() => { return cb; }, () => { return cb; @@ -192,6 +203,10 @@ function safariCopyBuild(source, dest) { }); } +function stdOutProc(proc) { + proc.stdout.on('data', (data) => console.log(data.toString())); + proc.stderr.on('data', (data) => console.error(data.toString()));} + function webfonts() { return gulp.src('./webfonts.list') .pipe(googleWebFonts({