Lalindu
Lalindu

Reputation: 349

Read VSTS/TFS extension version from extension code

Is there any way to read extension version number from within the extension?

We are manually adding version to vss-extension.json and task.json . It will be great help if someone provide guidelines to retrieve version from either of these places.

1) vss-extension.json enter image description here

2) task.json

enter image description here

Upvotes: 1

Views: 325

Answers (1)

PatrickLu-MSFT
PatrickLu-MSFT

Reputation: 51183

You could use Build and Release tasks for Extensions which released by Microsoft.

This extension provides build and release tasks for packaging and publishing Visual Studio Team Services (VSTS) extensions to the Visual Studio Marketplace.

enter image description here Use the query version task: query an extension's version (to make it easy to increment on your next package or publish)

For how to do this, you could refer the source code in GitHub.

Upvotes: 1

Related Questions