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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ BuildTasks/*Extension*/common.ts
*.vsix

/.vs
*.sqlite
*.sqlite
/slnx.VC.VC.opendb
/slnx.VC.db
20 changes: 19 additions & 1 deletion BuildTasks/Common/Common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,25 @@ export function setTfxManifestArguments(tfx: ToolRunner): (() => void) {
const isPreview = extensionVisibility.indexOf("preview") >= 0;

jsonOverrides.public = isPublic;
if (isPreview) { jsonOverrides.galleryFlags = ["Preview"]; };

if (isPreview) {
jsonOverrides.galleryFlags = jsonOverrides.galleryFlags || [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this line isn't doing anything

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Replaced the line below with .Push.
Kept the coalesce in there to make the code aligned with the pricing option below and to make sure it keeps working if the order is changed.

jsonOverrides.galleryFlags.Push("Preview");
};
}

const extensionPricing = tl.getInput("extensionPricing", false);
if (extensionPricing && extensionPricing !== "default") {
tl.debug(`Overriding extension pricing to: ${extensionPricing}`);
jsonOverrides = (jsonOverrides || {});

const isFree = extensionPricing.indexOf("free") >= 0;
const isPaid = extensionPricing.indexOf("paid") >= 0;

if (isPaid) {
jsonOverrides.galleryFlags = jsonOverrides.galleryFlags || [];
jsonOverrides.galleryFlags.Push("Paid");
}
}

let extensionVersion = getExtensionVersion();
Expand Down
3 changes: 1 addition & 2 deletions BuildTasks/PackageExtension/PackageExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,4 @@ common.runTfx(tfx => {
}).fail(err => {
tl.setResult(tl.TaskResult.Failed, `Error occurred while updating tasks version: ${err}`);
});
});

});
274 changes: 144 additions & 130 deletions BuildTasks/PackageExtension/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,136 +32,150 @@
}
],
"instanceNameFormat": "Package Extension: $(rootFolder)",
"inputs": [
{
"name": "rootFolder",
"type": "filePath",
"label": "Root manifests folder",
"defaultValue": "",
"required": false,
"helpMarkDown": "Root folder from which the manifests are searched."
},
{
"name": "localizationRoot",
"type": "filePath",
"label": "Localization Root folder",
"defaultValue": "",
"required": false,
"helpMarkDown": "Folder where localization file(s) exist."
},
{
"name": "patternManifest",
"type": "string",
"label": "Manifest file",
"defaultValue": "vss-extension.json",
"required": false,
"helpMarkDown": "Specify the pattern for manifest files to join."
},
{
"name": "outputPath",
"type": "filePath",
"label": "Package output file",
"defaultValue": "",
"required": false,
"helpMarkDown": "Specify the path and file name of the generated vsix."
},
{
"name": "outputVariable",
"type": "string",
"label": "Output Variable",
"defaultValue": "Extension.OutputPath",
"required": false,
"helpMarkDown": "The variable name to assign the location of the generated package to."
},
{
"name": "publisherId",
"type": "string",
"label": "Publisher ID",
"defaultValue": "",
"required": false,
"helpMarkDown": "Extension publisher ID. If not specified, the publisher specified in the manifest will be used.",
"groupName": "overrides"
},
{
"name": "extensionId",
"type": "string",
"label": "Extension ID",
"defaultValue": "",
"helpMarkDown": "Overrides extension ID. If not specified, the extension ID specified in the manifest will be used",
"required": false,
"groupName": "overrides"
},
{
"name": "extensionTag",
"type": "string",
"label": "Extension Tag",
"defaultValue": "",
"helpMarkDown": "Extension Tag to append to the extension ID",
"required": false,
"groupName": "overrides"
},
{
"name": "extensionName",
"type": "string",
"label": "Extension name",
"defaultValue": "",
"helpMarkDown": "Overrides extension name. If not specified, the extension name specified in the manifest will be used",
"required": false,
"groupName": "overrides"
},
{
"name": "extensionVersion",
"type": "string",
"label": "Extension version",
"defaultValue": "",
"helpMarkDown": "Overrides extension version. If not specified, the extension version specified in the manifest will be used",
"required": false,
"groupName": "overrides"
},
{
"name": "updateTasksVersion",
"type": "boolean",
"label": "Override tasks version",
"defaultValue": "true",
"required": false,
"helpMarkDown": "Search for contributed tasks in extension manifests and updates the version specified in each Build and Release task found.",
"groupName": "overrides"
},
{
"name": "extensionVisibility",
"type": "pickList",
"label": "Extension visibility",
"defaultValue": "",
"helpMarkDown": "Overrides extension visibility (Public vs Private) and optionally adds the Preview flag. If not specified, the extension visibility specified in the manifest will be used",
"required": false,
"groupName": "overrides",
"options": {
"default": "Not set",
"private": "Private",
"private_preview": "Private Preview",
"public_preview": "Public Preview",
"public": "Public"
}
},
{
"name": "arguments",
"type": "string",
"label": "Arguments",
"defaultValue": "",
"helpMarkDown": "Additional arguments passed to tfx.",
"required": false,
"groupName": "advanced"
},
{
"name": "cwd",
"type": "filePath",
"label": "Working Directory",
"defaultValue": "",
"required": false,
"helpMarkDown": "Current working directory when tfx is run. Defaults to the folder where the manifest is located.",
"groupName": "advanced"
}
],
"inputs": [
{
"name": "rootFolder",
"type": "filePath",
"label": "Root manifests folder",
"defaultValue": "",
"required": false,
"helpMarkDown": "Root folder from which the manifests are searched."
},
{
"name": "localizationRoot",
"type": "filePath",
"label": "Localization Root folder",
"defaultValue": "",
"required": false,
"helpMarkDown": "Folder where localization file(s) exist."
},
{
"name": "patternManifest",
"type": "string",
"label": "Manifest file",
"defaultValue": "vss-extension.json",
"required": false,
"helpMarkDown": "Specify the pattern for manifest files to join."
},
{
"name": "outputPath",
"type": "filePath",
"label": "Package output file",
"defaultValue": "",
"required": false,
"helpMarkDown": "Specify the path and file name of the generated vsix."
},
{
"name": "outputVariable",
"type": "string",
"label": "Output Variable",
"defaultValue": "Extension.OutputPath",
"required": false,
"helpMarkDown": "The variable name to assign the location of the generated package to."
},
{
"name": "publisherId",
"type": "string",
"label": "Publisher ID",
"defaultValue": "",
"required": false,
"helpMarkDown": "Extension publisher ID. If not specified, the publisher specified in the manifest will be used.",
"groupName": "overrides"
},
{
"name": "extensionId",
"type": "string",
"label": "Extension ID",
"defaultValue": "",
"helpMarkDown": "Overrides extension ID. If not specified, the extension ID specified in the manifest will be used",
"required": false,
"groupName": "overrides"
},
{
"name": "extensionTag",
"type": "string",
"label": "Extension Tag",
"defaultValue": "",
"helpMarkDown": "Extension Tag to append to the extension ID",
"required": false,
"groupName": "overrides"
},
{
"name": "extensionName",
"type": "string",
"label": "Extension name",
"defaultValue": "",
"helpMarkDown": "Overrides extension name. If not specified, the extension name specified in the manifest will be used",
"required": false,
"groupName": "overrides"
},
{
"name": "extensionVersion",
"type": "string",
"label": "Extension version",
"defaultValue": "",
"helpMarkDown": "Overrides extension version. If not specified, the extension version specified in the manifest will be used",
"required": false,
"groupName": "overrides"
},
{
"name": "updateTasksVersion",
"type": "boolean",
"label": "Override tasks version",
"defaultValue": "true",
"required": false,
"helpMarkDown": "Search for contributed tasks in extension manifests and updates the version specified in each Build and Release task found.",
"groupName": "overrides"
},
{
"name": "extensionVisibility",
"type": "pickList",
"label": "Extension visibility",
"defaultValue": "default",
"helpMarkDown": "Overrides extension visibility (Public vs Private) and optionally adds the Preview flag. If not specified, the extension visibility specified in the manifest will be used",
"required": false,
"groupName": "overrides",
"options": {
"default": "Not set",
"private": "Private",
"private_preview": "Private Preview",
"public_preview": "Public Preview",
"public": "Public"
}
},
{
"name": "extensionPricing",
"type": "pickList",
"label": "Extension pricing",
"defaultValue": "default",
"helpMarkDown": "Overrides extension pricing (Free vs Paid). If not specified, the extension pricing specified in the manifest will be used",
"required": false,
"groupName": "overrides",
"options": {
"default": "Not set",
"free": "Free",
"paid": "Paid"
}
},
{
"name": "arguments",
"type": "string",
"label": "Arguments",
"defaultValue": "",
"helpMarkDown": "Additional arguments passed to tfx.",
"required": false,
"groupName": "advanced"
},
{
"name": "cwd",
"type": "filePath",
"label": "Working Directory",
"defaultValue": "",
"required": false,
"helpMarkDown": "Current working directory when tfx is run. Defaults to the folder where the manifest is located.",
"groupName": "advanced"
}
],
"execution": {
"Node": {
"target": "PackageExtension.js",
Expand Down
12 changes: 6 additions & 6 deletions BuildTasks/PublishExtension/PublishExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,21 @@ common.runTfx(tfx => {

const publisher = tl.getInput("publisherId", false);

let extensionId = tl.getInput("extensionId", false);
const extensionId = tl.getInput("extensionId", false);
const extensionTag = tl.getInput("extensionTag", false);

if (extensionId && extensionTag) {
extensionId += extensionTag;
tl.debug(`Overriding extension id to: ${extensionId}`);
}

const extensionName = tl.getInput("extensionName", false);
const extensionVisibility = tl.getInput("extensionVisibility", false);
const extensionPricing = tl.getInput("extensionPricing", false);
const extensionVersion = common.getExtensionVersion();

const updateTasksVersion = tl.getBoolInput("updateTasksVersion", false);

if (publisher
|| extensionId
|| extensionTag
|| extensionName
|| (extensionPricing && extensionPricing !== "default")
|| (extensionVisibility && extensionVisibility !== "default")
|| extensionVersion) {

Expand All @@ -56,8 +54,10 @@ common.runTfx(tfx => {

if (publisher) { ve.editPublisher(publisher); }
if (extensionId) { ve.editId(extensionId); }
if (extensionTag) { ve.editIdTag(extensionTag); }
if (extensionName) { ve.editExtensionName(extensionName); }
if (extensionVisibility) { ve.editExtensionVisibility(extensionVisibility); }
if (extensionPricing) { ve.editExtensionPricing(extensionPricing); }
if (extensionVersion) {
ve.editVersion(extensionVersion);
ve.editUpdateTasksVersion(updateTasksVersion);
Expand Down
14 changes: 14 additions & 0 deletions BuildTasks/PublishExtension/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,20 @@
},
"groupName": "manifest"
},
{
"name": "extensionPricing",
"type": "pickList",
"label": "Extension pricing",
"defaultValue": "default",
"helpMarkDown": "Overrides extension pricing (Free vs Paid). If not specified, the extension pricing specified in the manifest will be used",
"required": false,
"groupName": "manifest",
"options": {
"default": "Not set",
"free": "Free",
"paid": "Paid"
}
},
{
"name": "outputVariable",
"type": "string",
Expand Down
Loading