|
Re: Compiling [message #605035 is a reply to message #604978] |
Sun, 14 March 2010 09:08 |
Ankur Sharma Messages: 68 Registered: July 2009 |
Member |
|
|
On 3/10/2010 10:23 PM, Brian Vosburgh wrote:
> I have a question about how PDE determines which version of a plug-in
> our code (Dali) compiles against.
>
> Our target workspace has 2 versions of the org.junit plug-in: 3.8.2 and
> 4.8.1 (both supplied by the Eclipse JDK download). Since we are a part
> of WTP, we are currently required to run against junit 3.8.2. As a
> result, we set our Required Plug-ins list to include
>
> org.junit (3.8.0)
>
> meaning we can run against junit 3.8.0 or anything higher. The problem
> comes that, when we compile, the build path uses junit 4.8.1. This
> doesn't seem right. Sure, we can *run* against 4.8.1; but that does not
> mean we want to *compile* against 4.8.1. In fact, that can cause us to
> have code that compiles cleanly but cannot run against 3.8.2. Does that
> make sense? It seems that the compile-time path should *require* a
> plug-in with a version that matches the low end of your own plug-ins
> required version. Otherwise, you have the potential for run-time errors.
>
> I would appreciate any insights.
>
If you open your the MANIFEST.MF file, you will see the required-bundle entry for junit plug-in like
this
org.junit;bundle-version="3.8.2"
this means PDE shall resolve it to the plug-in with the highest version in target greater than
3.8.2. For this reason junit 4.8.1 is getting picked.
There are two ways to ensure only 3.8.2 version gets picked.
1. Modify the target and remove 4.8.1 from it. But this is not what I would recommend.
2. Modify the manifest file and change the entry to
org.junit;bundle-version="[3.8.2,4.0.0)"
This means the plugin will now be resolved to a version 3.8.2 or higher (3.8.2 inclusive - implied
by "[" ) but lesser than 4.0.0 (exclusive - implied by ")" )
The easier way to configure this is on Dependency tab using the properties button.
After saving you can ensure which plugin it is getting resolved to using Plugin Dependencies view.
To use it right click on the plugin and choose PDE tools -> Open dependencies. Find org.junit plugin
in the list and note the version your plugin will be compiled against. (you may press the third
toolbar button in view - Set hierarchical layout to easily find the plugin)
hth
--
Ankur..
Eclipse PDE UI Committer | IBM India Software Lab, Bangalore
+91-99456-94011 | @ankur_sharma | http://blog.ankursharma.org
|
|
|
Powered by
FUDForum. Page generated in 0.04374 seconds