Top Description Fields Constructors Methods
com.jogamp.gluegen.ant

public Class GlueGenTask

extends Task
Class Inheritance
Imports
java.io.IOException, java.util.Iterator, .LinkedList, .List, org.apache.tools.ant.BuildException, .DirectoryScanner, .Project, .Task, org.apache.tools.ant.taskdefs.Execute, .LogStreamHandler, org.apache.tools.ant.types.AbstractFileSet, .CommandlineJava, .DirSet, .FileSet, .Path, .PatternSet, .Reference, org.apache.tools.ant.util.JavaEnvUtils

An ANT org.apache.tools.ant.Task for using com.jogamp.gluegen.GlueGen.

Usage:

   <gluegen src="[source C file]"
               outputrootdir="[optional output root dir]"
               includes="[optional directory pattern of include files to include]"
               excludes="[optional directory pattern of include files to exclude]"
               includeRefid="[optional FileSet or DirSet for include files]"
               literalInclude="[optional comma separated list of literal include directories, avoiding limitations of FileSet / DirSet issues]"
               emitter="[emitter class name]"
               config="[configuration file]"
               dumpCPP="[optional boolean]"
               debug="[optional boolean]"
               logLevel="[optional string]" />
Author
Rob Grzywinski [email protected]

Field Summary

Modifier and TypeField and Description
private String
configuration

The configuration file name.

private boolean
debug

The optional debug flag.

private boolean
dumpCPP

The optional dumpCPP flag.

private String
emitter

The name of the emitter class.

private static final String
private final CommandlineJava
private final FileSet
private String
literalIncludes

Comma separated list of literal directories to include.

private String
logLevel

The optional logLevel.

private String
outputRootDir

The optional output root dir.

private final List<AbstractFileSet>
setOfIncludeSets

The set of include sets.

private String
sourceFile

The name of the source C file that is to be parsed.

private boolean
usedIncludeSet

Because a org.apache.tools.ant.types.FileSet will include everything in its base directory if it is left untouched, the includeSet must only be added to the set of includes if it has been explicitly set.

Inherited from org.apache.tools.ant.Task:
targettaskNametaskTypewrapper

Constructor Summary

AccessConstructor and Description
public
GlueGenTask()

Create and add the VM and classname to org.apache.tools.ant.types.CommandlineJava.

Method Summary

Modifier and TypeMethod and Description
private void
addAttributes()

Add all of the attributes to the command line.

public void
addDirset(final DirSet
the DirSet to be added
dirset
)

Add a nested org.apache.tools.ant.types.DirSet to specify the files to include.

public Path
createClasspath()

Add an optional classpath that defines the location of com.jogamp.gluegen.GlueGen and GlueGen's dependencies.

public PatternSet.NameEntry
createExclude()

Add an include file to the list that is to be exluded.

public PatternSet.NameEntry
createExcludesFile()

Add an exclude file to the list.

public PatternSet.NameEntry
createInclude()

Add an include file to the list.

public PatternSet.NameEntry
createIncludesFile()

Add an include file to the list.

public void
execute()

Overrides org.apache.tools.ant.Task.execute.

Run the task.

private int
execute(final String[] command)

Execute com.jogamp.gluegen.GlueGen in a forked JVM.

private boolean

Returns:

true if the string is valid. false otherwise.
isValid
(final String
the string to be tested for validity
string
)

Is the specified string valid?

public void
setConfig(final String
the name of the configuration file
configuration
)

Set the configuration file name.

public void
setDebug(final boolean debug)

Set the debug flag (optional).

public void
setDumpCPP(final boolean dumpCPP)

Set the dumpCPP flag (optional).

public void
setEmitter(final String
the name of the emitter class
emitter
)

Set the emitter class name.

public void
setExcludes(final String
the string containing the exclude patterns
excludes
)

Set the set of exclude patterns.

public void
setIncludeRefid(final Reference reference)

Set a org.apache.tools.ant.types.Reference to simplify adding of complex sets of files to include.

public void
setIncludes(final String
the string containing the include patterns
includes
)

Set the set of include patterns.

public void
setLiteralInclude(final String
the comma separated directories to include
commaSeparatedIncludes
)

Set a literal include directories, separated with a comma.

public void
setLogLevel(final String logLevel)

Set the logLevel (optional).

public void
setOutputRootDir(final String
the optional output root dir
outputRootDir
)

Set the output root dir (optional).

public void
setSrc(final String
the name of the source file
sourceFile
)

Set the source C file that is to be parsed.

private void
validateAttributes()

Ensure that the user specified all required arguments.

Inherited from org.apache.tools.ant.Task:
bindToOwnergetOwningTargetgetRuntimeConfigurableWrappergetTaskNamegetTaskTypegetWrapperhandleErrorFlushhandleErrorOutputhandleFlushhandleInputhandleOutputinitisInvalidloglogloglogmaybeConfigureperformreconfiguresetOwningTargetsetRuntimeConfigurableWrappersetTaskNamesetTaskType

Field Detail

configurationback to summary
private String configuration

The configuration file name.

debugback to summary
private boolean debug

The optional debug flag.

dumpCPPback to summary
private boolean dumpCPP

The optional dumpCPP flag.

emitterback to summary
private String emitter

The name of the emitter class.

GLUE_GENback to summary
private static final String GLUE_GEN

The com.jogamp.gluegen.GlueGen classname.

gluegenCommandlineback to summary
private final CommandlineJava gluegenCommandline

The org.apache.tools.ant.types.CommandlineJava that is used to execute com.jogamp.gluegen.GlueGen.

includeSetback to summary
private final FileSet includeSet

