Set build name/label in build process in Team Foundation Server 2013 - tfs

I'm trying to edit my build template to set the build name to be the same as my msi name. My msi-file is created with wix with a name "Product 1.0.0..msi" and I want the "Product 1.0.0." to be the build name in TFS instead of the normal "$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)".
The assembly-version on the output of MSBuild is also correct, so a solution using that is acceptable too.
Is this possible to do in a custom build template in Visual Studio? Anyone who have done this?

If you edit the build definition and go to the process tab you should change the build number to $(build and)_1.0.0$(Rev:.r) which will give you the number
then get the TF Version activity from the TFS Community Build Tools on codeplex. Then you can configure TF Version in "Get Version" mode to populate the variable. With that you have to put something in there to update the msi file.
http://tfsbuildextensions.codeplex.com/wikipage?title=How%20to%20integrate%20the%20TfsVersion%20build%20activity&referringTitle=Documentation

Right button on build definition on Team Explorer, and "Edit Build Definition..." submenu. Rename the field "Build Definition Name:", like this:

Related

How to add a new Activity type to the Task work item in TFS 2018

I would like to do exactly what is being proposed in this question, but instead of VSTS, I'd like to do it in on a On-Premise TFS(2018):
"Is it possible to add a new Activity type on the Task work item in
VSTS and, if so, how can I do it? Thanks!"
I've followed the instructions explained here to export and modify my custom project template. However when I follow the instructions here(Step 5 of the original instructions) I get stuck at the "Configure Features" step, that does not appear in my implementation of TFS (Yes, my user account is part of "Project Collection Administrators"):
I'm sort of confused, there are people that claim this can't be done. In fact it's even stated in the process page:
"Changes you make to a process template will only apply to new team
projects. They will not affect existing team projects."
But the instructions clearly indicate that it can be, I just done see the "Configure features" link? The instructions indicate that the use case is after a TFS update, but if I just changed my custom template, how would I enable this, so I can implement my changes in the custom template?
Try below ways to achieve that:
Import, export, and manage work item types with witadmin
Export the specific work item type definition file (Task in your scenario). Run command prompt with administrator, if you are
using VS 2017, then cd C:\Program Files (x86)\Microsoft Visual
Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team
Explorer
witadmin exportwitd /collection:http://server:8080/tfs/DefaultCollection /p:ProjectName
/f:C:\temp\MyTask.xml /n:Task
Edit the exported WIT definition file (xml) with text editor, add a new Activity Type (e.g.: TestActivity0727in below
sample)
like below:
Save the file and import to TFS with witadmin command:
witadmin importwitd /collection:http://server:8080/tfs/DefaultCollection /p:ProjectName
/f:C:\temp\MyTask.xml /n:Task
Refresh the page, now the new activity should be worked in Task
work item.
Edit with TFS Process Template Editor, reference below screenshot:
For VS 2017, install the extension TFS Process Template Editor
For VS 2015, just install Microsoft Visual Studio Team Foundation
Server 2015 Power Tools

Build process template not visible when creating build definition in TFS 2010

I am trying to add a new build process template (XAML) to TFS 2010, using VS 2017.
I have committed it under the BuildProcessTemplates folder for the team project and it is shown in the Source Control Explorer, but it doesn't show up in the drop down list on the Process tab of the Build definition dialog.
The drop down list only shows the other 3 templates (DefaultTemplate.xaml, UpgradeTemplate.xaml...) in the folder.
I found this description of how the dropdown list works:
This list is populated with the following build process templates:
The ones that come out of the box (DefaultTemplate.xaml,
UpgradetTemplate.xaml and LabDefaultTemplate.xaml). These are created
for every new team project (this can be changed by modifying the
process template)
Any build process templates that have previously
been added for any other build definitions in the same team project.
The last bullet is a bit unintuitive, but it means that if a developer creates
a new build definition in team project A, and adds a new build process
template (for example by by selecting New and then browse to an
existing .xaml file),
this build process template will be available in the process dropdown
list for all other build definitions in team project A. It will not be
available in team project B, but has to be added in the same way.
https://blog.ehn.nu/2010/11/managing-build-process-templates-in-tfs-2010-build/
I tried clicking on "New..." next to the drop down list. It only shows the option
to "Select a team project that contains your build process template", there's no option to create a new one.
If I enter the path to the .xaml file under "Path in repository" and click on OK I get an error: "Object reference not set to an instance of an object"
Screenshot of error
How do I make the new build process template available for build definitions?
Normally, you just need to check in the template xaml files under the BuildProcessTemplate folder, then in Build Definition Process tab, Click New… button to add these xaml files from that fold. The path of xaml should have a \ sample in front of it.
In your case, also try to clear TFS and VS cache, then try it again.
If delete cache folder still doesn't work, please try it with older Visual Studio Version such as Visual Studio 2015 and create a new build definition, select the template.
Also take a look at this blog shows the customize process template experience in TFS 2013, which may be helpful.

