parent
1749c1c3c4
commit
d3d40f94f6
4 changed files with 26 additions and 1 deletions
|
@ -8,6 +8,8 @@
|
|||
<GalleryFlags>Public</GalleryFlags>
|
||||
<Properties>
|
||||
<% if (links.repository) { %><Property Id="Microsoft.VisualStudio.Services.Links.Source" Value="${ links.repository }" /><% } %>
|
||||
<% if (galleryBanner.color) { %><Property Id="Microsoft.VisualStudio.Services.Branding.Color" Value="${ galleryBanner.color }" /><% } %>
|
||||
<% if (galleryBanner.theme) { %><Property Id="Microsoft.VisualStudio.Services.Branding.Theme" Value="${ galleryBanner.theme }" /><% } %>
|
||||
</Properties>
|
||||
<% if (license) { %><License>${ license }</License><% } %>
|
||||
<% if (icon) { %><Icon>${ icon }</Icon><% } %>
|
||||
|
|
|
@ -16,6 +16,7 @@ export interface Manifest {
|
|||
contributes?: { [contributionType: string]: any; };
|
||||
activationEvents?: string[];
|
||||
extensionDependencies?: string[];
|
||||
galleryBanner?: { color?: string; theme?: string; };
|
||||
_bundling?: { [name: string]: string; }[];
|
||||
_testing?: string;
|
||||
|
||||
|
|
|
@ -81,7 +81,8 @@ class MainProcessor extends BaseProcessor {
|
|||
publisher: manifest.publisher,
|
||||
description: manifest.description || '',
|
||||
tags: (manifest.keywords || []).concat('vscode').join(','),
|
||||
links: { repository: manifest.repository }
|
||||
links: { repository: manifest.repository },
|
||||
galleryBanner: manifest.galleryBanner || {}
|
||||
});
|
||||
}
|
||||
onFile(file: IFile): Promise<IFile> {
|
||||
|
|
|
@ -272,6 +272,27 @@ describe('toVsixManifest', () => {
|
|||
assert.equal(result.PackageManifest.Metadata[0].License[0], 'extension/thelicense.md');
|
||||
});
|
||||
});
|
||||
|
||||
it('should understand gallery color and theme', () => {
|
||||
const manifest = {
|
||||
name: 'test',
|
||||
publisher: 'mocha',
|
||||
version: '0.0.1',
|
||||
engines: Object.create(null),
|
||||
galleryBanner: {
|
||||
color: '#5c2d91',
|
||||
theme: 'dark'
|
||||
}
|
||||
};
|
||||
|
||||
return toVsixManifest(manifest, [])
|
||||
.then(xml => parseXml(xml))
|
||||
.then(result => {
|
||||
const properties = result.PackageManifest.Metadata[0].Properties[0].Property.map(p => p.$);
|
||||
assert.ok(properties.some(p => p.Id === 'Microsoft.VisualStudio.Services.Branding.Color' && p.Value === '#5c2d91'));
|
||||
assert.ok(properties.some(p => p.Id === 'Microsoft.VisualStudio.Services.Branding.Theme' && p.Value === 'dark'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('toContentTypes', () => {
|
||||
|
|
Loading…
Add table
Reference in a new issue