Archive for July, 2006

TeamCity - new integrated team environment from JetBrains

Friday, July 28th, 2006

JetBrains is pleased to announce the wide public beta release of TeamCity 1.0. It is an integrated team environment that enables running and monitoring of build processes, and facilitates integration of changes for developers working on both Java and .Net platforms. The top TeamCity features include:

  • Continuous Integration Support - integrate and remotely test code changes many times a day utilizing NUnit (.NET) or JUnit (Java) testing frameworks.
  • Effective Build Management allows for running builds using popular NAnt, MSBuild, Ant, and Maven build tools and immediately provides information about build results via web interface or Windows tray notifier. In case of build failure, a developer can take responsibility for this and other team members are notified that the problem is being solved.
  • Powerful and Intelligent Build Grid leverages the workload of computers which may run multiple builds/tests at a time, both for single and multiple projects. Each computer included into the build grid can define its own environmental parameters and TeamCity intelligently distributes builds among the machines.
  • Web-based Administration - developers and their managers can easily get build and test reports, see the current build status, and configure all the necessary build settings using a convenient Web interface. Build history and all the resulting build artifacts can also be managed on the server.

Like other JetBrains products, TeamCity is created by and for professional developers. It is already being used by our own teams every day to run IntelliJ IDEA, ReSharper, and even its own builds.
To download TeamCity beta and learn more about its features, visit www.jetbrains.com/teamcity/.

Technorati tags: , , ,

Going generic

Thursday, July 13th, 2006

This How-To explains how to take advantage of ReSharper’s features to quickly convert your arrays into generic collections.

In .NET 1.1, if you wanted to have some typed interface to return some items, your only choice was to use arrays, since collections were untyped:

In .NET 1.1 you had to use arrays

If the implementation of INode did not keep an array of subnodes, one had to allocate a fresh array on every GetSubNodes() call.

In .NET 2.0, however, one can use generic collections. We would aim for our interface to look like this:

Generic collections are available in .NET 2.0

Generic collections a very good thing for a whole number of reasons that we won’t get into here.

So, now that people are migrating from 1.1 to 2.0, it would be great to somehow convert legacy interfaces from arrays to collections. For this, ReSharper comes in extremely handy. We ourselves used the following procedure when developing ReSharper 2.0 and we think it can be useful to you, too.

  1. Invoke the Change Signature refactoring (keyboard shortcut Ctrl + F6) on INode.GetSubNodes() to change the return type from INode to IList<INode>:

    Change Signature refactoring

    The return type of all implementations is changed accordingly.

  2. After you compile, the code will, of course, contain errors such as this one:

    Cannot convert IList<INode> to INode[]

    You can identify these compilation errors and navigate to them by using the error stripes on the right-hand sidebar:

    You can see all the errors and warnings and go to them.

          TIP:  You can also navigate between compilation errors in the file by using keyboard only. Press F12 to go the next error and Shift+F12 to go to the previous error.

    So, for errors like the one shown above, ReSharper suggests a quick-fix (keyboard shortcut Alt + Enter) to help you change the type of ‘subNodes‘ to IList:

    This quick-fix from ReSharper solves the problem

  3. However, another kind of error remains: the ‘Length’ member should be changed to ‘Count’ everywhere:

    We need to change all Lengths to Counts

    Just use the Change All quick-fix to quickly change all ‘Length’s into ‘Count’s:

    Lengths are changed to Counts with this quick-fix

    ReSharper will suggest a list of members and, in this case, will automatically guess that Count should be the right member.

    This concludes our conversion.



So, if you are going generic, we suggest you save yourself some hassle and give ReSharper a try!

Read more about the features discussed in this How-To:
Refactoring
Error Highlighting and Quick-Fixes

Technorati tags: , , ,

Take control of your file structure with ReSharper

Tuesday, July 4th, 2006

One of the new navigation features of ReSharper 2.0 is the very useful File Structure View. It lets you see the structure of your files and manage it easily.

Here is a File Structure view at a glance:

File Structure helps you keep track of and manage the structure of your code

With File Structure you can:

  • Get a quick overview of the current file:
    • properties, fields and methods can be easily identified by unique icons;
    • methods that override, implement or hide other methods are shown as such;
  • Enclose any part of the current file with a #region (and also collapse and close existing regions);
  • Rearrange file elements by simply dragging nodes in the view (between regions and within the overall file);
  • Navigate to source for any type or member with a double-click;
  • Apply a refactoring to a type or member with a simple right-click.



The view stays synchronized with the current file opened in the editor. You can choose to auto-track the caret in the editor and, vice versa, to auto-navigate to source as you change selection in the File Structure view.

To open the view, click ReSharper | Window | File Structure in the main menu.

For more details about File Structure window, see this ReSharper Help topic:
http://www.jetbrains.com/resharper/documentation/help20/Navigation/fileStructureWindow.html.

Technorati tags: , ,