galleryBanner color and theme

fixes #25
This commit is contained in:
Joao Moreno 2015-11-03 16:55:57 -08:00
parent 1749c1c3c4
commit d3d40f94f6
4 changed files with 26 additions and 1 deletions

View file

@ -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><% } %>

View file

@ -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;

View file

@ -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> {

View file

@ -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', () => {