vcTasks: an Ant task for compiling projects with Visual Studio

What is this?

vcTasks is a set of tasks for Ant.

It allows developers to create scripts that compile Visual Studio solutions. Currently we support the compilation using three different versions of VS: 2003, 2005, 2008, 2010 and 2012.


You just have to copy the vcTasks.jar file to the ./lib folder of your ant distribution.

How to use it?

The tasks has been developed using these other tasks, so their usage is similar to them. In that sense, our tasks accepts exactly the same arguments as the VC7task accept.

Some examples:

<project name="vcTasksExample">
  <taskdef resource = "" classpath="vcTasks"/>

  <!-- Visual Studio 2005 (VC8) -->
  <vc8 projectfolder="VC8" 
    <targets dir="MySource" includes="HelloWorld.sln"/>

  <!-- Visual Studio 2008 (VC9) -->
  <vc9 projectfolder="VC9" 
    <targets dir="ProjectsDir" includes="HelloWorld.sln"/>

  <!-- Visual Studio 2010 (VC10) -->
  <vc10 projectfolder="VC10" 
    <targets dir="ProjectsDir" includes="HelloWorld.sln"/>

  <!-- Visual Studio 2012 (VC11) -->
  <vc11 projectfolder="VC11" 
    <targets dir="ProjectsDir" includes="HelloWorld.sln"/>


How does it work?

The ant tasks checks different environment variables to found the Visual Studio tools. In particular, it uses those variables that the VS installer set: VS70COMNTOOLS, VS80COMNTOOLS, VS90COMNTOOLS, VS10COMNTOOLS and VS11COMNTOOLS. Using them vcTasks are able to found the different Visual Studio versions.

If the variable is not found, vcTasks relies on the PATH variable; it just will execute the compiler tool, hoping that the operating system will find it.

vcTasks works also with the Visual Studio Express editions even though the tools used are differents. The only (and logic) limitation is that the .sln should be compatible with the express edition. Otherwise the compilation will fail.


Version Source distribution Binary distribution
1.3 (Nov-2013)
1.2 (Mar-2012)
1.1 (Nov-2010)
1.0 (Sept-2010)


This software was developed by Marco Antonio Gómez Martín. If you have any comment or suggestion, contact me.

The original development of the tasks was made by John Arrizza. In fact, only small modifications were made to the original version in order to support modern Visual Studio versions and the Express editions.

The software is distributed under the terms of the GNU General Public License.

Los comentarios están cerrados.