1
votes

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.

2

2 Answers

2
votes

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/

1
votes

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.