Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pde-dev] Comparing successive versions of Arbitrary JAR's using API Tooling

Darin,

Thanks for the feedback I managed to get it to work after ensuring
that the both jars (e.g. b1 & b2) were using the same plugin_id. It
seems when you use "New > Create Plugin from existing jar" the name
chosen in the plugin creation wizard is also assigned to be the
plugin_id and this causes the API tooling to fail.

New Question:

One (hopefully) last question I am now trying to move from analyzing
the api of arbitrary jars to performing api-usage but my attempts at
making use of the existing support for api-usage  are failing

Approach 1:
Environment: Eclipse 3.5.1 and ANT 1.7:

Extending your example. I now have b1 and b2 as plugin projects in my
workspace following which:
a) I created new plugin project c1 (in the same workspace) that has b1.
b) Created code in c1 that made use of the b1 api. Thus requiring b1
to be added as a required plugin in the manifest/plugin.xml
b) I exported c1 to a local directory packing the bundle as a jar
c) created an ANT task making use of apitooling.apiuse to report
instances of b1 api usage within the c1 plugin.

The ant task is as follows (wherein /c1/plugins and /b1/plugins
contained the jar'd bundles):

	    <apitooling.apiuse
	      	baseline="/b1"
		scope="/c1"
	    	proceedonerror="true"
	      	report="/reportHome"
	      	considerinternal="true"
	      	considerapi="true"
	      	debug="true"
	     />

All I get back is an "not_searched" xml file showing this:


<components>
    <component excluded="false" id="JavaSE-1.6" no_description="true"
resolution_errors="false"/>
</components>


Approach 2 :
Environment: Eclipse 3.6_M3 and New "Api Use as an External Tool" feature

Tried to repeat this exercise in a different way using documentation
provided by Micheal Rennie at
http://wiki.eclipse.org/PDE/API_Tools/Resources

Michel's article showcases the "API Usage as an External tool" feature
in Eclipse 3.6 but it also generates another "not_searched" xml file:

<components>

    <component details="This component was excluded from the search by
the search parameters." id="JavaSE-1.6" version="JavaSE-1.6"/>

    <component details="Require-Bundle: b1;
bundle-version=&quot;1.0.8&quot;&lt;br/&gt;" id="c1" version="1.5.0"/>

</components>

In the above scenario I used the following options in Eclipse 3.6_M3
Analyze > directory > c:\temp\c1
Search for > References to > org.jdom  [i.e the jar imported as b1]
Search for > Api References > checked
Search for > Internal References > checked
Search In > Bundles Matching > .* [as per Micheal's wiki example]

I would welcome any suggestions for a solution (as would my "task
masters") or pointing out any glaring errors in my approach.

Thanks,
-pkapur



> Answers would be welcome on:
> a) if it is even possible to compare successive versions of Arbitrary
> JAR's using API Tooling?

No. Currently, API tooling only works on bundles. See the following
enhancement request for API tooling on standard Java projects:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=255068

> b) if the scenario/steps provided below are a step in the right
> direction or some other steps are required?
> c) what determines if a plugin is/is not included in the analysis
> output generated by API Tooling?

I was able to create and compare two simple jars by creating bundles from
the jars and setting up API tooling on the projects. The tools look for an
".api_description" file in the root of each bundle to identify it as
configured for API tooling. The description file should be generated
automatically when you export the bundles. Be sure to export all packages
that you want to be considered as API for comparison.

>
> More specifically:
> a) New > Create plugin from existing jar (be sure to enable API
> tooling once the plugin is created)
> b) New > Create Feature project (using the plugin from step a)
> c) New > Create Update Site (using the feature created in step b)
> d) Install new software > Local Update Site > (use the update site
> created in step c)

I just did this for each bundle:

a) New > Create plugin from existing jar
b) Setup API tooling once the plugin is created
c) Export to directory, packaging the bundle as a jar

Then I placed the jar'd bundles in directories like "b1\plugins" and
"b2\plugins", then I ran the analysis task:

      <apitooling.analysis
               baseline="c:\temp\b1"
               profile="c:\temp\b2"
               report="c:\temp\report"
               debug="true"
       />



Darin Wright



------------------------------

_______________________________________________
pde-dev mailing list
pde-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/pde-dev


End of pde-dev Digest, Vol 56, Issue 12
***************************************


Back to the top