ASF Bugzilla – Attachment 6247 Details for
Bug 19712
Add a task for SQLJ compilation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Documentation for the code
sqlj.html (text/html), 10.11 KB, created by
David Schultz
on 2003-05-07 00:25:39 UTC
(
hide
)
Description:
Documentation for the code
Filename:
MIME Type:
Creator:
David Schultz
Created:
2003-05-07 00:25:39 UTC
Size:
10.11 KB
patch
obsolete
><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> ><html lang="en-us"> ><head> > > <meta http-equiv="Content-Language" content="en-us"> > <title>SQLJ Task</title> > ></head> ><body> ><h2><a name="SQLJ">SQLJ</a></h2> ><h3>Description</h3> ><p>Invokes the SQLJ compiler on SQLJ source.</p> ><p>Scans the source and destination directories looking for source files to >be compiled that require compilation or customization. The check is different >from a traditional one to one comparison. There are up to 3 outputs from >an sqlj operation (<code>.java, .ser, .class</code>), at least two of which >can be checked if the appropriate options are used. The <code>.java</code> >file is always produced so this can be checked by default. The <code>.class</code> >file will be generated if the compile option is set, in which case the existence >and timestamp of the file should be checked. A <code>.ser</code> file CAN >be created if the profile option is set, however, since not all SQLJ files >produce a <code>.ser</code> file, we can't assume that one must exist. We >simply check for a valid date on the profile if the file does exist. The >caveat here is that if a file produces a <code>.ser</code> the first time >it is compiled and is then changed to no longer produce this file, the .ser >will need to be cleaned up or the logic will assume the file is out of date >every time.</p> ><p>Source files can be included or excluded using the standard file inclusion >and exclusion methodology. See the section on <a > href="../dirtasks.html#directorybasedtasks">directory-based tasks</a>, for >information on how the inclusion/exclusion of files works, and how to write >wildcard patterns.</p> ><p>To use this task the sqlj classes must be included in the classpath. The >command is executed by invoking the <code>sqlj.tools.Sqlj</code> class.</p> ><h3>Parameters</h3> ><table border="1" cellpadding="2" cellspacing="0"> > <tbody> > <tr> > <td valign="top"><b>Attribute</b></td> > <td valign="top"><b>Description</b></td> > <td align="center" valign="top"><b>Required</b></td> > </tr> > <tr> > <td valign="top">srcdir</td> > <td valign="top">Location of the sqlj files.</td> > <td align="center" valign="top">Yes, unless nested <code><src></code> >elements are present.</td> > </tr> > <tr> > <td valign="top">destdir</td> > <td valign="top">Location to store the profile and class files.</td> > <td align="center" valign="top">Yes</td> > </tr> > <tr> > <td valign="top">gendir<br> > </td> > <td valign="top">The location to place generated java files. Defaults >to the srcdir.<br> > </td> > <td valign="top" align="center">No<br> > </td> > </tr> > <tr> > <td valign="top">includes</td> > <td valign="top">Comma- or space-separated list of files (may be specified >using wildcard patterns) that must be included; all <code>.sqlj</code> >files are included when omitted.</td> > <td valign="top" align="center">No</td> > </tr> > <tr> > <td valign="top">includesfile</td> > <td valign="top">The name of a file that contains a list of files to > include (may be specified using wildcard patterns).</td> > <td valign="top" align="center">No</td> > </tr> > <tr> > <td valign="top">excludes</td> > <td valign="top">Comma- or space-separated list of files (may be specified >using wildcard patterns) that must be excluded; no files (except default > excludes) are excluded when omitted.</td> > <td valign="top" align="center">No</td> > </tr> > <tr> > <td valign="top">excludesfile</td> > <td valign="top">The name of a file that contains a list of files to > exclude (may be specified using wildcard patterns).</td> > <td valign="top" align="center">No</td> > </tr> > <tr> > <td valign="top">properties<br> > </td> > <td valign="top">A file that contains properties to be used during compilation.<br> > </td> > <td valign="top" align="center">No<br> > </td> > </tr> > <tr> > <td valign="top">status<br> > </td> > <td valign="top">True to indicate that status should be displayed during >compilation. Defaults to false.<br> > </td> > <td valign="top" align="center">No<br> > </td> > </tr> > <tr> > <td valign="top">warn<br> > </td> > <td valign="top">Flags for turning message options on and off. Options >include: all,none,verbose,noverbose, etc.<br> > </td> > <td valign="top" align="center">No<br> > </td> > </tr> > <tr> > <td valign="top">compile<br> > </td> > <td valign="top">Sets the COMPILE option to indicate if generated java >files should be compiled to class files. Defaults to true.<br> > </td> > <td align="center" valign="top">No<br> > </td> > </tr> > <tr> > <td valign="top">compiler<br> > </td> > <td valign="top">An alternative implementation of javac to perform compilation.<br> > </td> > <td align="center" valign="top">No<br> > </td> > </tr> > <tr> > <td valign="top">encoding<br> > </td> > <td valign="top">Specifies the input and output encoding of the source. >Defaults to the system property "file.encoding"<br> > </td> > <td align="center" valign="top">No<br> > </td> > </tr> > <tr> > <td valign="top">linemap<br> > </td> > <td valign="top">Sets the LINEMAP option to turn on or off the instrumentation >of class files with line numbers from sqlj source files. Defaults to >false.<br> > </td> > <td align="center" valign="top">No<br> > </td> > </tr> > <tr> > <td valign="top">profile<br> > </td> > <td valign="top">Set to true to indicate that profile customization will >occur. Defaults to true.<br> > </td> > <td align="center" valign="top">No<br> > </td> > </tr> > <tr> > <td valign="top">ser2class<br> > </td> > <td valign="top">Set to true to indicate that generated profiles should >be compiled to class files. Defaults to false.<br> > </td> > <td align="center" valign="top">No<br> > </td> > </tr> > <tr> > <td valign="top">url<br> > </td> > <td valign="top">The location of the database to use for online checking >of SQL.<br> > </td> > <td align="center" valign="top">No<br> > </td> > </tr> > <tr> > <td valign="top">user<br> > </td> > <td valign="top">The user id to connect to the database for online checking >of SQL.<br> > </td> > <td align="center" valign="top">No<br> > </td> > </tr> > <tr> > <td valign="top">password<br> > </td> > <td valign="top">The password to use to connect to the database for online >checking of SQL.<br> > </td> > <td align="center" valign="top">No<br> > </td> > </tr> > <tr> > <td valign="top">driver<br> > </td> > <td valign="top">Specifies the JDBC driver to use to connect to the database. > If not specified the system default is used.<br> > </td> > <td align="center" valign="top">No<br> > </td> > </tr> > <tr> > <td valign="top">offline<br> > </td> > <td valign="top">Specifies an alternate SQLChecker implementation to use >for offline SQL checking.<br> > </td> > <td align="center" valign="top">No<br> > </td> > </tr> > <tr> > <td valign="top">online<br> > </td> > <td valign="top">Specifies an alternate SQLChecker implementation to use >for online SQL checking.<br> > </td> > <td align="center" valign="top">No<br> > </td> > </tr> > <tr> > <td valign="top">cache<br> > </td> > <td valign="top">Set to true to employ caching of SQL checking results >to avoid database connections. Defaults to false.<br> > </td> > <td align="center" valign="top">No<br> > </td> > </tr> > > </tbody> ></table> ><h3>Parameters specified as nested elements</h3> ><p>This task forms an implicit <a href="../CoreTypes/fileset.html">FileSet</a> >and supports all attributes of <code><fileset></code>(<code>dir</code> >becomes <code>srcdir</code>) as well as the nested<code><include></code>, ><code><exclude></code> and<code><patternset></code> elements.</p> ><h4>compileroption</h4> ><p>You can specify additional command line arguments for the javac compiler >with nested <code><compileroption></code> elements. </p> ><table border="1" cellpadding="2" cellspacing="0"> > <tbody> > <tr> > <td width="12%" valign="top"><b>Attribute</b></td> > <td width="78%" valign="top"><b>Description</b></td> > <td width="10%" valign="top"><b>Required</b></td> > </tr> > <tr> > <td valign="top">option</td> > <td align="left">Command line option that should be passed to the javac >compiler.</td> > <td align="center">Exactly one of these.</td> > </tr> > > </tbody> ></table> ><h3>Examples</h3> ><pre> <sqlj destdir="${build}" srcdir="${src}"/><br></pre> ><p>compiles all <code>.sqlj</code> files under the <code>${src}</code>directory, >storing the <code>.java</code> files in the <code>${src}</code> directory >and the <code>.sqlj</code> and <code>.ser</code> files in the <code>${build}</code> >directory.</p> ><pre> <sqlj destdir="${build}" srcdir="${src}" gendir="${src2}"><br> <include name="**/MySqljObject.sqlj"/><br> </sqlj><br></pre> ><p>compiles any instance of the specified file under the <code>${src}</code>directory, >storing the <code>.java</code> files in the <code>${src2}</code> directory >and the <code>.sqlj</code> and <code>.ser</code> files in the <code>${build}</code> >directory.</p> ><pre> <sqlj destdir="${build}" srcdir="${src}"><br> <compileroption option="deprecation"/><br> </sqlj></pre> ><p>compiles all <code>.sqlj</code> files under the <code>${src}</code>directory, >storing the <code>.java</code> files in the <code>${src}</code> directory >and the <code>.sqlj</code> and <code>.ser</code> files in the <code>${build}</code> >directory. The class files are compiled will the <code>-deprecation</code> >option set.</p> ><pre></pre> ><hr> ><p align="center">Copyright © 2000-2003 Apache Software Foundation. >All rights Reserved.</p> ><br> ></body> ></html>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html lang="en-us"> <head> <meta http-equiv="Content-Language" content="en-us"> <title>SQLJ Task</title> </head> <body> <h2><a name="SQLJ">SQLJ</a></h2> <h3>Description</h3> <p>Invokes the SQLJ compiler on SQLJ source.</p> <p>Scans the source and destination directories looking for source files to be compiled that require compilation or customization. The check is different from a traditional one to one comparison. There are up to 3 outputs from an sqlj operation (<code>.java, .ser, .class</code>), at least two of which can be checked if the appropriate options are used. The <code>.java</code> file is always produced so this can be checked by default. The <code>.class</code> file will be generated if the compile option is set, in which case the existence and timestamp of the file should be checked. A <code>.ser</code> file CAN be created if the profile option is set, however, since not all SQLJ files produce a <code>.ser</code> file, we can't assume that one must exist. We simply check for a valid date on the profile if the file does exist. The caveat here is that if a file produces a <code>.ser</code> the first time it is compiled and is then changed to no longer produce this file, the .ser will need to be cleaned up or the logic will assume the file is out of date every time.</p> <p>Source files can be included or excluded using the standard file inclusion and exclusion methodology. See the section on <a href="../dirtasks.html#directorybasedtasks">directory-based tasks</a>, for information on how the inclusion/exclusion of files works, and how to write wildcard patterns.</p> <p>To use this task the sqlj classes must be included in the classpath. The command is executed by invoking the <code>sqlj.tools.Sqlj</code> class.</p> <h3>Parameters</h3> <table border="1" cellpadding="2" cellspacing="0"> <tbody> <tr> <td valign="top"><b>Attribute</b></td> <td valign="top"><b>Description</b></td> <td align="center" valign="top"><b>Required</b></td> </tr> <tr> <td valign="top">srcdir</td> <td valign="top">Location of the sqlj files.</td> <td align="center" valign="top">Yes, unless nested <code><src></code> elements are present.</td> </tr> <tr> <td valign="top">destdir</td> <td valign="top">Location to store the profile and class files.</td> <td align="center" valign="top">Yes</td> </tr> <tr> <td valign="top">gendir<br> </td> <td valign="top">The location to place generated java files. Defaults to the srcdir.<br> </td> <td valign="top" align="center">No<br> </td> </tr> <tr> <td valign="top">includes</td> <td valign="top">Comma- or space-separated list of files (may be specified using wildcard patterns) that must be included; all <code>.sqlj</code> files are included when omitted.</td> <td valign="top" align="center">No</td> </tr> <tr> <td valign="top">includesfile</td> <td valign="top">The name of a file that contains a list of files to include (may be specified using wildcard patterns).</td> <td valign="top" align="center">No</td> </tr> <tr> <td valign="top">excludes</td> <td valign="top">Comma- or space-separated list of files (may be specified using wildcard patterns) that must be excluded; no files (except default excludes) are excluded when omitted.</td> <td valign="top" align="center">No</td> </tr> <tr> <td valign="top">excludesfile</td> <td valign="top">The name of a file that contains a list of files to exclude (may be specified using wildcard patterns).</td> <td valign="top" align="center">No</td> </tr> <tr> <td valign="top">properties<br> </td> <td valign="top">A file that contains properties to be used during compilation.<br> </td> <td valign="top" align="center">No<br> </td> </tr> <tr> <td valign="top">status<br> </td> <td valign="top">True to indicate that status should be displayed during compilation. Defaults to false.<br> </td> <td valign="top" align="center">No<br> </td> </tr> <tr> <td valign="top">warn<br> </td> <td valign="top">Flags for turning message options on and off. Options include: all,none,verbose,noverbose, etc.<br> </td> <td valign="top" align="center">No<br> </td> </tr> <tr> <td valign="top">compile<br> </td> <td valign="top">Sets the COMPILE option to indicate if generated java files should be compiled to class files. Defaults to true.<br> </td> <td align="center" valign="top">No<br> </td> </tr> <tr> <td valign="top">compiler<br> </td> <td valign="top">An alternative implementation of javac to perform compilation.<br> </td> <td align="center" valign="top">No<br> </td> </tr> <tr> <td valign="top">encoding<br> </td> <td valign="top">Specifies the input and output encoding of the source. Defaults to the system property "file.encoding"<br> </td> <td align="center" valign="top">No<br> </td> </tr> <tr> <td valign="top">linemap<br> </td> <td valign="top">Sets the LINEMAP option to turn on or off the instrumentation of class files with line numbers from sqlj source files. Defaults to false.<br> </td> <td align="center" valign="top">No<br> </td> </tr> <tr> <td valign="top">profile<br> </td> <td valign="top">Set to true to indicate that profile customization will occur. Defaults to true.<br> </td> <td align="center" valign="top">No<br> </td> </tr> <tr> <td valign="top">ser2class<br> </td> <td valign="top">Set to true to indicate that generated profiles should be compiled to class files. Defaults to false.<br> </td> <td align="center" valign="top">No<br> </td> </tr> <tr> <td valign="top">url<br> </td> <td valign="top">The location of the database to use for online checking of SQL.<br> </td> <td align="center" valign="top">No<br> </td> </tr> <tr> <td valign="top">user<br> </td> <td valign="top">The user id to connect to the database for online checking of SQL.<br> </td> <td align="center" valign="top">No<br> </td> </tr> <tr> <td valign="top">password<br> </td> <td valign="top">The password to use to connect to the database for online checking of SQL.<br> </td> <td align="center" valign="top">No<br> </td> </tr> <tr> <td valign="top">driver<br> </td> <td valign="top">Specifies the JDBC driver to use to connect to the database. If not specified the system default is used.<br> </td> <td align="center" valign="top">No<br> </td> </tr> <tr> <td valign="top">offline<br> </td> <td valign="top">Specifies an alternate SQLChecker implementation to use for offline SQL checking.<br> </td> <td align="center" valign="top">No<br> </td> </tr> <tr> <td valign="top">online<br> </td> <td valign="top">Specifies an alternate SQLChecker implementation to use for online SQL checking.<br> </td> <td align="center" valign="top">No<br> </td> </tr> <tr> <td valign="top">cache<br> </td> <td valign="top">Set to true to employ caching of SQL checking results to avoid database connections. Defaults to false.<br> </td> <td align="center" valign="top">No<br> </td> </tr> </tbody> </table> <h3>Parameters specified as nested elements</h3> <p>This task forms an implicit <a href="../CoreTypes/fileset.html">FileSet</a> and supports all attributes of <code><fileset></code>(<code>dir</code> becomes <code>srcdir</code>) as well as the nested<code><include></code>, <code><exclude></code> and<code><patternset></code> elements.</p> <h4>compileroption</h4> <p>You can specify additional command line arguments for the javac compiler with nested <code><compileroption></code> elements. </p> <table border="1" cellpadding="2" cellspacing="0"> <tbody> <tr> <td width="12%" valign="top"><b>Attribute</b></td> <td width="78%" valign="top"><b>Description</b></td> <td width="10%" valign="top"><b>Required</b></td> </tr> <tr> <td valign="top">option</td> <td align="left">Command line option that should be passed to the javac compiler.</td> <td align="center">Exactly one of these.</td> </tr> </tbody> </table> <h3>Examples</h3> <pre> <sqlj destdir="${build}" srcdir="${src}"/><br></pre> <p>compiles all <code>.sqlj</code> files under the <code>${src}</code>directory, storing the <code>.java</code> files in the <code>${src}</code> directory and the <code>.sqlj</code> and <code>.ser</code> files in the <code>${build}</code> directory.</p> <pre> <sqlj destdir="${build}" srcdir="${src}" gendir="${src2}"><br> <include name="**/MySqljObject.sqlj"/><br> </sqlj><br></pre> <p>compiles any instance of the specified file under the <code>${src}</code>directory, storing the <code>.java</code> files in the <code>${src2}</code> directory and the <code>.sqlj</code> and <code>.ser</code> files in the <code>${build}</code> directory.</p> <pre> <sqlj destdir="${build}" srcdir="${src}"><br> <compileroption option="deprecation"/><br> </sqlj></pre> <p>compiles all <code>.sqlj</code> files under the <code>${src}</code>directory, storing the <code>.java</code> files in the <code>${src}</code> directory and the <code>.sqlj</code> and <code>.ser</code> files in the <code>${build}</code> directory. The class files are compiled will the <code>-deprecation</code> option set.</p> <pre></pre> <hr> <p align="center">Copyright © 2000-2003 Apache Software Foundation. All rights Reserved.</p> <br> </body> </html>
View Attachment As Raw
Actions:
View
Attachments on
bug 19712
:
6246
| 6247