Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions build/darwin/sign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ async function main(buildDir?: string): Promise<void> {
const appRoot = path.join(buildDir, `VSCode-darwin-${arch}`);
const appName = product.nameLong + '.app';
const infoPlistPath = path.resolve(appRoot, appName, 'Contents', 'Info.plist');
const embeddedInfoPlistPath = product.embedded
? path.resolve(appRoot, appName, 'Contents', 'Applications', `${product.embedded.nameLong}.app`, 'Contents', 'Info.plist')
: undefined;

const appOpts: SignOptions = {
app: path.join(appRoot, appName),
Expand Down Expand Up @@ -132,44 +129,6 @@ async function main(buildDir?: string): Promise<void> {
'The app uses your local network for DNS resolution and to connect to locally running services.',
`${infoPlistPath}`
]);

if (embeddedInfoPlistPath && fs.existsSync(embeddedInfoPlistPath)) {
await spawn('plutil', [
'-insert',
'NSAppleEventsUsageDescription',
'-string',
`An application in ${product.embedded.nameLong} wants to use AppleScript.`,
`${embeddedInfoPlistPath}`
]);
await spawn('plutil', [
'-replace',
'NSMicrophoneUsageDescription',
'-string',
`An application in ${product.embedded.nameLong} wants to use the Microphone.`,
`${embeddedInfoPlistPath}`
]);
await spawn('plutil', [
'-replace',
'NSCameraUsageDescription',
'-string',
`An application in ${product.embedded.nameLong} wants to use the Camera.`,
`${embeddedInfoPlistPath}`
]);
await spawn('plutil', [
'-replace',
'NSAudioCaptureUsageDescription',
'-string',
`An application in ${product.embedded.nameLong} wants to use Audio Capture.`,
`${embeddedInfoPlistPath}`
]);
await spawn('plutil', [
'-insert',
'NSLocalNetworkUsageDescription',
'-string',
`The app uses your local network for DNS resolution and to connect to locally running services.`,
`${embeddedInfoPlistPath}`
]);
}
}

await retrySignOnKeychainError(() => sign(appOpts));
Expand Down
65 changes: 3 additions & 62 deletions build/gulpfile.vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import { compileBuildWithoutManglingTask, compileBuildWithManglingTask } from '.
import { compileNonNativeExtensionsBuildTask, compileNativeExtensionsBuildTask, compileAllExtensionsBuildTask, compileExtensionMediaBuildTask, cleanExtensionsBuildTask, compileCopilotExtensionBuildTask } from './gulpfile.extensions.ts';
import { copyCodiconsTask } from './lib/compilation.ts';
import { getCopilotExcludeFilter, prepareBuiltInCopilotRipgrepShim } from './lib/copilot.ts';
import type { EmbeddedProductInfo } from './lib/embeddedType.ts';
import { useEsbuildTranspile } from './buildConfig.ts';
import { promisify } from 'util';
import globCallback from 'glob';
Expand Down Expand Up @@ -288,10 +287,6 @@ function packageTask(platform: string, arch: string, sourceFolderName: string, d

const name = product.nameShort;
const packageJsonUpdates: Record<string, unknown> = { name, version };
const isInsiderOrExploration = quality === 'insider' || quality === 'exploration';
const embedded = isInsiderOrExploration
? (product as typeof product & { embedded?: EmbeddedProductInfo }).embedded
: undefined;

if (platform === 'linux') {
packageJsonUpdates.desktopName = `${product.applicationName}.desktop`;
Expand All @@ -312,44 +307,13 @@ function packageTask(platform: string, arch: string, sourceFolderName: string, d
json.date = readISODate(out);
json.checksums = checksums;
json.version = version;
if (embedded) {
json['darwinSiblingBundleIdentifier'] = embedded.darwinBundleIdentifier;
const embeddedObj = json['embedded'] as EmbeddedProductInfo;
embeddedObj['darwinSiblingBundleIdentifier'] = json['darwinBundleIdentifier'] as string;
}
return json;
}))
.pipe(es.through(function (file) {
productJsonContents = file.contents.toString();
this.emit('data', file);
}));

const packageSubJsonStream = embedded
? gulp.src(['package.json'], { base: '.' })
.pipe(jsonEditor((json: Record<string, unknown>) => {
json.name = embedded.nameShort;
return json;
}))
.pipe(rename('package.sub.json'))
: undefined;

const productSubJsonStream = embedded
? gulp.src(['product.json'], { base: '.' })
.pipe(jsonEditor((json: Record<string, unknown>) => {
// Preserve the host's mutex name before overlaying embedded properties,
// so the embedded app can poll for the correct InnoSetup -ready mutex.
const hostMutexName = json['win32MutexName'];
Object.keys(embedded).forEach(key => {
json[key] = embedded[key as keyof EmbeddedProductInfo];
});
if (hostMutexName) {
json['win32SetupMutexName'] = hostMutexName;
}
return json;
}))
.pipe(rename('product.sub.json'))
: undefined;

