handle homepage links
This commit is contained in:
parent
0d9d4822f5
commit
6e57d39c51
3 changed files with 31 additions and 1 deletions
|
@ -7,6 +7,9 @@
|
||||||
<Tags>${ tags }</Tags>
|
<Tags>${ tags }</Tags>
|
||||||
<GalleryFlags>Public</GalleryFlags>
|
<GalleryFlags>Public</GalleryFlags>
|
||||||
<% if (license) { %><License>${ license }</License><% } %>
|
<% if (license) { %><License>${ license }</License><% } %>
|
||||||
|
<Properties>
|
||||||
|
<% if (links.homepage) { %><Property Id="Microsoft.VisualStudio.Services.Links.Source" Value="${ links.homepage }" /><% } %>
|
||||||
|
</Properties>
|
||||||
</Metadata>
|
</Metadata>
|
||||||
<Installation>
|
<Installation>
|
||||||
<InstallationTarget Id="Microsoft.VisualStudio.Code"/>
|
<InstallationTarget Id="Microsoft.VisualStudio.Code"/>
|
||||||
|
|
|
@ -116,6 +116,10 @@ export function toVsixManifest(manifest: Manifest, files: IFile[]): Promise<stri
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const links = {
|
||||||
|
homepage: manifest.homepage
|
||||||
|
};
|
||||||
|
|
||||||
return readFile(vsixManifestTemplatePath, 'utf8')
|
return readFile(vsixManifestTemplatePath, 'utf8')
|
||||||
.then(vsixManifestTemplateStr => _.template(vsixManifestTemplateStr))
|
.then(vsixManifestTemplateStr => _.template(vsixManifestTemplateStr))
|
||||||
.then(vsixManifestTemplate => vsixManifestTemplate({
|
.then(vsixManifestTemplate => vsixManifestTemplate({
|
||||||
|
@ -126,7 +130,8 @@ export function toVsixManifest(manifest: Manifest, files: IFile[]): Promise<stri
|
||||||
description: manifest.description || '',
|
description: manifest.description || '',
|
||||||
tags: (manifest.keywords || []).concat('vscode').join(';'),
|
tags: (manifest.keywords || []).concat('vscode').join(';'),
|
||||||
license,
|
license,
|
||||||
assets
|
assets,
|
||||||
|
links
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -157,6 +157,28 @@ describe('toVsixManifest', () => {
|
||||||
assert.equal(result.PackageManifest.Metadata[0].License[0], 'extension/thelicense.md');
|
assert.equal(result.PackageManifest.Metadata[0].License[0], 'extension/thelicense.md');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should add homepage link property', () => {
|
||||||
|
const manifest = {
|
||||||
|
name: 'test',
|
||||||
|
publisher: 'mocha',
|
||||||
|
version: '0.0.1',
|
||||||
|
description: 'test extension',
|
||||||
|
engines: Object.create(null),
|
||||||
|
homepage: 'https://homepage/test'
|
||||||
|
};
|
||||||
|
|
||||||
|
return toVsixManifest(manifest, [])
|
||||||
|
.then(xml => parseXml(xml))
|
||||||
|
.then(result => {
|
||||||
|
assert.ok(result.PackageManifest.Metadata[0].Properties);
|
||||||
|
assert.equal(result.PackageManifest.Metadata[0].Properties.length, 1);
|
||||||
|
assert.ok(result.PackageManifest.Metadata[0].Properties[0].Property, 1);
|
||||||
|
assert.equal(result.PackageManifest.Metadata[0].Properties[0].Property.length, 1);
|
||||||
|
assert.equal(result.PackageManifest.Metadata[0].Properties[0].Property[0].$.Id, 'Microsoft.VisualStudio.Services.Links.Source');
|
||||||
|
assert.equal(result.PackageManifest.Metadata[0].Properties[0].Property[0].$.Value, 'https://homepage/test');
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('toContentTypes', () => {
|
describe('toContentTypes', () => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue