Spacely BetaBlogger and MSBuild

by john 3/4/2007 6:26:00 AM

[Codegear] have very kindly given me permission to discuss Spacely, the upcoming release of [Delphi2007]. What better way to launch my blog than describe one of the new features.

[Delphi2007] is going to be using msbuild, which is a new build platform from Microsoft that comes as part of dotnet 2.0.

Documentation can be found here 

I think this is a pretty exciting move, because not only can I do more during the build process right out of the box, but there also seems to be quite a community building around msbuild.

For example I found this website

They provide a number of additional build tasks that I hope to be able to leverage when building my Delphi projects.

The steps to add a build task are as follow:-

1) Create a file containing the task definition. This one just zips up the contents of the project directory

 <Project xmlns="">

<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
<DefaultExclude Include="**\*.zip" />
<DefaultExclude Include="**\*.txt" />
<DefaultExclude Include="**\*.dpr" />
<DefaultExclude Include="**\*.dproj" />
<DefaultExclude Include="**\*.dproj.local" />
<DefaultExclude Include="**\*.identcache" />
<DefaultExclude Include="**\*.res" />
<DefaultExclude Include="**\*.dcu" />
<DefaultExclude Include="**\*.pas" />
<DefaultExclude Include="**\*.dfm" />

<ZipFiles Include="**\*.*" Exclude="@(DefaultExclude)" />

<Target Name="Zip">
<Zip Files="@(ZipFiles)" ZipFileName="" />

2) I named this file extra.proj

3) Open up the Delphi project file and insert the following line just after the project tag

  <Import Project="extra.proj" />

4)  From the commandline, I can build the application and perform the additional task using

msbuild BuildThis.dproj /t:build,zip 

Just in case your wondering, dproj is the new file extension for Delphi project files.

Next step is to actually start reading the msbuild documentation :)



 It's possible to set the default target(s) inside the dproj file. So the first few lines now looks like

<Project xmlns="" InitialTargets="build;zip">
  <Import Project="extra.proj" />


Notice the InitialTargets attribute

I am now able to run the zip task as part of an IDE build. 



Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


msbuild | Betablogger | Delphi | CodeGear | Spacely

Related posts


Comments are closed

Powered by BlogEngine.NET
Theme by Mads Kristensen

About the author

Name of author John Moshakis
I'm a software developer living in Toronto..

E-mail me Send mail


<<  May 2022  >>

View posts in large calendar


    Recent posts

    Recent comments



    Don't show


      The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

      © Copyright 2022

      Sign in