Top Description Fields Constructors Methods
org.python.util

public Class JythoncAntTask

extends MatchingTask
Class Inheritance
Imports
org.apache.tools.ant.taskdefs.MatchingTask, .Java, org.apache.tools.ant.BuildException, .DirectoryScanner, org.apache.tools.ant.types.Path, org.python.core.PySystemState, java.io.File

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.

Author
Cyrille Morvan - cmorvan@ingenosya.com - Ingenosya France
Version
1.0

Field Summary

Modifier and TypeField and Description
protected String
addpackages

Include Java dependencies from this list of packages.

protected boolean
all

Include all of the Jython libraries (everything in core + compiler and parser).

protected Path
classpath

The classpath for the virtual machine.

protected String
compiler

Compiler name.

protected String
compileropts

Use a different compiler than `standard' javac.

protected boolean
core

Include the core Jython libraries (about 130K).

protected boolean
deep

Compile all Python dependencies of the module.

protected File
destDir

Destination, build directory.

protected String
extraArgs

aditionnals args.

protected String
falsenames

Options passed directly to the Java compiler.

protected File
jarFile

Specifies a .jar file to create and put the results of the freeze into.

protected File
jarFileBean

Compile into jarfile, including the correct manifest for the bean.

protected static final String
protected static final String
protected File
jythoncpy

the compiler.

protected File
jythonHome

Path to jython directory.

protected String
packageName

Put all compiled code into the named Java package.

protected String
skipModule

Don't include any of these modules in compilation.

protected File
srcDir

Source directory.

protected File
workdir

Specify the working directory where the generated Java source code is placed.

Inherited from org.apache.tools.ant.taskdefs.MatchingTask:
fileset

Constructor Summary

AccessConstructor and Description
public
JythoncAntTask()

constructor set up the search pattern

Method Summary

Modifier and TypeMethod and Description
public Path

Returns:

A Path object representing the classpath to be used.
createClasspath
()

Add a classpath.

public void
execute()

Overrides org.apache.tools.ant.Task.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.

public void
setAll(boolean aValue)

Include all of the Jython libraries (everything in core + compiler and parser).

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
A Path object representing the "classpath" attribute.
aClasspath
)

Sets the classpath field.

public void
setCompiler(String aCompiler)

Set the compiler.

public void
setCompileropts(String aValue)

Options passed directly to the Java compiler.

public void
setCore(boolean aValue)

Include the core Jython libraries (about 130K).

public void
setDeep(boolean aValue)

Compile all Python dependencies of the module.

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.

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.

public void
setJythoncpy(File aValue)

Change the default Python compiler.

public void
setPackage(String
the packake name.
aString
)

Put all compiled code into the named Java package.

public void
setSkip(String aValue)

Don't include any of these modules in compilation.

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.

Inherited from org.apache.tools.ant.taskdefs.MatchingTask:
addaddAndaddContainsaddContainsRegexpaddCustomaddDateaddDependaddDepthaddDifferentaddFilenameaddMajorityaddModifiedaddNoneaddNotaddOraddPresentaddSelectoraddSizeaddTypeappendSelectorcreateExcludecreateExcludesFilecreateIncludecreateIncludesFilecreatePatternSetgetDirectoryScannergetImplicitFileSetgetSelectorshasSelectorsselectorCountselectorElementssetCaseSensitivesetDefaultexcludessetExcludessetExcludesfilesetFollowSymlinkssetIncludessetIncludesfilesetProjectXsetIgnoreXsetItems

Field Detail

addpackagesback to summary
protected String addpackages

Include Java dependencies from this list of packages. Default is org.python.modules and org.apache.oro.text.regex.

allback to summary
protected boolean all

Include all of the Jython libraries (everything in core + compiler and parser).

classpathback to summary
protected Path classpath

The classpath for the virtual machine.

compilerback to summary
protected String compiler

Compiler name.

compileroptsback to summary
protected String compileropts

Use a different compiler than `standard' javac. If this is set to "NONE" then compile ends with the generation of the Java source file. Alternatively, you can set the property python.jythonc.compiler in the registry.

