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.

Installation

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 = "vcTasks.properties" classpath="vcTasks"/>

  <!-- Visual Studio 2005 (VC8) -->
  <vc8 projectfolder="VC8" 
       buildmode="release"
       rebuild="true"
       logfile="vc8.log">
    <targets dir="MySource" includes="HelloWorld.sln"/>
  </vc8>

  <!-- Visual Studio 2008 (VC9) -->
  <vc9 projectfolder="VC9" 
       buildmode="debug"
       rebuild="false"
       logfile="vc9.log">
    <targets dir="ProjectsDir" includes="HelloWorld.sln"/>
  </vc9>
</project>

  <!-- Visual Studio 2010 (VC10) -->
  <vc10 projectfolder="VC10" 
       buildmode="debug"
       rebuild="false"
       logfile="vc10.log">
    <targets dir="ProjectsDir" includes="HelloWorld.sln"/>
  </vc10>

  <!-- Visual Studio 2012 (VC11) -->
  <vc11 projectfolder="VC11" 
       buildmode="debug"
       rebuild="false"
       logfile="vc11.log">
    <targets dir="ProjectsDir" includes="HelloWorld.sln"/>
  </vc11>

</project>

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.

Download

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

Author

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.