public class JRAntCompileTask extends JRBaseAntTask
javac
Ant task.
This task can take the following arguments:
src
and destdir
are required.
When this task executes, it will recursively scan the src
and
destdir
looking for XML report design files to compile.
This task makes its compile decision based on timestamp and only XML files
that have no corresponding .jasper file or where the compiled report design file
is older than the XML file will be compiled.jasperReportsContext
Constructor and Description |
---|
JRAntCompileTask() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkParameters()
Checks that all required attributes have been set and that the supplied values are valid.
|
protected void |
compile()
Performs the compilation of the selected report design files.
|
org.apache.tools.ant.types.Path |
createClasspath()
Adds a path to the classpath.
|
org.apache.tools.ant.types.Path |
createSrc()
Adds a path for source compilation.
|
void |
execute()
Executes the task.
|
protected void |
scanDir(File srcdir,
File destdir,
String[] files)
Scans the directory looking for source files to be compiled.
|
protected void |
scanSrc()
Scans the source directories looking for source files to be compiled.
|
void |
setCompiler(String compiler)
Sets the name of the report compiler class to use when compiling the XML
report design files.
|
void |
setDestdir(File destdir)
Sets the destination directory into which the XML report design files should be compiled.
|
void |
setKeepjava(Boolean keepjava)
Sets a boolean flag that will instruct the Java bytecode report compilers
to avoid deletion of the Java source files generated in the temporary working
directory during report generation.
|
void |
setSrcdir(org.apache.tools.ant.types.Path srcdir)
Sets the source directories to find the XML report design files.
|
void |
setTempdir(File tempdir)
Sets the temporary working directory into which to store the temporary files
generated during XML report design file compilation.
|
void |
setXmlvalidation(boolean xmlvalidation)
Instructs the XML parser to validate the XML report design file during compilation.
|
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
public void setSrcdir(org.apache.tools.ant.types.Path srcdir)
srcdir
- source pathpublic org.apache.tools.ant.types.Path createSrc()
public void setDestdir(File destdir)
destdir
- destination directorypublic void setTempdir(File tempdir)
If not set, the temporary working directory will be the current working directory,
as specified by the user.dir
system property.
tempdir
- temporary working directorypublic void setKeepjava(Boolean keepjava)
keepjava
- flag for preventing the deletion of generated Java source filespublic void setCompiler(String compiler)
The specified class should be an implementation of the
JRCompiler
interface.
When specified, this value will temporarily override the value of the
net.sf.jasperreports.compiler.class
system property.
compiler
- report compiler class namepublic org.apache.tools.ant.types.Path createClasspath()
public void setXmlvalidation(boolean xmlvalidation)
xmlvalidation
- flag for enabling/disabling the validation feature of the XML parserpublic void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
protected void checkParameters() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
protected void scanSrc() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
protected void scanDir(File srcdir, File destdir, String[] files)
reportFilesMap
.srcdir
- source directorydestdir
- destination directoryfiles
- included file namesprotected void compile() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
Copyright © 2023 Cloud Software Group, Inc.. All rights reserved.