Archive for September, 2006

Using MSBuild for automated builds

So, what if you want to do automated builds that will be doing a lot of custom stuff? Well, you use the MSBuild namespace and tasks, targets, etc to create a solution. Below is an example of some code for performing a build. What the code below does is build a solution file (.sln) in a local directory that you specify in the <SolutionFile> element. I used the AssemblyInfoTask target to change version numbers during a build. This way you can dynamically change the build number for each build. The CreateItem task coupled with the copy task will drop the output files in the bin directories from the build to a different directory on your build server specified in the <OutputDirectory> element. There is more code controlling the build than what is posted but you can do a simple build using the following lines of code and the following xml file.

Engine engine = new Engine(ConfigurationManager.AppSettings["MSBuildPath"]);

Microsoft.Build.BuildEngine.Project project = engine.CreateNewProject();

project.Load(FileSystemPath + ConfigurationManager.AppSettings["BuildProjectFile"]);

project.Build();

Build.proj

<Project xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema

        DefaultTargets=UpdateAssemblyInfoFiles;BuildAll;CopyFiles xmlns=http://schemas.microsoft.com/developer/msbuild/2003>

  <Import Project=$(MSBuildExtensionsPath)\Microsoft\AssemblyInfoTask\Microsoft.VersionNumber.Targets />

  <PropertyGroup>

    <AssemblyTitle>My Assembly Title</AssemblyTitle>

    <AssemblyBuildNumberType>NoIncrement</AssemblyBuildNumberType>

    <AssemblyRevisionType>NoIncrement</AssemblyRevisionType>

    <AssemblyMajorVersion>0</AssemblyMajorVersion>

    <AssemblyMinorVersion>0</AssemblyMinorVersion>

    <AssemblyBuildNumber>0</AssemblyBuildNumber>

    <AssemblyRevision>0</AssemblyRevision>

    <AssemblyFileBuildNumberType>NoIncrement</AssemblyFileBuildNumberType>

    <AssemblyFileRevisionType>NoIncrement</AssemblyFileRevisionType>

    <AssemblyFileMajorVersion>0</AssemblyFileMajorVersion>

    <AssemblyFileMinorVersion>0</AssemblyFileMinorVersion>

    <AssemblyFileBuildNumber>0</AssemblyFileBuildNumber>

    <AssemblyFileRevision>0</AssemblyFileRevision>

    <OutputDirectory>c:\temp\</OutputDirectory>

  </PropertyGroup>

  <ItemGroup>

    <SolutionFile Include=“” />

  </ItemGroup>

  <ItemGroup>

    <BuildFiles Include=**\bin\**\*.* />

  </ItemGroup>

  <Target Name=BuildAll>

    <MSBuild Projects=@(SolutionFile) Properties=Configuration=Debug;Platform=Any CPU />

    <MSBuild Projects=@(SolutionFile) Properties=Configuration=Release;Platform=Any CPU />

    <CreateItem Include=@(BuildFiles)>

      <Output TaskParameter=Include ItemName=OutputFiles/>

    </CreateItem>

  </Target>

  <Target Name=CopyFiles DependsOnTargets=BuildAll>

    <Copy SourceFiles=@(OutputFiles) SkipUnchangedFiles=false DestinationFiles=@(OutputFiles->’$(OutputDirectory)%(Identity)’) />

  </Target>

</Project>

No Comments

Its time to Zune in


Video: Microsoft Zune

Yesterday there was a public release about Microsoft’s new Zune. This thing is pretty cool…it might be the replacement for my archos. There is an official Zune site: Coming Zune, but I can’t figure what is going on with the bird catching on fire and the giant and tiny man petting and hugging a rabbit.

Here’s a quick run down of the features (from the Zune press pass site)

• Wireless Zune-to-Zune sharing. Zune lets you spontaneously share selected full-length sample tracks of your favorite songs, homemade recordings, playlists or pictures with friends wirelessly, device to device. You can listen to any song you receive up to three times in three days. And if you like a song you hear and want to buy it, you can flag it right on your device to easily find it later.
• Your own personalized Zune. Zune is easy to use and easy to love. You can choose one of three base colors, each combined with a distinctive double-shot finish created by the overlay of one color on another. The player also can easily be customized with your favorite pictures.
• Large color screen. Zune comes with a bright 3-inch LCD video screen that works in portrait or landscape mode. Your music, video and pictures never looked better.
• 30GB player. Zune stores up to 7,500 songs, 25,000 pictures or 100 hours of video. You can make playlists on the go and watch a slide show while you’re listening. Watching video in landscape mode gets the most out of the vivid display.
• Zune Pass. Downloads or a subscription? It’s your choice. A Zune Pass subscription gives you “all you can eat” access to discover and explore the Zune Marketplace.
• Built-in FM tuner. With the built-in FM tuner you can listen to local FM radio stations or tune in to programming while you’re at your local health club, for example. Advanced tuning capabilities allow you to see the name of the song currently playing on selected frequencies.

The DJ mode sounds amazing! The Zune looks like a great piece of technology. Watch out iPod.

Looks like they will be out in stores around November.

No Comments