Home Directory / GPCP Ant Task

Gardens Point Component Pascal Ant Task


This is a really simple Ant Task to invoke the CPMake tool within an Ant Project.

Gardens Point Component Pascal

GPCP Component Pascal is a compiler for the Component Pascal language who targets the JVM and the .NET environment.

Component Pascal is an Oberon variant who is specially designed for programming safe software components. You can see the Component Pascal definition here.

This software is only usable with the JVM-based version


To use the Ant task you must insert the following task definition into your ant file.

<path id="project.build.path">
  <pathelement location="${libs.dir}/gpcp.jar"/>
  <pathelement location="${libs.dir}/gpcpant.jar"/>
  <pathelement location="${build.dir}"/>

<taskdef name="cpmake" classname="CP.AntTask.AntTask_CPMake" classpathref="project.build.path"/>

Please note that "libs.dir" should point to the directory where you have the gpcp ant task files and that "build.dir" should point to the directory where you want to build your class files.

The task definition must be processed before you invoke the cpmake task. I usually insert the definition in my "init" target.

If you don't want to setup the project directory structure you can download a project skeleton from the download section in this page

Invoking the target

You can invoke the task with this syntax

<cpmake mainModule="${cp.main}" cpRoot="${gpcp.home}" outputDirectory="./build"/>

You can use the following task attributes:

mainModule (required) The name of the base module to compile. CPMake will search the modules in the current directory,
cpRoot (required) The path where the GPCP JVM compiler is installed.
outputDirectory (optional) The path where to put the ".class" files. If you don't specify anything the ".class" files will be created in the current directory. This attribute is equivalent with the "-clsdir" CPMake option.
symDir (optional) The path where to find and where to store the symbol files. The value of this attribute, if present, will be prepanded to the default CPSYM Java Environment variable ("CPROOT/libs:CPROOT/libs/JvmSystem").

Building the ant task

The distribution include the Ant Task binary jar file but, if you want to build your version of this ant task you can use the "build.xml" file included.

This ant task is written in Component Pascal so, if you want to build it, you will also need the GPCP Component Pascal compiler. Please remember to change the CPROOT setting in the build file. It must point to the compiler installation directory.

The "jar" task will build two jar files in the "dist" directory.

gpcpant.jarIs the ant task
gpcp.jarIs the Component Pascal runtime in a jar file

Tested system configuration

This program is developed with Java6/Windows and GPCP Component Pascal Compiler version 1.3.4 but it must run equally well under Linux.


This software is available under a BSD-like licence so you can do anything with it, commercial applications included.

Please read the full license agreement for the details.

Download links:

zip file with sources and binaries Download
gpcp project skeleton Download


Thanks to the Queensland University of Technology (Brisbane Australia) and to the Gardens Point Component Pascal Team we have a really interesting implementation of the Component Pascal language for the JVM platform.

If you have some questions or you want to contact me you can use my email address: leonardoNOSPAMce@interfree.it. Please remove NOSPAM from the address

I would be glad if you make me know if you are using this module in your project.

Latest update: 29/1/2008