I’m trying to set up Team Foundation Build and so far it’s running ok with builds, tests and code analysis.
My problem is, that I can’t figure out how to build just a subset of the projects included in the solution. I know how to use the configuration manager to create custom solution configuration that will build/deploy a selection of my projects. But when I create a new build definition, I only get the default “Debug” and “Release” configurations.
alt text http://img686.imageshack.us/img686/7453/builddefinitionprojectf.jpg
How do I set up a Team Foundation Build that only includes a selection of the projects in the solution?
I know I may be on the completely wrong track here, but I've been digging around for a while and so far it's my best guess.
Your custom configurations won't appear in the build definition wizard because we don't parse the solution file format. You can, however, just type it in and that will work just fine without manually editing the TFSBuild.proj file.
You will need to edit the TFSBuild.proj file generated by Build Definition created.
I have never used it to specify other configuration, but try using ConfigurationToBuild:
<ItemGroup>
<ConfigurationToBuild Include="Release|Any CPU">
<FlavorToBuild>Release</FlavorToBuild>
<PlatformToBuild>Any CPU</PlatformToBuild>
</ConfigurationToBuild>
</ItemGroup>
I think, you already answer your question: put the subset of the projects into the new solution and create new build definition for this solution.
What other configuration would you expect then Release and Debug?
Related
Is there a way that I can make a build definition for TFS2012 that will include all projects in a given folder ($\AllProjects for example)? I would like such a feature so that each time a new project was added anywhere in the child folders I don't have to manually update the build definition. Is this possible?
I think this is not possible, but you can create one solution just for this purpose (something like DeployProjects.sln), with all projects that you want to build. For each new project, you will add it to this solution.
If you don't mind customizing the workflow you can do this.
Use the FindMatchingFiles activity to find all csproj files, then loop through them and use the MSBuild activity to build each one.
Although, I would stick with Rafael's advice and just create a sln specifically for TFS Build that contains all projects you want to build.
Ok so I have to admit, I'm very new to all of this build automation stuff. But basically what I'm wondering is if there is a way to wire up my build definitions in such a way that if I have a case like so
ProjectA produces ComponentA.dll
ProjectB references ComponentA.dll and produces ComponentB.dll
ProjectC references ComponentB.dll
then when I make changes to ProjectA and check them in, the build process would automatically also build ProjectB, and finally ProjectC, and report any errors.
So is there a way to accomplish this, or should this type of thing be handled somehow completely differently in the first place?
The process you are referring to is the crux of the practice known as Continuous Integration.
TFS does it very well: simply set your build definition Trigger to Continuous Integration and set the Workspace working folder to the parent folder of the three projects. This way, any change in one of the projects will trigger a build.
MSDN: Build and Deploy Continuously
You can use a visual studio solution and use project references between the projects. Then build the solution on your build server.
I've got a solution to build an installer with InstallShield. The solution worked local. Now I've checked it in to the version control of our TFS2010 and I want to build the InstallShield-solution after all other solutions have been built.
What is the best way to build this solution?
Integrate this solution into the normal build as one of the many solutions and build it as the last one? How can I set special folders (pathvariables) I defined in the InstallShield-solution (PATH_TO_APP1, PATH_TO_APP2) to look for all the assemblies to put together in the setup?
Or, is it better to extend the build definition by an command-line call of MSBuild.exe with the InstallShield-solution after all the other solution have been built? But how do I set the path variables calling MSBuild.exe? Is every path variable a MSBuild-property and I set it via /p:PATH_TO_APP1="xxx"?
Set up the InstallShieldPathVariableOverrides itemgroup, or if you're not using the standard .isproj support, pass your own itemgroup into the InstallShield task's PathVariables property.
Aidan Ryan shows how to do the former, which looks like this. I believe his comment about needing to override the whole tree is no longer necessary in IS2012.
<ItemGroup>
<InstallShieldPathVariableOverrides
Include="((location))">
<PathVariable>((PATH_VARIABLE_NAME))</PathVariable>
</InstallShieldPathVariableOverrides>
</ItemGroup>
I have a solution the source Control (TFS 2008) with multiple projects. Some of the projects are independent of each other. I dont want to build the complete solution instead sometimes we need to build some of the projects.
I am a total newbie in Team Build. Please help how i can use the
<SolutionToBuild Include="$(BuildProjectFolderPath)/../../Development/Main/Build-Development.sln">
<Targets></Targets>
<Properties></Properties>
</SolutionToBuild>
to select only some of the projects from the solution.
Kindly give a detailed answer for me as i am absolutely clueless about it.
Thanks
The easiest way to do this is to define a new solution configuration for your existing solution. Just follow these steps:
Open your solution
From the main Visual Studio menu, select Build > Configuration Manager...
Click the "Active solution configuration" drop down and select New...
Enter a name for the new configuration (e.g. "TFS")
Specify the configuration to copy settings from (e.g. "Release")
In the "Build" column, uncheck any projects you don't want to build from your TFS Build
Click Close
Update your configurations to build to use the configuration you just defined
That's it! There's no need to manage multiple solutions and new projects should be included in your new configuration by default. Switching them off is as simple as clearing a checkbox.
Create a second build and a second .sln file to do the build. We have one project with three different builds in it (a "main" build, a "utility" build, and a "code analysis" build).
Manually create a solution that includes all the projects you want to build and check it in. Then create a new build using the wizard. Finally, edit the created .PROJ file (found in $/ProjectName/TeamBuildTypes) and point it to the correct solution.
Alternatively, you could copy and modify your existing .PROJ file, but since you said you're a newbie, I'd stick with the first to begin with.
Does anybody know how can I configure TFS Build to build a set of projects in a solution instead?
The solution I have, has 16 projects but for one of my build definitions I want some of them to be compiled.
The easiest way in my opinion is to create a new solution file. There is nothing stopping you from having several solutions that reference the same projects (or some subset).
The other way is to create a new configuration. In Solution Explorer, rightclick the root node -> Configuration Manager. In addition to standard configs like "debug" or "release" you can create your own custom ones. For each combination of config + platform, you can use the checkboxes below to define which projects will be built and what settings they'll use.
Whatever you choose, you'd edit your TFSBuild.proj file to point to the desired solution and/or configuration. MSDN instructions: http://msdn.microsoft.com/en-us/library/bb399127.aspx
Once you create your build it will make a TFSBuild.proj file in source control (you can right click on the build in Team Explorer and select Configuration Folder to find it.
Open this file and find the tag that has "SolutionToBuild". That tag has sub tags for specifying targets. I think if you enter the projects you want to build in there (semicolon delimited) then it will just build those.
If you have not made your build yet then (as John Saunders said) you can specify the projects in the setup of the build. (After you have set it up you cannot do that again.