Package org.python.util
Class JythoncAntTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.MatchingTask
org.python.util.JythoncAntTask
- All Implemented Interfaces:
Cloneable,org.apache.tools.ant.types.selectors.SelectorContainer
public class JythoncAntTask
extends org.apache.tools.ant.taskdefs.MatchingTask
Jythonc is a Python compiler into Java Bytecode. So you can
call your python code from Java, and call you java code from
Python, create bean, servlet...
The task is a directory based task, so attributes like includes="*.py" and excludes="broken.py" can be used to control the files pulled in. By default, all *.py files from the project folder down are included in the command.
- Version:
- 1.0
- Author:
- Cyrille Morvan - cmorvan@ingenosya.com - Ingenosya France
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.tools.ant.types.PathAdd a classpath.voidexecute()Exectute the compiler.get the compiler option, null if none.Get the path to the jython compiler file (in python).Get the path to the jython home (or python home)voidsetAddpackages(String aValue) Include Java dependencies from this list of packages.voidsetAll(boolean aValue) Include all of the Jython libraries (everything in core + compiler and parser).voidsets some additional args to send to jythonc.voidCompile into jarfile, including the correct manifest for the bean.voidsetClasspath(org.apache.tools.ant.types.Path aClasspath) Sets the classpath field.voidsetCompiler(String aCompiler) Set the compiler.voidsetCompileropts(String aValue) Options passed directly to the Java compiler.voidsetCore(boolean aValue) Include the core Jython libraries (about 130K).voidsetDeep(boolean aValue) Compile all Python dependencies of the module.voidsetDestdir(File aFile) Home for the destination (build).voidsetFalsenames(String aValue) A comma-separated list of names that are always false.voidJython home directory.voidSpecifies a .jar file to create and put the results of the freeze into.voidsetJythoncpy(File aValue) Change the default Python compiler.voidsetPackage(String aString) Put all compiled code into the named Java package.voidDon't include any of these modules in compilation.voidHome for the source.voidsetWorkdir(File aValue) Specify the working directory where the generated Java source code is placed.Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
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, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItemsMethods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, init, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation
-
Constructor Details
-
JythoncAntTask
public JythoncAntTask()constructor set up the search pattern
-
-
Method Details
-
createClasspath
public org.apache.tools.ant.types.Path createClasspath()Add a classpath. Used to handle the nested classpath element.- Returns:
- A Path object representing the classpath to be used.
-
setClasspath
public void setClasspath(org.apache.tools.ant.types.Path aClasspath) Sets the classpath field.- Parameters:
aClasspath- A Path object representing the "classpath" attribute.
-
setPackage
Put all compiled code into the named Java package.- Parameters:
aString- the packake name.
-
setJar
Specifies a .jar file to create and put the results of the freeze into. Set the deep option to true. -
setCore
public void setCore(boolean aValue) Include the core Jython libraries (about 130K). Needed for applets since Netscape doesn't yet support multiple archives. Set the deep option to true. -
setAll
public void setAll(boolean aValue) Include all of the Jython libraries (everything in core + compiler and parser). Set the deep option to true. -
setBean
Compile into jarfile, including the correct manifest for the bean. -
setSkip
Don't include any of these modules in compilation. This is a comma-separated list of modules. -
setDeep
public void setDeep(boolean aValue) Compile all Python dependencies of the module. This is used for creating applets. -
setAddpackages
Include Java dependencies from this list of packages. Default is org.python.modules and org.apache.oro.text.regex. -
setWorkdir
Specify the working directory where the generated Java source code is placed. Default is "./jpywork" -
setCompiler
Set the compiler. -
setCompileropts
Options passed directly to the Java compiler. Alternatively, you can set the property python.jythonc.compileropts in the registry. -
setFalsenames
A comma-separated list of names that are always false. Can be used to short-circuit if clauses. -
setHome
Jython home directory. -
setSrcdir
Home for the source. -
setDestdir
Home for the destination (build). -
setJythoncpy
Change the default Python compiler. -
setArgs
sets some additional args to send to jythonc. -
getCompilerOptions
get the compiler option, null if none. -
getPythonHome
Get the path to the jython home (or python home) -
getJythoncPY
Get the path to the jython compiler file (in python). -
execute
public void execute()Exectute the compiler.- Overrides:
executein classorg.apache.tools.ant.Task
-