How to configure multiple project in Team Build 2015

How to configure multiple project in Team Build 2015 (using the new task based workflow, not the old XAML builds).
Right now I see only one solution can be configured for Visual Studio build task.
You can easily add more than one build task that explicitly calls a single solution. That will also allow you to control the order that they get built.
Just select "Visual Studio Build" from the sea list. This works in Visual Studio Online and TFS 2015.
As others have mentioned there are multiple ways to accomplish this:
Add multiple "Build with MsBuild" or "Build with Visual Studio" tasks. Let each task build a specific solution by entering the full path to the solution/
Use the wildcard solution to find all solutions **/*.sln will build all solutions in the workspace.
You can use a workspace cloaking rule if you're using TFVC for source control to exclude one of your solution files from the workspace, that way it won't be downloaded from sourcecontrol and won't be built.
Use ; to combine multiple search patterns: **/abc.sln;**/xyz.sln
Create a custom msbuild file (e.g. buildprojects.proj) which in turns invokes the msbuild to build each solution you wan to build. Configure the task in the workflow to call teh .proj file instead of the specific solutions.
You can enter a pattern. The default for the Visual Studio template is **/*.sln, which will recursively match on all .sln files in the repository/workspace.

TFS 2010 Missing Process Templates

I am trying to set up continuous integration using Visual studio 2010 and TFS 2010 and when i try to Create a new build definition, and go to Process Tab, i dont see any templates under the Build Process file(Windows workflow XAML) drop-down.
I have setup a build controller that points to our Team project collection and a build agent, in our TFS server.I am trying to setup a new build definition from my local machine Visual studio and i cant see any default templates under the Build Process file(Windows workflow XAML) drop-down.
Is there any settings i am missing ?Please let me know. Do i also need to install Visual studio in the TFS Server ?
All i need is whenever someone checks in a file, it should kick off a build and see the status if the build is broken or not !
Make sure you have a folder inside your Team Project Source Control called:
BuildProcessTemplates
Inside of there should be the following files:
DefaultTemplate.xaml
UpgradeTemplate.xaml
There are additional ones in this example, but you should have those two from the install.
If you have this folder and still cannot see anything in that dropdown let me know and we can take it from there. What most likely happened is you or someone on your team saw the folder and deleted it or moved it thinking it its placement wasn't important in the project. Or perhaps deleted the xaml files inside there.
The process section uses that folder and all files within it to display on that prompt.

In TFS, once I have the build definition setup, how to I modify the task list etc?

I setup my build definition, is that all I do when it comes to setting up my build using the Team Explorer GUI?
It seems like the only thing for me to do now is edit the msbuild .proj file?
Is there a GUI for this or its all hand editing from here on it?
Currently there is no MSBuild editor inside Visual studio, but I've read that there gonna be one in Visual Studio Team System 2010 (one based on Workflow Foundation renderer).
If you really want a GUI you could try Microsoft Build Sidekick v2 but it is not free (55$) and not very useful in my opinion.
In TFS 2008 some of the information about a build can be edited through the GUI, but not much. If you right click on the build definition and choose Edit Build Definition you can change the workspace mappings, retention policy, drop location, and triggers. To change anything else you need to edit the .proj file.
What is it that you're trying to do? If you ask a specific question you might get interesting answers.

Resources