No Country for Old Browsers - IE8 Beta1

Well.. here I am .. running in IE8 , freshly released, along with a host of other goodies, from MIX08 happening right now somewhere in Las Vegas. Ive never really got on with Firefox .. I know, I know  .. shoot me .. but I find the temptation to install all those plugins a bit too much and soon poor firefox is crawling to a halt. So I was quite excited to get my hands on IE8.

Developer Tools 

At first I thought they had just included the regular developer toolbar into the main program but on further investigation the developer tools they've added have some very powerful features and should make many developers very happy (me included!) 

You will now find a lot of the debugging and CSS analysis features found in the new Visual Studio 2008 sitting in the 'Developer Tools' console.

Open it up and you find you can now set breakpoints in your javascript code the step through line by line

You can create watches, see autos and effect variables directly with the immediate console. All great stuff ! Also locating problems in CSS got a whole bunch easier (now I dont need have to switch back to Firefox just to use FireBug hehe)

Web Slices

One thing I quite like are the addition of Web Slices I just wanted to quickly note how to get them up and running :) As afr as I can see they are a way to wrap your normal feed in some custom HTML so it looks like it came from your site (so mine would have bad spelling and lots of transformers icons everywhere)

Its essentially creating a small piece of HTML within a page with the correct classes applied. IE8 then picks up these and allows you to subscribe to the 'slice' (jazzed up RSS)
(The important classes are in bold)  

<div id="myblogupdates" class="hslice" >
 <div style="display:none;">
 <a href="#" class="entry-title">Ultramagnus Blog Updates</a> ~
 <a href="#" class="entry-content">&nbsp;</a>
 <a href="http://www.ultramagnus.org/syndication.axd" class="feedurl" rel="feedurl">&nbsp;</a>
 </div>
</div>

 

If all is working, when you view the page you will see a new little swirly purple icon (where your RSS feeds normally appear) with the name of your WebSlice in it...

... clicking on the link will bring up a dialog asking if you want to subscribe to this webslice ..

.. once done the 'slice' will appear as a link in your toolbar.

You do need to tweak the code in your RSS feed to include a new namespace ..

<rss version="2.0"xmlns:mon="http://www.microsoft.com/schemas/rss/monitoring/2007">

 .. it will then use the HTML you defined originally to display the slice in the browser drop-down .. so you can now add a bit of personalisation your RSS feed :)

 


Posted by: [mRg]
Posted on: 3/5/2008 at 11:08 PM
Tags: ,
Categories: Guides
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Mass Code Auto - Team City

Over the past week or so I have been trialing Team City from JetBrains (makers of Resharper et al). There has been a lot of buzz around this product and I wanted to include all the bits I had found and my thoughts on it as a product.

First a bit of background, as well as our development team we also have an application support team. Its imperative that they can get access to the latest, working builds of all our companies code. After our move to TFS we setup a series of team builds that people could run to produce DLLs / websites etc. on demand. This worked to a certain extent but wasnt perfect. A while ago we changed to running CI builds for our major projects using Cruise Control .NET and havent looked back.

CC.NET is a fantastic tool, we were able to get all the things we want, NUnit tests, code coverage (NCover), documentation generation (Sandcastle), code metrics etc but the bus factor is quite high (ie if the guy who maintains it gets run over by a bus then the rest of the team is screwed cause no one else knows how it works). The mass of XML and supporting files (BATs or MSBuild tasks) that had to be edited to get a new project up and running was quite frightening and most of the time you are copying the same config code various times. I was starting to write a large document on how to get CI up and running for new projects when I realised it was really quite stupidly complicated and began hearing good things about TeamCity.

The test I set for myself with TeamCity was  - Could I get all the things I had running with CC.NET running in TeamCity in less time and with less fiddling with config files ? The answer was suprisingly .. Yes !

The installation was very straight forward and I was up and running with zero issues. I chose a simple project to start off with, I created a source control root to monitor in TFS. The integration with TFS was seamless and posed no problems.

Next I began to setup the build. This takes the form of a 7 stage wizard ... nothing frightening here .. just common sense settings such as when you want a build to be triggered (scheduling is very nice), dependencies and runners (the things that will do the actual build). It comes with a mass of runners for Java and .NET.

