mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-15 07:28:05 +00:00
chore: harder checks around universal build creation
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const vscode_universal_bundler_1 = require("vscode-universal-bundler");
|
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 fs = require("fs-extra");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const plist = require("plist");
|
const plist = require("plist");
|
||||||
@@ -50,6 +51,12 @@ async function main() {
|
|||||||
LSRequiresNativeExecution: true
|
LSRequiresNativeExecution: true
|
||||||
});
|
});
|
||||||
await fs.writeFile(infoPlistPath, plist.build(infoPlistJson), 'utf8');
|
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) {
|
if (require.main === module) {
|
||||||
main().catch(err => {
|
main().catch(err => {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import { makeUniversalApp } from 'vscode-universal-bundler';
|
import { makeUniversalApp } from 'vscode-universal-bundler';
|
||||||
|
import { spawn } from '@malept/cross-spawn-promise';
|
||||||
import * as fs from 'fs-extra';
|
import * as fs from 'fs-extra';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as plist from 'plist';
|
import * as plist from 'plist';
|
||||||
@@ -57,6 +58,13 @@ async function main() {
|
|||||||
LSRequiresNativeExecution: true
|
LSRequiresNativeExecution: true
|
||||||
});
|
});
|
||||||
await fs.writeFile(infoPlistPath, plist.build(infoPlistJson), 'utf8');
|
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) {
|
if (require.main === module) {
|
||||||
|
|||||||
Reference in New Issue
Block a user