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:
java.lang.Cloneable,org.apache.tools.ant.types.selectors.SelectorContainer
public class JythoncAntTask extends org.apache.tools.ant.taskdefs.MatchingTaskJythonc 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 Constructor Description JythoncAntTask()constructor set up the search pattern
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.tools.ant.types.PathcreateClasspath()Add a classpath.voidexecute()Exectute the compiler.java.lang.StringgetCompilerOptions()get the compiler option, null if none.java.io.FilegetJythoncPY()Get the path to the jython compiler file (in python).java.io.FilegetPythonHome()Get the path to the jython home (or python home)voidsetAddpackages(java.lang.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).voidsetArgs(java.lang.String aValue)sets some additional args to send to jythonc.voidsetBean(java.io.File aJarFileBean)Compile into jarfile, including the correct manifest for the bean.voidsetClasspath(org.apache.tools.ant.types.Path aClasspath)Sets the classpath field.voidsetCompiler(java.lang.String aCompiler)Set the compiler.voidsetCompileropts(java.lang.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(java.io.File aFile)Home for the destination (build).voidsetFalsenames(java.lang.String aValue)A comma-separated list of names that are always false.voidsetHome(java.io.File aFile)Jython home directory.voidsetJar(java.io.File aJarFile)Specifies a .jar file to create and put the results of the freeze into.voidsetJythoncpy(java.io.File aValue)Change the default Python compiler.voidsetPackage(java.lang.String aString)Put all compiled code into the named Java package.voidsetSkip(java.lang.String aValue)Don't include any of these modules in compilation.voidsetSrcdir(java.io.File aFile)Home for the source.voidsetWorkdir(java.io.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, XsetItems
-
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, init, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
-
-
-
-
Method Detail
-
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
public void setPackage(java.lang.String aString)
Put all compiled code into the named Java package.- Parameters:
aString- the packake name.
-
setJar
public void setJar(java.io.File aJarFile)
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
public void setBean(java.io.File aJarFileBean)
Compile into jarfile, including the correct manifest for the bean.
-
setSkip
public void setSkip(java.lang.String aValue)
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
public void setAddpackages(java.lang.String aValue)
Include Java dependencies from this list of packages. Default is org.python.modules and org.apache.oro.text.regex.
-
setWorkdir
public void setWorkdir(java.io.File aValue)
Specify the working directory where the generated Java source code is placed. Default is "./jpywork"
-
setCompiler
public void setCompiler(java.lang.String aCompiler)
Set the compiler.
-
setCompileropts
public void setCompileropts(java.lang.String aValue)
Options passed directly to the Java compiler. Alternatively, you can set the property python.jythonc.compileropts in the registry.
-
setFalsenames
public void setFalsenames(java.lang.String aValue)
A comma-separated list of names that are always false. Can be used to short-circuit if clauses.
-
setHome
public void setHome(java.io.File aFile)
Jython home directory.
-
setSrcdir
public void setSrcdir(java.io.File aFile)
Home for the source.
-
setDestdir
public void setDestdir(java.io.File aFile)
Home for the destination (build).
-
setJythoncpy
public void setJythoncpy(java.io.File aValue)
Change the default Python compiler.
-
setArgs
public void setArgs(java.lang.String aValue)
sets some additional args to send to jythonc.
-
getCompilerOptions
public java.lang.String getCompilerOptions()
get the compiler option, null if none.
-
getPythonHome
public java.io.File getPythonHome()
Get the path to the jython home (or python home)
-
getJythoncPY
public java.io.File 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
-
-