| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
| <html lang="en"> | |
| <head> | |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2009. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page."> | |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | |
| <meta http-equiv="Content-Style-Type" content="text/css"> | |
| <link rel="stylesheet" href="../../../apache_style.css" type="text/css"> | |
| <title>API Use Ant Task</title> | |
| <script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js" type="text/javascript"> </script> | |
| </head> | |
| <body> | |
| <h1> API Use Ant Task </h1> | |
| <h2>Purpose</h2> | |
| <p>This task runs a complete search of a given baseline to determine a producer-centric report of API usage.</p> | |
| <p>The analysis does not include bundles that are not API Tools enabled.</p> | |
| <h2>Usage</h2> | |
| <h3>Description</h3> | |
| <p>The name of the ant task is: <code>apitooling.apiuse</code>. To be used, the jar file <code>apitooling-ant.jar</code> has to be on the ant | |
| classpath.</p> | |
| <pre> | |
| <b><font color="#0000ff"><apitooling.apiuse | |
| location=<font color="#008000">"..."</font> | |
| scopepattern=<font color="#008000">"..."</font> | |
| referencepattern=<font color="#008000">"..."</font> | |
| report=<font color="#008000">"..."</font> | |
| considerinternal=<font color="#008000">"..."</font> | |
| considerapi=<font color="#008000">"..."</font> | |
| apipatterns=<font color="#008000">"..."</font> | |
| internalpatterns=<font color="#008000">"..."</font> | |
| debug=<font color="#008000">"..."</font> | |
| /></font></b> | |
| </pre> | |
| <h3>Parameters</h3> | |
| <table border="1" cellpadding="2" cellspacing="0"> | |
| <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">location</td> | |
| <td valign="top"> | |
| This attribute specifies the location of the current product you want to search for API usage. | |
| <br><br> | |
| It can be a .zip, .jar, .tgz, .tar.gz file, or a directory that corresponds to a collection of bundles. | |
| <br><br> | |
| The location is specified using an absolute path.</td> | |
| <td align="center" valign="top">Yes</td> | |
| </tr> | |
| <tr> | |
| <td valign="top">scopepattern</td> | |
| <td valign="top"> | |
| This attribute specifies the regular expression pattern used to build the scope of elements to search for | |
| references from in the product location. | |
| <br><br> | |
| The pattern must be a well-formatted regular expression as | |
| defined <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html">here</a>. | |
| </td> | |
| <td align="center" valign="top">No</td> | |
| </tr> | |
| <tr> | |
| <td valign="top">referencepattern</td> | |
| <td valign="top"> | |
| Set the regular expression pattern used to build the scope of elements to search for | |
| references to in the product location. | |
| <br><br> | |
| The pattern must be a well-formatted regular expression as | |
| defined <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html">here</a>. | |
| </td> | |
| <td align="center" valign="top">No</td> | |
| </tr> | |
| <tr> | |
| <td valign="top">report</td> | |
| <td valign="top">Set the output location where the reports will be generated. | |
| <br><br> | |
| Once the task is completed, reports are available in this directory using a hierarchical structure. A sub-folder is created | |
| for each component that has another bundle that references it. Each sub-folder contains a file called "[bundlename].xml". Within | |
| this folder is another sub-folder (named "[referencing bundle name].xml") for each bundle that references the bundle of the containing folder. | |
| Inside the referencing bundle folder is one of three sub-folders (API, PRIVATE or OTHER) which contain type, method or field references of that kind. | |
| <br><br> | |
| Two other special files are written into the report directory, which are "not_searched.xml" and "no_apidescription.xml" and they contain | |
| information about bundles from the baseline that were not search for usage information and those that did not have an .api_description files in them, respectively. | |
| <br><br> | |
| The location is specified using an absolute path. | |
| <br><br> | |
| For example: | |
| <pre> | |
| root | |
| | | |
| +-- "not_searched.xml" | |
| +-- "no_apidescription.xml" | |
| +-- bundle name with usage | |
| | | |
| +--referencing bundle name | |
| | | |
| +-- [API or PRIVATE or OTHER] | |
| | | |
| +--[type_ or method_ or field_]references.xml | |
| </pre> | |
| </td> | |
| <td align="center" valign="top">Yes</td> | |
| </tr> | |
| <tr> | |
| <td valign="top">considerinternal</td> | |
| <td valign="top">If internal references should be considered during the search. | |
| <br><br>Default is <code>false</code>.</td> | |
| <td align="center" valign="top">No</td> | |
| </tr> | |
| <tr> | |
| <td valign="top">considerapi</td> | |
| <td valign="top">If API references should be considered during the search. | |
| <br><br>Default is <code>false</code>.</td> | |
| <td align="center" valign="top">No</td> | |
| </tr> | |
| <tr> | |
| <td valign="top">apipatterns</td> | |
| <td valign="top">A comma separated list of package name patterns (regular expressions) to consider as API packages. | |
| <br><br>By default API descriptions are used in the scanned bundles, but this can be used to | |
| override or add API packages.</td> | |
| <td align="center" valign="top">No</td> | |
| </tr> | |
| <tr> | |
| <td valign="top">internalpatterns</td> | |
| <td valign="top">A comma separated list of package name patterns (regular expressions) to consider as private packages. | |
| <br><br>By default API descriptions are used in the scanned bundles, but this can be used to | |
| override or add private packages.</td> | |
| <td align="center" valign="top">No</td> | |
| </tr> | |
| <tr> | |
| <td valign="top">debug</td> | |
| <td valign="top">Set the debug value. | |
| <br><br>The possible values are: <code>true</code>, <code>false</code> | |
| <br>Default is <code>false</code>.</td> | |
| <td align="center" valign="top">No</td> | |
| </tr> | |
| </table> | |
| <h3>Examples</h3> | |
| <pre> | |
| <b><font color="#0000ff"><apitooling.apiuse | |
| location=<font color="#008000">"/eclipse/eclipse.tar.gz"</font> | |
| scopepattern=<font color="#008000">".*"</font> | |
| referencepattern=<font color="#008000">"org\.eclipse.*"</font> | |
| report=<font color="#008000">"/eclipse/apiuse-both/XML"</font> | |
| considerinternal=<font color="#008000">"true"</font> | |
| considerapi=<font color="#008000">"true"</font> | |
| debug=<font color="#008000">"true"</font> | |
| /></font></b> | |
| </pre> | |
| <p>This will run the task creating <code>*.xml</code> files inside the folder <code>/eclipse/apiuse-both/XML</code>. | |
| The task will search all bundles in the product location - defined by the regular expression <code>.*</code> - searching | |
| for all references to any bundles whose identifier begins with org.eclipse (defined by the <code>org\.eclipse.*</code> regular expression). | |
| <p>If debug is enabled, some debug tracing will show up in the ant console.</p> | |
| <p><img src="../../../images/ngrelr.png" alt="Related reference" border="0"></p> | |
| <p><a href="apifreeze-ant-task.htm">API Tools API Freeze Ant Task</a> | |
| <br><a href="filegeneration-ant-task.htm">API Tools File Generation Ant Task</a> | |
| <br><a href="analysis-reportconversion-ant-task.htm">API Tools Analysis Report Conversion Ant Task</a> | |
| <br><a href="apifreeze-reportconversion-ant-task.htm">API Tools API Freeze Report Conversion Ant Task</a> | |
| <br><a href="apiuse-reportconversion-ant-task.htm">API Tools API Use Report Conversion Ant Task</a> | |
| </p> | |
| </body> | |
| </html> |