The new "VNext" build system has tasks to perform operations like MSBuild and Deploy things. One common task it has been missing out of box is the task to checkin items to tfs. The xaml builds had the provision to use tfs api's and write a c# code to perform this tasks, but dosen't seem straight forward with the powershell based "VNext" tasks. The TFS 2015 API does not have a straight way to do this as well. Is there a out of box solution to do this or any api call to checkin code during builds?
Asked
Active
Viewed 506 times
0
-
3Why do you *want* a build to modify source code? Builds should be verifying the software, not modifying it further. – Daniel Mann Mar 07 '16 at 13:40
-
We have a different versioning system where we require to checkin the version files into tfs. We do not want it to be present physically on some drive. For this we checkin our versioning files into tfs. – dhruv patel Mar 07 '16 at 16:16
-
1Why don't you automatically increment the version rather than checking in? It'sreally not a good idea to checkin during a build. – MrHinsh - Martin Hinshelwood Mar 07 '16 at 18:51
2 Answers
0
The TFA API does have a Checkin
method in VersionControl
client namespace.
Here is an example - http://singhtechies.com/programatically-checkin-file-to-tfs-using-c/

chief7
- 14,263
- 14
- 47
- 80
-
Right, sorry for not being clear, but the problem is I have activity created for xaml builds using c#, but the new build system uses powershell tasks, so if there is an out of box solution using powerhsell to checkin files, it would help in creation of powershell tasks. – dhruv patel Mar 07 '16 at 12:24
0
You can use the New-TFSChangeset cmdlet.
NAME
New-TfsChangeset
SYNOPSIS
SYNTAX
New-TfsChangeset [-Author <String>] [-Comment <String>] [[-Item] <QualifiedItemSpec[]>] [-Prompt] [-Notes
<String>] [-Override <String>] [-Recurse] [-Saved] [-Validate] [<CommonParameters>]

chief7
- 14,263
- 14
- 47
- 80