coreback to summary
protected boolean core

Include the core Jython libraries (about 130K). Needed for applets since Netscape doesn't yet support multiple archives.

deepback to summary
protected boolean deep

Compile all Python dependencies of the module. This is used for creating applets.

destDirback to summary
protected File destDir

Destination, build directory.

extraArgsback to summary
protected String extraArgs

aditionnals args.

falsenamesback to summary
protected String falsenames

Options passed directly to the Java compiler. Alternatively, you can set the property python.jythonc.compileropts in the registry.

jarFileback to summary
protected File jarFile

Specifies a .jar file to create and put the results of the freeze into. Set the deep option to true.

jarFileBeanback to summary
protected File jarFileBean

Compile into jarfile, including the correct manifest for the bean.

JYTHON_CLASSback to summary
protected static final String JYTHON_CLASS
JYTHONC_PYback to summary
protected static final String JYTHONC_PY
jythoncpyback to summary
protected File jythoncpy

the compiler.

jythonHomeback to summary
protected File jythonHome

Path to jython directory.

packageNameback to summary
protected String packageName

Put all compiled code into the named Java package.

skipModuleback to summary
protected String skipModule

Don't include any of these modules in compilation. This is a comma-separated list of modules.

srcDirback to summary
protected File srcDir

Source directory.

workdirback to summary
protected File workdir

Specify the working directory where the generated Java source code is placed. Default is "./jpywork"

Constructor Detail

JythoncAntTaskback to summary
public JythoncAntTask()

constructor set up the search pattern

Method Detail

createClasspathback to summary
public Path createClasspath()

Add a classpath. Used to handle the nested classpath element.

Returns:Path

A Path object representing the classpath to be used.

executeback to summary
public void execute()

Overrides org.apache.tools.ant.Task.execute.

Exectute the compiler.

getCompilerOptionsback to summary
public String getCompilerOptions()

get the compiler option, null if none.

getJythoncPYback to summary
public File getJythoncPY()

Get the path to the jython compiler file (in python).

getPythonHomeback to summary
public File getPythonHome()

Get the path to the jython home (or python home)

setAddpackagesback to summary
public void setAddpackages(String aValue)

Include Java dependencies from this list of packages. Default is org.python.modules and org.apache.oro.text.regex.

setAllback to summary
public void setAll(boolean aValue)

Include all of the Jython libraries (everything in core + compiler and parser). Set the deep option to true.

setArgsback to summary
public void setArgs(String aValue)

sets some additional args to send to jythonc.

setBeanback to summary
public void setBean(File aJarFileBean)

Compile into jarfile, including the correct manifest for the bean.

setClasspathback to summary
public void setClasspath(Path aClasspath)

Sets the classpath field.

Parameters
aClasspath:Path

A Path object representing the "classpath" attribute.

setCompilerback to summary
public void setCompiler(String aCompiler)

Set the compiler.

setCompileroptsback to summary
public void setCompileropts(String aValue)

Options passed directly to the Java compiler. Alternatively, you can set the property python.jythonc.compileropts in the registry.

setCoreback to summary
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.

setDeepback to summary
public void setDeep(boolean aValue)

Compile all Python dependencies of the module. This is used for creating applets.

setDestdirback to summary
public void setDestdir(File aFile)

Home for the destination (build).

setFalsenamesback to summary
public void setFalsenames(String aValue)

A comma-separated list of names that are always false. Can be used to short-circuit if clauses.

setHomeback to summary
public void setHome(File aFile)

Jython home directory.

setJarback to summary
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.

setJythoncpyback to summary
public void setJythoncpy(File aValue)

Change the default Python compiler.

setPackageback to summary
public void setPackage(String aString)

Put all compiled code into the named Java package.

Parameters
aString:String

the packake name.

setSkipback to summary
public void setSkip(String aValue)

Don't include any of these modules in compilation. This is a comma-separated list of modules.

setSrcdirback to summary
public void setSrcdir(File aFile)

Home for the source.

setWorkdirback to summary
public void setWorkdir(File aValue)

Specify the working directory where the generated Java source code is placed. Default is "./jpywork"