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

public Class StaticGLGenTask

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

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

Usage:

   <staticglgen package="[generated files package]"
                   headers="[file pattern of GL headers]"
                   outputdir="[directory to output the generated files]" />
Author
Rob Grzywinski [email protected]

Field Summary

Modifier and TypeField and Description
private static final String
private final CommandlineJava
private final FileSet
private String
outputDirectory

The output directory.

private String
packageName

The package name for the generated files.

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

Constructor Summary

AccessConstructor and Description
public
StaticGLGenTask()

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 Path
createClasspath()

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

public PatternSet.NameEntry
createHeader()

Add a header file to the list.

public PatternSet.NameEntry
public void
execute()

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

Run the task.

private int
execute(final String[] command)

Execute com.jogamp.gluegen.opengl.BuildStaticGLInfo 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
setHeaders(final String
the string containing the header patterns
headers
)

Set the set of header patterns.

public void
setOutputDir(final String
the output directory
directory
)

Set the output directory.

public void
setPackage(final String
the name of the package for the generated files
packageName
)

Set the package name for the generated files.

private void
validateAttributes()

Ensure that the user specified all required arguments.

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

Field Detail

GL_GENback to summary
private static final String GL_GEN

The com.jogamp.gluegen.opengl.BuildStaticGLInfo classname.

glgenCommandlineback to summary
private final CommandlineJava glgenCommandline

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

headerSetback to summary
private final FileSet headerSet

The org.apache.tools.ant.types.FileSet of GL headers.

outputDirectoryback to summary
private String outputDirectory

The output directory.

packageNameback to summary
private String packageName

The package name for the generated files.

Constructor Detail

StaticGLGenTaskback to summary
public StaticGLGenTask()

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

Method Detail

addAttributesback to summary
private void addAttributes()

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

createClasspathback to summary
public Path createClasspath()

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

Returns:Path

org.apache.tools.ant.types.Path

createHeaderback to summary
public PatternSet.NameEntry createHeader()

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

Returns:PatternSet.NameEntry

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

createHeadersFileback to summary
public PatternSet.NameEntry createHeadersFile()

Add a header 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.opengl.BuildStaticGLInfo 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.

setHeadersback to summary
public void setHeaders(final String headers)

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

Parameters
headers:String

the string containing the header patterns

setOutputDirback to summary
public void setOutputDir(final String directory)

Set the output directory. This is called by ANT.

Parameters
directory:String

the output directory

setPackageback to summary
public void setPackage(final String packageName)

Set the package name for the generated files. This is called by ANT.

Parameters
packageName:String

the name of the package for the generated files

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