FileDocCategorySizeDatePackage
Script.javaAPI DocApache Ant 1.703846Wed Dec 13 06:16:18 GMT 2006org.apache.tools.ant.taskdefs.optional

Script

public class Script extends org.apache.tools.ant.Task
Executes a script.
ant.task
name="script"

Fields Summary
private org.apache.tools.ant.util.ScriptRunnerHelper
helper
Constructors Summary
Methods Summary
public voidaddText(java.lang.String text)
Set the script text.

param
text a component of the script text to be added.

        helper.addText(text);
    
public org.apache.tools.ant.types.PathcreateClasspath()
Classpath to be used when searching for classes and resources.

return
an empty Path instance to be configured by Ant.

        return helper.createClasspath();
    
public voidexecute()
Run the script using the helper object.

exception
BuildException if something goes wrong with the build

        helper.getScriptRunner().executeScript("ANT");
    
public voidsetClasspath(org.apache.tools.ant.types.Path classpath)
Set the classpath to be used when searching for classes and resources.

param
classpath an Ant Path object containing the search path.

        helper.setClasspath(classpath);
    
public voidsetClasspathRef(org.apache.tools.ant.types.Reference r)
Set the classpath by reference.

param
r a Reference to a Path instance to be used as the classpath value.

        helper.setClasspathRef(r);
    
public voidsetLanguage(java.lang.String language)
Defines the language (required).

param
language the scripting language name for the script.

        helper.setLanguage(language);
    
public voidsetManager(java.lang.String manager)
Defines the manager.

param
manager the scripting manager.

        helper.setManager(manager);
    
public voidsetProject(org.apache.tools.ant.Project project)
Set the project.

param
project the project that this task belongs to.


                     
        
        super.setProject(project);
        helper.setProjectComponent(this);
    
public voidsetSetBeans(boolean setBeans)
Set the setbeans attribute. If this is true, <script> will create variables in the script instance for all properties, targets and references of the current project. It this is false, only the project and self variables will be set. The default is true.

param
setBeans the value to set.

        helper.setSetBeans(setBeans);
    
public voidsetSrc(java.lang.String fileName)
Load the script from an external file ; optional.

param
fileName the name of the file containing the script source.

        helper.setSrc(new File(fileName));