次の方法で共有


Analysis Services 2008 R2 Team Build in TFS 2010

If you’ve tried to build a BIDS project in a team build, you’ve noticed that BIDS doesn’t support MSBuild. There are a couple of workarounds for this.

  1. Find MSBuild extensions for the various BIDS projects. They’re out there.
  2. Run the build through Visual Studio—a “DevEnv” build.

I chose the second option. I downloaded the latest Community TFS Build Extensions and followed the instructions to add the activities to the workflow and the toolbox.  The activity I cared about was the “VSDevEnv” activity, and that’s in the TfsBuildExtensions.Activities.dll assembly.  I added it to a new tab called “Team Build Contributions” (VSDevEnv is the fourth activity):

image

I copied the DefaultTemplate.xaml file into a DevEnvTemplate.xaml. You can navigate down to a subworkflow called “Process > Sequence > Run on Agent > Try Compile and Test > For Each Configuration > Compile and Test > if Build Settings … > For Each Project … > Try to Compile … > Compile the Project”. In it, there is an option called “Run MSBuild for Project”.  I removed the “Run MSBuild for Project” activity shown below:

image

and I replaced it with the “VSDevEnv” extension activity. I added the “Copy Directory” activity, since the MSBuild activity copies the binaries to a drop and the VSDevEnv activity doesn’t.  You can see the new flow in the picture below:

image

I added the BIDS DevEnv path to my global “path” variable on the system, but you can add it to the user path on the build server. I also tagged the build server with “BIDS08” to direct the build to a machine that could support that build.

I had to set the input path—”localProject” already had the name of the file I was trying to build; set it to the project if you can rather than the solution.

The “OutputFile” is the log file from the build. I set that to outputDirectory + "\" + System.IO.Path.GetFileName(localProject) + ".log".  

 image

For “CopyDirectory”, I used BinariesDirectory as the Destination, and I used System.IO.Path.GetDirectoryName(localProject) + "\bin\" as the input directory.

image

At the end, I had all four of my Analysis Service build assets in the drop folder. Hopefully, I can tackle deployment in another post.