org.apache.hadoop.record.compiler.ant
Class RccTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.hadoop.record.compiler.ant.RccTask
All Implemented Interfaces:
Cloneable

public class RccTask
extends org.apache.tools.ant.Task

Hadoop record compiler ant Task

This task takes the given record definition files and compiles them into java or c++ files. It is then up to the user to compile the generated files.

The task requires the file or the nested fileset element to be specified. Optional attributes are language (set the output language, default is "java"), destdir (name of the destination directory for generated java/c++ code, default is ".") and failonerror (specifies error handling behavior. default is true).

Usage

 <recordcc
       destdir="${basedir}/gensrc"
       language="java">
   <fileset include="**\/*.jr" />
 </recordcc>
 


Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
RccTask()
          Creates a new instance of RccTask
 
Method Summary
 void addFileset(org.apache.tools.ant.types.FileSet set)
          Adds a fileset that can consist of one or more files
 void execute()
          Invoke the Hadoop record compiler on each record definition file
 void setDestdir(File dir)
          Sets directory where output files will be generated
 void setFailonerror(boolean flag)
          Given multiple files (via fileset), set the error handling behavior
 void setFile(File file)
          Sets the record definition file attribute
 void setLanguage(String language)
          Sets the output language option
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RccTask

public RccTask()
Creates a new instance of RccTask

Method Detail

setLanguage

public void setLanguage(String language)
Sets the output language option

Parameters:
language - "java"/"c++"

setFile

public void setFile(File file)
Sets the record definition file attribute

Parameters:
file - record definition file

setFailonerror

public void setFailonerror(boolean flag)
Given multiple files (via fileset), set the error handling behavior

Parameters:
flag - true will throw build exception in case of failure (default)

setDestdir

public void setDestdir(File dir)
Sets directory where output files will be generated

Parameters:
dir - output directory

addFileset

public void addFileset(org.apache.tools.ant.types.FileSet set)
Adds a fileset that can consist of one or more files

Parameters:
set - Set of record definition files

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Invoke the Hadoop record compiler on each record definition file

Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException


Copyright © 2009 The Apache Software Foundation