Bandara
Bandara

Reputation: 800

How do you share code between two VSTS build tasks?

I need to share some TypeScript classes between two VSTS build tasks. As I understand, all compiled files required to be in the task folder to be able to function the build task.

Current scenario: I have common files in common folder in the root folder of the VSTS code base. I have two task A and B which utilize these classes. When I package the code it ignores the common folder.

Is it possible to achieve this in above scenario? Please advice.

Thanks.

Upvotes: 1

Views: 331

Answers (2)

Eddie Chen - MSFT
Eddie Chen - MSFT

Reputation: 29958

Your understand is correct. The build tasks are stored in separate folders after upload them to VSTS/TFS. So you must place all the required files in the build task folder when you packing it. If you want to share the classes, you can consider to use npm package.

Upvotes: 1

PatrickLu-MSFT
PatrickLu-MSFT

Reputation: 51073

This can't be achieved. Each build task are independent of each other. You may have to add the classes for both task respectively.

Here is the sample of VSTS task in GitHub for you reference: vsts-tasks/Tasks/

Upvotes: 2

Related Questions