const license = gulp.src([product.licenseFileName, 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.', allowEmpty: true });

// TODO the API should be copied to `out` during compile, not here
Expand Down Expand Up @@ -401,12 +365,6 @@ function packageTask(platform: string, arch: string, sourceFolderName: string, d
sources,
deps
];
if (packageSubJsonStream) {
mergeStreams.push(packageSubJsonStream);
}
if (productSubJsonStream) {
mergeStreams.push(productSubJsonStream);
}
let all = es.merge(...mergeStreams);

if (platform === 'win32') {
Expand Down Expand Up @@ -442,9 +400,6 @@ function packageTask(platform: string, arch: string, sourceFolderName: string, d
'resources/win32/code_70x70.png',
'resources/win32/code_150x150.png'
], { base: '.' }));
if (embedded) {
all = es.merge(all, gulp.src('resources/win32/sessions.ico', { base: '.' }));
}
} else if (platform === 'linux') {
const policyDest = gulp.src('.build/policies/linux/**', { base: '.build/policies/linux' })
.pipe(rename(f => f.dirname = `policies/${f.dirname}`));
Expand All @@ -463,21 +418,7 @@ function packageTask(platform: string, arch: string, sourceFolderName: string, d
...config,
platform,
arch: arch === 'armhf' ? 'arm' : arch,
ffmpegChromium: false,
...(embedded ? {
darwinMiniAppName: embedded.nameShort,
darwinMiniAppDisplayName: embedded.nameLong,
darwinMiniAppBundleIdentifier: embedded.darwinBundleIdentifier,
darwinMiniAppIcon: 'resources/darwin/agents.icns',
darwinMiniAppAssetsCar: 'resources/darwin/agents.car',
darwinMiniAppBundleURLTypes: [{
role: 'Viewer',
name: embedded.nameLong,
urlSchemes: [embedded.urlProtocol]
}],
win32ProxyAppName: embedded.nameShort,
win32ProxyIcon: 'resources/win32/sessions.ico',
} : {})
ffmpegChromium: false
};

let result: NodeJS.ReadWriteStream = all
Expand All @@ -489,8 +430,8 @@ function packageTask(platform: string, arch: string, sourceFolderName: string, d
'**',
'!LICENSE',
'!version',
...(platform === 'darwin' && !isInsiderOrExploration ? ['!**/Contents/Applications', '!**/Contents/Applications/**'] : []),
...(platform === 'win32' && !isInsiderOrExploration ? ['!**/electron_proxy.exe'] : []),
...(platform === 'darwin' ? ['!**/Contents/Applications', '!**/Contents/Applications/**'] : []),
...(platform === 'win32' ? ['!**/electron_proxy.exe'] : []),
], { dot: true }));

if (platform === 'linux') {
Expand Down
20 changes: 0 additions & 20 deletions build/gulpfile.vscode.win32.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import product from '../product.json' with { type: 'json' };
import { getVersion } from './lib/getVersion.ts';
import * as task from './lib/task.ts';
import * as util from './lib/util.ts';
import type { EmbeddedProductInfo } from './lib/embeddedType.ts';

import { createRequire } from 'module';
const require = createRequire(import.meta.url);
Expand Down Expand Up @@ -112,25 +111,6 @@ function buildWin32Setup(arch: string, target: string): task.CallbackTask {
Quality: quality
};

const isInsiderOrExploration = quality === 'insider' || quality === 'exploration';
const embedded = isInsiderOrExploration
? (product as typeof product & { embedded?: EmbeddedProductInfo }).embedded
: undefined;

if (embedded) {
// VS Code's sibling is the embedded app.
productJson['win32SiblingExeBasename'] = embedded.nameShort;
// The embedded app's sibling is VS Code.
if (productJson['embedded']) {
productJson['embedded']['win32SiblingExeBasename'] = product.nameShort;
}
definitions['ProxyExeBasename'] = embedded.nameShort;
definitions['ProxyAppUserId'] = embedded.win32AppUserModelId;
definitions['ProxyNameLong'] = embedded.nameLong;
definitions['ProxyExeUrlProtocol'] = embedded.urlProtocol;
definitions['ProxyMutex'] = embedded.win32MutexName;
}

if (quality === 'stable' || quality === 'insider') {
definitions['AppxPackage'] = `${quality === 'stable' ? 'code' : 'code_insider'}_${arch}.appx`;
definitions['AppxPackageDll'] = `${quality === 'stable' ? 'code' : 'code_insider'}_explorer_command_${arch}.dll`;
Expand Down
20 changes: 0 additions & 20 deletions build/lib/embeddedType.ts

This file was deleted.

4 changes: 4 additions & 0 deletions build/lib/i18n.resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@
"name": "vs/workbench/contrib/externalUriOpener",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/agentsAppMergedBanner",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/welcomeGettingStarted",
"project": "vscode-workbench"
Expand Down
Loading
Loading