mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
chore: harder checks around universal build creation
This commit is contained in:
parent
49af1cbe00
commit
d49d7e7fe1
|
@ -5,6 +5,7 @@
|
|||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const vscode_universal_bundler_1 = require("vscode-universal-bundler");
|
||||
const cross_spawn_promise_1 = require("@malept/cross-spawn-promise");
|
||||
const fs = require("fs-extra");
|
||||
const path = require("path");
|
||||
const plist = require("plist");
|
||||
|
@ -50,6 +51,12 @@ async function main() {
|
|||
LSRequiresNativeExecution: true
|
||||
});
|
||||
await fs.writeFile(infoPlistPath, plist.build(infoPlistJson), 'utf8');
|
||||
// Verify if native module architecture is correct
|
||||
const findOutput = await (0, cross_spawn_promise_1.spawn)('find', [outAppPath, '-name', 'keytar.node']);
|
||||
const lipoOutput = await (0, cross_spawn_promise_1.spawn)('lipo', ['-archs', findOutput.replace(/\n$/, "")]);
|
||||
if (lipoOutput.replace(/\n$/, "") !== 'x86_64 arm64') {
|
||||
throw new Error(`Invalid arch, got : ${lipoOutput}`);
|
||||
}
|
||||
}
|
||||
if (require.main === module) {
|
||||
main().catch(err => {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
'use strict';
|
||||
|
||||
import { makeUniversalApp } from 'vscode-universal-bundler';
|
||||
import { spawn } from '@malept/cross-spawn-promise';
|
||||
import * as fs from 'fs-extra';
|
||||
import * as path from 'path';
|
||||
import * as plist from 'plist';
|
||||
|
@ -57,6 +58,13 @@ async function main() {
|
|||
LSRequiresNativeExecution: true
|
||||
});
|
||||
await fs.writeFile(infoPlistPath, plist.build(infoPlistJson), 'utf8');
|
||||
|
||||
// Verify if native module architecture is correct
|
||||
const findOutput = await spawn('find', [outAppPath, '-name', 'keytar.node'])
|
||||
const lipoOutput = await spawn('lipo', ['-archs', findOutput.replace(/\n$/, "")]);
|
||||
if (lipoOutput.replace(/\n$/, "") !== 'x86_64 arm64') {
|
||||
throw new Error(`Invalid arch, got : ${lipoOutput}`)
|
||||
}
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
|
|
Loading…
Reference in a new issue