org.python.util
Class JythoncAntTask
public
class
JythoncAntTask
extends 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
Method Summary |
Path | createClasspath()
Add a classpath. |
void | execute()
Exectute the compiler. |
String | getCompilerOptions()
get the compiler option, null if none. |
File | getJythoncPY()
Get the path to the jython compiler file (in python). |
File | getPythonHome()
Get the path to the jython home (or python home) |
void | setAddpackages(String aValue)
Include Java dependencies from this list of packages. |
void | setAll(boolean aValue)
Include all of the Jython libraries (everything in core + compiler and
parser). |
void | setArgs(String aValue)
sets some additional args to send to jythonc. |
void | setBean(File aJarFileBean)
Compile into jarfile, including the correct manifest for the bean. |
void | setClasspath(Path aClasspath)
Sets the classpath field. |
void | setCompiler(String aCompiler)
Set the compiler. |
void | setCompileropts(String aValue)
Options passed directly to the Java compiler. |
void | setCore(boolean aValue)
Include the core Jython libraries (about 130K).
|
void | setDeep(boolean aValue)
Compile all Python dependencies of the module. |
void | setDestdir(File aFile)
Home for the destination (build). |
void | setFalsenames(String aValue)
A comma-separated list of names that are always false. |
void | setHome(File aFile)
Jython home directory. |
void | setJar(File aJarFile)
Specifies a .jar file to create and put the results of
the freeze into. |
void | setJythoncpy(File aValue)
Change the default Python compiler. |
void | setPackage(String aString)
Put all compiled code into the named Java package. |
void | setSkip(String aValue)
Don't include any of these modules in compilation. |
void | setSrcdir(File aFile)
Home for the source. |
void | setWorkdir(File aValue)
Specify the working directory where the generated Java source code is
placed. |
public JythoncAntTask()
constructor set up the search pattern
public Path createClasspath()
Add a classpath. Used to handle the nested classpath
element.
Returns: A Path object representing the classpath to be used.
public void execute()
Exectute the compiler.
public String getCompilerOptions()
get the compiler option, null if none.
public File getJythoncPY()
Get the path to the jython compiler file (in python).
public File getPythonHome()
Get the path to the jython home (or python home)
public void setAddpackages(String aValue)
Include Java dependencies from this list of packages. Default is
org.python.modules and org.apache.oro.text.regex.
public void setAll(boolean aValue)
Include all of the Jython libraries (everything in core + compiler and
parser). Set the deep option to true.
public void setArgs(String aValue)
sets some additional args to send to jythonc.
public void setBean(File aJarFileBean)
Compile into jarfile, including the correct manifest for the bean.
public void setClasspath(Path aClasspath)
Sets the classpath field.
Parameters: aClasspath A Path object representing the "classpath" attribute.
public void setCompiler(String aCompiler)
Set the compiler.
public void setCompileropts(String aValue)
Options passed directly to the Java compiler. Alternatively, you can set
the property python.jythonc.compileropts in the registry.
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.
public void setDeep(boolean aValue)
Compile all Python dependencies of the module. This is
used for creating applets.
public void setDestdir(File aFile)
Home for the destination (build).
public void setFalsenames(String aValue)
A comma-separated list of names that are always false. Can be used to
short-circuit if clauses.
public void setHome(File aFile)
Jython home directory.
public void setJar(File aJarFile)
Specifies a .jar file to create and put the results of
the freeze into. Set the deep option to true.
public void setJythoncpy(File aValue)
Change the default Python compiler.
public void setPackage(String aString)
Put all compiled code into the named Java package.
Parameters: aString the packake name.
public void setSkip(String aValue)
Don't include any of these modules in compilation. This is a
comma-separated list of modules.
public void setSrcdir(File aFile)
Home for the source.
public void setWorkdir(File aValue)
Specify the working directory where the generated Java source code is
placed. Default is "./jpywork"