Building System For Large C#/XNA Projects

This Post will talk about our custom Building System used to create the PloobsEngine MSI Package. Lots of time ago, when the engine code and the project number were smaller, we could afford to build our packages by hand, but when things got bigger and bigger the necessity for something fully automatizated became obvious.

The main funcionalities of our Building System are:

  1. Download Latest/Specific version of your repo (Mercurial)
  2. Compile all Projects, Tests and Demos
  3. Run Some Tests
  4. Compile Documentation
  5. Create and compress the Package (generate the Msi file)
  6. Upload to a Server (ftp)
  7. Notify People (send emails)

Here we will describe with details how each part was implemented, showing some parts of the used scripts.  (Everything is hosted in a Windows 7 machine).

Download Latest/Specific version of your repo.
As said, We used Mercurial for source code management. To download the repo and update to the latest version we used the following script.

@echo off
echo Downloading Ploobs HG Repo
cd /
if exist %RepoPath%/port-ploobsengine   goto NEXT
md %RepoPath%\
cd %RepoPath%\
call hg clone
if %errorlevel% 1 (
   echo Failure Reason Given is %errorlevel%
   chdir /d %OLDDIR%
   exit /b %errorlevel%
cd /

cd %RepoPath%port-ploobsengine
call hg pull
call hg update --clean
cd /

The script is very simple, it just creates the repo folder and clone the repo (if it does not exists yet) and then pull and updates its contents to the latest remote version. (the bin folder of the TortoiseHg must be on the Windows Path. If you use SVN or git or …. just adapt the script).

To those that are curious, our public repo is:

Compile all Projects, Tests and Demos
We have lots of different types of projects in PloobsEngine, then we need to use different tools to build each of them. The following script shows how to deal with these situations:
First of all: Set some Environment Variables (MSBuild Path, XNA PATH, .Net Framework Path …)

SET PATH=%*;%XNAGSv4%Tools;%XNAGSShared%XnaPack;%XNAGSShared%Device Center;C:\Windows\Microsoft.NET\Framework\v4.0.30319\;C:\Windows\Microsoft.NET\Framework\v3.5\;C:\Windows\Microsoft.NET\Framework\v2.0.50727;%PATH%

Using Msbuild for content pipeline and main XNA project

The content pipeline / XNA project are just “regular” Visual Studio projects, to build them we just used the following lines (adapt to your needs)

msbuild %RepoPath%\PloobsEngine\PloobsEngineContent\PloobsEngineContent.contentproj /p:XNAContentPipelineTargetPlatform=Windows;XNAContentPipelineTargetProfile=HiDef;TargetFrameworkVersion=v4.0;Configuration=Release
msbuild %RepoPath%\PloobsEngine\PloobsEngine\PloobsEngine.csproj /p:Configuration=Release

Using the Visual Studion IDE compiling ability directely (msbuild cant compile Visual Studio Installer projects !!!)

Some projects (like those that ends with .vdproj) cant be built using MSBuild, then we call directely the Visual studio line comand IDE utility.

echo Compiling Ploobs Updater
"%VS100COMNTOOLS%..\IDE\" /build Release %RepoPath%\PROJEC_PATH\PloobsInstallerSetup.vdproj
rd /s/q FOLDER
copy %RepoPath%\PROJECT_PATH\*.* FOLDER /Y

Just building and copying the generated contents to a folder (deleting if it already exists)

Using Msbuild to Compile/Clean Full Solutions

The script:

echo Copy Others Demos
rd /s/q SourceCodeDemos
md SourceCodeDemos
msbuild %RepoPath%\PloobsUpdater\PloobsUpdater.sln
msbuild %RepoPath%\AdvancedDemos\AdvancedDemos.sln /t:Clean
msbuild %RepoPath%\IntroductionDemo\IntroductionDemo4.0\IntroductionDemo4.0.sln /t:Clean
msbuild %RepoPath%\ReachDemos\ReachDemos.sln /t:Clean
msbuild %RepoPath%\PhoneSilverLightDemo\GraphicsApp1.sln /t:Clean

Just building the PloobsUpdater.sln Solution and cleaning some others (removing the Bin and Obj folders -> removing previous builds contents, we dont need to send then to the clients !)

Calling Some Custom Scripts

PloobsEngine depends of LOOTS of Dlls, for the end user is easier to have just one with everything inside of it, the following code shows how this can be achieved (using the Microsoft ILMerge Program)

ilmerge /out:PloobsEngineDebug.dll SharedOsiris.dll PloobsEngine.dll FarseerPhysicsXNA.dll Lidgren.Network.dll Library.dll TomShane.Neoforce.Controls.dll BEPUphysics.dll XNAnimation.dll DPSF.dll  /lib:"C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86" /targetplatform:v4,"C:\Windows\Microsoft.NET\Framework\v4.0.30319" /keyfile:XNAnimation.snk  /xmldocs  /ver: /log

For more informations about the arguments, look at the ILMerge Documentation. In this line we just merged Lots of dlls (and the xml docs of each one) and signed the generated assembly with a keyfile.

Running Some Tests

To make sure that we are delivering something that works, our building system also implements some custom unity and Visual Tests. The following script calls our Test Module and checks its answer. (if somethings wrong happens, errors are directed to us !)

echo Executing Visual Tests
cd AdvDemosBin
call AdvancedDemos.exe VisualUnitTests
echo Return Code is %errorlevel%
if %errorlevel% == 0 goto LB
   echo Tests Failed, Check the Logs
   set erro=1 #### Pack the logs and mail the programmers =P ....
   exit /b -1
del *.log
cd ..

Compiling the Documentation
We use the marvelous SandCastle project to create our documentation.
Sandcastle produces accurate, MSDN style, comprehensive documentation by reflecting over the source assemblies and optionally integrating XML Documentation Comments. It also let us to create some custom pages in order to make a full professional like manual.
The amazing thing is that SandCastle compilation can be triggered using msbuild. (the output is a .chm file), the following script shows how:

if %NODOC% == "FALSE"  goto ND
echo Compiling Ploobs Documentation
msbuild %RepoPath%\Documentation\EngineHelper.shfbproj
rd /s/q Help
md Help
copy "%RepoPath%\Documentation\Ploobs Engine Help.chm" Help /Y

Creating the Installer (using the marvelous InstallShield Visual Studio Extension)

Each piece are put together with the Install Shield Installer (ends up up a MSI package). The building process can also be triggered using msbuild !!!

echo Creating the Installer
rd /s/q PloobsEngine
md PloobsEngine
rd /s/q %RepoPath%\PloobsInstaller\PloobsInstaller\Express
msbuild %RepoPath%\PloobsInstaller\PloobsInstaller.isproj /p:Configuration=Release;Build=Complete;BuildCompressed=true;BuildSetupExe=true
xcopy %RepoPath%\PloobsInstaller\PloobsInstaller\Express\Release\DiskImages\DISK1\*.*  PloobsEngine /Y /e /i /h

We also run some custom scripts to set the right minor/minor version of the release.

Compressing with Rar (using the classic Winrar)

After the package generation, we need to compress it to a single file (not a requirement in most cases). We just used the classic Winrar for this task.

set PATH="C:\Program Files (x86)\WinRAR";%PATH%
cd PloobsEngine
rd /s/q Package
md Package
cd ..
rar a -r "PloobsEngine/Package/PloobsEngine.rar" "PloobsEngine/*"
copy %DeployPath%\Changes.pdf %DeployPath%\PloobsEngine\Package\ /Y

Uploading to FTP server (generated from the previous pass)

Then we make a simple script to connect to our FTP server to upload the rar file to the righ folder

@echo off
echo Uploading Installer to the Main Server
echo user USER> ftpcmd.dat
echo PASSWORD>> ftpcmd.dat
echo cd Web/Updater>> ftpcmd.dat
echo mkdir teste>> ftpcmd.dat
echo cd teste>> ftpcmd.dat
echo bin>> ftpcmd.dat
echo mput piece.bat>> ftpcmd.dat
echo y>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -n -s:ftpcmd.dat FTP_URL
del ftpcmd.dat

The script just generates a dummy conf file (to be able to log in the remote ftp server) and uses it as a parameter to the FTP command.

You can download our packages here:

Sending some Emails and notifications

The last step is notifying everyone involved about the new release. For this we just send some email to the righ people (We made a custom .exe to perform this task, unfortunaly the code is not avaliable but this is a very simple thing to build)

We also have some things to adjust the version number of the releases that were not shown here.

The whole proccess takes more than 4 hours to be completed and is fully automatized. (We remotely calls it and waits for the email containing the Download Link !!!)

There are lots of good build systems avaliable like Team City. I always encourage people to use them. Exceptionaly in our case, i prefered to do all by hand because of the large amount of customization we needed.

  1. #1 by Basic Human Rights on 27 de outubro de 2016 - 8:41 pm

    just beneath, are many entirely not associated web sites to ours, on the other hand, they may be certainly really worth going over

  2. #3 by on 27 de outubro de 2016 - 9:51 pm

    sThe premium that it great, then again, simply because on dimensions operated mini choose that any shape up.If you’re 5f 4inches next size requirements modifying or even exclusively put on actually tall footwear. Besides that adored that the dress

  3. #4 by on 27 de outubro de 2016 - 9:52 pm

    sThe top quality it ideal, although, due to the fact the particular sizes run small take information technology 1 shape up.If you are 5f 4inches next duration requires modifying or simply wear really high shoes or boots. Other than that adored the actual dress

  4. #5 by yogurt recipe on 27 de outubro de 2016 - 10:25 pm

    I will products this overview in the direction of 2 versions of human beings: latest Zune property owners who are looking at an improve, and people in america attempting to determine involving a Zune and an iPod. (There are other players great importance taking into consideration out there, like the Sony Walkman X, yet I expect this delivers your self plenty of info towards crank out an knowledgeable conclusion of the Zune vs gamers other than the iPod line as effectively.)

  5. #6 by on 28 de outubro de 2016 - 12:06 am

    This might be truly pretty. I like they lots. On quote is pretty then container wrapped at wonderful bow. It isn’t the essential great bracelet ever, however for the price this surpasses my personal objectives. Can’twait to promote information technology and my mother for Mother’s Day!

  6. #7 by on 28 de outubro de 2016 - 12:07 am

    Quite when i ordered this i thought things was will be per good however inexpensively established bracelet ideal of stocking stuffers. Conversely it is has made amazingly furthermore is actually thick so their not really plastic material otherwise effortlessly broken steel. The mom adored that it. This can be a little bit on the smaller part so if you need a larger wrist i wouldnt advocate it but it is therefore well worth that bargain rate!!

  7. #8 by red timberland boots on 28 de outubro de 2016 - 12:21 am

    I’m extremely impressed along with your writing talents as well as with the format to your blog. Is this a paid topic or did you modify it your self? Anyway stay up the excellent high quality writing, it is rare to peer a great weblog like this one nowadays..|

  8. #9 by food recipe sites on 28 de outubro de 2016 - 1:45 am

    Hands down, Apple’s app retailer wins by means of a mile. It really is a huge number of all types of purposes vs a as an alternative not happy option of a handful for Zune. Microsoft consists of programs, specifically inside the realm of game titles, nevertheless I’m not certainly I might require in direction of bet upon the long term if this portion is crucial toward yourself. The iPod is a substantially greater option in just that circumstance.

  9. #10 by online games online games online games on 28 de outubro de 2016 - 2:18 am

    The Zune concentrates on being a Portable Media Player. Not a web browser. Not a game machine. Probably within just the potential it will do even superior within just all those areas, nevertheless for at this time it really is a very good direction to set up and hear in direction of your audio and videos, and is with no peer within that respect. The iPod’s rewards are its world wide web traveling to and applications. If these stable additional compelling, potentially it is your least difficult determination.

  10. #11 by ガガミラノ 時計 人気 on 28 de outubro de 2016 - 3:03 am

    ガガミラノ 専門店。ガガミラノ GAGA MILANO 腕時計,ガガミラノ 時計 メンズ,ガガミラノ 時計 レディース、ガガ正規販売代理店バランススタイル!どこよりも品揃えも豊富です!

  11. #12 by Son Losch on 28 de outubro de 2016 - 3:33 am

    Thanks for another great article. Where else may anybody get that type of information in such a perfect manner of writing? I have a presentation next week, and I’m on the search for such information.

  12. #13 by home improvement books on 28 de outubro de 2016 - 5:43 am

    Concerning me and my husband we’ve owned excess MP3 gamers about the a long time than I can depend, like Sansas, iRivers, iPods (classic & touch), the Ibiza Rhapsody, and so on. But, the closing handful of yrs I’ve fixed down toward one particular line of avid gamers. Why? Because I was pleased in direction of uncover how well-designed and enjoyment towards use the underappreciated (and commonly mocked) Zunes are.

  13. #14 by health related current events on 28 de outubro de 2016 - 5:56 am

    Apple at the moment is made up of Rhapsody as an app, which is a ideal start, nevertheless it is currently hampered by the inability to retail outlet regionally upon your iPod, and includes a dismal 64kbps little bit selling price. If this alterations, then it will to some degree negate this ease for the Zune, yet the Ten music per month will nonetheless be a big additionally inside of Zune Pass’ favor.

  14. #15 by on 28 de outubro de 2016 - 6:19 am

    sThe excellent that it very good, nevertheless, mainly because on models operated small take that it a single dimensions upwards.If you are 5f 4inches and then length specifications adjusting or perhaps only put on really high footwear. Besides that enjoyed their gown

  15. #16 by on 28 de outubro de 2016 - 6:19 am

    sThe excellent that it awesome, however, due the sizes run mini bring information technology an individual dimensions increase.If you are 5f 4inches then span requirements modifying or just wear completely tall sneakers. Other than that adored on dress

  16. #17 by NIKI BRINKERHOFF on 28 de outubro de 2016 - 7:25 am

    Major thankies for the blog article.Really looking forward to read more. Will read on…

  17. #18 by on 28 de outubro de 2016 - 8:55 am

    So that once I ordered that i thought this had been will be your sweet then again inexpensively established bracelet most appropriate for the stocking stuffers. Then again it is established wonderfully as well as is actually thick hence their maybe not plastic or conveniently broken steel. My mother adored this. This is a little bit regarding the tiny side so if you need a larger wrist i wouldnt recommend that it however it is hence really worth the discount rates!!

  18. #19 by real sword on 28 de outubro de 2016 - 11:37 am

    This sword is well made and came sharp. Shipped in about a week although it was estimated for a month. It is tight in the sheath but has began to loosen up over time. I’ve cut through some water bottles with a clean slice, no problem.

  19. #20 by health in the news on 28 de outubro de 2016 - 11:43 am

    Among me and my spouse we have owned much more MP3 avid gamers more than the yrs than I can rely, together with Sansas, iRivers, iPods (classic & touch), the Ibiza Rhapsody, and so forth. But, the last number of a long time I’ve resolved down to a person line of gamers. Why? Considering that I was delighted to check out how well-designed and exciting to hire the underappreciated (and widely mocked) Zunes are.

  20. #21 by ニクソン TIME TELLER タイムテラー on 28 de outubro de 2016 - 12:11 pm

    ニクソン(NIXON)の腕時計の激安通販サイトです。ニクソン(NIXON)腕時計を 驚きの価格で販売しています。返品?交換?サービス、2年保証付きで安心。今なら全品配達料金無料!

  21. #22 by yarnell hill fire on 28 de outubro de 2016 - 1:16 pm

    Asking questions are genuinely nice thing if you are not understanding something fully, except this article gives fastidious understanding yet.|

  22. #23 by pożyczki chwilówki przez internet on 28 de outubro de 2016 - 1:25 pm

    Do you mind if I quote a couple of your articles as long as I provide credit and sources back to your weblog? My website is in the very same niche as yours and my users would certainly benefit from some of the information you present here. Please let me know if this alright with you. Appreciate it!

  23. #24 by katana sword for sale on 28 de outubro de 2016 - 1:46 pm

    Quality, Quality, Quality!

  24. #25 by Prescott Country Club Golf Course on 28 de outubro de 2016 - 1:48 pm

    Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You obviously know what youre talking about, why waste your intelligence on just posting videos to your site when you could be giving us something informative to read?

  25. #26 by софия имот on 28 de outubro de 2016 - 1:56 pm

    Oh my goodness! an amazing article dude. Thank you However I am experiencing issue with ur rss . Don’t know why Unable to subscribe to it. Is there anyone getting identical rss problem? Anyone who knows kindly respond. Thnkx

  26. #27 by robe femme 2013 on 28 de outubro de 2016 - 2:39 pm

    Simply want to say your article is as surprising. The clearness in your post is just spectacular and i can assume you are an expert on this subject. Well with your permission let me to grab your feed to keep updated with forthcoming post. Thanks a million and please continue the enjoyable work.

  27. #28 by Espace Multimédia on 28 de outubro de 2016 - 2:55 pm

    Attractive section of content. I just stumbled upon your site and in accession capital to assert that I get actually enjoyed account your blog posts. Any way I will be subscribing to your feeds and even I achievement you access consistently quickly.

  28. #29 by robe femme 5 euros on 28 de outubro de 2016 - 3:41 pm

    I think this is a real great blog post.Really thank you! Cool.

  29. #30 by Thi Erler on 28 de outubro de 2016 - 3:57 pm

    Its like you learn my mind! You seem to understand so much about this, like you wrote the guide in it or something. I feel that you simply can do with a few to pressure the message house a little bit, but other than that, that is wonderful blog. An excellent read. I’ll certainly be back.

  30. #31 by ninja swords on 28 de outubro de 2016 - 5:21 pm

    Given the price, I was a bit skeptical, but was surprised that the quality was awesome. Good weight and balance. Very sharp. Some reviews have complained that it is made in China, but the Chinese have been making swords for over 2000 years. This is a Ten Ryu katana. One of the better low price swords, since a real Japanese katana would cost between $5000 and $50,000. Dual mekugi pegs add strength so there is no looseness between the nakago and ho. The hamon doesn’t appear to be etched. I did however replace the saya with a leather wrapped one that I can wear over my shoulder.

  31. #32 by Naginata weapon on 28 de outubro de 2016 - 5:24 pm

    If you look at the question and answer section for this sword someone asked if you can cut a watermelon. Someone answered that the Damascus lines are just a decal that can be removed with chemicals. This is not true. You can see the continuation of the Damascus lines where the blade has been sharpened.

  32. #33 by full software download for windows 7 on 28 de outubro de 2016 - 5:52 pm

    Utterly pent articles, appreciate it for entropy. “The bravest thing you can do when you are not brave is to profess courage and act accordingly.” by Corra Harris.

  33. #34 by robe femme style marin on 28 de outubro de 2016 - 5:56 pm

    You could certainly see your enthusiasm in the paintings you write. The sector hopes for even more passionate writers such as you who aren’t afraid to say how they believe. At all times go after your heart.

  34. #35 by Nila Ringeisen on 28 de outubro de 2016 - 6:31 pm

    I’d been honored to get a call from my friend as soon as he identified the important recommendations shared on the site. Going through your blog write-up is a real wonderful experience. Many thanks for considering readers like me, and I want for you the best of achievements for a professional in this field.

  35. #36 by michael kors embossed large black totes on 28 de outubro de 2016 - 6:45 pm

    Fifty-five Key Street checks outside popular model Iman’utes World-wide Trendy.Stiletto Marketplace demonstrates ways to clean cashmere just like an specialist.Allie is actually ” cable ” addresses Oprah’utes final decision to absolve The Oprah Show this year.Bag Happiness Exceptional Function: Linea Pelle Handbags plus Buckle Example Sales. Have the receive!Case Snob’azines Nov Item: OSCAR En RENTA Taylor Python – just click here to penetrate to help earn.Elegance Snob has got Illamasqua, any UK collection that presented in the usa, that has a A lot of different merchandise including many of the most vibrant colours we’ng witnessed.Coquette loves the variety of methods for you to have on Donna Karan’vertisements Infinity DressFashion Heart beat Day-to-day ended up being there opening up day along with magic ended up being Jimmy Choo intended for H&Michael Worthy of Put it off?Genuine or. Steal: I’meters Certainly not Keen protects Lauren Conrad’vertisements Black Glimpse.A Jet Placed Ladies see Dita Von Teese vacant all of it at the Outrageous Indy in Paris.KRISTOPHER DUKES is desiring, sporting, plus disliking cashmere jumpsuits.Next Location Design and style fulfilled a celebrated Ervin Maysles where his / her Trademark Fashion Receives Mounted at Barneys.Don’testosterone levels close up ones dresses along with dresses – SheFinds identified best wishes designed nylons along with pantyhose and also hardwearing . feet stylishly heat this winter season.Searching and Info adores the dark sand wedge suede boots by Dolce & Gabanna. StyleBakery seemingly enclosed in sequins for time and also nightStylehive offers identified a pair of party-perfect sequined pumps, just like Badgley Mischka’azines yet at the small percentage in the cost…The Beauty Cease covers this nonsense encompassing Mac pc Volcanic Ashes Exfoliator.The Running shoe Goddess nonetheless really loves awesome types, yet recently my wife experienced the girl eye in extra classic shoes and boots this way Yves Laurent Tube!The situation is having ‘curiouser as well as curiouser’ there is much surprise. eye4style’vertisements anticipating your Bergdorf Goodman holiday getaway windows 7!
    michael kors embossed large black totes

  36. #37 by Privacy on 28 de outubro de 2016 - 7:14 pm

    Here is an excellent Weblog You may Come across Exciting that we encourage you to visit.It is not my first time to visit this site, iam browsing this web site dailly and get good information from here daily.

  37. #38 by Ich dachte darüber nach on 28 de outubro de 2016 - 7:36 pm

    Neben dir liegend kuesst du mich und streichst mir dabei ueber mein Gesicht.

  38. #39 by home on 28 de outubro de 2016 - 7:39 pm


  39. #40 by trueswords on 28 de outubro de 2016 - 7:47 pm

    Absolutely awesome, definitely gives you warm feeling every time it’s unsheathed.

  40. #41 by samurai katana sword on 28 de outubro de 2016 - 7:47 pm

    It is perfect came right on time hands down precision quality, would advise anyone searching for the real crafted sword this is ok be them

  41. #42 by The Way To Happiness on 28 de outubro de 2016 - 9:06 pm

    we came across a cool web page that you could appreciate. Take a search should you want

  42. #43 by Parking lotniskowy Gdansk on 28 de outubro de 2016 - 9:19 pm

    Howdy are using WordPress for your blog platform? I’m new to the blog world but I’m trying to get started and set up my own. Do you require any html coding expertise to make your own blog? Any help would be greatly appreciated!

1 125 126 127
(não será publicado)