Class Script
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.optional.Script
- All Implemented Interfaces:
- Cloneable
Executes a script.
- 
Field SummaryFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidSet the script text.Classpath to be used when searching for classes and resources.voidexecute()Run the script using the helper object.voidsetClasspath(Path classpath) Set the classpath to be used when searching for classes and resources.voidSet the classpath by reference.voidsetEncoding(String encoding) Set the encoding of the script from an external file; optional.voidsetLanguage(String language) Defines the language (required).voidsetManager(String manager) Deprecated.voidsetManager(ScriptManager manager) Set the script manager.voidsetProject(Project project) Set the project.voidsetSetBeans(boolean setBeans) Set the setbeans attribute.voidLoad the script from an external file; optional.Methods inherited from class org.apache.tools.ant.TaskbindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation
- 
Constructor Details- 
Scriptpublic Script()
 
- 
- 
Method Details- 
setProjectSet the project.- Overrides:
- setProjectin class- ProjectComponent
- Parameters:
- project- the project that this task belongs to.
 
- 
executeRun the script using the helper object.- Overrides:
- executein class- Task
- Throws:
- BuildException- if something goes wrong with the build
 
- 
setManagerDeprecated.Defines the manager.- Parameters:
- manager- the scripting manager.
 
- 
setManagerSet the script manager.- Parameters:
- manager-
 
- 
setLanguageDefines the language (required).- Parameters:
- language- the scripting language name for the script.
 
- 
setSrcLoad the script from an external file; optional.- Parameters:
- fileName- the name of the file containing the script source.
 
- 
addTextSet the script text.- Parameters:
- text- a component of the script text to be added.
 
- 
setClasspathSet the classpath to be used when searching for classes and resources.- Parameters:
- classpath- an Ant Path object containing the search path.
 
- 
createClasspathClasspath to be used when searching for classes and resources.- Returns:
- an empty Path instance to be configured by Ant.
 
- 
setClasspathRefSet the classpath by reference.- Parameters:
- r- a Reference to a Path instance to be used as the classpath value.
 
- 
setSetBeanspublic void setSetBeans(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.- Parameters:
- setBeans- the value to set.
 
- 
setEncodingSet the encoding of the script from an external file; optional.- Parameters:
- encoding- the encoding of the file containing the script source.
- Since:
- Ant 1.10.2
 
 
-