The org.apache.tools.ant.types.FileSet of includes.

literalIncludesback to summary
private String literalIncludes

Comma separated list of literal directories to include. This is to get around the fact that neither org.apache.tools.ant.types.FileSet nor org.apache.tools.ant.types.DirSet can handle multiple drives in a sane manner or deal with relative path outside of the base-dir. If null then it has not been specified.

logLevelback to summary
private String logLevel

The optional logLevel.

outputRootDirback to summary
private String outputRootDir

The optional output root dir.

setOfIncludeSetsback to summary
private final List<AbstractFileSet> setOfIncludeSets

The set of include sets. This allows includes to be added in multiple fashions.

sourceFileback to summary
private String sourceFile

The name of the source C file that is to be parsed.

usedIncludeSetback to summary
private boolean usedIncludeSet

Because a org.apache.tools.ant.types.FileSet will include everything in its base directory if it is left untouched, the includeSet must only be added to the set of includes if it has been explicitly set.

Constructor Detail

GlueGenTaskback to summary
public GlueGenTask()

Create and add the VM and classname to org.apache.tools.ant.types.CommandlineJava.

Method Detail

addAttributesback to summary
private void addAttributes() throws BuildException

Add all of the attributes to the command line. They have already been validated.

addDirsetback to summary
public void addDirset(final DirSet dirset)

Add a nested org.apache.tools.ant.types.DirSet to specify the files to include. This is called by ANT.

Parameters
dirset:DirSet

the DirSet to be added

createClasspathback to summary
public Path createClasspath()

Add an optional classpath that defines the location of com.jogamp.gluegen.GlueGen and GlueGen's dependencies.

Returns:Path

org.apache.tools.ant.types.Path

createExcludeback to summary
public PatternSet.NameEntry createExclude()

Add an include file to the list that is to be exluded. This is called by ANT for a nested element.

Returns:PatternSet.NameEntry

org.apache.tools.ant.types.PatternSet.NameEntry

createExcludesFileback to summary
public PatternSet.NameEntry createExcludesFile()

Add an exclude file to the list. This is called by ANT for a nested element.

Returns:PatternSet.NameEntry

org.apache.tools.ant.types.PatternSet.NameEntry

createIncludeback to summary
public PatternSet.NameEntry createInclude()

Add an include file to the list. This is called by ANT for a nested element.

Returns:PatternSet.NameEntry

org.apache.tools.ant.types.PatternSet.NameEntry

createIncludesFileback to summary
public PatternSet.NameEntry createIncludesFile()

Add an include file to the list. This is called by ANT for a nested element.

Returns:PatternSet.NameEntry

org.apache.tools.ant.types.PatternSet.NameEntry

executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

Run the task. This involves validating the set attributes, creating the command line to be executed and finally executing the command.

Annotations
@Override
Exceptions
BuildException:

Doc from org.apache.tools.ant.Task.execute.

if something goes wrong with the build.

See Also
org.apache.tools.ant.Task#execute()
executeback to summary
private int execute(final String[] command) throws BuildException

Execute com.jogamp.gluegen.GlueGen in a forked JVM.

isValidback to summary
private boolean isValid(final String string)

Is the specified string valid? A valid string is non-null and has a non-zero length.

Parameters
string:String

the string to be tested for validity

Returns:boolean

true if the string is valid. false otherwise.

setConfigback to summary
public void setConfig(final String configuration)

Set the configuration file name. This is called by ANT.

Parameters
configuration:String

the name of the configuration file

setDebugback to summary
public void setDebug(final boolean debug)

Set the debug flag (optional). This is called by ANT.

setDumpCPPback to summary
public void setDumpCPP(final boolean dumpCPP)

Set the dumpCPP flag (optional). This is called by ANT.

setEmitterback to summary
public void setEmitter(final String emitter)

Set the emitter class name. This is called by ANT.

Parameters
emitter:String

the name of the emitter class

setExcludesback to summary
public void setExcludes(final String excludes)

Set the set of exclude patterns. Patterns may be separated by a comma or a space. This is called by ANT.

Parameters
excludes:String

the string containing the exclude patterns

setIncludeRefidback to summary
public void setIncludeRefid(final Reference reference)

Set a org.apache.tools.ant.types.Reference to simplify adding of complex sets of files to include. This is called by ANT.

?
Parameters
reference:Reference

a Reference to a org.apache.tools.ant.types.FileSet or org.apache.tools.ant.types.DirSet

Exceptions
BuildException:
if the specified Reference is not either a FileSet or DirSet
setIncludesback to summary
public void setIncludes(final String includes)

Set the set of include patterns. Patterns may be separated by a comma or a space. This is called by ANT.

Parameters
includes:String

the string containing the include patterns

setLiteralIncludeback to summary
public void setLiteralInclude(final String commaSeparatedIncludes)

Set a literal include directories, separated with a comma. See the literalInclude javadoc for more information.

Parameters
commaSeparatedIncludes:String

the comma separated directories to include

setLogLevelback to summary
public void setLogLevel(final String logLevel)

Set the logLevel (optional). This is called by ANT.

setOutputRootDirback to summary
public void setOutputRootDir(final String outputRootDir)

Set the output root dir (optional). This is called by ANT.

Parameters
outputRootDir:String

the optional output root dir

setSrcback to summary
public void setSrc(final String sourceFile)

Set the source C file that is to be parsed. This is called by ANT.

Parameters
sourceFile:String

the name of the source file

validateAttributesback to summary
private void validateAttributes() throws BuildException

Ensure that the user specified all required arguments.

Exceptions
BuildException:
if there are required arguments that are not present or not valid