Working with TFS from Mac OS X

PDF for offline use

Let us know how you feel about this

Translation Quality


last updated: 2017-03

Our final part of this walkthrough is to work with the TFS team project on a Mac. As discussed in Connecting to TFS with Xamarin Studio Mac, Xamarin Studio doesn’t directly support working with Team Foundation Server, so we'll instead use Eclipse and Microsoft’s Team Explorer Everywhere (TEE) plugin for Eclipse. These provide an interface that's nearly identical to that of Visual Studio. In Eclipse, we'll browse the team project and make a change to the code to trigger a CI build and test run.

Getting the Solution

To being, we'll need to get the latest version of the TaskyPortable solution on the Mac:

  1. Start Eclipse, go to the Team Explorer panel and click Source Control Explorer:

  2. In the Source Control pad, select the Tasky team project and click the Not Mapped link:

  3. In the Set Working Folder dialog that appears, click Browse…, select a destination for the solution (such as the Projects folder of the current user), click Open, and then click OK:

  4. When prompted to Set Working Folder, click Yes to get the source code and continue:

  5. Next we need to connect to our Tasky team project. From Team Explorer select Home > Projects and My Teams > Connect to Team Projects… to display the Add Editing Team Project dialog. Place a check by the Tasky Team Project and click the Finish button to close the dialog:

  6. In Team Explorer, select Home > Projects and Teams > Tasky :

  7. Now we can work with the project's source code. In the Source Control pane, expand the Tasky team project, select TaskyPortable, and double-click the TaskyPortable.sln solution file to open it in Xamarin Studio:

Checking Out Source Code and Running a Local Test Build

To test continuous integration again, let's add a method in the Task class to clear the Importance property we added above.

  1. Back in the Source Control pane in Eclipse, expand the TaskyPortable project, select TaskyPortableLibrary, then right-click Task.cs and select Check Out for Edit...:

  2. The next dialog should show a check indicator beside Task.cs. Press OK to finish.

  3. In Xamarin Studio, open Task.cs and add the following code to the bottom of the Task class:

    public void ResetImportance()
        _importance = 0;
  4. Save your changes, right click on the TaskyPortable solution in the Solution Explorer and select Build. This will test our changes with a local build.

  5. To validate our changes with unit tests, select the NUnitTests project in the Solution Explorer, then select the Run > Run Unit Tests menu command. The Testing Explorer displays the results of the tests:

Checking in Changes to Trigger a Continuous Integration Build

  1. Return to Eclipse, right click Task.cs in Source Control, and select Check In Pending Changes…
  2. Place a check by Task.cs, enter a comment of Added new ResetImportance method, then click Check In to complete the process:

Viewing Build Results

Our check-in of the modified Task.cs file will have launched an automated build. To see the results of this build do the following:

  1. In Eclipse, click Builds in the Team Explorer pane, which should show an instance of Build and Test All in the queue, in progress, or completed:

  2. Double-click a build to see the results:

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.