For this simple setup I used the 'SLN2008' runner to build from a VS2008 Solution File in the root of my project and set it to build when i checked something in. 

NCover

I used the Ncover MSBuild tasks that come with the program .. pretty standard stuff .. one for a summary and one for a full report. Only one thing to note is that the NCover help file doesnt list the correct enum for genearting a full HTML report out so I had to get busy with Reflector to find that one ! (Its "FullCoverageReport" btw!)

<NCover ToolPath="$(NCoverPath)"
    CommandLineExe="$(NUnitPath)\nunit-console.exe" 
    CommandLineArgs="$(TestDll)" 
    CoverageFile="@(CoverageFile)" />

<!-- Summary Page -->
<NCoverExplorer ToolPath="$(NCoverPath)" 
    ProjectName="$(ProjectName)" 
    OutputDir="..\Docs" 
    CoverageFiles="@(CoverageFile)" 
    SatisfactoryCoverage="80" 
    ReportType="ModuleClassSummary" 
    HtmlReportName="CoverageSummary.html" 
    Exclusions="$(CoverageExclusions)" />

<!-- Full HTML Report -->
<NCoverExplorer ToolPath="$(NCoverPath)" 
    ProjectName="$(ProjectName)" 
    OutputDir="..\Docs\Coverage" 
    CoverageFiles="@(CoverageFile)" 
    SatisfactoryCoverage="80" 
    ReportType="FullCoverageReport" 
    HtmlReportName="Coverage.html" 
    Exclusions="$(CoverageExclusions)" />

The next thing to do was to declare the coverage as artifacts of the build in the configuration section of the build.

Docs/Coverage/* => Coverage,
Docs/Coverage/files/* => Coverage/files,
Docs/CoverageSummary.html

The final part (and this only has to be done once!) is to update the main config so it adds two tabs for the summary and the full report (Dont worry .. if the files arent there the tabs arent shown) 

Locate the TeamCity config file (\.BuildServer\config\main-config.xml) and add two entries.

<report-tab title="Code Coverage Summary" basePath="" startPage="CoverageSummary.html" />
<
report-tab title="Code Coverage" basePath="/Coverage/" />

 

Sandcastle

I used a pretty standard MSBuild task for Sandcastle but ran into one problem (nothing to do with TeamCity directly) .. it wouldnt run .. the script worked fine from Visual Studio, worked fine from the command line msbuild but wouldnt run when executed from within TC, one of the sandcastle tools MRefBuilder exits with Code 1 (helpful!).. turns out you need to remember to add DXROOT as an environmental variable to point to the sandcastle folder. 

 

.. and thats it ! All setup essentially in a few clicks .. the great thing is the tasks like adding tabs and setting environment variables only need to done once and now I can copy the configuration and futher reduce my setup times. More importantly, anyone in the team should be able to look at this config and see whats happening and tweak if needed. (Lets hope the bus thing doesnt happen quite yet though)

My experience with TeamCity, so far, has lived up to expectations .. and hopefully Ill be able to tweak it more as time goes on. Ive also found that the new vs2008 web deployment project gives a great framework for adding little MSBuild scripts even if your not used to using MSBuild .. but maybe ill blog about that another time as Im going off on a tangent ! 

Pros 

  • Most basic builds are created in a few clicks.
  • Duplicating build configuration is a single click - simple enough but this is really time saving.
  • Artifacts - This feature, i would imagine, is designed for those people whos projects produce MSI installers etc but as a web developer I found this gave me a nice persepctive on what the actual deliverables of a web project are. In the past a build would deliver the contents as a whole web dir but now ive found myself zipping up the different parts (bin dir / main site) which should will make it more maintainable for our support team as they can just grab the bits they need !
  • Custom tabs for different reports (NCover etc.)  - This means if i can add anything I want to as long as its added to my artifacts.
  • Personal Builds - Bah didnt have time to talk about this but its like a sort of gatekeeper .. you can get the TC server to build your new code changes and check they work before you officially check it in .. very cool !

Cons

  • Doesnt support triggering a TFS team build (as far as I can see, I had to use a custom plugin for CC.NET) - Not a huge issue but would be a nice-to-have. 

Posted by: [mRg]
Posted on: 2/1/2008 at 8:24 PM
Tags: , , , ,
Categories: Guides
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed