For the interest of those wanting to
create "illegal API usage" reports during a batch build process,
it should be a little simpler now. We've refactored code such that a search
can be called from an integrated builder or batch process. See the new
class "ApiUseAnalyzer". It can be called to find illegal API
use in an entire profile, component, or specific scope within a component.
It returns the illegal usages as a collection of IReferences that can be
processed as desired.
----- Forwarded by Darin
Wright/Ottawa/IBM on 01/25/2008 01:09 PM -----
Darin Wright/Ottawa/IBM@IBMCA Sent by: pde-ui-dev-bounces@xxxxxxxxxxx
01/16/2008 12:06 PM
Please respond to
"Eclipse PDE UI developers list." <pde-ui-dev@xxxxxxxxxxx>
[pde-ui-dev] re: PDE API tooling questions
I'm posting this discussion on the mailing list to benefit others interested
leveraging API tooling features...
API tooling is scheduled to have its "graduation review" with
the EMO on Jan 30th. You can see our graduation review link off this page
- http://www.eclipse.org/projects/whatsnew.php. Assuming we pass the review,
the code will be graduated to the Eclipse SDK shortly after that (likely
the week of Feb 11th). So, API tooling exists as code in the CVS repository,
but will not be available as a binary download as part of the SDK until
There's nothing to stop you from experimenting with the code right now
- in fact, I encourage you to do so. My only disclaimer is that the code
is under development - APIs are not frozen. In fact, as you will see in
the slides, we are not planning to ship a public API in the first release.
So, you need to be willing to accept migration effort as API tooling evolves.
> I'd like to start with "API
> Usage Reporting" feature from http://wiki.eclipse.org/index.
> 1) What is the current state of this feature?
Infrastructure to support API usage analysis exists. There is *no* command
line tool as of yet. We do intend to produce rudimentary API usage reports
with Eclipse builds (we will likey write some Ant tasks to help with this).
The support is designed to work in "pure Java" mode (i.e. no
OSGi or workspace required). So you would need to write a Java program
that calls our provisional APIs. Below is a description of what you would
need to do. Perhaps you could review this, and provide some feedback on
how we can make this more consumable for you.
For example, in the SDK, we analyze a project for API usage problems when
it is built. We do this by collecting all of its prequisite bundles' API
descriptions to create search criteria for elements that have usage restrictions.
We then search the project being built.
* Create an API profile (translates to a product made up of binary bundles/plug-ins).
- use the Factory to do this (based on a location, name, id, version,
and execution environment description file)
* For each bundle in the product, create and add the corresponding API
component to the profile
- API components are created from the profile, based on location
* Use the API search engine to search for specific API usage problems
- define the scope to search, and the problems you are searching for
- you could look at the APIToolBuilder as an example that searches components
for illegal API use
* Create a report with the search results (references)
- we do not currently create reports, we create problem markers in the
Note: currently an API component initializes its "API description"
from the bundle's manifest.mf (i.e. defines which packages are API), and
from the .api_description file in the root of the bundle (jar or folder).
The .api_description file is the same format as component.xml files - but
also allows visibility and usage flags to be set on members within types.
This means you'd need to have some way of injecting the api description
files into the bundles. We plan to do this with regular Eclipse builds.
Here's an example file: