ASF Bugzilla – Attachment 1567 Details for
Bug 8080
New <jythonc> task to compile Python code in java bytecode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
jakarta-ant\docs\manual\OptionalTasks\python.html
python.html (text/html), 8.38 KB, created by
Cyrille Morvan
on 2002-04-15 01:00:32 UTC
(
hide
)
Description:
jakarta-ant\docs\manual\OptionalTasks\python.html
Filename:
MIME Type:
Creator:
Cyrille Morvan
Created:
2002-04-15 01:00:32 UTC
Size:
8.38 KB
patch
obsolete
><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> ><html> ><head> > <title>Python Tasks</title> ></head> > <body bgcolor="#ffffff"> > ><h1>Ant Python tasks User Manual</h1> > ><p>by</p> > <!-- Names are in alphabetical order, on last name --> ><ul> > <li>Cyrille Morvan ( <a href="mailto:cmorvan@ingenosya.com">cmorvan@ingenosya.com</a> > )</li> > ></ul> > ><hr> ><h2>Task: jythonc</h2> > You can use the jythonc to build a real java class from a Python > class, to create bean, servlet, ...<br> > <br> > The jythonc tool generates actual Java source code, and then > invokes a Java compiler over this source code to create the .class >files. The task is a directory based task, so attributes like <b>includes="**/*.py"</b> > and <b>excludes="broken.py"</b> can be used to control the files > pulled in. By default, all *.py files from the project folder down are > included in the command. <br> > <br> > ><table border="1"> > <tbody> > <tr> > <td valign="Top"><b>Attribute</b><br> > </td> > <td valign="Top"><b>Description</b><br> > </td> > <td valign="Top"><b>Required</b><br> > </td> > </tr> > <tr> > <td valign="Top">home<br> > </td> > <td valign="Top">You must specify the Jython home (c:\jython-2.1) >or use the magic property <i>python.home</i> .<br> > </td> > <td valign="Top"> > <div align="Center">yes (unless <br> > <i>python.home</i><br> > specified )<br> > </div> > </td> > </tr> > <tr> > <td valign="Top">srcdir<br> > </td> > <td valign="Top">Location of the python files. <br> > </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td valign="Top">destdir<br> > </td> > <td valign="Top">Location to store the class files (it's not officialy > supported by jythonc).<br> > </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td valign="Top">excludes<br> > </td> > <td valign="Top">comma separated list of patterns of files that must > be excluded. No files (except default excludes) are excluded >when omitted.<br> > </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td valign="Top">excludesfile<br> > </td> > <td valign="Top">the name of a file. Each line of this file is > taken to be an exclude pattern<br> > </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td valign="Top">includes<br> > </td> > <td valign="Top">comma separated list of patterns of files that must > be included. All files are included when omitted.<br> > </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td valign="Top">includesfile<br> > </td> > <td valign="Top">the name of a file. Each line of this file is > taken to be an include pattern<br> > </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td>package<em></em><br> > </td> > <td>Put all compiled code into the named Java package. </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td>jar</td> > <td>Specifies a .jar file to create and put the results of the freeze > into. Automatically set the <i>deep</i> option to true. </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td>deep<br> > </td> > <td>Compile all Python dependencies of the module. This is used for > creating applets.</td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td>core<br> > </td> > <td>Include the core Jython libraries (about 130K). Needed for applets > since Netscape doesn't yet support multiple archives. Automatically >set the <i>deep</i> option to true. </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td>all</td> > <td>Include all of the Jython libraries (everything in core + compiler > and parser). Automatically set the <i>deep</i> option to true. > </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td>bean</td> > <td>Compile into <em>jarfile</em>, including the correct manifest >for the bean. </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td>addpackages </td> > <td>Include Java dependencies from this list of packages. Default >is <tt>org.python.modules</tt> and <tt>org.apache.oro.text.regex</tt> > . </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td>workdir<em></em></td> > <td>Specify the working directory where the generated Java source >code is placed. Default is "./jpywork" </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td>skip</td> > <td>Don't include any of these modules in compilation. This is a >comma-separated list of modules. </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td>compiler<em></em></td> > <td>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 <tt>python.jythonc.compiler</tt> > in the registry. </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td>compileropts<em></em><br> > <em></em></td> > <td>Options passed directly to the Java compiler. Alternatively, >you can set the property <tt>python.jythonc.compileropts</tt> in the > registry. </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td>falsenames<em></em><br> > </td> > <td>A comma-separated list of names that are always false. Can be > used to short-circuit if clauses. </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td valign="Top">classpath<br> > </td> > <td valign="Top">the classpath to use.<br> > </td> > <td valign="Top"><br> > </td> > </tr> > <tr> > <td>jythoncpy </td> > <td>The Jython compiler script. Default to ${python.home}/Tools/jythonc/jythonc.py > </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > <tr> > <td>args<br> > </td> > <td>sets some additional args to send to jythonc before the list of > modules.<br> > </td> > <td valign="Top"> > <div align="Center">no<br> > </div> > </td> > </tr> > > </tbody> ></table> > <br> > ><h3>Nested Elements </h3> > ><p>The jythonc task supports a nested <code><classpath></code> element >to set the classpath.<br> > This task supports also the nested <code><include></code> >, <code> <exclude></code> and <code><patternset></code> > elements.</p> > ><p>Example </p> > ><pre> <br> <jythonc home="/usr/jython-2.1/" <br> srcdir="${src}" <br> package="com.ingenosya" > <br> <include name="*.py" /> <br> <exclude name="Test.py" /><br> </jythonc><br><br><br></pre> > ><hr> ><p align="Center">Copyright © 2002 Apache Software Foundation. All rights > Reserved.</p> > ></body> ></html>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Python Tasks</title> </head> <body bgcolor="#ffffff"> <h1>Ant Python tasks User Manual</h1> <p>by</p> <!-- Names are in alphabetical order, on last name --> <ul> <li>Cyrille Morvan ( <a href="mailto:cmorvan@ingenosya.com">cmorvan@ingenosya.com</a> )</li> </ul> <hr> <h2>Task: jythonc</h2> You can use the jythonc to build a real java class from a Python class, to create bean, servlet, ...<br> <br> The jythonc tool generates actual Java source code, and then invokes a Java compiler over this source code to create the .class files. The task is a directory based task, so attributes like <b>includes="**/*.py"</b> and <b>excludes="broken.py"</b> can be used to control the files pulled in. By default, all *.py files from the project folder down are included in the command. <br> <br> <table border="1"> <tbody> <tr> <td valign="Top"><b>Attribute</b><br> </td> <td valign="Top"><b>Description</b><br> </td> <td valign="Top"><b>Required</b><br> </td> </tr> <tr> <td valign="Top">home<br> </td> <td valign="Top">You must specify the Jython home (c:\jython-2.1) or use the magic property <i>python.home</i> .<br> </td> <td valign="Top"> <div align="Center">yes (unless <br> <i>python.home</i><br> specified )<br> </div> </td> </tr> <tr> <td valign="Top">srcdir<br> </td> <td valign="Top">Location of the python files. <br> </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td valign="Top">destdir<br> </td> <td valign="Top">Location to store the class files (it's not officialy supported by jythonc).<br> </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td valign="Top">excludes<br> </td> <td valign="Top">comma separated list of patterns of files that must be excluded. No files (except default excludes) are excluded when omitted.<br> </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td valign="Top">excludesfile<br> </td> <td valign="Top">the name of a file. Each line of this file is taken to be an exclude pattern<br> </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td valign="Top">includes<br> </td> <td valign="Top">comma separated list of patterns of files that must be included. All files are included when omitted.<br> </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td valign="Top">includesfile<br> </td> <td valign="Top">the name of a file. Each line of this file is taken to be an include pattern<br> </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td>package<em></em><br> </td> <td>Put all compiled code into the named Java package. </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td>jar</td> <td>Specifies a .jar file to create and put the results of the freeze into. Automatically set the <i>deep</i> option to true. </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td>deep<br> </td> <td>Compile all Python dependencies of the module. This is used for creating applets.</td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td>core<br> </td> <td>Include the core Jython libraries (about 130K). Needed for applets since Netscape doesn't yet support multiple archives. Automatically set the <i>deep</i> option to true. </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td>all</td> <td>Include all of the Jython libraries (everything in core + compiler and parser). Automatically set the <i>deep</i> option to true. </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td>bean</td> <td>Compile into <em>jarfile</em>, including the correct manifest for the bean. </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td>addpackages </td> <td>Include Java dependencies from this list of packages. Default is <tt>org.python.modules</tt> and <tt>org.apache.oro.text.regex</tt> . </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td>workdir<em></em></td> <td>Specify the working directory where the generated Java source code is placed. Default is "./jpywork" </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td>skip</td> <td>Don't include any of these modules in compilation. This is a comma-separated list of modules. </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td>compiler<em></em></td> <td>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 <tt>python.jythonc.compiler</tt> in the registry. </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td>compileropts<em></em><br> <em></em></td> <td>Options passed directly to the Java compiler. Alternatively, you can set the property <tt>python.jythonc.compileropts</tt> in the registry. </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td>falsenames<em></em><br> </td> <td>A comma-separated list of names that are always false. Can be used to short-circuit if clauses. </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td valign="Top">classpath<br> </td> <td valign="Top">the classpath to use.<br> </td> <td valign="Top"><br> </td> </tr> <tr> <td>jythoncpy </td> <td>The Jython compiler script. Default to ${python.home}/Tools/jythonc/jythonc.py </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> <tr> <td>args<br> </td> <td>sets some additional args to send to jythonc before the list of modules.<br> </td> <td valign="Top"> <div align="Center">no<br> </div> </td> </tr> </tbody> </table> <br> <h3>Nested Elements </h3> <p>The jythonc task supports a nested <code><classpath></code> element to set the classpath.<br> This task supports also the nested <code><include></code> , <code> <exclude></code> and <code><patternset></code> elements.</p> <p>Example </p> <pre> <br> <jythonc home="/usr/jython-2.1/" <br> srcdir="${src}" <br> package="com.ingenosya" > <br> <include name="*.py" /> <br> <exclude name="Test.py" /><br> </jythonc><br><br><br></pre> <hr> <p align="Center">Copyright © 2002 Apache Software Foundation. All rights Reserved.</p> </body> </html>
View Attachment As Raw
Actions:
View
Attachments on
bug 8080
:
1565
|
1566
| 1567