Home arrow Documentation arrow Core Documentation arrow Power Tools

Blogs

CI Factory is in Windows Developer Power Tools

Power Tools PDF Print

Power Tools


This is a collection of tools, some new and some are improvements to existing tools.  Some are geared toward the developer and some to the build master.  You should be able to drop them in the Product directory (don't for get to add the new ones into source control).  Note the CCNet Server Aggregator zip is not shown nor is it a drop in tool, see below.




Build Masters

There are two items for you.  One is a NAnt script and the other is a link to a tool written by someone else.  Gaston Milano's CoolCommands is a Visual Studio add-in.  It has many cool features.  We are interested in one, maybe two, of them.  We are absolutely interested in the command “Add Projects From Folder”.  It makes adding a multitude of existing project to a solution a very easy affair.  After you have copied all your projects to the correct location follow these steps:

  1. Right Click on a folder in the solution explorer and select the menu item "Add Projects From Folder..."
  2. Browse to the Product directory and click OK.
  3. Review the projects found, make correction if needed, and click OK.

Thanks Gaston for such a great tool!

The NAnt script is Scratch.Lib.xml.  There is a little bit of history here and I will expect you to do your homework.  So please read this short blog post first: NAnt Scratch.  I am moving forward in this document as if you have added NAnt to your external tools and mapped a key command to execute it (I use Ctrl+Alt+N).

interested in Execute the batch file C:\Projects\<Project Name>\<Code Line Name>\Product\OpenSolution.bat.  It will make you life a little easier if you add the file Scratch.Lib.xml to the solution.  You can easily do this by dragging and dropping it from Explorer to the Solution Explorer.  Open it up and take note of the targets it provides.  We will be immediately interested in FixUpThirdPartyRefs.  Open Scratch.Build.xml and create an new target.  You might not get any intellisense.



If your in this boat go to the properties window for the document.  Click the Schemas entry and notice the ellipsis.  Click it and this window will appear:



Click the add button and browse to and open C:\Projects\<Project Name>\<Code Line Name>\Build\NAnt.xsd.  Click OK.  Now you should have intellisense.

The target should be named test as that is the default target for Scratch.Build.xml.  In this target make a call to the target FixUpThirdPartyRefs.  Oh yea, you need to add the include for Scratch.Lib.xml file too.

<?xml version="1.0" encoding="utf-8"?>

<project xmlns="http://nant.sf.net/schemas/nant.xsd" name="scratch" default="test" basedir="..\Build" >

 

  <property name="CCNetBuildCondition" value="ForceBuild "/>

  <property name="CCNetIntegrationStatus" value="Success"/>

  <property name="CCNetLastIntegrationStatus" value="Success"/>

  <property name="CCNetBuildDate" value="2006-09-12"/>

  <property name="CCNetBuildTime" value="11:10:00"/>

  <property name="CCNetArtifactDirectory" value="C:\Temp\CCNetArtifactDirectory"/>

  <property name="CCNetWorkingDirectory" value="C:\Temp\CCNetWorkingDirectory"/>

 

  <property name="CCNetLabel" value="1.0.0.2"/>

  <property name="CCNetProject" value="TestProject"/>

  <property name="CCNetLogFilePath" value=""/>

 

  <include buildfile="Properties.Build.xml"/>

  <include buildfile="Common.Build.xml" />

 

  <property name="Compile.ConfigName" value="debug"/>

 

  <include buildfile=".\Packages\Deployment\Deployment.Target.xml"/>

  <include buildfile=".\Packages\MSBuild\Compile.Target.xml" />

  <include buildfile="..\Product\Scratch.Lib.xml"/>

 

  <target name="test">

    <call target="FixUpThirdPartyRefs"/>

  </target>

 

  <target name="test-createzip">

    <property name="Compile.ConfigName" value="release"/>

    <property name="Compile.Bin" value="${ProductDirectory}\ReleaseBin" />

    <property name="Compile.ToCopyToBin" value="true" />

    <property name="Compile.ToDeployZip" value="true"/>

    <property name="Compile.ZipFileName" value="Doubler.zip"/>

    <delete>

      <fileset>

        <include name="${Compile.Bin}\*.*"/>

      </fileset>

    </delete>

    <call target="Private.Compile.CopyToWorkingBin" />

    <call target="Private.Compile.DeployZip" />

  </target>

 

</project>



You are ready to run it (Ctrl+Alt+N).  You might want to review what the target does before you execute it.  It is designed to replace all Hint paths found for all references that exist in the Third Party directory.  Another way to say it is: it will fix any references that you have copied to the Third Party directory.

So between Gaston's CoolCommands and the FixUpThirdPartyRefs target you should be in business with most any existing project in no time at all.

There are a few more targets in the Scratch.Lib.xml file:
  • FixProjectBindings
    • This target is designed to fix all the project binding to source control.  Note that this assumes that the solution is under source control too.
  • FixSolutionBindings
    • This target is designed to fix all the binding information in the solution for the projects.
  • ConvertVBToCSharp
    • Will convert VB.Net to C#.
  • FixUpProjectInfo
    • Will add a link to each project that does not already have one for the ProjectInfo file.  It will also make sure that there are no conflicts between the AssemblyInfo and ProjectInfo.
  • FixUpProjectOutputDir
    • Will change the project output directories to a common directory or individual directories; CommonBin or bin\<config>.

To be clear you can use the Scratch.Lib.xml from either the Build directory or Product directory, your choice.

The CCNet Server Aggregator is the newest bit.  Phil Haack and gang over on the SubText project have braught it to my attention that having multiple CCNet server can be an administration burden as far as CCTray is concerned.  They pointed out that multiple holes in the firewall would have to be opened to support CI Factory on all their branches and projects.  It my work we have seen how it is difficult to remember and communicate all the different server names and ports.  The Oberon project is on the server BuildMonkey at port 23465.  The UberThing project is on BuildLemur at port 23451.  It does not take long for you go cross-eyed.  Luckily a solution was really easy to code up.

It will be bundled in the Power Tools of the next CI Factory release.  Until then you can down load it from here.

You need to know these things to configure it.  One it has an app.config file with remoting information, just like the CCNet server (default port is 12345).  It also uses the same config file as CCTray: cctray-settings.xml or settings.xml.  So you can use CCTray to configure what it will relay/aggregate.  It will look for the config file first in the same directory as itself and second in current users Application Data folder.  It is dirt simple or cheap.  It is a console app and to shut it down hit enter.  It is just sitting there listen with a Console.ReadLine();.


Developers

Build.bat

This script accepts parameters: Build, Rebuild, Compile, Recompile, and Test.  The default parameter is Build, meaning that it can be called with passing anything.  The first thing this script does regardless of the parameter is perform an update from source control.  It will update the Build, Product, and Third Party directories.

Build calls Compile and Test.
Rebuild calls Recompile and Test.
Compile calls the Compile.CompileSource target and Ant.Build if Ant is part of the CI Factory project.
Recompile deletes all the bin and obj directories then calls Compile.
Test calls the Unit Test package's target UnitTest.RunTests.

NoUpdateBuild.bat

This script is identical to the Build.bat script except that it does not perform and update from source control.

Test.bat

This script will run all the unit tests.

Personal.Build.xml

This is the glue between the previous three batch files and the Packages in the Build Directory.

Compile.Environment.xml/Ant.Environment.xml

These files allows you to override the default environment variables for use during the compilation of the build.  It provides several advantages, the main one being that environment variables car version controlled.

OpenCommandPrompt.bat

This script will open a command prompt with all it's environment variables set as defined in the *.Environment.xml or with the defaults.  NAnt, and Ant if it is part of your Project, are in the path so you can more easily use these tools.

OpenSolution.bat

This file exists in the main distrobusion of CI Factory.  The Power Tools version calls the OpenSolution.Script.xml.

OpenSolution.Script.xml

This file is useful if you are a user of TestDriven.Net.  It will set your Registry values for TD.Net to the installation of MbUnit in the Third Party directory.  This allows you to work with multiple versions of MbUnit.
 
< Prev   Next >