darwin: customize plain electron for dev
parent
28550cff75
commit
ebf9722e2e
|
@ -114,10 +114,19 @@ const config = {
|
|||
token: process.env['GITHUB_TOKEN'] || void 0
|
||||
};
|
||||
|
||||
gulp.task('electron', () => {
|
||||
// Force windows to use ia32
|
||||
const arch = process.env.VSCODE_ELECTRON_PLATFORM || (process.platform === 'win32' ? 'ia32' : process.arch);
|
||||
return electron.dest(path.join(build, 'electron'), _.extend({}, config, { arch: arch, ffmpegChromium: true }));
|
||||
const electronPath = path.join(build, 'electron');
|
||||
|
||||
gulp.task('clean-electron', util.rimraf(electronPath));
|
||||
|
||||
gulp.task('electron', ['clean-electron'], () => {
|
||||
const platform = process.platform;
|
||||
const arch = process.env.VSCODE_ELECTRON_PLATFORM || (platform === 'win32' ? 'ia32' : process.arch);
|
||||
const opts = _.extend({}, config, { platform, arch, ffmpegChromium: true, keepDefaultApp: true });
|
||||
|
||||
return gulp.src('package.json')
|
||||
.pipe(electron(opts))
|
||||
.pipe(filter(['**', '!**/app/package.json']))
|
||||
.pipe(symdest(electronPath));
|
||||
});
|
||||
|
||||
const languages = ['chs', 'cht', 'jpn', 'kor', 'deu', 'fra', 'esn', 'rus', 'ita'];
|
||||
|
@ -156,7 +165,7 @@ function packageTask(platform, arch, opts) {
|
|||
const sources = es.merge(src, extensions)
|
||||
.pipe(nlsDev.createAdditionalLanguageFiles(languages, path.join(__dirname, '..', 'i18n')))
|
||||
.pipe(filter(['**', '!**/*.js.map']))
|
||||
.pipe(util.handleAzureJson({ platform: platform }));
|
||||
.pipe(util.handleAzureJson({ platform }));
|
||||
|
||||
let version = packageJson.version;
|
||||
const quality = product.quality;
|
||||
|
@ -211,7 +220,7 @@ function packageTask(platform, arch, opts) {
|
|||
let result = all
|
||||
.pipe(util.skipDirectories())
|
||||
.pipe(util.fixWin32DirectoryPermissions())
|
||||
.pipe(electron(_.extend({}, config, { platform: platform, arch: arch, ffmpegChromium: true })))
|
||||
.pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
|
||||
.pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version']));
|
||||
|
||||
if (platform === 'win32') {
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
"ghooks": "1.0.3",
|
||||
"glob": "^5.0.13",
|
||||
"gulp": "^3.8.9",
|
||||
"gulp-atom-electron": "^1.7.1",
|
||||
"gulp-atom-electron": "^1.9.0",
|
||||
"gulp-azure-storage": "^0.6.0",
|
||||
"gulp-bom": "^1.0.0",
|
||||
"gulp-buffer": "0.0.2",
|
||||
|
|
|
@ -14,7 +14,11 @@ function code() {
|
|||
test -d node_modules || ./scripts/npm.sh install
|
||||
|
||||
# Get electron
|
||||
test -d .build/electron || ./node_modules/.bin/gulp electron
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
test -d .build/electron/Code\ -\ OSS.app || ./node_modules/.bin/gulp electron
|
||||
else
|
||||
test -d .build/electron || ./node_modules/.bin/gulp electron
|
||||
fi
|
||||
|
||||
# Build
|
||||
test -d out || ./node_modules/.bin/gulp compile
|
||||
|
@ -28,7 +32,7 @@ function code() {
|
|||
|
||||
# Launch Code
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
exec ./.build/electron/Electron.app/Contents/MacOS/Electron . "$@"
|
||||
exec ./.build/electron/Code\ -\ OSS.app/Contents/MacOS/Electron . "$@"
|
||||
else
|
||||
exec ./.build/electron/electron . "$@"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue